Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
290 commits
Select commit Hold shift + click to select a range
14ae692
Fixes http client repsonse
papac May 20, 2023
5617e0c
Merge pull request #234 from bowphp/5.x-refactoring-for-perf
papac May 20, 2023
f518c27
Fixes enum type bind for pgsql
papac May 21, 2023
fba4626
Fixes display error message format
papac May 21, 2023
4b8163e
Fixes generate the table name from model name
papac May 21, 2023
c5a6fc0
Merge pull request #235 from bowphp/5.x-refactoring-for-perf
papac May 21, 2023
508f336
Initialize the request ID
papac May 21, 2023
0b55ba3
Merge pull request #236 from bowphp/5.x-refactoring-for-perf
papac May 21, 2023
1559c0a
Refactoring custom validation message data parser
papac May 22, 2023
64f401f
Update pgsql connector dsn builder
papac May 22, 2023
1e0bbf7
Change event name and get last_insert_id mechanism
papac May 22, 2023
472f628
Refactoring pgsql migration composer
papac May 22, 2023
c4700b9
Proto formatting
papac May 22, 2023
95a621a
Fixes variable definition errors
papac May 22, 2023
77127d2
Fixes translate parser
papac May 22, 2023
d1764ee
Fixes migration unity tests
papac May 22, 2023
c2cd31e
Fixes translate stubs configuration
papac May 22, 2023
f7e7b02
Fixes getAttribute finder
papac May 22, 2023
2e4b1ea
Fixes pgsql serial generation logic
papac May 22, 2023
0ac3e09
Fixes save row from model
papac May 22, 2023
8f03bd1
Merge pull request #237 from bowphp/5.x-refactoring-for-perf
papac May 22, 2023
dc67c31
Update CHANGELOG
papac May 22, 2023
c311101
Merge pull request #238 from bowphp/5.x-update-changelog
papac May 22, 2023
9c8f637
Fixes check row exists from model error
papac May 22, 2023
ce93f03
Fixes the http client
papac May 22, 2023
8e01783
Add the addRaw method for migration
papac May 23, 2023
bcddcd5
Fixes check statement definition
papac May 23, 2023
ad3d24e
Add the column size on mysql
papac May 23, 2023
036834b
Merge pull request #239 from bowphp/5.x-refactoring-for-perf
papac May 23, 2023
f1e554f
Refactoring the http client
papac May 23, 2023
b763426
Change validation exception definition
papac May 23, 2023
fddf1d6
Upgrade the policer package version
papac May 23, 2023
2429916
Fixes the hasone relationship
papac May 23, 2023
bcfd0c0
Merge pull request #240 from bowphp/5.x-refactoring-for-perf
papac May 23, 2023
6060508
Fixes hasOne relationship
papac May 23, 2023
04f2fec
Optimisize the jwt system
papac May 23, 2023
aecf182
Update unity tests
papac May 23, 2023
04c99dc
Fixes relationship and cache system
papac May 24, 2023
e6b96bc
Merge pull request #241 from bowphp/5.x-refactoring-for-perf
papac May 24, 2023
9be15ac
Update CHANGELOG
papac May 24, 2023
50296e8
Fixes http client errors from testcase service
papac May 24, 2023
f95e980
Add unity tests
papac May 24, 2023
5cb3710
Merge pull request #242 from bowphp/5.x-update-changelog
papac May 24, 2023
7f6f223
Merge branch '5.x' into 5.x-refactoring-for-perf
papac May 24, 2023
7488f49
Merge pull request #243 from bowphp/5.x-refactoring-for-perf
papac May 24, 2023
0bb0f8c
Update CHANGELOG
papac May 24, 2023
7589576
Merge pull request #244 from bowphp/5.x-update-changelog
papac May 27, 2023
970c348
Fixes the return type
papac May 26, 2023
020e99a
Add the setUserAgent method
papac May 26, 2023
b434fb7
Add the json method
papac May 26, 2023
9e11aaf
Fixes persitence cache for filesystem
papac May 26, 2023
34503b2
Fixes the route url compilation
papac May 27, 2023
1e98447
Fixes route data key checker
papac May 27, 2023
9d0c208
Fixes the route proto
papac May 27, 2023
1791494
Fixes the file cache adapter
papac May 27, 2023
a2ef07f
Merge pull request #245 from bowphp/5.x-refactoring-for-perf
papac May 27, 2023
934c5a2
Add the http client exception
papac May 29, 2023
b7b4457
Add method for get adapter
papac May 29, 2023
8bbdc14
Fixes add query data on url and add the new exception
papac May 29, 2023
112013b
Fixes regex validaion
papac May 29, 2023
752db9c
Add accept json headers
papac May 30, 2023
721831b
Fixes the env loading
papac May 30, 2023
cfc6dfd
Throw when parsing request json content
papac May 30, 2023
627a232
Fixes the define header
papac May 30, 2023
8fa0223
Merge pull request #248 from bowphp/5.x-refactoring-for-perf
papac Jun 1, 2023
2b925a8
Update CHANGELOG
papac Jun 1, 2023
0a4d81d
Fixes the translate errors
papac Jun 2, 2023
b5da00e
Remove helpers
papac Jun 5, 2023
f9508b1
Add the required_if rule
papac Jun 5, 2023
694bbab
Add log service support
papac Jun 5, 2023
2265a83
Fixes the required_if rule
papac Jun 5, 2023
214b25e
Update class docs
papac Jun 5, 2023
2120348
Refactoring kernel testing api
papac Jun 6, 2023
6b2a2be
Fixes validation
papac Jun 6, 2023
9696512
Update kernel testing
papac Jun 6, 2023
5f4caed
Merge pull request #249 from bowphp/5.x-refactoring-for-perf
papac Jun 6, 2023
2a096d5
Make redis accessible to the whole project
papac Jun 6, 2023
7c14c3e
Merge pull request #250 from bowphp/247-5x-create-a-redis-support-as-…
papac Jun 6, 2023
a475af5
Merge branch '5.x' into 5.x-update-changelog
papac Jun 6, 2023
51df925
Merge pull request #251 from bowphp/5.x-update-changelog
papac Jun 6, 2023
2456694
Add custom adaptor
papac Jun 6, 2023
9f7b9f6
Merge pull request #252 from bowphp/247-5x-create-a-redis-support-as-…
papac Jun 7, 2023
458b5a5
Update CHANGELOG
papac Jun 7, 2023
1f06ca1
Merge pull request #253 from bowphp/5.x-update-changelog
papac Jun 7, 2023
947bac0
Update README.md
papac Jun 7, 2023
0631ce6
Merge pull request #254 from bowphp/papac-patch-1
papac Jun 7, 2023
627f513
Update Database.php
papac Aug 21, 2023
364ef3a
Fixes transform model collection to json
papac Aug 21, 2023
85de991
Fixes unity tests
papac Aug 21, 2023
ff05d71
Fixes collection as json
papac Aug 21, 2023
b397ce4
Merge pull request #255 from bowphp/papac-patch-1
papac Aug 21, 2023
1f4396c
Update CHANGELOG
papac Sep 15, 2023
1277b52
Update Database.php
papac Sep 17, 2023
c452a07
Update helpers.php
papac Sep 17, 2023
f292c0a
Merge pull request #256 from bowphp/fix-database-method
papac Sep 17, 2023
28daa98
Merge branch '5.x' into fix-helper-method
papac Sep 17, 2023
1107ca6
Merge pull request #257 from bowphp/fix-helper-method
papac Sep 17, 2023
c706108
Merge branch '5.x' into 5.x-update-changelog
papac Sep 17, 2023
1a97aa3
Merge pull request #258 from bowphp/5.x-update-changelog
papac Sep 17, 2023
b291428
Update CHANGELOG
papac Sep 17, 2023
7f55818
Merge pull request #259 from bowphp/5.x-update-changelog
papac Sep 18, 2023
a9fee79
Fixes many issues
papac Sep 19, 2023
2cd447d
FIxes request json payload parsing
papac Sep 19, 2023
43c1d39
Fixes get relation result
papac Sep 20, 2023
4c256d7
Fixs Trait Bow\Queue\Traits\SerializesModels not found
papac Sep 20, 2023
15b4954
Fixes jwt token verification
papac Sep 21, 2023
8c858aa
Fixes data type issues
papac Sep 22, 2023
b44a993
Fixes findAndDelete issue
papac Sep 22, 2023
533de2f
Fixes jwt token parser issue
papac Sep 22, 2023
1eda3a5
Refactoring the queue worker pattern
papac Sep 22, 2023
e593dad
Update unity tests
papac Sep 22, 2023
5d3b893
Update beanstalkd port
papac Sep 22, 2023
4a13a08
Fixes return type
papac Sep 22, 2023
3e6e4ca
Fixes return type
papac Sep 22, 2023
38d2a95
Refactoring
papac Sep 22, 2023
d38f749
Fixes unity tests
papac Sep 22, 2023
c4220ad
Merge pull request #262 from bowphp/fix-many-issues
papac Sep 22, 2023
8484b23
Initial database and sqs queue adapter
papac Sep 22, 2023
8ae5e89
fixes phpdoc
papac Sep 22, 2023
12a8302
Integrate SQS adapter
papac Sep 22, 2023
9b0015f
Formatting
papac Sep 22, 2023
fbbf3af
Update get env function
papac Sep 22, 2023
8bc13ff
Enable connection
papac Sep 22, 2023
b06c964
Integration of database adapter
papac Sep 22, 2023
0c97b6e
Fixes unity tests
papac Sep 22, 2023
2d23c82
Refactoring errors handlers
papac Sep 22, 2023
2f4ba40
Update unity tests
papac Sep 22, 2023
c0c7624
Merge pull request #263 from bowphp/feat-integrate-queue-adapters
papac Sep 22, 2023
cf5b066
Change cache method to store
papac Sep 22, 2023
63a9e3d
Update cache method
papac Sep 22, 2023
43f27ab
Update unity tests
papac Sep 22, 2023
c3a2aca
Merge pull request #264 from bowphp/feat-integrate-queue-adapters
papac Sep 22, 2023
a1f0bdd
Add onException method for catch job error
papac Sep 23, 2023
929d7f0
Update mail component
papac Sep 23, 2023
9b5787b
Refactoring
papac Sep 23, 2023
291b695
Merge pull request #265 from bowphp/feat-integrate-queue-adapters
papac Sep 23, 2023
03f346f
formatting
papac Sep 23, 2023
dcf099f
lint
papac Sep 23, 2023
0e1b454
Merge pull request #266 from bowphp/feat-integrate-queue-adapters
papac Sep 23, 2023
c6ce0d5
Fixs migration stubs
papac Sep 23, 2023
ca59301
Update unity tests
papac Sep 23, 2023
8f07cab
Merge pull request #267 from bowphp/feat-integrate-queue-adapters
papac Sep 23, 2023
6952ecc
Update readme.md
papac Sep 24, 2023
18230e4
Merge pull request #268 from bowphp/update-readme
papac Sep 24, 2023
96c0ff2
Add email queue processing
papac Sep 28, 2023
28ec0e3
Integrate mail queue
papac Sep 29, 2023
8e5f82f
Integrate event queue
papac Sep 29, 2023
d6f2292
lint
papac Sep 29, 2023
6e8cc5d
Fixes getForm return type
papac Sep 29, 2023
36e9ca3
Merge pull request #269 from bowphp/feat-integrate-queue-adapters
papac Sep 29, 2023
d911f54
Add sync queue adapter
papac Oct 5, 2023
e6ff5c9
Merge pull request #270 from bowphp/feat-integrate-queue-adapters
papac Oct 5, 2023
6c0c187
Update WorkerCommand.php
papac Oct 16, 2023
e6cfed3
Update QueueAdapter.php
papac Oct 16, 2023
a41ba10
Update Console.php
papac Oct 16, 2023
918aa34
Merge pull request #271 from bowphp/papac-patch-1
papac Oct 16, 2023
46fc80a
Merge branch '5.x' into papac-patch-2
papac Oct 16, 2023
1e6e09a
Merge pull request #272 from bowphp/papac-patch-2
papac Oct 16, 2023
34e2bd7
Merge branch '5.x' into papac-patch-3
papac Oct 16, 2023
c810734
Merge pull request #273 from bowphp/papac-patch-3
papac Oct 16, 2023
2eb2150
Update BeanstalkdAdapter.php
papac Oct 16, 2023
f2b0ab8
Merge pull request #274 from bowphp/papac-patch-1
papac Oct 16, 2023
1676f73
Update Model.php
papac Oct 27, 2023
9b41fa2
Merge pull request #275 from bowphp/papac-patch-1
papac Oct 27, 2023
1dcab5c
Update MysqlCompose.php
papac Oct 29, 2023
2541cca
Merge pull request #276 from bowphp/papac-patch-1
papac Oct 29, 2023
e8ae3d1
Update HttpClient.php
papac Oct 29, 2023
1ae3725
Merge pull request #277 from bowphp/papac-patch-1
papac Oct 29, 2023
14fd71e
Fix duplicate headers
papac Nov 5, 2023
5bae292
Merge pull request #278 from bowphp/fix-http-duplicate-header
papac Nov 5, 2023
5099c91
comply with psr-4 autoloading standard
papac Nov 8, 2023
60f9902
Merge branch '5.x' into fix-http-duplicate-header
papac Nov 8, 2023
1e8bfd0
Merge pull request #279 from bowphp/fix-http-duplicate-header
papac Nov 8, 2023
6a60e65
Fixes the processingf request data from php input
papac Nov 9, 2023
99ec54b
Fixes the tests
papac Nov 9, 2023
672b56b
Merge pull request #280 from bowphp/fix-http-duplicate-header
papac Nov 9, 2023
5e69f86
Bug fixes
papac Nov 14, 2023
162b25c
Merge pull request #281 from bowphp/fix-http-duplicate-header
papac Dec 1, 2023
205a30d
Fix Serializes importation in event.stub
papac Sep 21, 2024
e9fb1a6
chore: install uuid package
papac Dec 6, 2024
e38ed98
chore: upgrade twig
papac Dec 12, 2024
10efe0a
chore: update vsftpd image
papac Dec 12, 2024
5ba2a2f
fix: match should return Route class instance
papac Dec 12, 2024
04edbf8
refactor: change method name
papac Dec 13, 2024
e425629
test: fix http test
papac Dec 13, 2024
9cb52e3
ci: change the ftp server
papac Dec 13, 2024
4ac97d2
refactor: change the isDirectory method
papac Dec 13, 2024
d1577d3
fix(ci): remove network setting on the ftp server
papac Dec 14, 2024
e7d6310
Merge pull request #287 from bowphp/fix/route
papac Dec 14, 2024
f168b53
Merge branch '5.x' into papac-patch-1
papac Dec 14, 2024
dc457c4
test: update snapshot
papac Dec 14, 2024
0d232ad
Merge pull request #285 from bowphp/papac-patch-1
papac Dec 14, 2024
489ea4a
fix: return type compatibility
papac Dec 14, 2024
38d78e1
Merge pull request #288 from bowphp/fix/session
papac Dec 14, 2024
0895dd5
feat: add userAgent method
papac Dec 15, 2024
8f2e54d
Merge pull request #289 from bowphp/feat/request
papac Dec 15, 2024
98da564
fix(route): format route by his name
papac Dec 15, 2024
b89f138
Merge pull request #290 from bowphp/fix/helper-route
papac Dec 15, 2024
d097c73
refactor: change and add new methods
papac Dec 16, 2024
5656a55
test: fix unit tests
papac Dec 16, 2024
3ae8f3e
Merge branch '5.x' into feat/string
papac Dec 16, 2024
3bb035b
Merge pull request #291 from bowphp/feat/string
papac Dec 16, 2024
f34b1da
refactor: refactor http module
papac Dec 16, 2024
78228a4
Merge pull request #292 from bowphp/feat/http
papac Dec 16, 2024
22ada09
feat: add paginate class
papac Dec 16, 2024
33aa5fd
test: add unity test for pagination
papac Dec 16, 2024
65318ba
Merge pull request #293 from bowphp/feat/paginate
papac Dec 16, 2024
d46eb2b
feat: add new method
papac Dec 16, 2024
2fda8ca
fix: refond response helper
papac Dec 16, 2024
fbe340a
Merge pull request #294 from bowphp/feat/paginate
papac Dec 16, 2024
9e6ae1f
fix: return value of str_uuid
papac Dec 16, 2024
466b0bb
refactor: change uploaded file name
papac Dec 16, 2024
058543c
Merge pull request #295 from bowphp/feat/paginate
papac Dec 16, 2024
73c17e6
Merge branch '5.x' into feat/http-uploaded
papac Dec 16, 2024
c3219c1
Merge pull request #296 from bowphp/feat/http-uploaded
papac Dec 16, 2024
797afc1
fix: return type compatibility
papac Dec 16, 2024
291a54d
fix: upload exception
papac Dec 16, 2024
3e79647
Merge pull request #297 from bowphp/feat/http-uploaded
papac Dec 16, 2024
f8bd89f
chore: upgrade psy/psysh
papac Dec 16, 2024
ce7f516
fix: change the basic extended class
papac Dec 16, 2024
29d17f8
fix(log): fix log and data access config
papac Dec 16, 2024
f13c705
Merge pull request #298 from bowphp/feat/http-uploaded
papac Dec 16, 2024
c6516b8
fix: arraydotify return value
papac Dec 17, 2024
103d343
Merge pull request #299 from bowphp/feat/http-uploaded
papac Dec 17, 2024
b4fd873
fix: set the cookie configuration
papac Dec 17, 2024
09f577b
fix(model): apply many bugs
papac Dec 17, 2024
3e7d3b7
fix: resolve url by route name
papac Dec 17, 2024
10786b9
fix(model): fix save method when attribute is already set
papac Dec 17, 2024
2652b85
Merge pull request #300 from bowphp/feat/http-uploaded
papac Dec 17, 2024
9ed4120
fix: data secure
papac Dec 17, 2024
9391ffa
Merge pull request #301 from bowphp/feat/http-uploaded
papac Dec 17, 2024
f6b07e7
fix: change session prototype
papac Dec 18, 2024
9c39adc
fix: update e helper
papac Dec 18, 2024
61c3044
Merge branch '5.x' into feat/http-uploaded
papac Dec 18, 2024
9cce14e
Merge pull request #302 from bowphp/feat/http-uploaded
papac Dec 18, 2024
e1abfc1
fix: stop execute of words
papac Dec 18, 2024
414ab4b
Merge pull request #303 from bowphp/fix/str
papac Dec 18, 2024
c8a7235
feat(http): add http status class
papac Dec 20, 2024
728d1e0
refactor: refactor the app_abort class
papac Dec 20, 2024
5673a7f
fix(str): refactoring str classes
papac Dec 20, 2024
be3b14d
Merge pull request #304 from bowphp/fix/str
papac Dec 20, 2024
ee3b948
Update CHANGELOG
papac Dec 20, 2024
95fbe62
Merge pull request #305 from bowphp/5.x-update-changelog
papac Dec 20, 2024
3903639
feat(barry): add relative create method for barry model
papac Dec 21, 2024
32e6854
Merge branch '5.x' into fix/bugs
papac Dec 21, 2024
b70bd03
Merge pull request #306 from bowphp/fix/bugs
papac Dec 21, 2024
2bf903c
Update CHANGELOG
papac Dec 25, 2024
3c1bd07
Merge pull request #307 from bowphp/5.x-update-changelog
papac Dec 25, 2024
3b0102a
Update README.md
papac Jan 11, 2025
8d263ef
Merge pull request #308 from bowphp/papac-patch-1
papac Jan 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ env:
FTP_USER: username
FTP_PASSWORD: password
FTP_PORT: 21
FTP_ROOT: /tmp

