From 5b234fd0b35183ab1daffc811fe95b2e922211b4 Mon Sep 17 00:00:00 2001 From: Natan Felles Date: Mon, 1 Apr 2024 19:21:22 -0300 Subject: [PATCH 1/7] Remove strategy sections --- .github/workflows/tests.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5218a6e..b3a0860 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 @@ -89,9 +86,6 @@ jobs: runs-on: ubuntu-22.04 timeout-minutes: 10 - strategy: - fail-fast: true - services: mariadb: image: mariadb From ce112c3958d42809c60850439f2b375792b421d6 Mon Sep 17 00:00:00 2001 From: Natan Felles Date: Mon, 1 Apr 2024 19:33:58 -0300 Subject: [PATCH 2/7] Upgrade Checkout v3 to v4 --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b3a0860..c978f91 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -37,7 +37,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -112,7 +112,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 From a7128a1b21060af5f481dfb3fa95ba1c85d781da Mon Sep 17 00:00:00 2001 From: Natan Felles Date: Mon, 1 Apr 2024 20:12:56 -0300 Subject: [PATCH 3/7] Require PHP 8.3 --- .github/workflows/tests.yml | 4 ++-- .gitlab-ci.yml | 2 +- composer.json | 2 +- docker-compose.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c978f91..2c0f654 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,7 +33,7 @@ jobs: ports: - 6379:6379 - name: PHP 8.1 + name: PHP 8.3 steps: - name: Checkout @@ -42,7 +42,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 8.3 tools: composer coverage: xdebug 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..0802efa 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ } ], "require": { - "php": ">=8.1", + "php": ">=8.3", "ext-memcached": "*", "ext-redis": "*", "aplus/database": "^3.0", 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: From 862533864aee5a2a347904aa32f21baf1c70abcd Mon Sep 17 00:00:00 2001 From: Natan Felles Date: Mon, 1 Apr 2024 20:25:11 -0300 Subject: [PATCH 4/7] Upgrade required packages --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 0802efa..59bb199 100644 --- a/composer.json +++ b/composer.json @@ -36,9 +36,9 @@ "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": "*", From f1926040cb88d91aa41969609af32940876e2e63 Mon Sep 17 00:00:00 2001 From: Natan Felles Date: Mon, 1 Apr 2024 20:50:35 -0300 Subject: [PATCH 5/7] Add session icon --- src/Debug/icons/session.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/Debug/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 @@ + From 32a0e355b5554145879e63580fb9256087c1c3a5 Mon Sep 17 00:00:00 2001 From: Natan Felles Date: Mon, 1 Apr 2024 20:59:33 -0300 Subject: [PATCH 6/7] Add SessionCollection class --- src/Debug/SessionCollection.php | 22 +++++++++++++++++++++ tests/Debug/SessionCollectionTest.php | 28 +++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 src/Debug/SessionCollection.php create mode 100644 tests/Debug/SessionCollectionTest.php 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/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()); + } +} From 77051b6db7bd982b393c0f798d9914f116b2c8e8 Mon Sep 17 00:00:00 2001 From: Natan Felles Date: Tue, 23 Jul 2024 19:24:57 -0300 Subject: [PATCH 7/7] Update user guide --- guide/index.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 ^^^^^^^^^^^^^