PHP Framework from EEQSOFT Documentation

Introduction

This application is a PHP framework. It uses the MVC design pattern. All you need is a personal computer with XAMPP or Docker Desktop. The application requires PHP and, for example, MySQL.

More Information

  1. Installation
  2. Usage
  3. Development
  4. Upgrade
  5. Change Logs

1. Installation

Server Requirements

This application requires at least PHP 8.4 and MySQL 5.x-8.x. Please ensure your hosting service or personal computer meets these requirements.

Hosting Configuration

Set the root directory of the php files to "public". Set the path for your hosting:

<path to project>/public

Create a database with full user permissions. Use the database name as in your config:

for example: "framework"

Application Configuration

Change the settings in the "database.php" file. Set as in the "database.php.dist" file (check "config"):

'db_host' => 'localhost'
'db_port' => 3306
'db_user' => '<user>'
'db_password' => '<password>'
'db_database' => 'framework'

If necessary, set these permissions. Change the permissions of the "settings.php" file to 666:

<path to project>/config/settings.php

Application Installation

If you want to use a database, use the SQL commands from the "framework.sql" file for your database:

<path to project>/data/framework.sql

Run this web application in your browser. Open the url below:

https://<domain.com>

2. Usage

Below you can find the Directory Structure of this framework. Let's see what files the directories contain.

Config

The "config" directory contains all the configuration files:

<path to project>/config/actions.php
<path to project>/config/config.php
<path to project>/config/database.php
<path to project>/config/database.php.dist
<path to project>/config/redirects.php
<path to project>/config/settings.php
<path to project>/config/settings.php.dist

Data

The "data" directory contains the "framework.sql" file with an example structure of database tables:

<path to project>/data/framework.sql

Include

The "inc" directory contains included files that are not classes:

<path to project>/inc/core/core.php
<path to project>/inc/core/data.php
<path to project>/inc/public/error.php
<path to project>/inc/public/index.php
<path to project>/inc/public/info.php

Public

The "public" directory contains files displayed by the browser to users:

<path to project>/public/css/default.css
<path to project>/public/css/rwd.css
<path to project>/public/images/favicon.ico
<path to project>/public/js/default.js
<path to project>/public/.htaccess
<path to project>/public/error.php
<path to project>/public/index.php
<path to project>/public/robots.txt

Source

The "src" directory contains source files that are classes:

<path to project>/src/Controller/MainPageController.php
<path to project>/src/Core/*
<path to project>/src/Repository/UserRepository.php
<path to project>/src/Service/MainPageService.php
<path to project>/src/Validator/MainPageValidator.php
<path to project>/src/autoload.php

The "src/Core/*" directory contains all the core files of this framework. Add or edit the contents of the "Controller," "Repository," "Service," and "Validator" directories. Use the "autoload.php" file in "config.php" (check "config") if you don't plan to use Composer.

Templates

The "templates" directory contains all the design files for this framework. You can add multiple layouts and additional pages:

<path to project>/templates/layout/main/*.php
<path to project>/templates/layout/*
<path to project>/templates/main_page/main_page.php
<path to project>/templates/main_page/name_info.php

Tests

The "tests" directory contains the framework's test files. You can modify its contents:

<path to project>/tests/Browser/MainPageBrowserTest.php
<path to project>/tests/Repository/UserRepositoryTest.php
<path to project>/tests/Validator/MainPageValidatorTest.php
<path to project>/tests/bootstrap.php

Translations

The "translations" directory contains all translation files:

<path to project>/translations/languages.php
<path to project>/translations/languages.en.php
<path to project>/translations/languages.pl.php
<path to project>/translations/messages.en.php
<path to project>/translations/messages.pl.php
<path to project>/translations/validators.en.php
<path to project>/translations/validators.pl.php

Vendor

The "vendor" directory contains all libraries added by Composer:

<path to project>/vendor/*
<path to project>/vendor/autoload.php

3. Development

The easiest way to develop this software is to use Docker Desktop. To do so, follow the instructions below.

Go to the application directory:

cd <path to project>

Start the application stack defined in "docker-compose.yml":

docker-compose up -d

Set the permissions and access for the "fwe-php-apache" container:

docker exec -it fwe-php-apache bash
cd /var/www
ls -l
chmod 777 /var/www/html
chown -R www-data:www-data /var/www/html
ls -l
exit

Use Composer to install the needed dependencies from the "composer.json" file:

docker exec -it fwe-php-apache bash
cd /var/www/html
composer install

Run the PHPUnit Tests:

docker exec -it fwe-php-apache vendor/bin/phpunit tests

Open this web application and/or phpMyAdmin in your browser:

http://localhost:8000
http://localhost:8001

Stop the application stack:

docker-compose down

4. Upgrade

These PHP Framework core classes are located in the "src/Core/*" directory. You'll need to copy the new ones to the updated project and fix any inconsistencies in other application files.

5. Change Logs

v0.3.0 - 30 June 2025

- Add: MyPDO class added
- Update: Core classes changed
- Fix: Database security improvements

v0.2.0 - 11 June 2025

- Update: Many classes changed
- Fix: Many security improvements

v0.1.0 - 20 February 2025

- Initial Release