Mikhail Stupalov
079d7bf471
fix: allow plain function name callbacks in Dispatcher::execute()
...
Since v3.19.2 every string callback went through parseStringClassAndMethod(),
so routes and events mapped to a global function name threw
InvalidArgumentException. Call existing functions directly and keep the
Class->method / Class::method parsing as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 days ago
Ambrose Casanova
9491b93951
feat: drive view path containment via flight.views.restrict_to_path
...
Expose the opt-in as a Flight::set() key in the flight.views.* family. Engine applies it to View::$restrictToPath when the view is created, same as path and extension. Default remains false.
3 weeks ago
Ambrose Casanova
eac9fef021
feat: make view path containment opt-in with View::$restrictToPath
...
Restore getTemplate() and its existing test exactly as on master. Default behavior is unchanged: absolute paths still render and exists() never throws. With restrictToPath on, render(), fetch() and exists() only accept files that resolve inside the views path. A blocked file has its own error message, separate from "not found".
3 weeks ago
Ambrose Casanova
8093a18fb3
fix: reject Windows view paths that leave the views directory
...
Normalize both separators before the containment check, and build the regression next to the views directory so it stays on the same drive.
4 weeks ago
Ambrose Casanova
63e5bcd613
fix: keep view templates inside the views directory
...
Reject absolute template paths and any resolved path outside the configured views directory.
4 weeks ago
n0nag0n
24640dcbcb
Merge pull request #727 from flightphp/fix-726-fetchfield-null
...
fix: return false from fetchField on empty result
2 months ago
Ambrose Casanova
e42c7848c4
fix: return false from fetchField on empty result
...
SimplePdo::fetchRow() returns null when there are no rows. Guard
PdoWrapper::fetchField() so empty queries return false instead of
calling getData() on null. Closes #726 .
2 months ago
Ambrose Casanova
6b8d2f9880
fix: escape single quotes in View::e()
...
Pass ENT_QUOTES|ENT_SUBSTITUTE and UTF-8 to htmlentities so single-quoted
attributes are escaped on PHP 7.4/8.0 as well as 8.1+.
2 months ago
Ambrose Casanova
13af0cb63c
Do not add the package root to Loader::$dirs under Composer.
...
files autoload still registers Loader::autoload() so Flight::path() works. Composer PSR-4 already loads flight\*. Reset leftover path() dirs in AutoloadTest so LoaderTest can assert the exact list.
2 months ago
Ambrose Casanova
2880142083
Restore Flight::path() autoloading after the 3.19 autoload rework.
...
PR 709 dropped the Composer files entry for flight/autoload.php and that file returned early when vendor/autoload.php existed, so Loader::autoload() never registered. path() still added directories; namespaced app classes never loaded. Upgrades must not break that.
2 months ago
n0nag0n
d332b453c0
Merge pull request #721 from flightphp/dispatcher-rework
...
Refactor Dispatcher to improve type hints and simplify callable handling
2 months ago
n0nag0n
b26dc67adc
Merge pull request #723 from flightphp/loader-rework
...
Refactor and improve Loader documentation and properties
2 months ago
copilot-swe-agent[bot]
6a127b1f0f
Clarify setV2ClassLoading() docblock to explain true/false behaviour
...
Co-authored-by: fadrian06 <109766973+fadrian06@users.noreply.github.com>
2 months ago
fadrian06
89c378cc94
fix constructor arguments typehint
...
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2 months ago
fadrian06
2fac34fbb7
refactor Loader@autoload, Loader@addDirectory and Loader@setV2ClassLoading
2 months ago
fadrian06
77e68ea77b
improve Loader@reset docblock
2 months ago
fadrian06
89a9decc0b
improve Loader@get docblock
2 months ago
fadrian06
09e222c0fa
simplify Loader@newInstance
2 months ago
fadrian06
5a83743cc7
simplify Loader@getInstance docblock
2 months ago
fadrian06
712792006f
refactor Loader@load with better names and docblock
2 months ago
fadrian06
1519e0cf30
improve Loader@unregister $name param docblock
2 months ago
fadrian06
d9406bbf24
improve Loader@register docblocks
2 months ago
fadrian06
ff5e90c592
define class factory callable arguments typehint
2 months ago
fadrian06
d9b01781e6
rewrite Loader docblock
2 months ago
fadrian06
6acbdb2082
refactor Loader@load
2 months ago
fadrian06
d196cc09e1
format Loader@register and Loader@unregister docblocks
2 months ago
fadrian06
85f5431a40
reduce loader classes property docblock line length
2 months ago
fadrian06
7f1b976ca1
simplify loader properties typehints
2 months ago
fadrian06
30193dedac
compact loader properties docblocks
2 months ago
fadrian06
8523025cb5
rewrap loader description
2 months ago
fadrian06
1a8af5c96b
Merge branch 'master' into dispatcher-rework
2 months ago
n0nag0n
5372672332
Merge pull request #722 from flightphp/eventdispatcher-rework
...
Simplify EventDispatcher methods and remove redundant descriptions
2 months ago
fadrian06
cd3d8bb44e
simplify EventDispatcher@removeAllListeners and resetInstance
2 months ago
fadrian06
4cb50f66ab
simplify EventDispatcher@removeListener
2 months ago
fadrian06
6c22bad3f0
remove redundant explanation of EventDispatcher@getAllRegisteredEvents
2 months ago
fadrian06
361e45e974
simplify EventDispatcher@getListeners
2 months ago
fadrian06
4abcd23e11
use EventDispatcher@hasListeners in trigger
2 months ago
fadrian06
6bc62d9b0c
simplify EventDispatcher@hasListeners
2 months ago
fadrian06
0d50ed97d6
use early returns in EventDispatcher@trigger
2 months ago
fadrian06
f7b2736736
simplify EventDispatcher@trigger
2 months ago
fadrian06
3723228c3d
simplify EventDispatcher@on
2 months ago
fadrian06
8d29ad4fd0
remove reduntant EventDispatcher@getInstance description
2 months ago
fadrian06
3066c5dcc4
simplify EventDispatcher listeners typehint
2 months ago
fadrian06
4c2a08c3e6
remove reduntant EventDispatcher::$instance description
2 months ago
fadrian06
7482506270
remove EngineTemplate
2 months ago
fadrian06
17ed78763f
add more @template
2 months ago
fadrian06
8e168e648b
remove unused $container
2 months ago
fadrian06
cfa87bee4e
remove unneccesary references
2 months ago
fadrian06
e48b976aac
fix phpstan message about Dispatcher@get return type
2 months ago
fadrian06
bdd5bdcc24
fix Dispatcher@get return type
2 months ago