mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-15 18:23:26 +03:00
Development
- Fixed 403 not allowed exception is now thrown as NotFoundHttpException. - Added REQUEST_TYPE_HEAD to Route class. - Minor optimizations.
This commit is contained in:
371
.idea/workspace.xml
generated
371
.idea/workspace.xml
generated
@@ -5,7 +5,11 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="a7058529-bdc4-40b4-a50d-c50564dc83f0" name="Default" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Pecee/Http/Input/InputHandler.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Pecee/Http/Input/InputHandler.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/Route.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/Route.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Pecee/SimpleRouter/Router.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Pecee/SimpleRouter/Router.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Pecee/SimpleRouter/SimpleRouter.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Pecee/SimpleRouter/SimpleRouter.php" afterDir="false" />
|
||||
</list>
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="TRACKING_ENABLED" value="true" />
|
||||
@@ -22,11 +26,44 @@
|
||||
</component>
|
||||
<component name="FileEditorManager">
|
||||
<leaf SIDE_TABS_SIZE_LIMIT_KEY="375">
|
||||
<file leaf-file-name="RouteController.php" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/RouteController.php">
|
||||
<file leaf-file-name="SimpleRouter.php" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/SimpleRouter.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="20">
|
||||
<caret line="15" column="22" selection-start-line="15" selection-start-column="22" selection-end-line="15" selection-end-column="22" />
|
||||
<state relative-caret-position="-2294">
|
||||
<caret line="100" column="16" selection-start-line="100" selection-start-column="8" selection-end-line="100" selection-end-column="16" />
|
||||
<folding>
|
||||
<element signature="e#302#319#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="LoadableRoute.php" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/LoadableRoute.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="1420">
|
||||
<caret line="71" column="33" selection-start-line="71" selection-start-column="27" selection-end-line="71" selection-end-column="33" />
|
||||
<folding>
|
||||
<element signature="e#44#82#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="RouteResource.php" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/RouteResource.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="403">
|
||||
<caret line="94" column="116" selection-start-line="94" selection-start-column="116" selection-end-line="94" selection-end-column="116" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="RouteUrl.php" pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/RouteUrl.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="298">
|
||||
<caret line="16" column="64" selection-start-line="16" selection-start-column="64" selection-end-line="16" selection-end-column="64" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@@ -34,53 +71,8 @@
|
||||
<file leaf-file-name="IRoute.php" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/IRoute.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="224">
|
||||
<caret line="39" column="10" selection-start-line="39" selection-start-column="10" selection-end-line="39" selection-end-column="10" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="README.md" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/README.md">
|
||||
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
||||
<state split_layout="SPLIT">
|
||||
<first_editor relative-caret-position="165">
|
||||
<caret line="1220" column="10" selection-start-line="1220" selection-start-column="10" selection-end-line="1220" selection-end-column="10" />
|
||||
</first_editor>
|
||||
<second_editor />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="ILoadableRoute.php" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/ILoadableRoute.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="204">
|
||||
<caret line="32" column="36" selection-start-line="32" selection-start-column="30" selection-end-line="32" selection-end-column="36" />
|
||||
<folding>
|
||||
<element signature="e#44#67#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="RouteUrl.php" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/RouteUrl.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="200">
|
||||
<caret line="10" column="22" selection-start-line="10" selection-start-column="22" selection-end-line="10" selection-end-column="22" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="InputHandler.php" pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/Http/Input/InputHandler.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="162">
|
||||
<caret line="292" column="42" selection-start-line="292" selection-start-column="42" selection-end-line="292" selection-end-column="42" />
|
||||
<folding>
|
||||
<element signature="e#36#82#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
<state relative-caret-position="300">
|
||||
<caret line="16" column="20" selection-start-line="16" selection-start-column="20" selection-end-line="16" selection-end-column="20" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@@ -88,8 +80,8 @@
|
||||
<file leaf-file-name="Route.php" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/Route.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="162">
|
||||
<caret line="498" column="61" selection-start-line="498" selection-start-column="61" selection-end-line="498" selection-end-column="61" />
|
||||
<state relative-caret-position="205">
|
||||
<caret line="133" column="43" selection-start-line="133" selection-start-column="43" selection-end-line="133" selection-end-column="43" />
|
||||
<folding>
|
||||
<element signature="e#44#82#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
@@ -97,11 +89,23 @@
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="InputHandler.php" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/Http/Input/InputHandler.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="480">
|
||||
<caret line="315" column="17" selection-start-line="315" selection-start-column="17" selection-end-line="315" selection-end-column="17" />
|
||||
<folding>
|
||||
<element signature="e#36#82#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="Router.php" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Router.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="220">
|
||||
<caret line="517" selection-start-line="517" selection-end-line="517" />
|
||||
<state relative-caret-position="197">
|
||||
<caret line="893" column="20" selection-start-line="893" selection-start-column="20" selection-end-line="893" selection-end-column="20" />
|
||||
<folding>
|
||||
<element signature="e#38#84#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
@@ -109,36 +113,10 @@
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="SimpleRouter.php" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/SimpleRouter.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="505">
|
||||
<caret line="63" selection-start-line="63" selection-end-line="63" />
|
||||
<folding>
|
||||
<element signature="e#302#319#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="helpers.php" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/helpers.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="622">
|
||||
<caret line="51" column="59" selection-start-line="51" selection-start-column="59" selection-end-line="51" selection-end-column="59" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
</leaf>
|
||||
</component>
|
||||
<component name="FindInProjectRecents">
|
||||
<findStrings>
|
||||
<find>set</find>
|
||||
<find>hasParam</find>
|
||||
<find>csrf_token</find>
|
||||
<find>static function start</find>
|
||||
<find>fireEvents(</find>
|
||||
<find>->setUrl</find>
|
||||
<find>EVENT_LOAD</find>
|
||||
<find>addRoute</find>
|
||||
@@ -157,13 +135,18 @@
|
||||
<find>matchRoute</find>
|
||||
<find>->getValue</find>
|
||||
<find>->find</find>
|
||||
<find>function find</find>
|
||||
<find />
|
||||
<find>Req</find>
|
||||
<find>value(</find>
|
||||
<find>file(</find>
|
||||
<find>setUrl</find>
|
||||
<find>TODO</find>
|
||||
<find>input()->get</find>
|
||||
<find />
|
||||
<find>REQUEST_TYPE_</find>
|
||||
<find />
|
||||
<find>setDebugEnabled</find>
|
||||
<find>debugEnabled</find>
|
||||
</findStrings>
|
||||
<dirStrings>
|
||||
<dir>D:\Workspace\simple-php-router\src\Pecee\SimpleRouter\Route</dir>
|
||||
@@ -226,16 +209,16 @@
|
||||
<option value="$PROJECT_DIR$/src/Pecee/Http/Middleware/BaseCsrfVerifier.php" />
|
||||
<option value="$PROJECT_DIR$/README.md" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/Http/Request.php" />
|
||||
<option value="$PROJECT_DIR$/tests/Pecee/SimpleRouter/InputHandlerTest.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/LoadableRoute.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/RouteController.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/ILoadableRoute.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/RouteUrl.php" />
|
||||
<option value="$PROJECT_DIR$/helpers.php" />
|
||||
<option value="$PROJECT_DIR$/tests/Pecee/SimpleRouter/InputHandlerTest.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/Http/Input/InputHandler.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/Route.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Router.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/SimpleRouter.php" />
|
||||
<option value="$PROJECT_DIR$/helpers.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/Http/Input/InputHandler.php" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
@@ -308,7 +291,6 @@
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="Scope" />
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<expand>
|
||||
@@ -378,10 +360,24 @@
|
||||
<item name="simple-php-router" type="2a2b976b:PhpTreeStructureProvider$1" />
|
||||
<item name="tests" type="2a2b976b:PhpTreeStructureProvider$1" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="simple-php-router" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="simple-php-router" type="2a2b976b:PhpTreeStructureProvider$1" />
|
||||
<item name="tests" type="2a2b976b:PhpTreeStructureProvider$1" />
|
||||
<item name="Pecee" type="2a2b976b:PhpTreeStructureProvider$1" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="simple-php-router" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="simple-php-router" type="2a2b976b:PhpTreeStructureProvider$1" />
|
||||
<item name="tests" type="2a2b976b:PhpTreeStructureProvider$1" />
|
||||
<item name="Pecee" type="2a2b976b:PhpTreeStructureProvider$1" />
|
||||
<item name="SimpleRouter" type="2a2b976b:PhpTreeStructureProvider$1" />
|
||||
</path>
|
||||
</expand>
|
||||
<select />
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="Scope" />
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
@@ -448,9 +444,9 @@
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="PHPUnit.phpunit.xml" />
|
||||
<item itemvalue="PHP Script.debug.php" />
|
||||
<item itemvalue="PHPUnit.EventHandlerTest" />
|
||||
<item itemvalue="PHPUnit.tests" />
|
||||
<item itemvalue="PHP Script.debug.php" />
|
||||
<item itemvalue="PHPUnit.RouterUrlTest" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
@@ -527,26 +523,13 @@
|
||||
<workItem from="1522508007514" duration="2427000" />
|
||||
<workItem from="1522530661439" duration="3502000" />
|
||||
<workItem from="1522668357317" duration="4847000" />
|
||||
<workItem from="1523014652739" duration="14327000" />
|
||||
<workItem from="1523014652739" duration="16240000" />
|
||||
<workItem from="1523035686391" duration="174000" />
|
||||
<workItem from="1523035884787" duration="578000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TestHistory">
|
||||
<history-entry file="phpunit_xml - 2018.04.06 at 16h 11m 34s.xml">
|
||||
<configuration name="phpunit.xml" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
<history-entry file="phpunit_xml - 2018.04.06 at 16h 11m 56s.xml">
|
||||
<configuration name="phpunit.xml" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
<history-entry file="phpunit_xml - 2018.04.06 at 16h 12m 06s.xml">
|
||||
<configuration name="phpunit.xml" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
<history-entry file="phpunit_xml - 2018.04.06 at 16h 12m 15s.xml">
|
||||
<configuration name="phpunit.xml" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
<history-entry file="phpunit_xml - 2018.04.06 at 16h 53m 38s.xml">
|
||||
<configuration name="phpunit.xml" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
<history-entry file="phpunit_xml - 2018.04.06 at 16h 54m 36s.xml">
|
||||
<configuration name="phpunit.xml" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
@@ -562,9 +545,24 @@
|
||||
<history-entry file="phpunit_xml - 2018.04.06 at 16h 57m 10s.xml">
|
||||
<configuration name="phpunit.xml" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
<history-entry file="phpunit_xml - 2018.04.06 at 19h 04m 25s.xml">
|
||||
<configuration name="phpunit.xml" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
<history-entry file="phpunit_xml - 2018.04.06 at 19h 04m 32s.xml">
|
||||
<configuration name="phpunit.xml" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
<history-entry file="phpunit_xml - 2018.04.06 at 19h 35m 48s.xml">
|
||||
<configuration name="phpunit.xml" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
<history-entry file="phpunit_xml - 2018.04.06 at 19h 35m 53s.xml">
|
||||
<configuration name="phpunit.xml" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
<history-entry file="phpunit_xml - 2018.04.06 at 19h 35m 56s.xml">
|
||||
<configuration name="phpunit.xml" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
</component>
|
||||
<component name="TimeTrackingManager">
|
||||
<option name="totallyTimeSpent" value="163542000" />
|
||||
<option name="totallyTimeSpent" value="166207000" />
|
||||
</component>
|
||||
<component name="TodoView">
|
||||
<todo-panel id="selected-file">
|
||||
@@ -582,26 +580,26 @@
|
||||
<window_info anchor="bottom" id="TODO" order="11" weight="0.32983023" />
|
||||
<window_info anchor="bottom" id="Event Log" order="7" sideWeight="0.50919265" side_tool="true" weight="0.32902184" />
|
||||
<window_info anchor="bottom" id="Database Changes" order="13" show_stripe_button="false" />
|
||||
<window_info anchor="bottom" id="Run" order="2" sideWeight="0.49080735" weight="0.3272727" />
|
||||
<window_info anchor="bottom" id="Run" order="2" sideWeight="0.49080735" visible="true" weight="0.3272727" />
|
||||
<window_info anchor="bottom" id="Version Control" order="14" weight="0.32828283" />
|
||||
<window_info active="true" anchor="bottom" id="Terminal" order="12" sideWeight="0.49680257" visible="true" weight="0.28282827" />
|
||||
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.20479521" />
|
||||
<window_info anchor="bottom" id="Terminal" order="12" sideWeight="0.49680257" weight="0.28282827" />
|
||||
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.20879121" />
|
||||
<window_info anchor="bottom" id="Docker" order="8" show_stripe_button="false" />
|
||||
<window_info anchor="bottom" id="Inspection Results" order="15" weight="0.32828283" />
|
||||
<window_info anchor="right" id="Database" order="3" />
|
||||
<window_info anchor="bottom" id="Find" order="1" sideWeight="0.48880896" weight="0.3272727" />
|
||||
<window_info id="Structure" order="1" weight="0.24975026" />
|
||||
<window_info id="Structure" order="1" side_tool="true" weight="0.24975026" />
|
||||
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
|
||||
<window_info id="Favorites" order="2" weight="0.32967034" />
|
||||
<window_info anchor="bottom" id="Message" order="0" />
|
||||
<window_info id="Favorites" order="2" side_tool="true" weight="0.32967034" />
|
||||
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
|
||||
<window_info anchor="bottom" id="Inspection" order="6" weight="0.4" />
|
||||
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
|
||||
<window_info anchor="bottom" id="PHP-CGI Server" order="10" />
|
||||
<window_info anchor="right" id="Commander" order="0" weight="0.4" />
|
||||
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
|
||||
<window_info anchor="bottom" id="PHP-CGI Server" order="10" />
|
||||
<window_info anchor="bottom" id="REST Client" order="5" weight="0.32929292" />
|
||||
<window_info anchor="bottom" id="Command Line Tools Console" order="9" weight="0.32928804" />
|
||||
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
|
||||
<window_info anchor="bottom" id="Message" order="0" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
@@ -781,9 +779,6 @@
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="1860">
|
||||
<caret line="94" column="24" selection-start-line="94" selection-start-column="24" selection-end-line="94" selection-end-column="24" />
|
||||
<folding>
|
||||
<element signature="e#249#292#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@@ -794,13 +789,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/RouteResource.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="403">
|
||||
<caret line="94" column="116" selection-start-line="94" selection-start-column="116" selection-end-line="94" selection-end-column="116" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/Http/Response.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="-2096" />
|
||||
@@ -848,13 +836,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/tests/Pecee/SimpleRouter/InputHandlerTest.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="1806">
|
||||
<caret line="93" column="63" selection-start-line="93" selection-start-column="63" selection-end-line="93" selection-end-column="63" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/Http/Url.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="86">
|
||||
@@ -876,16 +857,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/LoadableRoute.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="20">
|
||||
<caret line="71" column="33" selection-start-line="71" selection-start-column="27" selection-end-line="71" selection-end-column="33" />
|
||||
<folding>
|
||||
<element signature="e#44#82#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/RouteController.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="20">
|
||||
@@ -893,16 +864,9 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/IRoute.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="224">
|
||||
<caret line="39" column="10" selection-start-line="39" selection-start-column="10" selection-end-line="39" selection-end-column="10" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/ILoadableRoute.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="204">
|
||||
<state relative-caret-position="640">
|
||||
<caret line="32" column="36" selection-start-line="32" selection-start-column="30" selection-end-line="32" selection-end-column="36" />
|
||||
<folding>
|
||||
<element signature="e#44#67#0#PHP" expanded="true" />
|
||||
@@ -910,46 +874,9 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/RouteUrl.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="200">
|
||||
<caret line="10" column="22" selection-start-line="10" selection-start-column="22" selection-end-line="10" selection-end-column="22" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/Route.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="162">
|
||||
<caret line="498" column="61" selection-start-line="498" selection-start-column="61" selection-end-line="498" selection-end-column="61" />
|
||||
<folding>
|
||||
<element signature="e#44#82#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Router.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="220">
|
||||
<caret line="517" selection-start-line="517" selection-end-line="517" />
|
||||
<folding>
|
||||
<element signature="e#38#84#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/SimpleRouter.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="505">
|
||||
<caret line="63" selection-start-line="63" selection-end-line="63" />
|
||||
<folding>
|
||||
<element signature="e#302#319#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/helpers.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="622">
|
||||
<state relative-caret-position="960">
|
||||
<caret line="51" column="59" selection-start-line="51" selection-start-column="59" selection-end-line="51" selection-end-column="59" />
|
||||
</state>
|
||||
</provider>
|
||||
@@ -957,22 +884,90 @@
|
||||
<entry file="file://$PROJECT_DIR$/README.md">
|
||||
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
||||
<state split_layout="SPLIT">
|
||||
<first_editor relative-caret-position="165">
|
||||
<first_editor relative-caret-position="24400">
|
||||
<caret line="1220" column="10" selection-start-line="1220" selection-start-column="10" selection-end-line="1220" selection-end-column="10" />
|
||||
</first_editor>
|
||||
<second_editor />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/tests/Pecee/SimpleRouter/InputHandlerTest.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="405">
|
||||
<caret line="81" column="60" selection-start-line="81" selection-start-column="60" selection-end-line="81" selection-end-column="60" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/Http/Input/InputHandler.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="162">
|
||||
<caret line="292" column="42" selection-start-line="292" selection-start-column="42" selection-end-line="292" selection-end-column="42" />
|
||||
<state relative-caret-position="480">
|
||||
<caret line="315" column="17" selection-start-line="315" selection-start-column="17" selection-end-line="315" selection-end-column="17" />
|
||||
<folding>
|
||||
<element signature="e#36#82#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Router.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="197">
|
||||
<caret line="893" column="20" selection-start-line="893" selection-start-column="20" selection-end-line="893" selection-end-column="20" />
|
||||
<folding>
|
||||
<element signature="e#38#84#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/Route.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="205">
|
||||
<caret line="133" column="43" selection-start-line="133" selection-start-column="43" selection-end-line="133" selection-end-column="43" />
|
||||
<folding>
|
||||
<element signature="e#44#82#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/SimpleRouter.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="-2294">
|
||||
<caret line="100" column="16" selection-start-line="100" selection-start-column="8" selection-end-line="100" selection-end-column="16" />
|
||||
<folding>
|
||||
<element signature="e#302#319#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/LoadableRoute.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="1420">
|
||||
<caret line="71" column="33" selection-start-line="71" selection-start-column="27" selection-end-line="71" selection-end-column="33" />
|
||||
<folding>
|
||||
<element signature="e#44#82#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/RouteResource.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="403">
|
||||
<caret line="94" column="116" selection-start-line="94" selection-start-column="116" selection-end-line="94" selection-end-column="116" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/IRoute.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="300">
|
||||
<caret line="16" column="20" selection-start-line="16" selection-start-column="20" selection-end-line="16" selection-end-column="20" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/RouteUrl.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="298">
|
||||
<caret line="16" column="64" selection-start-line="16" selection-start-column="64" selection-end-line="16" selection-end-column="64" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
</project>
|
||||
@@ -313,7 +313,7 @@ class InputHandler
|
||||
}
|
||||
}
|
||||
|
||||
return ($filter !== null) ? array_intersect_key($output, array_flip($filter)) : $output;
|
||||
return (\count($filter) > 0) ? array_intersect_key($output, array_flip($filter)) : $output;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,6 +18,7 @@ abstract class Route implements IRoute
|
||||
public const REQUEST_TYPE_PATCH = 'patch';
|
||||
public const REQUEST_TYPE_OPTIONS = 'options';
|
||||
public const REQUEST_TYPE_DELETE = 'delete';
|
||||
public const REQUEST_TYPE_HEAD = 'head';
|
||||
|
||||
public static $requestTypes = [
|
||||
self::REQUEST_TYPE_GET,
|
||||
@@ -26,6 +27,7 @@ abstract class Route implements IRoute
|
||||
self::REQUEST_TYPE_PATCH,
|
||||
self::REQUEST_TYPE_OPTIONS,
|
||||
self::REQUEST_TYPE_DELETE,
|
||||
self::REQUEST_TYPE_HEAD,
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -120,23 +122,25 @@ abstract class Route implements IRoute
|
||||
|
||||
protected function parseParameters($route, $url, $parameterRegex = null)
|
||||
{
|
||||
$regex = null;
|
||||
if (strpos($route, $this->paramModifiers[0]) !== false) {
|
||||
$regex = sprintf(static::PARAMETERS_REGEX_FORMAT, $this->paramModifiers[0], $this->paramOptionalSymbol, $this->paramModifiers[1]);
|
||||
}
|
||||
$regex = (strpos($route, $this->paramModifiers[0]) === false) ? null :
|
||||
sprintf
|
||||
(
|
||||
static::PARAMETERS_REGEX_FORMAT,
|
||||
$this->paramModifiers[0],
|
||||
$this->paramOptionalSymbol,
|
||||
$this->paramModifiers[1]
|
||||
);
|
||||
|
||||
// Ensures that host names/domains will work with parameters
|
||||
$url = '/' . ltrim($url, '/');
|
||||
$urlRegex = null;
|
||||
$urlRegex = '';
|
||||
$parameters = [];
|
||||
|
||||
if ($regex === null || (bool)preg_match_all('/' . $regex . '/u', $route, $parameters) === false) {
|
||||
$urlRegex = preg_quote($route, '/');
|
||||
} else {
|
||||
|
||||
$urlParts = preg_split('/((\-?\/?)\{[^}]+\})/', $route);
|
||||
|
||||
foreach ($urlParts as $key => $t) {
|
||||
foreach (preg_split('/((\-?\/?)\{[^}]+\})/', $route) as $key => $t) {
|
||||
|
||||
$regex = '';
|
||||
|
||||
@@ -164,7 +168,7 @@ abstract class Route implements IRoute
|
||||
}
|
||||
}
|
||||
|
||||
if ($urlRegex === null || (bool)preg_match(sprintf($this->urlRegex, $urlRegex), $url, $matches) === false) {
|
||||
if (trim($urlRegex) === '' || (bool)preg_match(sprintf($this->urlRegex, $urlRegex), $url, $matches) === false) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -174,7 +178,7 @@ abstract class Route implements IRoute
|
||||
|
||||
/* Only take matched parameters with name */
|
||||
foreach ((array)$parameters[1] as $name) {
|
||||
$values[$name] = (isset($matches[$name]) && $matches[$name] !== '') ? $matches[$name] : null;
|
||||
$values[$name] = (isset($matches[$name]) === true && $matches[$name] !== '') ? $matches[$name] : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -412,7 +412,7 @@ class Router
|
||||
|
||||
if ($methodNotAllowed === true) {
|
||||
$message = sprintf('Route "%s" or method "%s" not allowed.', $this->request->getUrl()->getPath(), $this->request->getMethod());
|
||||
$this->handleException(new HttpException($message, 403));
|
||||
$this->handleException(new NotFoundHttpException($message, 403));
|
||||
}
|
||||
|
||||
if (\count($this->request->getLoadedRoutes()) === 0) {
|
||||
@@ -457,7 +457,9 @@ class Router
|
||||
}
|
||||
|
||||
if ($this->request->getRewriteUrl() !== $url) {
|
||||
|
||||
unset($this->processedRoutes[$key]);
|
||||
|
||||
$this->request->setHasPendingRewrite(false);
|
||||
|
||||
$this->fireEvents(EventHandler::EVENT_REWRITE, [
|
||||
@@ -644,11 +646,7 @@ class Router
|
||||
}
|
||||
|
||||
/* Only merge $_GET when all parameters are null */
|
||||
if ($name === null && $parameters === null && $getParams === null) {
|
||||
$getParams = $_GET;
|
||||
} else {
|
||||
$getParams = (array)$getParams;
|
||||
}
|
||||
$getParams = ($name === null && $parameters === null && $getParams === null) ? $_GET : (array)$getParams;
|
||||
|
||||
/* Return current route if no options has been specified */
|
||||
if ($name === null && $parameters === null) {
|
||||
|
||||
@@ -24,7 +24,6 @@ use Pecee\SimpleRouter\Handlers\IEventHandler;
|
||||
use Pecee\SimpleRouter\Route\IGroupRoute;
|
||||
use Pecee\SimpleRouter\Route\IPartialGroupRoute;
|
||||
use Pecee\SimpleRouter\Route\IRoute;
|
||||
use Pecee\SimpleRouter\Route\Route;
|
||||
use Pecee\SimpleRouter\Route\RouteController;
|
||||
use Pecee\SimpleRouter\Route\RouteGroup;
|
||||
use Pecee\SimpleRouter\Route\RoutePartialGroup;
|
||||
@@ -75,8 +74,7 @@ class SimpleRouter
|
||||
|
||||
try {
|
||||
ob_start();
|
||||
static::router()->setDebugEnabled(true);
|
||||
static::start();
|
||||
static::router()->setDebugEnabled(true)->start();
|
||||
$routerOutput = ob_get_contents();
|
||||
ob_end_clean();
|
||||
} catch (\Exception $e) {
|
||||
@@ -187,7 +185,7 @@ class SimpleRouter
|
||||
*/
|
||||
public static function get(string $url, $callback, array $settings = null): IRoute
|
||||
{
|
||||
return static::match([Route::REQUEST_TYPE_GET], $url, $callback, $settings);
|
||||
return static::match(['get'], $url, $callback, $settings);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -200,7 +198,7 @@ class SimpleRouter
|
||||
*/
|
||||
public static function post(string $url, $callback, array $settings = null): IRoute
|
||||
{
|
||||
return static::match([Route::REQUEST_TYPE_POST], $url, $callback, $settings);
|
||||
return static::match(['post'], $url, $callback, $settings);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -213,7 +211,7 @@ class SimpleRouter
|
||||
*/
|
||||
public static function put(string $url, $callback, array $settings = null): IRoute
|
||||
{
|
||||
return static::match([Route::REQUEST_TYPE_PUT], $url, $callback, $settings);
|
||||
return static::match(['put'], $url, $callback, $settings);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -226,7 +224,7 @@ class SimpleRouter
|
||||
*/
|
||||
public static function patch(string $url, $callback, array $settings = null): IRoute
|
||||
{
|
||||
return static::match([Route::REQUEST_TYPE_PATCH], $url, $callback, $settings);
|
||||
return static::match(['patch'], $url, $callback, $settings);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -239,7 +237,7 @@ class SimpleRouter
|
||||
*/
|
||||
public static function options(string $url, $callback, array $settings = null): IRoute
|
||||
{
|
||||
return static::match([Route::REQUEST_TYPE_OPTIONS], $url, $callback, $settings);
|
||||
return static::match(['options'], $url, $callback, $settings);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user