Skip to content

Commit 88d7032

Browse files
authored
Merge pull request #677 from flightphp/simple-pdo
Added SimplePdo class to replace PdoWrapper
2 parents 2ab26aa + dd39d4a commit 88d7032

File tree

6 files changed

+940
-25
lines changed

6 files changed

+940
-25
lines changed

.gemini/GEMINI.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# FlightPHP/Core Project Instructions
2+
3+
## Overview
4+
This is the main FlightPHP core library for building fast, simple, and extensible PHP web applications. It is dependency-free for core usage and supports PHP 7.4+.
5+
6+
## Project Guidelines
7+
- PHP 7.4 must be supported. PHP 8 or greater also supported, but avoid PHP 8+ only features.
8+
- Keep the core library dependency-free (no polyfills or interface-only repositories).
9+
- All Flight projects are meant to be kept simple and fast. Performance is a priority.
10+
- Flight is extensible and when implementing new features, consider how they can be added as plugins or extensions rather than bloating the core library.
11+
- Any new features built into the core should be well-documented and tested.
12+
- Any new features should be added with a focus on simplicity and performance, avoiding unnecessary complexity.
13+
- This is not a Laravel, Yii, Code Igniter or Symfony clone. It is a simple, fast, and extensible framework that allows you to build applications quickly without the overhead of large frameworks.
14+
15+
## Development & Testing
16+
- Run tests: `composer test` (uses phpunit/phpunit and spatie/phpunit-watcher)
17+
- Run test server: `composer test-server` or `composer test-server-v2`
18+
- Lint code: `composer lint` (uses phpstan/phpstan, level 6)
19+
- Beautify code: `composer beautify` (uses squizlabs/php_codesniffer, PSR1)
20+
- Check code style: `composer phpcs`
21+
- Test coverage: `composer test-coverage`
22+
23+
## Coding Standards
24+
- Follow PSR1 coding standards (enforced by PHPCS)
25+
- Use strict comparisons (`===`, `!==`)
26+
- PHPStan level 6 compliance
27+
- Focus on PHP 7.4 compatibility (avoid PHP 8+ only features)

composer.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,21 @@
6161
"sort-packages": true
6262
},
6363
"scripts": {
64-
"test": "phpunit",
65-
"test-watcher": "phpunit-watcher watch",
66-
"test-ci": "phpunit",
67-
"test-coverage": "rm -f clover.xml && XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html=coverage --coverage-clover=clover.xml && vendor/bin/coverage-check clover.xml 100",
68-
"test-server": "echo \"Running Test Server\" && php -S localhost:8000 -t tests/server/",
69-
"test-server-v2": "echo \"Running Test Server\" && php -S localhost:8000 -t tests/server-v2/",
64+
"test": "@php vendor/bin/phpunit",
65+
"test-watcher": "@php vendor/bin/phpunit-watcher watch",
66+
"test-ci": "@php vendor/bin/phpunit",
67+
"test-coverage": [
68+
"rm -f clover.xml",
69+
"@putenv XDEBUG_MODE=coverage",
70+
"@php vendor/bin/phpunit --coverage-html=coverage --coverage-clover=clover.xml",
71+
"@php vendor/bin/coverage-check clover.xml 100"
72+
],
73+
"test-server": "echo \"Running Test Server\" && @php -S localhost:8000 -t tests/server/",
74+
"test-server-v2": "echo \"Running Test Server\" && @php -S localhost:8000 -t tests/server-v2/",
7075
"test-coverage:win": "del clover.xml && phpunit --coverage-html=coverage --coverage-clover=clover.xml && coverage-check clover.xml 100",
7176
"test-performance": [
7277
"echo \"Running Performance Tests...\"",
73-
"php -S localhost:8077 -t tests/performance/ > /dev/null 2>&1 & echo $! > server.pid",
78+
"@php -S localhost:8077 -t tests/performance/ > /dev/null 2>&1 & echo $! > server.pid",
7479
"sleep 2",
7580
"bash tests/performance/performance_tests.sh",
7681
"kill `cat server.pid`",

flight/database/PdoWrapper.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
use PDO;
1010
use PDOStatement;
1111

12+
/**
13+
* @deprecated version 3.18.0 - Use SimplePdo instead
14+
*/
1215
class PdoWrapper extends PDO
1316
{
1417
/** @var bool $trackApmQueries Whether to track application performance metrics (APM) for queries. */

0 commit comments

Comments
 (0)