jobs:
lunix-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
php: [8.1, 8.2]
php: [8.1, 8.2, 8.3]
os: [ubuntu-latest]
stability: [prefer-lowest, prefer-stable]

Expand Down Expand Up @@ -41,11 +42,11 @@ jobs:
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysql, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, redis
coverage: none

- run: docker run --net=host -p 21:21 -e USER=$FTP_USER -e PASS=$FTP_PASSWORD -d --name ftp -v $(pwd)/:/ftp/$FTP_USER emilybache/vsftpd-server
- run: docker run -p 21:21 -p 20:20 -p 12020:12020 -p 12021:12021 -p 12022:12022 -p 12023:12023 -p 12024:12024 -p 12025:12025 -e USER=$FTP_USER -e PASS=$FTP_PASSWORD -d --name ftp papacdev/vsftpd
- run: docker run -p 1080:1080 -p 1025:1025 -d --name maildev soulteary/maildev
- run: docker run -p 6379:6379 -d --name redis redis
- run: docker run -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -d postgis/postgis
- run: docker run -d -p 11301:11300 schickling/beanstalkd
- run: docker run -d -p 11300:11300 schickling/beanstalkd

- name: Cache Composer packages
id: composer-cache
Expand All @@ -57,13 +58,13 @@ jobs:
${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}

