diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 468ec77..3c21ac5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,19 +8,19 @@ on: jobs: tests: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 timeout-minutes: 10 - name: PHP 8.3 + name: PHP 8.5 steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.5 tools: composer coverage: xdebug @@ -57,14 +57,14 @@ jobs: php-coveralls --coverage_clover=build/logs/clover.xml -v tests-latest: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 timeout-minutes: 10 name: PHP Latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 with: diff --git a/.gitignore b/.gitignore index 592d95b..d6a2742 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ build/ raw-tests/ vendor/ .php-cs-fixer.cache +.phpunit.cache .phpunit.result.cache composer.lock composer.phar diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 79714d2..9fcddee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ --- -image: registry.gitlab.com/aplus-framework/images/base:4 +image: registry.gitlab.com/aplus-framework/images/base:6 include: - template: Security/SAST.gitlab-ci.yml diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index e7d7245..6ff808f 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -10,7 +10,7 @@ use Framework\CodingStandard\Config; use Framework\CodingStandard\Finder; -return (new Config())->setDefaultHeaderComment( +return new Config()->setDefaultHeaderComment( 'Aplus Framework', 'Natan Felles ' )->setFinder( diff --git a/autoload.php b/autoload.php index 4d50449..7fc96ff 100644 --- a/autoload.php +++ b/autoload.php @@ -7,13 +7,14 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +// NOTE: This file is designed to work in a global installation with Composer or similar. require __DIR__ . '/../autoload/src/Autoloader.php'; use Framework\Autoload\Autoloader; $aplusDir = dirname(__DIR__) . \DIRECTORY_SEPARATOR; -return (new Autoloader())->setClasses([ +return new Autoloader()->setClasses([ 'Aplus' => __DIR__ . '/src/Aplus.php', ])->setNamespaces([ 'Framework\Autoload' => $aplusDir . 'autoload/src', diff --git a/composer.json b/composer.json index eb50a6c..969856c 100644 --- a/composer.json +++ b/composer.json @@ -29,35 +29,35 @@ } ], "require": { - "php": ">=8.3", - "aplus/autoload": "^3.0.1", - "aplus/cache": "^4.1.0", - "aplus/cli": "^3.0.1", - "aplus/config": "^4.0.1", - "aplus/crypto": "^2.0.1", - "aplus/database": "^4.1.2", - "aplus/database-extra": "^4.0.1", - "aplus/date": "^3.0.1", - "aplus/debug": "^4.1.2", - "aplus/dev-commands": "^2.0.2", - "aplus/email": "^4.0.1", - "aplus/events": "^2.0.0", - "aplus/factories": "^2.0.1", - "aplus/helpers": "^4.0.1", - "aplus/http": "^6.2.0", - "aplus/http-client": "^5.0.1", - "aplus/image": "^3.0.1", - "aplus/language": "^4.0.1", - "aplus/log": "^4.1.0", - "aplus/mvc": "^4.1.0", - "aplus/pagination": "^4.0.1", - "aplus/routing": "^4.0.1", - "aplus/session": "^4.0.1", - "aplus/validation": "^3.1.1" + "php": ">=8.5", + "aplus/autoload": "^4.0", + "aplus/cache": "^5.0", + "aplus/cli": "^4.0", + "aplus/config": "^5.0", + "aplus/crypto": "^3.0", + "aplus/database": "^5.0", + "aplus/database-extra": "^5.0", + "aplus/date": "^4.0", + "aplus/debug": "^5.0", + "aplus/dev-commands": "^3.0", + "aplus/email": "^5.0", + "aplus/events": "^3.0", + "aplus/factories": "^3.0", + "aplus/helpers": "^5.0", + "aplus/http": "^7.0", + "aplus/http-client": "^6.0", + "aplus/image": "^4.0", + "aplus/language": "^5.0", + "aplus/log": "^5.0", + "aplus/mvc": "^5.0", + "aplus/pagination": "^5.0", + "aplus/routing": "^5.0", + "aplus/session": "^5.0", + "aplus/validation": "^4.0" }, "require-dev": { "ext-xdebug": "*", - "aplus/coding-standard": "^2.8.0", + "aplus/coding-standard": "^3.0", "ergebnis/composer-normalize": "^2.44", "phpmd/phpmd": "^2.15", "phpstan/phpstan": "^1.12", diff --git a/docker-compose.yml b/docker-compose.yml index 06118b1..b7fe0f3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,6 @@ -version: "3" services: package: - image: registry.gitlab.com/aplus-framework/images/package:4 + image: registry.gitlab.com/aplus-framework/images/package:6 container_name: package-framework working_dir: /package volumes: diff --git a/guide/index.rst b/guide/index.rst index 6c298e9..67c05fd 100644 --- a/guide/index.rst +++ b/guide/index.rst @@ -123,7 +123,7 @@ Let's see an example autoloading in the ``index.php`` file: App::setService('autoloader', $autoloader); - (new App())->run(); + new App()->run(); The Autoloader instance was reused, setting the directory to the ``App`` namespace and also set as a service in the MVC @@ -146,7 +146,7 @@ PHP-FPM In production, it is very common to use **FastCGI Process Manager**. The ``php.ini`` file of `PHP-FPM `_ -on Debian-based distributions is located at ``/etc/php/8.1/fpm/php.ini``. +on Debian-based distributions is located at ``/etc/php/8.5/fpm/php.ini``. To enable preloading enter the path of the preload file and the username, which is normally ``www-data``: @@ -160,7 +160,7 @@ Then restart the PHP-FPM service: .. code-block:: - sudo systemctl restart php8.1-fpm.service + sudo systemctl restart php8.5-fpm.service And that's it! Loaded classes. We can use them directly as if they were part of the PHP core! @@ -197,7 +197,7 @@ Let's look at a basic file for responding to HTTP requests: runHttp(); + new App()->runHttp(); And that's it! @@ -211,5 +211,5 @@ The more you use it, the more you will learn. .. note:: Did you find something wrong? Be sure to let us know about it with an - `issue `_. + `issue `_. Thank you! diff --git a/preload.php b/preload.php index 4096e91..81b654c 100644 --- a/preload.php +++ b/preload.php @@ -7,13 +7,19 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +// NOTE: This file is designed to work in a global installation with Composer or similar. require __DIR__ . '/../autoload/src/Preloader.php'; use Framework\Autoload\Preloader; -$files = (new Preloader())->load(); +new Preloader()->load(); + +/* +// Commenting prevents the echo from appearing in the server logs. +$files = new Preloader()->load(); echo 'Preloading Aplus Framework: ' . \PHP_EOL; foreach ($files as $index => $file) { echo ++$index . ') ' . $file . \PHP_EOL; } echo 'Total of ' . count($files) . ' preloaded files.' . \PHP_EOL . \PHP_EOL; +*/ diff --git a/src/Aplus.php b/src/Aplus.php index 22bb33f..bafdcbb 100644 --- a/src/Aplus.php +++ b/src/Aplus.php @@ -17,5 +17,5 @@ final class Aplus /** * The Aplus version. */ - public const string VERSION = '25.1.0'; + public const string VERSION = '26.0.0'; }