diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5218a6e..2c0f654 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,9 +11,6 @@ jobs: runs-on: ubuntu-22.04 timeout-minutes: 10 - strategy: - fail-fast: true - services: mariadb: image: mariadb @@ -36,16 +33,16 @@ jobs: ports: - 6379:6379 - name: PHP 8.1 + name: PHP 8.3 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 8.3 tools: composer coverage: xdebug @@ -89,9 +86,6 @@ jobs: runs-on: ubuntu-22.04 timeout-minutes: 10 - strategy: - fail-fast: true - services: mariadb: image: mariadb @@ -118,7 +112,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 12205a4..0ff2d72 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ --- -image: registry.gitlab.com/aplus-framework/images/base:2 +image: registry.gitlab.com/aplus-framework/images/base:4 include: - template: Security/SAST.gitlab-ci.yml diff --git a/composer.json b/composer.json index 11f9b82..59bb199 100644 --- a/composer.json +++ b/composer.json @@ -33,12 +33,12 @@ } ], "require": { - "php": ">=8.1", + "php": ">=8.3", "ext-memcached": "*", "ext-redis": "*", - "aplus/database": "^3.0", - "aplus/debug": "^3.1", - "aplus/log": "^3.0" + "aplus/database": "^4.0", + "aplus/debug": "^4.0", + "aplus/log": "^4.0" }, "require-dev": { "ext-xdebug": "*", diff --git a/docker-compose.yml b/docker-compose.yml index 8540a79..5557e35 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: "3" services: package: - image: registry.gitlab.com/aplus-framework/images/package:2 + image: registry.gitlab.com/aplus-framework/images/package:4 container_name: package-session working_dir: /package volumes: diff --git a/guide/index.rst b/guide/index.rst index 81eff2d..f084f8d 100644 --- a/guide/index.rst +++ b/guide/index.rst @@ -291,6 +291,25 @@ the example below: $saveHandler = new DatabaseHandler(); $saveHandler->setDatabase($database); // static +Database Table +############## + +A basic example of a table for sessions is below: + +.. code-block:: sql + + CREATE TABLE `Sessions` ( + `id` varchar(128) NOT NULL, + `timestamp` timestamp NOT NULL, + `data` blob NOT NULL, + `ip` varchar(45) NOT NULL, -- optional + `ua` varchar(255) NOT NULL, -- optional + PRIMARY KEY (`id`), + KEY `timestamp` (`timestamp`), + KEY `ip` (`ip`), -- optional + KEY `ua` (`ua`) -- optional + ); + Files Handler ^^^^^^^^^^^^^ diff --git a/src/Debug/SessionCollection.php b/src/Debug/SessionCollection.php new file mode 100644 index 0000000..6e5070a --- /dev/null +++ b/src/Debug/SessionCollection.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Framework\Session\Debug; + +use Framework\Debug\Collection; + +/** + * Class SessionCollection. + * + * @package session + */ +class SessionCollection extends Collection +{ + protected string $iconPath = __DIR__ . '/icons/session.svg'; +} diff --git a/src/Debug/icons/session.svg b/src/Debug/icons/session.svg new file mode 100644 index 0000000..684cfa7 --- /dev/null +++ b/src/Debug/icons/session.svg @@ -0,0 +1 @@ + diff --git a/tests/Debug/SessionCollectionTest.php b/tests/Debug/SessionCollectionTest.php new file mode 100644 index 0000000..5ec53da --- /dev/null +++ b/tests/Debug/SessionCollectionTest.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Tests\Session\Debug; + +use Framework\Session\Debug\SessionCollection; +use PHPUnit\Framework\TestCase; + +final class SessionCollectionTest extends TestCase +{ + protected SessionCollection $collection; + + protected function setUp() : void + { + $this->collection = new SessionCollection('Session'); + } + + public function testIcon() : void + { + self::assertStringStartsWith('collection->getIcon()); + } +}