- name: Copy the php ini config
run: cp php.dist.ini php.ini
run: sudo cp php.dist.ini php.ini

- name: Install dependencies
run: composer update --prefer-dist --no-interaction
run: sudo composer update --prefer-dist --no-interaction

- name: Create test cache directory
run: if [ ! -d /tmp/bowphp_testing ]; then mkdir -p /tmp/bowphp_testing; fi;

- name: Run test suite
run: composer run-script test
run: sudo composer run-script test
129 changes: 128 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,134 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## 5.1.7 - 2024-12-21

### What's Changed

* Update CHANGELOG by @papac in https://github.com/bowphp/framework/pull/305
* feat(barry): add relative create method for barry model by @papac in https://github.com/bowphp/framework/pull/306

**Full Changelog**: https://github.com/bowphp/framework/compare/5.1.6...5.1.7

## 5.1.6 - 2024-12-20

### What's Changed

* Implement feature for improve http and str classes by @papac in https://github.com/bowphp/framework/pull/304

**Full Changelog**: https://github.com/bowphp/framework/compare/5.1.5...5.1.6

## 5.1.2 - 2023-09-17

Fix `db_seed` helper

Ref

- #257
- #256

## 5.1.1 - 2023-08-21

Add the transaction method

This method aims to execute an SQL transaction around a passed arrow function.

