Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

---

## Our Standards

Examples of behavior that contributes to a positive environment for our community include:

- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

- The use of sexualized language or imagery, and sexual attention or advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others’ private information, such as a physical or email address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

---

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

---

## Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

---

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [ryabchenko.andrew@gmail.com](mailto:ryabchenko.andrew@gmail.com). All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

---

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of actions.

**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the community.

---

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html).

Community Impact Guidelines were inspired by [Mozilla’s code of conduct enforcement ladder](https://github.com/mozilla/diversity).

For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are available at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations).
113 changes: 113 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Contributing to PHPapp

Thank you for considering contributing to PHPapp! This document provides guidelines and best practices to help you make your contributions effectively.

---

## Table of Contents

1. [How to Contribute](#how-to-contribute)
2. [Code of Conduct](#code-of-conduct)
3. [Development Workflow](#development-workflow)
4. [Pull Request Guidelines](#pull-request-guidelines)
5. [Reporting Issues](#reporting-issues)
6. [Community and Support](#community-and-support)

---

## How to Contribute

We welcome contributions of all kinds including bug fixes, new features, documentation improvements, and more. Here's how you can get started:

1. **Fork the Repository**: Create a personal copy of the repository by forking it to your GitHub account.
2. **Clone the Repository**: Clone your fork to your local machine.

```bash
git clone https://github.com/<your-username>/phpapp.git
```

3. **Create a Feature Branch**: Create a new branch for your change.

```bash
git checkout -b feature/your-feature-name
```

4. **Write Clean Code**: Follow the project’s coding standards and structure. Familiarize yourself with the MVC (Model-View-Controller) architecture used in PHPapp.

5. **Test Your Changes**: Ensure that your contribution doesn't break existing functionality. Add tests if applicable.

6. **Commit and Push**: Write clear and descriptive commit messages.

```bash
git commit -m "feat: add feature description"
git push origin feature/your-feature-name
```

7. **Open a Pull Request**: Head to the original repository and submit a pull request.

---

## Code of Conduct

Please adhere to the [Code of Conduct](CODE_OF_CONDUCT.md) to maintain a welcoming and inclusive community. Be respectful and constructive in your interactions.

---

## Development Workflow

### 1. Setting Up the Environment

- Ensure you have PHP 8+ installed.
- Install dependencies using Composer:

```bash
composer install
```

- Use the interactive installer to set up the project by visiting `http://yourdomain.com/installer.php`.

### 2. Directory Structure

The framework follows the MVC architecture. Key directories include:

- `app/`: Contains models, views, and controllers.
- `core/`: Houses essential libraries such as `db.php`, `request.php`, and `response.php`.
- `static/`: Static files like CSS, JavaScript, and images.
- `config/`: Configuration files.

Review the README for more details on the project's structure.

---

## Pull Request Guidelines

To ensure a smooth review process:

- **Branch Naming Convention**: Use descriptive names such as `fix/issue-name` or `feature/feature-name`.
- **Write Descriptive Commit Messages**: Clearly explain the purpose of your changes.
- **Keep Changes Focused**: Avoid bundling unrelated changes in a single pull request.
- **Add Tests**: Include tests for new features or bug fixes.
- **Link Issues**: If your pull request addresses an issue, reference it in the description (e.g., `Fixes #123`).

---

## Reporting Issues

Found a bug or have a feature request? Open an [issue](https://github.com/and-ri/phpapp/issues) and provide the following:

1. A clear and descriptive title.
2. Steps to reproduce the issue (if applicable).
3. Expected and actual behavior.
4. Screenshots, logs, or error messages (if available).

---

## Community and Support

For questions, discussions, or collaboration, feel free to:

- Start a [GitHub Discussion](https://github.com/and-ri/phpapp/discussions).
- Join issues or pull request threads for ongoing topics.
- Reach out to the repository owner directly for critical matters.

We appreciate your time and effort in contributing to PHPapp. Together, we can make it an even better framework for developers worldwide!
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@
- **staticfile.php**: Serves static files (CSS, JS, images).
- **url.php**: Generates URLs and manages routing.
- **log.php**: Provides centralized logging functionality using Monolog.
- **meta.php**: Manages SEO metadata including page titles, descriptions, Open Graph tags, and robots directives using the Melbahja/Seo package.

### New Features

- **Migration System:** Manage database schema changes with ease. Use `php migrate.php migrate` to apply migrations, `php migrate.php rollback` to undo the last migration, and `php migrate.php status` to check migration status.
- **Interactive Installer:** Quickly set up your application by providing database and web configuration details in a user-friendly web installer.
- **Centralized Logging:** Monitor application events, errors, and debugging information using the integrated Monolog-based logging system.
- **SEO Management:** Easily manage page metadata, title tags, Open Graph properties, and other SEO essentials using the integrated meta.php library powered by Melbahja/Seo package.

## License

Expand Down
5 changes: 2 additions & 3 deletions app/controller/catalog/components.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ class ControllerCatalogComponents extends Controller {
public function index() {
$this->app->useLanguage('catalog/components');

$this->response->setTitle($this->language->get('meta_title'));
$this->response->setDescription($this->language->get('meta_description'));
$this->response->setKeywords($this->language->get('meta_keywords'));
$this->meta->setTitle($this->language->get('meta_title'));
$this->meta->setDescription($this->language->get('meta_description'));

$this->response->addStyle('https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css');
$this->response->addScript('https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js');
Expand Down
5 changes: 2 additions & 3 deletions app/controller/catalog/csrf_protection.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ class ControllerCatalogCsrfProtection extends Controller {
public function index() {
$this->app->useLanguage('catalog/csrf_protection');

$this->response->setTitle($this->language->get('meta_title'));
$this->response->setDescription($this->language->get('meta_description'));
$this->response->setKeywords($this->language->get('meta_keywords'));
$this->meta->setTitle($this->language->get('meta_title'));
$this->meta->setDescription($this->language->get('meta_description'));

$this->data['action'] = $this->url->link('catalog/csrf_protection');

Expand Down
5 changes: 2 additions & 3 deletions app/controller/catalog/pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ public function index() {
$this->app->useLanguage('catalog/pagination');
$this->app->useModel('demo/demo');

$this->response->setTitle($this->language->get('meta_title'));
$this->response->setDescription($this->language->get('meta_description'));
$this->response->setKeywords($this->language->get('meta_keywords'));
$this->meta->setTitle($this->language->get('meta_title'));
$this->meta->setDescription($this->language->get('meta_description'));

$page = isset($this->request->get['page']) ? $this->request->get['page'] : 1;

Expand Down
8 changes: 2 additions & 6 deletions app/controller/common/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@

class ControllerCommonHeader extends Controller {
public function index() {
$this->data['title'] = $this->response->getTitle();
$this->data['description'] = $this->response->getDescription();
$this->data['keywords'] = $this->response->getKeywords();
$this->data['robots'] = $this->response->getRobots();
$this->data['canonical'] = $this->response->getCanonical();
$this->data['links'] = $this->response->getLinks();
$this->data['meta'] = $this->meta->getMetaTags();

$this->data['styles'] = $this->response->getStyles();

$scripts = $this->response->getScripts();
Expand Down
9 changes: 0 additions & 9 deletions app/controller/common/welcome.php

This file was deleted.

5 changes: 2 additions & 3 deletions app/controller/error/not_found.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ class ControllerErrorNotFound extends Controller {
public function index() {
$this->app->useLanguage('error/not_found');

$this->response->setTitle($this->language->get('meta_title'));
$this->response->setDescription($this->language->get('meta_description'));
$this->response->setKeywords($this->language->get('meta_keywords'));
$this->meta->setTitle($this->language->get('meta_title'));
$this->meta->setDescription($this->language->get('meta_description'));

$this->data['heading_title'] = $this->language->get('heading_title');

Expand Down
7 changes: 4 additions & 3 deletions app/controller/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

class ControllerIndex extends Controller {
public function index() {
$this->response->setTitle($this->language->get('meta_title'));
$this->response->setDescription($this->language->get('meta_description'));
$this->response->setKeywords($this->language->get('meta_keywords'));
$this->meta->setTitle($this->language->get('meta_title'));
$this->meta->setDescription($this->language->get('meta_description'));

$this->data['heading_title'] = $this->language->get('heading_title');

$this->data['cover'] = $this->staticfile->getUri('img/welcome.png');

$this->data['header'] = $this->load->controller('common/header');

$this->data['welcome'] = $this->load->controller('common/welcome');
Expand Down
1 change: 0 additions & 1 deletion app/language/en/catalog/components.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
return [
'meta_title' => 'PHPapp :: Components',
'meta_description' => 'This is a simple components page.',
'meta_keywords' => 'hello, world',
'heading_title' => 'Components',
'text_help' => 'This page displays all the classes and libraries in the core directory.',
'text_classes' => 'Classes',
Expand Down
1 change: 0 additions & 1 deletion app/language/en/catalog/csrf_protection.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
'heading_title' => 'CSRF Protection',
'meta_title' => 'CSRF Protection',
'meta_description' => 'CSRF Protection',
'meta_keywords' => 'CSRF Protection',
'text_form' => 'Form',
'entry_email' => 'Email',
'entry_password' => 'Password',
Expand Down
1 change: 0 additions & 1 deletion app/language/en/catalog/pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
return [
'meta_title' => 'PHPapp :: Pagination',
'meta_description' => 'This is a simple pagination page.',
'meta_keywords' => 'hello, world',
'heading_title' => 'Pagination Example',
'column_post_id' => 'ID',
'column_hash' => 'Hash',
Expand Down
1 change: 0 additions & 1 deletion app/language/en/error/not_found.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
return [
'meta_title' => 'PHPapp :: Error',
'meta_description' => 'This is a simple error page.',
'meta_keywords' => 'hello, world',
'heading_title' => 'Error 404',
];
17 changes: 1 addition & 16 deletions app/view/common/header.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,7 @@
<head>
<meta charset="{{ charset }}">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ title }}</title>
{% if description %}
<meta name="description" content="{{ description }}">
{% endif %}
{% if keywords %}
<meta name="keywords" content="{{ keywords }}">
{% endif %}
{% if robots %}
<meta name="robots" content="{{ robots }}">
{% endif %}
{% if canonical %}
<link rel="canonical" href="{{ canonical }}">
{% endif %}
{% for link in links %}
<link rel="{{ link.rel }}" href="{{ link.href }}">
{% endfor %}
{{ meta }}
{% for style in styles %}
<link rel="stylesheet" href="{{ style }}">
{% endfor %}
Expand Down
22 changes: 0 additions & 22 deletions app/view/common/welcome.twig

This file was deleted.

Loading