```php
Database::transaction(fn() => $user->update(['name' => '']));




```
Ref: #255

## 5.1.0 - 2023-06-07

Release 5.1.0

- Add custom adaptor #252
- Make Redis accessible on whole project #250

## 5.0.9 - 2023-06-01

Release 5.0.9

Fixes many bugs

Reference #248

## 5.0.8 - 2023-05-24

Release 5.0.8

Fixes test case errors

Reference #243
From #242

## 5.0.7 - 2023-05-24

Release 5.0.7

- Fixes the database relationship
- Fixes the HTTP client
- Fixes the JWT authentication service

Fixes #241
Fixes #213
Fixes #240

## 5.0.6 - 2023-05-22

Release 5.0.6

- Fixes get last insert id for pgsql
- Add data validation custom message parser
- Fixes PgSQL migration errors
- Fixes initialize the request ID #236

References

- Validation and PgSQL #237
- Many bugs fixes #237

## 5.0.5 - 2023-05-20

Release 5.0.5

- Fix migration status table definition
- Fix enum creation for pgsql

Reference #232

## 5.0.4 - 2023-05-19

Release 5.0.4

- Fixes HTTP Client
- Add variable binding to the env loader
- Fixes validation for regex rule
- Fixes request data parser
- Fixes middleware execution order

All update ref #230

## 5.0.3 - 2023-05-16

Add many fixes

- Fixes the error handler
- Fixes the HTTP client
- Fixes TestCase service

## 5.0.2 - 2023-05-16

Release for 5.0.2

- Fix action dependency injector
- Add the base error handler

## 5.0.0 - 2023-05-10

- [Add] Convert the project from PHP7 to PHP8
- [Add] Multiconnection for storage system
Expand Down
20 changes: 6 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,21 @@
"bowphp/tintin": "^3.0",
"filp/whoops": "^2.1",
"nesbot/carbon": "^2.16",
"psy/psysh": "v0.10.*",
"psy/psysh": "v0.12.*",
"fakerphp/faker": "^1.20",
"neitanod/forceutf8": "^2.0",
"ext-openssl": "*",
"ext-intl": "*",
"ext-pdo": "*",
"ext-mbstring": "*",
"ext-xml": "*",
"ext-json": "*",
"ext-pdo_mysql": "*",
"ext-pdo_sqlite": "*",
"ext-redis": "*"
"ramsey/uuid": "^4.7"
},
"require-dev": {
"pda/pheanstalk": "^4.0",
"phpunit/phpunit": "^8",
"pda/pheanstalk": "^4.0.5",
"phpunit/phpunit": "^9",
"monolog/monolog": "^1.22",
"twig/twig": "^2.5",
"twig/twig": "^3",
"squizlabs/php_codesniffer": "3.*",
"aws/aws-sdk-php": "^3.87",
"phpstan/phpstan": "^0.12.87",
"php-amqplib/php-amqplib": "^3.0",
"bowphp/policier": "dev-master",
"bowphp/policier": "^3.0",
"mockery/mockery": "^1.5",
"spatie/phpunit-snapshot-assertions": "^4.2",
"predis/predis": "^2.1"
Expand Down
7 changes: 4 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To use this package, please create an application from this package [bowphp/app]

## The Framework Main Feature

- Full Featured database classes with support for several platforms.
- Full-featured database classes with support for several platforms.
- Query Builder Database Support
- Form and Data Validation
- Security and XSS Filtering
Expand All @@ -21,10 +21,10 @@ To use this package, please create an application from this package [bowphp/app]
- Pagination
- CQRS helpful implementation
- File System Management with many drivers like S3 and FTP (Support connection switch)
- Extensible with an external package that can plug-in
- Extensible with an external package that can plug in
- Application logs Management
- Database Connection (MySQL, SQLite, PostgreSQL)
- Simplest ORM which names Barry
- Simplest ORM which is named Barry
- Cache support (Filesystem, Redis, Database caching)
- Event Management (Interpage Event)
- Emailing (SMTP, SES, Native PHP mail supports)
Expand All @@ -34,6 +34,7 @@ To use this package, please create an application from this package [bowphp/app]
- Very easy Translate Management
- Many helpers
- The native authentication system
- Producer/Consumer with beanstalkd, database, Redis, SQS backend

## Contributing

Expand Down
20 changes: 4 additions & 16 deletions src/Application/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ public function __construct(Request $request, Response $response)

$this->capsule = Capsule::getInstance();

$this->capsule->instance('request', $request);
$this->capsule->instance('response', $response);
$this->capsule->instance('request', $request);
$this->capsule->instance('app', $this);

$this->request->capture();
parent::__construct($request->method(), $request->get('_method'));
}

Expand Down Expand Up @@ -195,30 +196,17 @@ public function send(): ?bool
// the routing collection
$routes = $this->getRoutes();

if (!isset($routes[$method])) {
// We verify and call function associate by 404 code
$this->response->status(404);

if (empty($this->error_code)) {
$this->response->send(
sprintf('Cannot %s %s 404', $method, $this->request->path())
);
}

return false;
}

$response = null;
$resolved = false;

foreach ($routes[$method] as $route) {
foreach ($routes[$method] ?? [] as $route) {
// The route must be an instance of Route
if (!($route instanceof Route)) {
continue;
}

// We launch the search of the method that arrived in the query
// then start checking the url of the request
// then start checking the url of the request
if (!$route->match($this->request->path())) {
continue;
}
Expand Down
83 changes: 83 additions & 0 deletions src/Application/Exception/BaseErrorHandler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?php

declare(strict_types=1);

namespace Bow\Application\Exception;

use PDOException;
use Bow\View\View;
use Bow\Http\Exception\HttpException;
use Bow\Validation\Exception\ValidationException;
use Policier\Exception\TokenExpiredException;
use Policier\Exception\TokenInvalidException;

class BaseErrorHandler
{
/**
* Render view as response
*
* @param string $view
* @param array $data
* @return string
*/
protected function render($view, $data = []): string
{
return View::parse($view, $data)->getContent();
}

/**
* Send the json as response
*
* @param string $data
* @param mixed $code
* @return mixed
*/
protected function json($exception, $code = null)
{
if ($exception instanceof TokenInvalidException) {
$code = 'TOKEN_INVALID';
}

if ($exception instanceof TokenExpiredException) {
$code = 'TOKEN_EXPIRED';
}

if (is_null($code)) {
if (method_exists($exception, 'getStatus')) {
$code = $exception->getStatus();
} else {
$code = 'INTERNAL_SERVER_ERROR';
}
}

if (app_env("APP_ENV") == "production" && $exception instanceof PDOException) {
$message = 'An SQL error occurs. For security, we did not display the message.';
} else {
$message = $exception->getMessage();
}

$response = [
'message' => $message,
'code' => $code,
'time' => date('Y-m-d H:i:s')
];

$status = 500;

if ($exception instanceof HttpException) {
$status = $exception->getStatusCode();
$response = array_merge($response, compact('status'));
if ($exception instanceof ValidationException) {
$response["errors"] = $exception->getErrors();
}
}

if (app_env("APP_ENV") != "production") {
$response["trace"] = $exception->getTrace();
}

response()->status($status);

return die(json_encode($response));
}
}
Loading
Loading