mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
v4-development sync & getIp() update to new header method
This commit is contained in:
+2
-1
@@ -1,3 +1,4 @@
|
||||
composer.lock
|
||||
vendor/
|
||||
tests/tmp/*
|
||||
tests/tmp/*
|
||||
.idea/
|
||||
Generated
-8
@@ -1,8 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
Generated
-5
@@ -1,5 +0,0 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Simon" />
|
||||
</state>
|
||||
</component>
|
||||
Generated
-12
@@ -1,12 +0,0 @@
|
||||
<component name="ProjectDictionaryState">
|
||||
<dictionary name="simon">
|
||||
<words>
|
||||
<w>bootmanager</w>
|
||||
<w>bootmanagers</w>
|
||||
<w>csrf</w>
|
||||
<w>middlewares</w>
|
||||
<w>pecee</w>
|
||||
<w>urldecode</w>
|
||||
</words>
|
||||
</dictionary>
|
||||
</component>
|
||||
Generated
-4
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
|
||||
</project>
|
||||
Generated
-72
@@ -1,72 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MarkdownProjectSettings">
|
||||
<PreviewSettings splitEditorLayout="SPLIT" splitEditorPreview="PREVIEW" useGrayscaleRendering="false" zoomFactor="1.25" maxImageWidth="0" showGitHubPageIfSynced="false" allowBrowsingInPreview="false" synchronizePreviewPosition="true" highlightPreviewType="NONE" highlightFadeOut="5" highlightOnTyping="true" synchronizeSourcePosition="true" verticallyAlignSourceAndPreviewSyncPosition="true" showSearchHighlightsInPreview="false" showSelectionInPreview="true">
|
||||
<PanelProvider>
|
||||
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.panel" providerName="Default - Swing" />
|
||||
</PanelProvider>
|
||||
</PreviewSettings>
|
||||
<ParserSettings gitHubSyntaxChange="false">
|
||||
<PegdownExtensions>
|
||||
<option name="ABBREVIATIONS" value="false" />
|
||||
<option name="ANCHORLINKS" value="true" />
|
||||
<option name="ASIDE" value="false" />
|
||||
<option name="ATXHEADERSPACE" value="true" />
|
||||
<option name="AUTOLINKS" value="true" />
|
||||
<option name="DEFINITIONS" value="false" />
|
||||
<option name="DEFINITION_BREAK_DOUBLE_BLANK_LINE" value="false" />
|
||||
<option name="FENCED_CODE_BLOCKS" value="true" />
|
||||
<option name="FOOTNOTES" value="false" />
|
||||
<option name="HARDWRAPS" value="false" />
|
||||
<option name="HTML_DEEP_PARSER" value="false" />
|
||||
<option name="INSERTED" value="false" />
|
||||
<option name="QUOTES" value="false" />
|
||||
<option name="RELAXEDHRULES" value="true" />
|
||||
<option name="SMARTS" value="false" />
|
||||
<option name="STRIKETHROUGH" value="true" />
|
||||
<option name="SUBSCRIPT" value="false" />
|
||||
<option name="SUPERSCRIPT" value="false" />
|
||||
<option name="SUPPRESS_HTML_BLOCKS" value="false" />
|
||||
<option name="SUPPRESS_INLINE_HTML" value="false" />
|
||||
<option name="TABLES" value="true" />
|
||||
<option name="TASKLISTITEMS" value="true" />
|
||||
<option name="TOC" value="false" />
|
||||
<option name="WIKILINKS" value="true" />
|
||||
</PegdownExtensions>
|
||||
<ParserOptions>
|
||||
<option name="COMMONMARK_LISTS" value="true" />
|
||||
<option name="DUMMY" value="false" />
|
||||
<option name="EMOJI_SHORTCUTS" value="true" />
|
||||
<option name="FLEXMARK_FRONT_MATTER" value="false" />
|
||||
<option name="GFM_LOOSE_BLANK_LINE_AFTER_ITEM_PARA" value="false" />
|
||||
<option name="GFM_TABLE_RENDERING" value="true" />
|
||||
<option name="GITBOOK_URL_ENCODING" value="false" />
|
||||
<option name="GITHUB_EMOJI_URL" value="false" />
|
||||
<option name="GITHUB_LISTS" value="false" />
|
||||
<option name="GITHUB_WIKI_LINKS" value="true" />
|
||||
<option name="JEKYLL_FRONT_MATTER" value="false" />
|
||||
<option name="SIM_TOC_BLANK_LINE_SPACER" value="true" />
|
||||
</ParserOptions>
|
||||
</ParserSettings>
|
||||
<HtmlSettings headerTopEnabled="false" headerBottomEnabled="false" bodyTopEnabled="false" bodyBottomEnabled="false" embedUrlContent="false" addPageHeader="true">
|
||||
<GeneratorProvider>
|
||||
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.generator" providerName="Default Swing HTML Generator" />
|
||||
</GeneratorProvider>
|
||||
<headerTop />
|
||||
<headerBottom />
|
||||
<bodyTop />
|
||||
<bodyBottom />
|
||||
</HtmlSettings>
|
||||
<CssSettings previewScheme="UI_SCHEME" cssUri="" isCssUriEnabled="false" isCssTextEnabled="false" isDynamicPageWidth="true">
|
||||
<StylesheetProvider>
|
||||
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.css" providerName="Default Swing Stylesheet" />
|
||||
</StylesheetProvider>
|
||||
<ScriptProviders />
|
||||
<cssText />
|
||||
</CssSettings>
|
||||
<HtmlExportSettings updateOnSave="false" parentDir="$ProjectFileDir$" targetDir="$ProjectFileDir$" cssDir="" scriptDir="" plainHtml="false" imageDir="" copyLinkedImages="false" imageUniquifyType="0" targetExt="" useTargetExt="false" noCssNoScripts="false" linkToExportedHtml="true" exportOnSettingsChange="true" regenerateOnProjectOpen="false" />
|
||||
<LinkMapSettings>
|
||||
<textMaps />
|
||||
</LinkMapSettings>
|
||||
</component>
|
||||
</project>
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
<component name="MarkdownNavigator.ProfileManager">
|
||||
<settings default="" pdf-export="" />
|
||||
</component>
|
||||
Generated
-8
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/simple-php-router.iml" filepath="$PROJECT_DIR$/.idea/simple-php-router.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
Generated
-14
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PhpTestFrameworkVersionCache">
|
||||
<tools_cache>
|
||||
<tool tool_name="PHPUnit">
|
||||
<cache>
|
||||
<versions>
|
||||
<info id="Local" version="6.5.7" />
|
||||
</versions>
|
||||
</cache>
|
||||
</tool>
|
||||
</tools_cache>
|
||||
</component>
|
||||
</project>
|
||||
Generated
-53
@@ -1,53 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PhpIncludePathManager">
|
||||
<include_path>
|
||||
<path value="$PROJECT_DIR$/vendor/composer" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-common" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/phpunit" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpdocumentor/type-resolver" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-docblock" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-code-coverage" />
|
||||
<path value="$PROJECT_DIR$/vendor/webmozart/assert" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/phpunit-mock-objects" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/version" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-token-stream" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/diff" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-text-template" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/recursion-context" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-timer" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/exporter" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-file-iterator" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/environment" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/comparator" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/global-state" />
|
||||
<path value="$PROJECT_DIR$/vendor/doctrine/instantiator" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpspec/prophecy" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/resource-operations" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/object-reflector" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/object-enumerator" />
|
||||
<path value="$PROJECT_DIR$/vendor/hamcrest/hamcrest-php" />
|
||||
<path value="$PROJECT_DIR$/vendor/theseer/tokenizer" />
|
||||
<path value="$PROJECT_DIR$/vendor/phar-io/version" />
|
||||
<path value="$PROJECT_DIR$/vendor/phar-io/manifest" />
|
||||
<path value="$PROJECT_DIR$/vendor/myclabs/deep-copy" />
|
||||
<path value="$PROJECT_DIR$/vendor/mockery/mockery" />
|
||||
<path value="$PROJECT_DIR$/vendor/jeremeamia/SuperClosure" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-util" />
|
||||
<path value="$PROJECT_DIR$/vendor/php-di/invoker" />
|
||||
<path value="$PROJECT_DIR$/vendor/php-di/phpdoc-reader" />
|
||||
<path value="$PROJECT_DIR$/vendor/nikic/php-parser" />
|
||||
<path value="$PROJECT_DIR$/vendor/psr/container" />
|
||||
<path value="$PROJECT_DIR$/vendor/php-di/php-di" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/yaml" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php56" />
|
||||
</include_path>
|
||||
</component>
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="7.1" />
|
||||
<component name="PhpUnit">
|
||||
<phpunit_settings>
|
||||
<PhpUnitSettings configuration_file_path="$PROJECT_DIR$/phpunit.xml" custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" phpunit_phar_path="" use_configuration_file="true" />
|
||||
</phpunit_settings>
|
||||
</component>
|
||||
</project>
|
||||
Generated
-52
@@ -1,52 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/Pecee" isTestSource="false" packagePrefix="Pecee\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/instantiator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/hamcrest/hamcrest-php" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/jeremeamia/SuperClosure" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/mockery/mockery" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/deep-copy" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/nikic/php-parser" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/manifest" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/version" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/php-di/invoker" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/php-di/php-di" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/php-di/phpdoc-reader" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-common" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-docblock" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/type-resolver" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpspec/prophecy" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-code-coverage" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-file-iterator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-text-template" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-timer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-token-stream" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/phpunit" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/phpunit-mock-objects" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/comparator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/diff" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/environment" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/exporter" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/global-state" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-enumerator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-reflector" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/recursion-context" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/resource-operations" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/version" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php56" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-util" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/yaml" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/theseer/tokenizer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/webmozart/assert" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
Generated
-6
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
-877
@@ -1,877 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="BookmarkManager">
|
||||
<bookmark url="file://$PROJECT_DIR$/src/Pecee/Http/Input/InputHandler.php" line="221" />
|
||||
</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/InputItem.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Pecee/Http/Input/InputItem.php" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="ComposerSettings" doNotAsk="true" synchronizationState="SYNCHRONIZE">
|
||||
<pharConfigPath>$PROJECT_DIR$/composer.json</pharConfigPath>
|
||||
<execution />
|
||||
</component>
|
||||
<component name="FavoritesManager">
|
||||
<favorites_list name="simple-php-router" />
|
||||
</component>
|
||||
<component name="FindInProjectRecents">
|
||||
<findStrings>
|
||||
<find>options</find>
|
||||
<find>parent::set</find>
|
||||
<find>parseParameters</find>
|
||||
<find>stripos</find>
|
||||
<find>setPrefix</find>
|
||||
<find>var_dum</find>
|
||||
<find>parse</find>
|
||||
<find>getParams</find>
|
||||
<find>setQuery</find>
|
||||
<find>contains</find>
|
||||
<find>matchRoute</find>
|
||||
<find>->getValue</find>
|
||||
<find>->find</find>
|
||||
<find>function find</find>
|
||||
<find>Req</find>
|
||||
<find>value(</find>
|
||||
<find>file(</find>
|
||||
<find>setUrl</find>
|
||||
<find>TODO</find>
|
||||
<find>input()->get</find>
|
||||
<find>function get</find>
|
||||
<find>REQUEST_TYPE_</find>
|
||||
<find>or method</find>
|
||||
<find>setDebugEnabled</find>
|
||||
<find>debugEnabled</find>
|
||||
<find>optiona</find>
|
||||
<find>\/</find>
|
||||
<find>requirements</find>
|
||||
<find>ler = new I</find>
|
||||
<find>csrf_token</find>
|
||||
</findStrings>
|
||||
<dirStrings>
|
||||
<dir>D:\Workspace\simple-php-router\src\Pecee\SimpleRouter\Route</dir>
|
||||
<dir>D:\Workspace\simple-php-router\src</dir>
|
||||
<dir>D:\Workspace\simple-php-router\tests\Pecee\SimpleRouter\Dummy</dir>
|
||||
<dir>D:\Workspace\simple-php-router</dir>
|
||||
<dir>E:\Workspace\simple-php-router\tests</dir>
|
||||
<dir>E:\Workspace\simple-php-router\src\Pecee</dir>
|
||||
<dir>E:\Workspace\simple-php-router\tests\Pecee\SimpleRouter</dir>
|
||||
<dir>E:\Workspace\simple-php-router\src\Pecee\SimpleRouter\Route</dir>
|
||||
<dir>E:\Workspace\simple-php-router\src\Pecee\SimpleRouter</dir>
|
||||
<dir>E:\Workspace\simple-php-router\src</dir>
|
||||
<dir>E:\Workspace\simple-php-router</dir>
|
||||
</dirStrings>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="GitSEFilterConfiguration">
|
||||
<file-type-list>
|
||||
<filtered-out-file-type name="LOCAL_BRANCH" />
|
||||
<filtered-out-file-type name="REMOTE_BRANCH" />
|
||||
<filtered-out-file-type name="TAG" />
|
||||
<filtered-out-file-type name="COMMIT_BY_MESSAGE" />
|
||||
</file-type-list>
|
||||
</component>
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/tests/Pecee/SimpleRouter/Dummy/Handler/ExceptionHandlerFirst.php" />
|
||||
<option value="$PROJECT_DIR$/tests/Pecee/SimpleRouter/Dummy/Handler/ExceptionHandlerSecond.php" />
|
||||
<option value="$PROJECT_DIR$/tests/TestRouter.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Event/IEventArgument.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/IRouterBootManager.php" />
|
||||
<option value="$PROJECT_DIR$/tests/Pecee/SimpleRouter/Dummy/Security/SilentTokenProvider.php" />
|
||||
<option value="$PROJECT_DIR$/tests/Pecee/SimpleRouter/Dummy/Managers/TestBootManager.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/Http/Security/ITokenProvider.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/Http/Response.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/IRoute.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/RoutePartialGroup.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Handlers/IEventHandler.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Handlers/DebugEventHandler.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Event/EventArgument.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Handlers/ClassHandler.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Handlers/ClassLoader.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/ClassLoader.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/ClassLoader/DIContainerBuilder.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/ClassLoader/Containers/DIContainerBuilder.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/ClassLoader/ContainerInterface.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/ClassLoader/IContainer.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/ClassLoader/IClassLoader.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/ClassLoader/ClassLoader.php" />
|
||||
<option value="$PROJECT_DIR$/tests/Pecee/SimpleRouter/GroupTest.php" />
|
||||
<option value="$PROJECT_DIR$/tests/Pecee/SimpleRouter/DependencyInjectionTest.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/Http/Input/IInputItem.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/Http/Input/InputItem.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/Http/Input/InputFile.php" />
|
||||
<option value="$PROJECT_DIR$/tests/Pecee/SimpleRouter/EventHandlerTest.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Handlers/EventHandler.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/RouteGroup.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/RouteResource.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/Http/Url.php" />
|
||||
<option value="$PROJECT_DIR$/tests/Pecee/SimpleRouter/RouterUrlTest.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/Http/Request.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$/tests/Pecee/SimpleRouter/RouterRouteTest.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/LoadableRoute.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/Http/Security/CookieTokenProvider.php" />
|
||||
<option value="$PROJECT_DIR$/composer.json" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/SimpleRouter.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Router.php" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/Route.php" />
|
||||
<option value="$PROJECT_DIR$/README.md" />
|
||||
<option value="$PROJECT_DIR$/src/Pecee/Http/Middleware/BaseCsrfVerifier.php" />
|
||||
<option value="$PROJECT_DIR$/.gitignore" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="JsFlowSettings">
|
||||
<service-enabled>false</service-enabled>
|
||||
<exe-path />
|
||||
<annotation-enable>false</annotation-enable>
|
||||
<other-services-enabled>false</other-services-enabled>
|
||||
<auto-save>true</auto-save>
|
||||
</component>
|
||||
<component name="PhpWorkspaceProjectConfiguration" interpreter_name="PHP 7.3">
|
||||
<include_path>
|
||||
<path value="$PROJECT_DIR$/vendor/composer" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-common" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/phpunit" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpdocumentor/type-resolver" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-docblock" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-code-coverage" />
|
||||
<path value="$PROJECT_DIR$/vendor/webmozart/assert" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/phpunit-mock-objects" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/version" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-token-stream" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/diff" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-text-template" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/recursion-context" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-timer" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/exporter" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-file-iterator" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/environment" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/comparator" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/global-state" />
|
||||
<path value="$PROJECT_DIR$/vendor/doctrine/instantiator" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpspec/prophecy" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/resource-operations" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/object-reflector" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/object-enumerator" />
|
||||
<path value="$PROJECT_DIR$/vendor/hamcrest/hamcrest-php" />
|
||||
<path value="$PROJECT_DIR$/vendor/theseer/tokenizer" />
|
||||
<path value="$PROJECT_DIR$/vendor/phar-io/version" />
|
||||
<path value="$PROJECT_DIR$/vendor/phar-io/manifest" />
|
||||
<path value="$PROJECT_DIR$/vendor/myclabs/deep-copy" />
|
||||
<path value="$PROJECT_DIR$/vendor/mockery/mockery" />
|
||||
<path value="$PROJECT_DIR$/vendor/jeremeamia/SuperClosure" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-util" />
|
||||
<path value="$PROJECT_DIR$/vendor/php-di/invoker" />
|
||||
<path value="$PROJECT_DIR$/vendor/php-di/phpdoc-reader" />
|
||||
<path value="$PROJECT_DIR$/vendor/nikic/php-parser" />
|
||||
<path value="$PROJECT_DIR$/vendor/psr/container" />
|
||||
<path value="$PROJECT_DIR$/vendor/php-di/php-di" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/yaml" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php56" />
|
||||
<path value="$PROJECT_DIR$/vendor/opis/closure" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
|
||||
</include_path>
|
||||
</component>
|
||||
<component name="ProjectFrameBounds" extendedState="6">
|
||||
<option name="x" value="-10" />
|
||||
<option name="width" value="2295" />
|
||||
<option name="height" value="1235" />
|
||||
</component>
|
||||
<component name="ProjectId" id="1puNexBUD99jjBAKJYQWVgC8eR3" />
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
|
||||
<ConfirmationsSetting value="2" id="Add" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator proportions="" version="1">
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="Scope" />
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<expand>
|
||||
<path>
|
||||
<item name="simple-php-router" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="simple-php-router" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="simple-php-router" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="simple-php-router" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="src" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="simple-php-router" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="simple-php-router" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="src" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="Pecee" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="simple-php-router" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="simple-php-router" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="src" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="Pecee" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="Http" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="simple-php-router" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="simple-php-router" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="src" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="Pecee" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="SimpleRouter" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="simple-php-router" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="simple-php-router" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="src" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="Pecee" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="SimpleRouter" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="Route" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="simple-php-router" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="simple-php-router" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="tests" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="simple-php-router" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="simple-php-router" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="tests" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="Pecee" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="simple-php-router" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="simple-php-router" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="tests" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="Pecee" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="SimpleRouter" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
</expand>
|
||||
<select />
|
||||
</subPane>
|
||||
</pane>
|
||||
</panes>
|
||||
</component>
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
||||
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
||||
<property name="node.js.detected.package.eslint" value="true" />
|
||||
<property name="node.js.detected.package.standard" value="true" />
|
||||
<property name="node.js.path.for.package.eslint" value="project" />
|
||||
<property name="node.js.path.for.package.standard" value="project" />
|
||||
<property name="node.js.selected.package.eslint" value="" />
|
||||
<property name="node.js.selected.package.standard" value="" />
|
||||
<property name="nodejs_package_manager_path" value="npm" />
|
||||
<property name="php.override.implement.member.chooser.php.doc" value="NONE" />
|
||||
<property name="run.code.analysis.last.selected.profile" value="pProject Default" />
|
||||
<property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
|
||||
<property name="vue.rearranger.settings.migration" value="true" />
|
||||
</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="E:\Workspace\simple-php-router\tests\Pecee\SimpleRouter" />
|
||||
<recent name="D:\Workspace\simple-php-router\tests" />
|
||||
<recent name="D:\Workspace\simple-php-router" />
|
||||
<recent name="D:\Workspace\simple-php-router\test" />
|
||||
<recent name="D:\Workspace\simple-php-router\src\Pecee\SimpleRouter\Route" />
|
||||
</key>
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="E:\Workspace\simple-php-router\src\Pecee\SimpleRouter\ClassLoader\Containers" />
|
||||
<recent name="E:\Workspace\simple-php-router\src\Pecee\SimpleRouter\ClassLoader" />
|
||||
<recent name="E:\Workspace\simple-php-router\src\Pecee\SimpleRouter" />
|
||||
<recent name="E:\Workspace\simple-php-router\src\Pecee\SimpleRouter\Handler" />
|
||||
<recent name="D:\Workspace\simple-php-router\tests" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunManager" selected="PHPUnit.tests">
|
||||
<configuration name="EventHandlerTest" type="PHPUnitRunConfigurationType" factoryName="PHPUnit" temporary="true">
|
||||
<TestRunner class="EventHandlerTest" file="$PROJECT_DIR$/tests/Pecee/SimpleRouter/EventHandlerTest.php" scope="Class" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="RouterRouteTest" type="PHPUnitRunConfigurationType" factoryName="PHPUnit" temporary="true">
|
||||
<TestRunner class="RouterRouteTest" file="$PROJECT_DIR$/tests/Pecee/SimpleRouter/RouterRouteTest.php" scope="Class" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="phpunit.xml" type="PHPUnitRunConfigurationType" factoryName="PHPUnit" temporary="true">
|
||||
<TestRunner configuration_file="$PROJECT_DIR$/phpunit.xml" scope="XML" use_alternative_configuration_file="true" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="tests" type="PHPUnitRunConfigurationType" factoryName="PHPUnit" temporary="true">
|
||||
<TestRunner configuration_file="$PROJECT_DIR$/phpunit.xml" directory="$PROJECT_DIR$/tests" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="debug.php" type="PhpLocalRunConfigurationType" factoryName="PHP Console" temporary="true" path="$PROJECT_DIR$/tests/debug.php">
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<list>
|
||||
<item itemvalue="PHP Script.debug.php" />
|
||||
<item itemvalue="PHPUnit.EventHandlerTest" />
|
||||
<item itemvalue="PHPUnit.RouterRouteTest" />
|
||||
<item itemvalue="PHPUnit.phpunit.xml" />
|
||||
<item itemvalue="PHPUnit.tests" />
|
||||
</list>
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="PHPUnit.tests" />
|
||||
<item itemvalue="PHPUnit.RouterRouteTest" />
|
||||
<item itemvalue="PHPUnit.phpunit.xml" />
|
||||
<item itemvalue="PHP Script.debug.php" />
|
||||
<item itemvalue="PHPUnit.EventHandlerTest" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="project-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="SvnConfiguration">
|
||||
<configuration />
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="a7058529-bdc4-40b4-a50d-c50564dc83f0" name="Default" comment="" />
|
||||
<created>1502498236860</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1502498236860</updated>
|
||||
<workItem from="1502498238130" duration="495000" />
|
||||
<workItem from="1502589327470" duration="1325000" />
|
||||
<workItem from="1502643621164" duration="1124000" />
|
||||
<workItem from="1502665379176" duration="1624000" />
|
||||
<workItem from="1502669212357" duration="163000" />
|
||||
<workItem from="1503009054866" duration="109000" />
|
||||
<workItem from="1503143546207" duration="965000" />
|
||||
<workItem from="1503146420259" duration="656000" />
|
||||
<workItem from="1503148077591" duration="1223000" />
|
||||
<workItem from="1503157038418" duration="7000" />
|
||||
<workItem from="1503418539960" duration="475000" />
|
||||
<workItem from="1503499434906" duration="6410000" />
|
||||
<workItem from="1503519096046" duration="649000" />
|
||||
<workItem from="1503520310378" duration="280000" />
|
||||
<workItem from="1503521737747" duration="856000" />
|
||||
<workItem from="1503524427576" duration="2573000" />
|
||||
<workItem from="1503536487719" duration="1589000" />
|
||||
<workItem from="1503542802083" duration="820000" />
|
||||
<workItem from="1503585789014" duration="820000" />
|
||||
<workItem from="1504176764746" duration="658000" />
|
||||
<workItem from="1504283976613" duration="694000" />
|
||||
<workItem from="1504448385820" duration="7834000" />
|
||||
<workItem from="1504459201935" duration="83000" />
|
||||
<workItem from="1504459311471" duration="1376000" />
|
||||
<workItem from="1504486369526" duration="451000" />
|
||||
<workItem from="1504917061077" duration="1291000" />
|
||||
<workItem from="1507375921398" duration="131000" />
|
||||
<workItem from="1508785846050" duration="916000" />
|
||||
<workItem from="1508786969551" duration="615000" />
|
||||
<workItem from="1508787603350" duration="1889000" />
|
||||
<workItem from="1509491007644" duration="14000" />
|
||||
<workItem from="1509491033605" duration="6000" />
|
||||
<workItem from="1510192196700" duration="11000" />
|
||||
<workItem from="1510192217149" duration="152000" />
|
||||
<workItem from="1510193026656" duration="140000" />
|
||||
<workItem from="1511567082879" duration="3024000" />
|
||||
<workItem from="1511629790083" duration="1115000" />
|
||||
<workItem from="1511632906778" duration="6000" />
|
||||
<workItem from="1511709768816" duration="954000" />
|
||||
<workItem from="1511710733832" duration="10000" />
|
||||
<workItem from="1511710754848" duration="6388000" />
|
||||
<workItem from="1511717327384" duration="1762000" />
|
||||
<workItem from="1511736112440" duration="855000" />
|
||||
<workItem from="1511741616771" duration="3149000" />
|
||||
<workItem from="1512583258866" duration="985000" />
|
||||
<workItem from="1512706044104" duration="1603000" />
|
||||
<workItem from="1521506970558" duration="7811000" />
|
||||
<workItem from="1522072655826" duration="1072000" />
|
||||
<workItem from="1522073747209" duration="63000" />
|
||||
<workItem from="1522073847648" duration="23574000" />
|
||||
<workItem from="1522309434425" duration="745000" />
|
||||
<workItem from="1522310203119" duration="120000" />
|
||||
<workItem from="1522310337826" duration="117000" />
|
||||
<workItem from="1522310475899" duration="12840000" />
|
||||
<workItem from="1522325810130" duration="30260000" />
|
||||
<workItem from="1522360506281" duration="168000" />
|
||||
<workItem from="1522378435862" duration="2772000" />
|
||||
<workItem from="1522385007533" duration="313000" />
|
||||
<workItem from="1522507670882" duration="309000" />
|
||||
<workItem from="1522508007514" duration="2427000" />
|
||||
<workItem from="1522530661439" duration="3502000" />
|
||||
<workItem from="1522668357317" duration="4847000" />
|
||||
<workItem from="1523014652739" duration="16240000" />
|
||||
<workItem from="1523035686391" duration="174000" />
|
||||
<workItem from="1523035884787" duration="1022000" />
|
||||
<workItem from="1523038029219" duration="56000" />
|
||||
<workItem from="1535121332253" duration="2346000" />
|
||||
<workItem from="1535671881115" duration="506000" />
|
||||
<workItem from="1535806837271" duration="204000" />
|
||||
<workItem from="1543101575756" duration="1207000" />
|
||||
<workItem from="1616029119335" duration="207000" />
|
||||
<workItem from="1616030812009" duration="3745000" />
|
||||
<workItem from="1616076234772" duration="377000" />
|
||||
<workItem from="1616086876180" duration="6839000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TestHistory">
|
||||
<history-entry file="tests - 2018.08.24 at 17h 12m 28s.xml">
|
||||
<configuration name="tests" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
<history-entry file="tests - 2018.08.24 at 17h 12m 29s.xml">
|
||||
<configuration name="tests" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
<history-entry file="tests - 2018.08.24 at 17h 12m 31s.xml">
|
||||
<configuration name="tests" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
<history-entry file="tests - 2018.08.24 at 17h 12m 32s.xml">
|
||||
<configuration name="tests" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
<history-entry file="tests - 2018.08.24 at 17h 12m 33s.xml">
|
||||
<configuration name="tests" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
<history-entry file="tests - 2018.08.24 at 17h 13m 32s.xml">
|
||||
<configuration name="tests" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
<history-entry file="tests - 2018.08.31 at 01h 36m 24s.xml">
|
||||
<configuration name="tests" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
<history-entry file="tests - 2018.08.31 at 01h 36m 28s.xml">
|
||||
<configuration name="tests" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
<history-entry file="tests - 2018.08.31 at 01h 36m 29s.xml">
|
||||
<configuration name="tests" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
<history-entry file="tests - 2018.11.25 at 00h 37m 03s.xml">
|
||||
<configuration name="tests" configurationId="PHPUnitRunConfigurationType" />
|
||||
</history-entry>
|
||||
</component>
|
||||
<component name="TimeTrackingManager">
|
||||
<option name="totallyTimeSpent" value="171000000" />
|
||||
</component>
|
||||
<component name="TodoView">
|
||||
<todo-panel id="selected-file">
|
||||
<is-autoscroll-to-source value="true" />
|
||||
</todo-panel>
|
||||
<todo-panel id="all">
|
||||
<are-packages-shown value="true" />
|
||||
<is-autoscroll-to-source value="true" />
|
||||
</todo-panel>
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="-7" y="-7" width="2062" height="1126" extended-state="6" />
|
||||
<editor active="true" />
|
||||
<layout>
|
||||
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.21878122" />
|
||||
<window_info id="Structure" order="1" weight="0.24975026" />
|
||||
<window_info id="Favorites" order="2" weight="0.32967034" />
|
||||
<window_info anchor="bottom" id="Message" order="0" />
|
||||
<window_info anchor="bottom" id="Find" order="1" sideWeight="0.48880896" weight="0.32696176" />
|
||||
<window_info anchor="bottom" id="Terminal" order="2" sideWeight="0.4935065" visible="true" weight="0.28169015" />
|
||||
<window_info anchor="bottom" id="Run" order="3" sideWeight="0.49080735" weight="0.32595575" />
|
||||
<window_info anchor="bottom" id="Debug" order="4" weight="0.4" />
|
||||
<window_info anchor="bottom" id="Cvs" order="5" weight="0.25" />
|
||||
<window_info anchor="bottom" id="REST Client" order="6" weight="0.32929292" />
|
||||
<window_info anchor="bottom" id="Inspection" order="7" weight="0.4" />
|
||||
<window_info anchor="bottom" id="Docker" order="8" show_stripe_button="false" />
|
||||
<window_info anchor="bottom" id="Command Line Tools Console" order="9" weight="0.32928804" />
|
||||
<window_info anchor="bottom" id="PHP-CGI Server" order="10" />
|
||||
<window_info anchor="bottom" id="TODO" order="11" weight="0.32897383" />
|
||||
<window_info anchor="bottom" id="Database Changes" order="12" show_stripe_button="false" />
|
||||
<window_info anchor="bottom" id="Version Control" order="13" weight="0.3279678" />
|
||||
<window_info anchor="bottom" id="Inspection Results" order="14" weight="0.32696176" />
|
||||
<window_info anchor="bottom" id="Event Log" order="15" sideWeight="0.5064935" weight="0.28169015" />
|
||||
<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="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
|
||||
<window_info anchor="right" id="Database" order="3" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
<component name="Vcs.Log.History.Properties">
|
||||
<option name="COLUMN_ID_ORDER">
|
||||
<list>
|
||||
<option value="Default.Root" />
|
||||
<option value="Default.Author" />
|
||||
<option value="Default.Date" />
|
||||
<option value="Default.Subject" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="XSLT-Support.FileAssociations.UIState">
|
||||
<expand />
|
||||
<select />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Handlers/IEventHandler.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="552">
|
||||
<caret line="23" column="20" selection-start-line="23" selection-start-column="20" selection-end-line="23" selection-end-column="20" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Event/EventArgument.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="54">
|
||||
<caret line="45" column="26" lean-forward="true" selection-start-line="45" selection-start-column="26" selection-end-line="45" selection-end-column="26" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Handlers/CallbackExceptionHandler.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="48">
|
||||
<caret line="2" selection-start-line="2" selection-end-line="2" selection-end-column="38" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/vendor/php-di/php-di/src/ContainerBuilder.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="210">
|
||||
<caret line="121" column="21" selection-start-line="121" selection-start-column="21" selection-end-line="121" selection-end-column="21" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/ClassLoader/Containers/IContainer.php" />
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/ClassLoader/Containers/DIContainerBuilder.php" />
|
||||
<entry file="file://$PROJECT_DIR$/vendor/php-di/php-di/src/FactoryInterface.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="267">
|
||||
<caret line="14" column="10" selection-start-line="14" selection-start-column="10" selection-end-line="14" selection-end-column="10" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/vendor/php-di/invoker/src/InvokerInterface.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="264">
|
||||
<caret line="13" column="10" selection-start-line="13" selection-start-column="10" selection-end-line="13" selection-end-column="10" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/vendor/psr/container/src/ContainerInterface.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="192">
|
||||
<caret line="10" column="10" selection-start-line="10" selection-start-column="10" selection-end-line="10" selection-end-column="10" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/ClassLoader/IContainer.php" />
|
||||
<entry file="file://$PROJECT_DIR$/vendor/mockery/mockery/library/Mockery/Container.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="-3360">
|
||||
<caret line="26" column="6" selection-start-line="26" selection-start-column="6" selection-end-line="26" selection-end-column="6" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/vendor/php-di/php-di/src/Container.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="-21">
|
||||
<caret line="266" column="20" selection-start-line="266" selection-start-column="20" selection-end-line="266" selection-end-column="20" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/ClassLoader/IClassLoader.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="144">
|
||||
<caret line="6" selection-start-line="6" selection-end-line="6" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/tmp/CompiledContainer.php" />
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/ClassLoader/ClassLoader.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="384">
|
||||
<caret line="34" column="47" selection-start-line="34" selection-start-column="47" selection-end-line="34" selection-end-column="47" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/tests/Pecee/SimpleRouter/GroupTest.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="258">
|
||||
<caret line="21" column="8" selection-start-line="21" selection-start-column="8" selection-end-line="21" selection-end-column="8" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/tests/Pecee/SimpleRouter/Dummy/Exception/ResponseException.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="192">
|
||||
<caret line="8" column="8" selection-start-line="8" selection-start-column="8" selection-end-line="8" selection-end-column="8" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/tests/Pecee/SimpleRouter/DependencyInjectionTest.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="696">
|
||||
<caret line="29" column="38" selection-start-line="29" selection-start-column="38" selection-end-line="29" selection-end-column="38" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/Http/Input/IInputItem.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="380">
|
||||
<caret line="19" column="40" selection-start-line="19" selection-start-column="40" selection-end-line="19" selection-end-column="40" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/Http/Input/InputItem.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="80">
|
||||
<caret line="4" column="37" selection-start-line="4" selection-start-column="37" selection-end-line="4" selection-end-column="37" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/Http/Input/InputFile.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="180">
|
||||
<caret line="9" column="17" selection-start-line="9" selection-start-column="17" selection-end-line="9" selection-end-column="17" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Handlers/EventHandler.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="540">
|
||||
<caret line="28" selection-start-line="28" selection-end-line="28" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/tests/Pecee/SimpleRouter/EventHandlerTest.php">
|
||||
<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" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/IPartialGroupRoute.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="80">
|
||||
<caret line="4" column="10" selection-start-line="4" selection-start-column="10" selection-end-line="4" selection-end-column="10" />
|
||||
</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" />
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/vendor/phpunit/phpunit/src/Framework/TestCase.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="-687">
|
||||
<caret line="100" column="15" selection-start-line="100" selection-start-column="15" selection-end-line="100" selection-end-column="15" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/tests/Pecee/SimpleRouter/MiddlewareTest.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="120">
|
||||
<caret line="6" column="53" lean-forward="true" selection-start-line="6" selection-start-column="53" selection-end-line="6" selection-end-column="53" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/tests/Pecee/SimpleRouter/RouterUrlTest.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="1640">
|
||||
<caret line="85" selection-start-line="85" selection-end-line="85" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/vendor/phpunit/phpunit/src/Framework/Assert.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="333">
|
||||
<caret line="1197" column="27" selection-start-line="1197" selection-start-column="27" selection-end-line="1197" selection-end-column="27" />
|
||||
</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">
|
||||
<caret line="25" column="20" selection-start-line="25" selection-start-column="20" selection-end-line="25" selection-end-column="20" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/SimpleRouter/Route/RouteGroup.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="716">
|
||||
<caret line="55" column="45" selection-start-line="55" selection-start-column="45" selection-end-line="55" selection-end-column="45" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/tests/TestRouter.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="240">
|
||||
<caret line="12" selection-start-line="12" selection-end-line="12" />
|
||||
</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">
|
||||
<caret line="15" column="22" selection-start-line="15" selection-start-column="22" selection-end-line="15" selection-end-column="22" />
|
||||
</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="640">
|
||||
<caret line="32" column="36" selection-start-line="32" selection-start-column="30" selection-end-line="32" selection-end-column="36" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/helpers.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<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>
|
||||
</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/SimpleRouter/Route/RouteUrl.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="120">
|
||||
<caret line="6" column="28" selection-start-line="6" selection-start-column="28" selection-end-line="6" selection-end-column="28" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/tests/Pecee/SimpleRouter/RouterRouteTest.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="280">
|
||||
<caret line="14" lean-forward="true" selection-start-line="14" selection-end-line="14" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/Http/Security/CookieTokenProvider.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="206">
|
||||
<caret line="65" column="87" selection-start-line="65" selection-start-column="87" selection-end-line="65" selection-end-column="87" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/composer.json">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="538">
|
||||
<caret line="30" column="20" selection-start-line="30" selection-start-column="20" selection-end-line="30" selection-end-column="20" />
|
||||
</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="243">
|
||||
<caret line="263" column="48" lean-forward="true" selection-start-line="263" selection-start-column="48" selection-end-line="263" selection-end-column="48" />
|
||||
</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="120">
|
||||
<caret line="9" column="38" selection-start-line="9" selection-start-column="38" selection-end-line="9" selection-end-column="38" />
|
||||
</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="363">
|
||||
<caret line="19" column="36" selection-start-line="19" selection-start-column="36" selection-end-line="19" selection-end-column="36" />
|
||||
</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="168">
|
||||
<caret line="8" column="14" selection-start-line="8" selection-start-column="14" selection-end-line="8" selection-end-column="14" />
|
||||
</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="396">
|
||||
<caret line="190" column="12" selection-start-line="190" selection-start-column="12" selection-end-line="190" selection-end-column="12" />
|
||||
</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="294">
|
||||
<caret line="32" column="7" selection-start-line="32" selection-start-column="7" selection-end-line="32" selection-end-column="7" />
|
||||
<folding>
|
||||
<element signature="e#36#82#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/Http/Request.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="265">
|
||||
<caret line="87" column="24" selection-start-line="87" selection-start-column="24" selection-end-line="87" selection-end-column="24" />
|
||||
</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="172">
|
||||
<caret line="94" column="49" selection-start-line="94" selection-start-column="49" selection-end-line="94" selection-end-column="49" />
|
||||
<folding>
|
||||
<element signature="e#44#82#0#PHP" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/README.md">
|
||||
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
|
||||
<state split_layout="SPLIT">
|
||||
<first_editor relative-caret-position="206">
|
||||
<caret line="849" column="50" selection-start-line="849" selection-start-column="50" selection-end-line="849" selection-end-column="50" />
|
||||
</first_editor>
|
||||
<second_editor>
|
||||
<markdownNavigatorState />
|
||||
</second_editor>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Pecee/Http/Middleware/BaseCsrfVerifier.php">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="357">
|
||||
<caret line="20" column="7" selection-start-line="20" selection-start-column="7" selection-end-line="20" selection-end-column="7" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/.gitignore">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="42">
|
||||
<caret line="2" column="11" selection-start-line="2" selection-start-column="11" selection-end-line="2" selection-end-column="11" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
</project>
|
||||
@@ -33,6 +33,7 @@ You can donate any amount of your choice by [clicking here](https://www.paypal.c
|
||||
- [Helper functions](#helper-functions)
|
||||
- [Routes](#routes)
|
||||
- [Basic routing](#basic-routing)
|
||||
- [Class hinting](#class-hinting)
|
||||
- [Available methods](#available-methods)
|
||||
- [Multiple HTTP-verbs](#multiple-http-verbs)
|
||||
- [Route parameters](#route-parameters)
|
||||
@@ -123,7 +124,7 @@ composer require pecee/simple-router
|
||||
|
||||
The goal of this project is to create a router that is more or less 100% compatible with the Laravel documentation, while remaining as simple as possible, and as easy to integrate and change without compromising either speed or complexity. Being lightweight is the #1 priority.
|
||||
|
||||
We've included a simple demo project for the router which can be found in the `demo-project` folder. This project should give you a basic understanding of how to setup and use simple-php-router project.
|
||||
We've included a simple demo project for the router which can be found [here](https://github.com/skipperbent/simple-router-demo). This project should give you a basic understanding of how to setup and use simple-php-router project.
|
||||
|
||||
Please note that the demo-project only covers how to integrate the `simple-php-router` in a project without an existing framework. If you are using a framework in your project, the implementation might vary.
|
||||
|
||||
@@ -404,6 +405,14 @@ SimpleRouter::get('/', function() {
|
||||
});
|
||||
```
|
||||
|
||||
### Class hinting
|
||||
|
||||
You can use class hinting to load a class & method like this:
|
||||
|
||||
```php
|
||||
SimpleRouter::get('/', [MyClass::class, 'myMethod']);
|
||||
```
|
||||
|
||||
### Available methods
|
||||
|
||||
Here you can see a list over all available routes:
|
||||
@@ -785,12 +794,17 @@ SimpleRouter::group(['middleware' => \Demo\Middlewares\Site::class, 'exceptionHa
|
||||
|
||||
SimpleRouter::get('/answers/{id}', 'ControllerAnswers@show', ['where' => ['id' => '[0-9]+']]);
|
||||
|
||||
/**
|
||||
* Class hinting is supported too
|
||||
*/
|
||||
|
||||
SimpleRouter::get('/answers/{id}', [ControllerAnswers::class, 'show'], ['where' => ['id' => '[0-9]+']]);
|
||||
|
||||
/**
|
||||
* Restful resource (see IRestController interface for available methods)
|
||||
*/
|
||||
|
||||
SimpleRouter::resource('/rest', ControllerRessource::class);
|
||||
SimpleRouter::resource('/rest', ControllerResource::class);
|
||||
|
||||
|
||||
/**
|
||||
@@ -811,7 +825,6 @@ SimpleRouter::group(['middleware' => \Demo\Middlewares\Site::class, 'exceptionHa
|
||||
});
|
||||
|
||||
SimpleRouter::get('/page/404', 'ControllerPage@notFound', ['as' => 'page.notfound']);
|
||||
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -27,6 +27,24 @@ class InputHandler
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* Original post variables
|
||||
* @var array
|
||||
*/
|
||||
protected $originalPost = [];
|
||||
|
||||
/**
|
||||
* Original get/params variables
|
||||
* @var array
|
||||
*/
|
||||
protected $originalParams = [];
|
||||
|
||||
/**
|
||||
* Get original file variables
|
||||
* @var array
|
||||
*/
|
||||
protected $originalFile = [];
|
||||
|
||||
/**
|
||||
* Input constructor.
|
||||
* @param Request $request
|
||||
@@ -46,22 +64,34 @@ class InputHandler
|
||||
{
|
||||
/* Parse get requests */
|
||||
if (\count($_GET) !== 0) {
|
||||
$this->get = $this->parseInputItem($_GET);
|
||||
$this->originalParams = $_GET;
|
||||
$this->get = $this->parseInputItem($this->originalParams);
|
||||
}
|
||||
|
||||
/* Parse post requests */
|
||||
$postVars = $_POST;
|
||||
$this->originalPost = $_POST;
|
||||
|
||||
if (\in_array($this->request->getMethod(), ['put', 'patch', 'delete'], false) === true) {
|
||||
parse_str(file_get_contents('php://input'), $postVars);
|
||||
if (\in_array($this->request->getMethod(), Request::$requestTypesPost, false) === true) {
|
||||
|
||||
$contents = file_get_contents('php://input');
|
||||
|
||||
// Append any PHP-input json
|
||||
if (strpos(trim($contents), '{') === 0) {
|
||||
$post = json_decode($contents, true);
|
||||
|
||||
if ($post !== false) {
|
||||
$this->originalPost += $post;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (\count($postVars) !== 0) {
|
||||
$this->post = $this->parseInputItem($postVars);
|
||||
if (\count($this->originalPost) !== 0) {
|
||||
$this->post = $this->parseInputItem($this->originalPost);
|
||||
}
|
||||
|
||||
/* Parse get requests */
|
||||
if (\count($_FILES) !== 0) {
|
||||
$this->originalFile = $_FILES;
|
||||
$this->file = $this->parseFiles();
|
||||
}
|
||||
}
|
||||
@@ -192,11 +222,11 @@ class InputHandler
|
||||
{
|
||||
$element = null;
|
||||
|
||||
if (\count($methods) === 0 || \in_array('get', $methods, true) === true) {
|
||||
if (\count($methods) === 0 || \in_array(Request::REQUEST_TYPE_GET, $methods, true) === true) {
|
||||
$element = $this->get($index);
|
||||
}
|
||||
|
||||
if (($element === null && \count($methods) === 0) || (\count($methods) !== 0 && \in_array('post', $methods, true) === true)) {
|
||||
if (($element === null && \count($methods) === 0) || (\count($methods) !== 0 && \in_array(Request::REQUEST_TYPE_POST, $methods, true) === true)) {
|
||||
$element = $this->post($index);
|
||||
}
|
||||
|
||||
@@ -288,24 +318,7 @@ class InputHandler
|
||||
*/
|
||||
public function all(array $filter = []): array
|
||||
{
|
||||
$output = $_GET;
|
||||
|
||||
if ($this->request->getMethod() === 'post') {
|
||||
|
||||
// Append POST data
|
||||
$output += $_POST;
|
||||
$contents = file_get_contents('php://input');
|
||||
|
||||
// Append any PHP-input json
|
||||
if (strpos(trim($contents), '{') === 0) {
|
||||
$post = json_decode($contents, true);
|
||||
|
||||
if ($post !== false) {
|
||||
$output += $post;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$output = $this->originalParams + $this->originalPost + $this->originalFile;
|
||||
$output = (\count($filter) > 0) ? array_intersect_key($output, array_flip($filter)) : $output;
|
||||
|
||||
foreach ($filter as $filterKey) {
|
||||
@@ -350,4 +363,64 @@ class InputHandler
|
||||
$this->file[$key] = $item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get original post variables
|
||||
* @return array
|
||||
*/
|
||||
public function getOriginalPost(): array
|
||||
{
|
||||
return $this->originalPost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set original post variables
|
||||
* @param array $post
|
||||
* @return static $this
|
||||
*/
|
||||
public function setOriginalPost(array $post): self
|
||||
{
|
||||
$this->originalPost = $post;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get original get variables
|
||||
* @return array
|
||||
*/
|
||||
public function getOriginalParams(): array
|
||||
{
|
||||
return $this->originalParams;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set original get-variables
|
||||
* @param array $params
|
||||
* @return static $this
|
||||
*/
|
||||
public function setOriginalParams(array $params): self
|
||||
{
|
||||
$this->originalParams = $params;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get original file variables
|
||||
* @return array
|
||||
*/
|
||||
public function getOriginalFile(): array
|
||||
{
|
||||
return $this->originalFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set original file posts variables
|
||||
* @param array $file
|
||||
* @return static $this
|
||||
*/
|
||||
public function setOriginalFile(array $file): self
|
||||
{
|
||||
$this->originalFile = $file;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,9 +2,6 @@
|
||||
|
||||
namespace Pecee\Http\Input;
|
||||
|
||||
use Exception;
|
||||
use Traversable;
|
||||
|
||||
class InputItem implements IInputItem, \IteratorAggregate
|
||||
{
|
||||
public $index;
|
||||
@@ -81,7 +78,7 @@ class InputItem implements IInputItem, \IteratorAggregate
|
||||
return (\is_array($value) === true) ? json_encode($value) : $value;
|
||||
}
|
||||
|
||||
public function getIterator()
|
||||
public function getIterator(): \ArrayIterator
|
||||
{
|
||||
return new \ArrayIterator($this->getValue());
|
||||
}
|
||||
|
||||
@@ -63,13 +63,12 @@ class BaseCsrfVerifier implements IMiddleware
|
||||
*/
|
||||
public function handle(Request $request): void
|
||||
{
|
||||
|
||||
if ($this->skip($request) === false && \in_array($request->getMethod(), ['post', 'put', 'delete'], true) === true) {
|
||||
if ($this->skip($request) === false && \in_array($request->getMethod(), Request::$requestTypesPost, true) === true) {
|
||||
|
||||
$token = $request->getInputHandler()->value(
|
||||
static::POST_KEY,
|
||||
$request->getHeader(static::HEADER_KEY),
|
||||
'post'
|
||||
Request::$requestTypesPost
|
||||
);
|
||||
|
||||
if ($this->tokenProvider->validate((string)$token) === false) {
|
||||
@@ -80,7 +79,6 @@ class BaseCsrfVerifier implements IMiddleware
|
||||
|
||||
// Refresh existing token
|
||||
$this->tokenProvider->refresh();
|
||||
|
||||
}
|
||||
|
||||
public function getTokenProvider(): ITokenProvider
|
||||
|
||||
@@ -4,12 +4,46 @@ namespace Pecee\Http;
|
||||
|
||||
use Pecee\Http\Exceptions\MalformedUrlException;
|
||||
use Pecee\Http\Input\InputHandler;
|
||||
use Pecee\Http\Middleware\BaseCsrfVerifier;
|
||||
use Pecee\SimpleRouter\Route\ILoadableRoute;
|
||||
use Pecee\SimpleRouter\Route\RouteUrl;
|
||||
use Pecee\SimpleRouter\SimpleRouter;
|
||||
|
||||
class Request
|
||||
{
|
||||
public const REQUEST_TYPE_GET = 'get';
|
||||
public const REQUEST_TYPE_POST = 'post';
|
||||
public const REQUEST_TYPE_PUT = 'put';
|
||||
public const REQUEST_TYPE_PATCH = 'patch';
|
||||
public const REQUEST_TYPE_OPTIONS = 'options';
|
||||
public const REQUEST_TYPE_DELETE = 'delete';
|
||||
public const REQUEST_TYPE_HEAD = 'head';
|
||||
|
||||
/**
|
||||
* All request-types
|
||||
* @var string[]
|
||||
*/
|
||||
public static $requestTypes = [
|
||||
self::REQUEST_TYPE_GET,
|
||||
self::REQUEST_TYPE_POST,
|
||||
self::REQUEST_TYPE_PUT,
|
||||
self::REQUEST_TYPE_PATCH,
|
||||
self::REQUEST_TYPE_OPTIONS,
|
||||
self::REQUEST_TYPE_DELETE,
|
||||
self::REQUEST_TYPE_HEAD,
|
||||
];
|
||||
|
||||
/**
|
||||
* Post request-types.
|
||||
* @var string[]
|
||||
*/
|
||||
public static $requestTypesPost = [
|
||||
self::REQUEST_TYPE_POST,
|
||||
self::REQUEST_TYPE_PUT,
|
||||
self::REQUEST_TYPE_PATCH,
|
||||
self::REQUEST_TYPE_DELETE,
|
||||
];
|
||||
|
||||
/**
|
||||
* Additional data
|
||||
*
|
||||
@@ -77,14 +111,14 @@ class Request
|
||||
{
|
||||
foreach ($_SERVER as $key => $value) {
|
||||
$this->headers[strtolower($key)] = $value;
|
||||
$this->headers[strtolower(str_replace('_', '-', $key))] = $value;
|
||||
$this->headers[str_replace('_', '-', strtolower($key))] = $value;
|
||||
}
|
||||
|
||||
$this->setHost($this->getHeader('http-host'));
|
||||
|
||||
// Check if special IIS header exist, otherwise use default.
|
||||
$this->setUrl(new Url($this->getHeader('unencoded-url', $this->getHeader('request-uri'))));
|
||||
|
||||
|
||||
$this->method = strtolower($this->getHeader('request-method'));
|
||||
$this->inputHandler = new InputHandler($this);
|
||||
$this->method = strtolower($this->inputHandler->value('_method', $this->getHeader('request-method')));
|
||||
@@ -147,6 +181,15 @@ class Request
|
||||
return $this->getHeader('php-auth-pw');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the csrf token
|
||||
* @return string|null
|
||||
*/
|
||||
public function getCsrfToken(): ?string
|
||||
{
|
||||
return $this->getHeader(BaseCsrfVerifier::HEADER_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all headers
|
||||
* @return array
|
||||
@@ -165,6 +208,13 @@ class Request
|
||||
*/
|
||||
public function getIp(bool $safe = false): ?string
|
||||
{
|
||||
return $this->getHeader(
|
||||
'http-cf-connecting-ip',
|
||||
$this->getHeader(
|
||||
'http-x-forwarded-for',
|
||||
$this->getHeader('remote-addr')
|
||||
)
|
||||
);
|
||||
$client_header = null;
|
||||
if(!$safe){
|
||||
if ($this->getHeader('http-cf-connecting-ip') !== null) {
|
||||
@@ -212,14 +262,28 @@ class Request
|
||||
/**
|
||||
* Get header value by name
|
||||
*
|
||||
* @param string $name
|
||||
* @param string|null $defaultValue
|
||||
* @param string $name Name of the header.
|
||||
* @param string|null $defaultValue Value to be returned if header is not found.
|
||||
* @param bool $tryParse When enabled the method will try to find the header from both from client (http) and server-side variants, if the header is not found.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getHeader($name, $defaultValue = null): ?string
|
||||
public function getHeader(string $name, $defaultValue = null, $tryParse = true): ?string
|
||||
{
|
||||
return $this->headers[strtolower($name)] ?? $defaultValue;
|
||||
$name = strtolower($name);
|
||||
$header = $this->headers[$name] ?? null;
|
||||
|
||||
if ($tryParse === true && $header === null) {
|
||||
if (strpos($name, 'http-') === 0) {
|
||||
// Trying to find client header variant which was not found, searching for header variant without http- prefix.
|
||||
$header = $this->headers[str_replace('http-', '', $name)] ?? null;
|
||||
} else {
|
||||
// Trying to find server variant which was not found, searching for client variant with http- prefix.
|
||||
$header = $this->headers['http-' . $name] ?? null;
|
||||
}
|
||||
}
|
||||
|
||||
return $header ?? $defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,7 +48,7 @@ class ClassLoader implements IClassLoader
|
||||
/**
|
||||
* Load closure
|
||||
*
|
||||
* @param \Closure $closure
|
||||
* @param Callable $closure
|
||||
* @param array $parameters
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException
|
||||
|
||||
@@ -22,8 +22,8 @@ interface IRoute
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Router $router
|
||||
* @throws \Pecee\SimpleRouter\Exceptions\NotFoundHttpException
|
||||
* @return string
|
||||
* @throws \Pecee\SimpleRouter\Exceptions\NotFoundHttpException
|
||||
*/
|
||||
public function renderRoute(Request $request, Router $router): ?string;
|
||||
|
||||
@@ -82,7 +82,7 @@ interface IRoute
|
||||
/**
|
||||
* Set callback
|
||||
*
|
||||
* @param string $callback
|
||||
* @param string|array|\Closure $callback
|
||||
* @return static
|
||||
*/
|
||||
public function setCallback($callback): self;
|
||||
@@ -206,4 +206,18 @@ interface IRoute
|
||||
*/
|
||||
public function setMiddlewares(array $middlewares): self;
|
||||
|
||||
/**
|
||||
* If enabled parameters containing null-value will not be passed along to the callback.
|
||||
*
|
||||
* @param bool $enabled
|
||||
* @return static $this
|
||||
*/
|
||||
public function setFilterEmptyParams(bool $enabled): self;
|
||||
|
||||
/**
|
||||
* Status if filtering of empty params is enabled or disabled
|
||||
* @return bool
|
||||
*/
|
||||
public function getFilterEmptyParams(): bool;
|
||||
|
||||
}
|
||||
@@ -60,7 +60,7 @@ abstract class LoadableRoute extends Route implements ILoadableRoute
|
||||
return null;
|
||||
}
|
||||
|
||||
return ((bool)preg_match($this->regex, $request->getHost() . $url) !== false);
|
||||
return ((bool)preg_match($this->regex, $url) !== false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,25 +10,7 @@ use Pecee\SimpleRouter\Router;
|
||||
abstract class Route implements IRoute
|
||||
{
|
||||
protected const PARAMETERS_REGEX_FORMAT = '%s([\w]+)(\%s?)%s';
|
||||
protected const PARAMETERS_DEFAULT_REGEX = '[\w\-]+';
|
||||
|
||||
public const REQUEST_TYPE_GET = 'get';
|
||||
public const REQUEST_TYPE_POST = 'post';
|
||||
public const REQUEST_TYPE_PUT = 'put';
|
||||
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,
|
||||
self::REQUEST_TYPE_POST,
|
||||
self::REQUEST_TYPE_PUT,
|
||||
self::REQUEST_TYPE_PATCH,
|
||||
self::REQUEST_TYPE_OPTIONS,
|
||||
self::REQUEST_TYPE_DELETE,
|
||||
self::REQUEST_TYPE_HEAD,
|
||||
];
|
||||
protected const PARAMETERS_DEFAULT_REGEX = '[\w-]+';
|
||||
|
||||
/**
|
||||
* If enabled parameters containing null-value
|
||||
@@ -99,22 +81,19 @@ abstract class Route implements IRoute
|
||||
return $router->getClassLoader()->loadClosure($callback, $parameters);
|
||||
}
|
||||
|
||||
/* When the callback is a class + method */
|
||||
$controller = explode('@', $callback);
|
||||
$controller = $this->getClass();
|
||||
$method = $this->getMethod();
|
||||
|
||||
$namespace = $this->getNamespace();
|
||||
|
||||
$className = ($namespace !== null && $controller[0][0] !== '\\') ? $namespace . '\\' . $controller[0] : $controller[0];
|
||||
$className = ($namespace !== null && $controller[0] !== '\\') ? $namespace . '\\' . $controller : $controller;
|
||||
|
||||
$router->debug('Loading class %s', $className);
|
||||
$class = $router->getClassLoader()->loadClass($className);
|
||||
|
||||
if (\count($controller) === 1) {
|
||||
if ($method === null) {
|
||||
$controller[1] = '__invoke';
|
||||
}
|
||||
|
||||
$method = $controller[1];
|
||||
|
||||
if (method_exists($class, $method) === false) {
|
||||
throw new NotFoundHttpException(sprintf('Method "%s" does not exist in class "%s"', $method, $className), 404);
|
||||
}
|
||||
@@ -144,7 +123,7 @@ abstract class Route implements IRoute
|
||||
$urlRegex = preg_quote($route, '/');
|
||||
} else {
|
||||
|
||||
foreach (preg_split('/((\-?\/?)\{[^}]+\})/', $route) as $key => $t) {
|
||||
foreach (preg_split('/((-?\/?){[^}]+})/', $route) as $key => $t) {
|
||||
|
||||
$regex = '';
|
||||
|
||||
@@ -159,7 +138,7 @@ abstract class Route implements IRoute
|
||||
$regex = $parameterRegex ?? $this->defaultParameterRegex ?? static::PARAMETERS_DEFAULT_REGEX;
|
||||
}
|
||||
|
||||
$regex = sprintf('((\/|\-)(?P<%2$s>%3$s))%1$s', $parameters[2][$key], $name, $regex);
|
||||
$regex = sprintf('((\/|-)(?P<%2$s>%3$s))%1$s', $parameters[2][$key], $name, $regex);
|
||||
}
|
||||
|
||||
$urlRegex .= preg_quote($t, '/') . $regex;
|
||||
@@ -271,7 +250,7 @@ abstract class Route implements IRoute
|
||||
/**
|
||||
* Set callback
|
||||
*
|
||||
* @param string $callback
|
||||
* @param string|array\Closure $callback
|
||||
* @return static
|
||||
*/
|
||||
public function setCallback($callback): IRoute
|
||||
@@ -291,6 +270,10 @@ abstract class Route implements IRoute
|
||||
|
||||
public function getMethod(): ?string
|
||||
{
|
||||
if (\is_array($this->callback) === true && \count($this->callback) > 1) {
|
||||
return $this->callback[1];
|
||||
}
|
||||
|
||||
if (\is_string($this->callback) === true && strpos($this->callback, '@') !== false) {
|
||||
$tmp = explode('@', $this->callback);
|
||||
|
||||
@@ -302,6 +285,10 @@ abstract class Route implements IRoute
|
||||
|
||||
public function getClass(): ?string
|
||||
{
|
||||
if (\is_array($this->callback) === true && \count($this->callback) > 0) {
|
||||
return $this->callback[0];
|
||||
}
|
||||
|
||||
if (\is_string($this->callback) === true && strpos($this->callback, '@') !== false) {
|
||||
$tmp = explode('@', $this->callback);
|
||||
|
||||
@@ -313,14 +300,14 @@ abstract class Route implements IRoute
|
||||
|
||||
public function setMethod(string $method): IRoute
|
||||
{
|
||||
$this->callback = sprintf('%s@%s', $this->getClass(), $method);
|
||||
$this->callback = [$this->getClass(), $method];
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setClass(string $class): IRoute
|
||||
{
|
||||
$this->callback = sprintf('%s@%s', $class, $this->getMethod());
|
||||
$this->callback = [$class, $this->getMethod()];
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -456,9 +443,9 @@ abstract class Route implements IRoute
|
||||
* Add regular expression parameter match.
|
||||
* Alias for LoadableRoute::where()
|
||||
*
|
||||
* @see LoadableRoute::where()
|
||||
* @param array $options
|
||||
* @return static
|
||||
* @see LoadableRoute::where()
|
||||
*/
|
||||
public function where(array $options)
|
||||
{
|
||||
@@ -506,9 +493,9 @@ abstract class Route implements IRoute
|
||||
/**
|
||||
* Add middleware class-name
|
||||
*
|
||||
* @deprecated This method is deprecated and will be removed in the near future.
|
||||
* @param IMiddleware|string $middleware
|
||||
* @return static
|
||||
* @deprecated This method is deprecated and will be removed in the near future.
|
||||
*/
|
||||
public function setMiddleware($middleware)
|
||||
{
|
||||
@@ -575,4 +562,25 @@ abstract class Route implements IRoute
|
||||
return $this->defaultParameterRegex;
|
||||
}
|
||||
|
||||
/**
|
||||
* If enabled parameters containing null-value will not be passed along to the callback.
|
||||
*
|
||||
* @param bool $enabled
|
||||
* @return static $this
|
||||
*/
|
||||
public function setFilterEmptyParams(bool $enabled): IRoute
|
||||
{
|
||||
$this->filterEmptyParams = $enabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Status if filtering of empty params is enabled or disabled
|
||||
* @return bool
|
||||
*/
|
||||
public function getFilterEmptyParams(): bool
|
||||
{
|
||||
return $this->filterEmptyParams;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -64,7 +64,7 @@ class RouteController extends LoadableRoute implements IControllerRoute
|
||||
if ($method !== null) {
|
||||
|
||||
/* Remove requestType from method-name, if it exists */
|
||||
foreach (static::$requestTypes as $requestType) {
|
||||
foreach (Request::$requestTypes as $requestType) {
|
||||
|
||||
if (stripos($method, $requestType) === 0) {
|
||||
$method = (string)substr($method, \strlen($requestType));
|
||||
@@ -110,7 +110,7 @@ class RouteController extends LoadableRoute implements IControllerRoute
|
||||
$this->parameters = \array_slice($path, 1);
|
||||
|
||||
// Set callback
|
||||
$this->setCallback($this->controller . '@' . $this->method);
|
||||
$this->setCallback([$this->controller, $this->method]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -52,8 +52,16 @@ class RouteGroup extends Route implements IGroupRoute
|
||||
return false;
|
||||
}
|
||||
|
||||
// Parse parameter
|
||||
|
||||
$prefix = $this->prefix;
|
||||
|
||||
foreach($this->getParameters() as $parameter => $value) {
|
||||
$prefix = str_ireplace('{' . $parameter . '}', $value, $prefix);
|
||||
}
|
||||
|
||||
/* Skip if prefix doesn't match */
|
||||
if ($this->prefix !== null && stripos($url, $this->prefix) === false) {
|
||||
if ($this->prefix !== null && stripos($url, $prefix) === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ class RouteResource extends LoadableRoute implements IControllerRoute
|
||||
|
||||
protected function call($method): bool
|
||||
{
|
||||
$this->setCallback($this->controller . '@' . $method);
|
||||
$this->setCallback([$this->controller, $method]);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -115,32 +115,32 @@ class RouteResource extends LoadableRoute implements IControllerRoute
|
||||
$method = $request->getMethod();
|
||||
|
||||
// Delete
|
||||
if ($method === static::REQUEST_TYPE_DELETE && $id !== null) {
|
||||
if ($method === Request::REQUEST_TYPE_DELETE && $id !== null) {
|
||||
return $this->call($this->methodNames['destroy']);
|
||||
}
|
||||
|
||||
// Update
|
||||
if ($id !== null && \in_array($method, [static::REQUEST_TYPE_PATCH, static::REQUEST_TYPE_PUT], true) === true) {
|
||||
if ($id !== null && \in_array($method, [Request::REQUEST_TYPE_PATCH, Request::REQUEST_TYPE_PUT], true) === true) {
|
||||
return $this->call($this->methodNames['update']);
|
||||
}
|
||||
|
||||
// Edit
|
||||
if ($method === static::REQUEST_TYPE_GET && $id !== null && $action === 'edit') {
|
||||
if ($method === Request::REQUEST_TYPE_GET && $id !== null && $action === 'edit') {
|
||||
return $this->call($this->methodNames['edit']);
|
||||
}
|
||||
|
||||
// Create
|
||||
if ($method === static::REQUEST_TYPE_GET && $id === 'create') {
|
||||
if ($method === Request::REQUEST_TYPE_GET && $id === 'create') {
|
||||
return $this->call($this->methodNames['create']);
|
||||
}
|
||||
|
||||
// Save
|
||||
if ($method === static::REQUEST_TYPE_POST) {
|
||||
if ($method === Request::REQUEST_TYPE_POST) {
|
||||
return $this->call($this->methodNames['store']);
|
||||
}
|
||||
|
||||
// Show
|
||||
if ($method === static::REQUEST_TYPE_GET && $id !== null) {
|
||||
if ($method === Request::REQUEST_TYPE_GET && $id !== null) {
|
||||
return $this->call($this->methodNames['show']);
|
||||
}
|
||||
|
||||
|
||||
@@ -305,8 +305,8 @@ class Router
|
||||
* Start the routing
|
||||
*
|
||||
* @return string|null
|
||||
* @throws \Pecee\SimpleRouter\Exceptions\NotFoundHttpException
|
||||
* @throws \Pecee\Http\Middleware\Exceptions\TokenMismatchException
|
||||
* @throws NotFoundHttpException
|
||||
* @throws TokenMismatchException
|
||||
* @throws HttpException
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace Pecee\SimpleRouter;
|
||||
|
||||
use DI\Container;
|
||||
use Pecee\Exceptions\InvalidArgumentException;
|
||||
use Pecee\Http\Exceptions\MalformedUrlException;
|
||||
use Pecee\Http\Middleware\BaseCsrfVerifier;
|
||||
use Pecee\Http\Request;
|
||||
use Pecee\Http\Response;
|
||||
@@ -76,7 +75,6 @@ class SimpleRouter
|
||||
ob_start();
|
||||
static::router()->setDebugEnabled(true)->start();
|
||||
$routerOutput = ob_get_clean();
|
||||
ob_end_clean();
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
@@ -178,79 +176,79 @@ class SimpleRouter
|
||||
* Route the given url to your callback on GET request method.
|
||||
*
|
||||
* @param string $url
|
||||
* @param string|\Closure $callback
|
||||
* @param string|array|\Closure $callback
|
||||
* @param array|null $settings
|
||||
*
|
||||
* @return RouteUrl
|
||||
*/
|
||||
public static function get(string $url, $callback, array $settings = null): IRoute
|
||||
{
|
||||
return static::match(['get'], $url, $callback, $settings);
|
||||
return static::match([Request::REQUEST_TYPE_GET], $url, $callback, $settings);
|
||||
}
|
||||
|
||||
/**
|
||||
* Route the given url to your callback on POST request method.
|
||||
*
|
||||
* @param string $url
|
||||
* @param string|\Closure $callback
|
||||
* @param string|array|\Closure $callback
|
||||
* @param array|null $settings
|
||||
* @return RouteUrl
|
||||
*/
|
||||
public static function post(string $url, $callback, array $settings = null): IRoute
|
||||
{
|
||||
return static::match(['post'], $url, $callback, $settings);
|
||||
return static::match([Request::REQUEST_TYPE_POST], $url, $callback, $settings);
|
||||
}
|
||||
|
||||
/**
|
||||
* Route the given url to your callback on PUT request method.
|
||||
*
|
||||
* @param string $url
|
||||
* @param string|\Closure $callback
|
||||
* @param string|array|\Closure $callback
|
||||
* @param array|null $settings
|
||||
* @return RouteUrl
|
||||
*/
|
||||
public static function put(string $url, $callback, array $settings = null): IRoute
|
||||
{
|
||||
return static::match(['put'], $url, $callback, $settings);
|
||||
return static::match([Request::REQUEST_TYPE_PUT], $url, $callback, $settings);
|
||||
}
|
||||
|
||||
/**
|
||||
* Route the given url to your callback on PATCH request method.
|
||||
*
|
||||
* @param string $url
|
||||
* @param string|\Closure $callback
|
||||
* @param string|array|\Closure $callback
|
||||
* @param array|null $settings
|
||||
* @return RouteUrl
|
||||
*/
|
||||
public static function patch(string $url, $callback, array $settings = null): IRoute
|
||||
{
|
||||
return static::match(['patch'], $url, $callback, $settings);
|
||||
return static::match([Request::REQUEST_TYPE_PATCH], $url, $callback, $settings);
|
||||
}
|
||||
|
||||
/**
|
||||
* Route the given url to your callback on OPTIONS request method.
|
||||
*
|
||||
* @param string $url
|
||||
* @param string|\Closure $callback
|
||||
* @param string|array|\Closure $callback
|
||||
* @param array|null $settings
|
||||
* @return RouteUrl
|
||||
*/
|
||||
public static function options(string $url, $callback, array $settings = null): IRoute
|
||||
{
|
||||
return static::match(['options'], $url, $callback, $settings);
|
||||
return static::match([Request::REQUEST_TYPE_OPTIONS], $url, $callback, $settings);
|
||||
}
|
||||
|
||||
/**
|
||||
* Route the given url to your callback on DELETE request method.
|
||||
*
|
||||
* @param string $url
|
||||
* @param string|\Closure $callback
|
||||
* @param string|array|\Closure $callback
|
||||
* @param array|null $settings
|
||||
* @return RouteUrl
|
||||
*/
|
||||
public static function delete(string $url, $callback, array $settings = null): IRoute
|
||||
{
|
||||
return static::match(['delete'], $url, $callback, $settings);
|
||||
return static::match([Request::REQUEST_TYPE_DELETE], $url, $callback, $settings);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -307,14 +305,14 @@ class SimpleRouter
|
||||
* Alias for the form method
|
||||
*
|
||||
* @param string $url
|
||||
* @param callable $callback
|
||||
* @param string|array|\Closure $callback
|
||||
* @param array|null $settings
|
||||
* @see SimpleRouter::form
|
||||
* @return RouteUrl
|
||||
*/
|
||||
public static function basic(string $url, $callback, array $settings = null): IRoute
|
||||
{
|
||||
return static::match(['get', 'post'], $url, $callback, $settings);
|
||||
return static::form($url, $callback, $settings);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -322,14 +320,17 @@ class SimpleRouter
|
||||
* Route the given url to your callback on POST and GET request method.
|
||||
*
|
||||
* @param string $url
|
||||
* @param string|\Closure $callback
|
||||
* @param string|array|\Closure $callback
|
||||
* @param array|null $settings
|
||||
* @see SimpleRouter::form
|
||||
* @return RouteUrl
|
||||
*/
|
||||
public static function form(string $url, $callback, array $settings = null): IRoute
|
||||
{
|
||||
return static::match(['get', 'post'], $url, $callback, $settings);
|
||||
return static::match([
|
||||
Request::REQUEST_TYPE_GET,
|
||||
Request::REQUEST_TYPE_POST
|
||||
], $url, $callback, $settings);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -337,7 +338,7 @@ class SimpleRouter
|
||||
*
|
||||
* @param array $requestMethods
|
||||
* @param string $url
|
||||
* @param string|\Closure $callback
|
||||
* @param string|array|\Closure $callback
|
||||
* @param array|null $settings
|
||||
* @return RouteUrl|IRoute
|
||||
*/
|
||||
@@ -358,7 +359,7 @@ class SimpleRouter
|
||||
* This type will route the given url to your callback and allow any type of request method
|
||||
*
|
||||
* @param string $url
|
||||
* @param string|\Closure $callback
|
||||
* @param string|array|\Closure $callback
|
||||
* @param array|null $settings
|
||||
* @return RouteUrl|IRoute
|
||||
*/
|
||||
@@ -382,7 +383,7 @@ class SimpleRouter
|
||||
* @param array|null $settings
|
||||
* @return RouteController|IRoute
|
||||
*/
|
||||
public static function controller(string $url, $controller, array $settings = null)
|
||||
public static function controller(string $url, string $controller, array $settings = null)
|
||||
{
|
||||
$route = new RouteController($url, $controller);
|
||||
$route = static::addDefaultNamespace($route);
|
||||
@@ -402,7 +403,7 @@ class SimpleRouter
|
||||
* @param array|null $settings
|
||||
* @return RouteResource|IRoute
|
||||
*/
|
||||
public static function resource(string $url, $controller, array $settings = null)
|
||||
public static function resource(string $url, string $controller, array $settings = null)
|
||||
{
|
||||
$route = new RouteResource($url, $controller);
|
||||
$route = static::addDefaultNamespace($route);
|
||||
@@ -465,7 +466,7 @@ class SimpleRouter
|
||||
/**
|
||||
* Get the request
|
||||
*
|
||||
* @return \Pecee\Http\Request
|
||||
* @return Request
|
||||
*/
|
||||
public static function request(): Request
|
||||
{
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
|
||||
class DummyController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function method1()
|
||||
{
|
||||
|
||||
|
||||
@@ -4,43 +4,36 @@ class ResourceController implements \Pecee\Controllers\IResourceController
|
||||
|
||||
public function index() : ?string
|
||||
{
|
||||
echo 'index';
|
||||
return null;
|
||||
return 'index';
|
||||
}
|
||||
|
||||
public function show($id) : ?string
|
||||
{
|
||||
echo 'show ' . $id;
|
||||
return null;
|
||||
return 'show ' . $id;
|
||||
}
|
||||
|
||||
public function store() : ?string
|
||||
{
|
||||
echo 'store';
|
||||
return null;
|
||||
return 'store';
|
||||
}
|
||||
|
||||
public function create() : ?string
|
||||
{
|
||||
echo 'create';
|
||||
return null;
|
||||
return 'create';
|
||||
}
|
||||
|
||||
public function edit($id) : ?string
|
||||
{
|
||||
echo 'edit ' . $id;
|
||||
return null;
|
||||
return 'edit ' . $id;
|
||||
}
|
||||
|
||||
public function update($id) : ?string
|
||||
{
|
||||
echo 'update ' . $id;
|
||||
return null;
|
||||
return 'update ' . $id;
|
||||
}
|
||||
|
||||
public function destroy($id) : ?string
|
||||
{
|
||||
echo 'destroy ' . $id;
|
||||
return null;
|
||||
return 'destroy ' . $id;
|
||||
}
|
||||
}
|
||||
@@ -6,23 +6,29 @@ require_once 'Dummy/Handler/ExceptionHandler.php';
|
||||
|
||||
class InputHandlerTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected $names = [
|
||||
'Lester',
|
||||
'Michael',
|
||||
'Franklin',
|
||||
'Trevor',
|
||||
];
|
||||
|
||||
protected $brands = [
|
||||
'Samsung',
|
||||
'Apple',
|
||||
'HP',
|
||||
'Canon',
|
||||
];
|
||||
|
||||
protected $day = 'monday';
|
||||
|
||||
public function testPost()
|
||||
{
|
||||
global $_POST;
|
||||
|
||||
$names = [
|
||||
'Lester',
|
||||
'Michael',
|
||||
'Franklin',
|
||||
'Trevor',
|
||||
];
|
||||
|
||||
$day = 'monday';
|
||||
|
||||
$_POST = [
|
||||
'names' => $names,
|
||||
'day' => $day,
|
||||
'names' => $this->names,
|
||||
'day' => $this->day,
|
||||
];
|
||||
|
||||
$router = TestRouter::router();
|
||||
@@ -31,11 +37,12 @@ class InputHandlerTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
$handler = TestRouter::request()->getInputHandler();
|
||||
|
||||
$this->assertEquals($names, $handler->value('names'));
|
||||
$this->assertEquals($names, $handler->all(['names'])['names']);
|
||||
$this->assertEquals($day, $handler->value('day'));
|
||||
$this->assertEquals($this->names, $handler->value('names'));
|
||||
$this->assertEquals($this->names, $handler->all(['names'])['names']);
|
||||
$this->assertEquals($this->day, $handler->value('day'));
|
||||
$this->assertInstanceOf(\Pecee\Http\Input\InputItem::class, $handler->find('day'));
|
||||
$this->assertInstanceOf(\Pecee\Http\Input\InputItem::class, $handler->post('day'));
|
||||
$this->assertInstanceOf(\Pecee\Http\Input\InputItem::class, $handler->find('day', 'post'));
|
||||
|
||||
// Check non-existing and wrong request-type
|
||||
$this->assertCount(1, $handler->all(['non-existing']));
|
||||
@@ -53,9 +60,10 @@ class InputHandlerTest extends \PHPUnit\Framework\TestCase
|
||||
/* @var $object \Pecee\Http\Input\InputItem */
|
||||
foreach($objects as $i => $object) {
|
||||
$this->assertInstanceOf(\Pecee\Http\Input\InputItem::class, $object);
|
||||
$this->assertEquals($names[$i], $object->getValue());
|
||||
$this->assertEquals($this->names[$i], $object->getValue());
|
||||
}
|
||||
|
||||
// Reset
|
||||
$_POST = [];
|
||||
}
|
||||
|
||||
@@ -63,18 +71,9 @@ class InputHandlerTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
global $_GET;
|
||||
|
||||
$names = [
|
||||
'Lester',
|
||||
'Michael',
|
||||
'Franklin',
|
||||
'Trevor',
|
||||
];
|
||||
|
||||
$day = 'monday';
|
||||
|
||||
$_GET = [
|
||||
'names' => $names,
|
||||
'day' => $day,
|
||||
'names' => $this->names,
|
||||
'day' => $this->day,
|
||||
];
|
||||
|
||||
$router = TestRouter::router();
|
||||
@@ -83,9 +82,9 @@ class InputHandlerTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
$handler = TestRouter::request()->getInputHandler();
|
||||
|
||||
$this->assertEquals($names, $handler->value('names'));
|
||||
$this->assertEquals($names, $handler->all(['names'])['names']);
|
||||
$this->assertEquals($day, $handler->value('day'));
|
||||
$this->assertEquals($this->names, $handler->value('names'));
|
||||
$this->assertEquals($this->names, $handler->all(['names'])['names']);
|
||||
$this->assertEquals($this->day, $handler->value('day'));
|
||||
$this->assertInstanceOf(\Pecee\Http\Input\InputItem::class, $handler->find('day'));
|
||||
$this->assertInstanceOf(\Pecee\Http\Input\InputItem::class, $handler->get('day'));
|
||||
|
||||
@@ -105,25 +104,73 @@ class InputHandlerTest extends \PHPUnit\Framework\TestCase
|
||||
/* @var $object \Pecee\Http\Input\InputItem */
|
||||
foreach($objects as $i => $object) {
|
||||
$this->assertInstanceOf(\Pecee\Http\Input\InputItem::class, $object);
|
||||
$this->assertEquals($names[$i], $object->getValue());
|
||||
$this->assertEquals($this->names[$i], $object->getValue());
|
||||
}
|
||||
|
||||
// Reset
|
||||
$_GET = [];
|
||||
}
|
||||
|
||||
public function testFile()
|
||||
{
|
||||
// TODO: implement test-file
|
||||
$this->assertEquals(true, true);
|
||||
}
|
||||
|
||||
public function testFiles()
|
||||
{
|
||||
// TODO: implement test-files
|
||||
$this->assertEquals(true, true);
|
||||
}
|
||||
|
||||
public function testAll()
|
||||
{
|
||||
$this->assertEquals(true, true);
|
||||
global $_POST;
|
||||
global $_GET;
|
||||
|
||||
$_POST = [
|
||||
'names' => $this->names,
|
||||
'is_sad' => true,
|
||||
];
|
||||
|
||||
$_GET = [
|
||||
'brands' => $this->brands,
|
||||
'is_happy' => true,
|
||||
];
|
||||
|
||||
$router = TestRouter::router();
|
||||
$router->reset();
|
||||
$router->getRequest()->setMethod('post');
|
||||
|
||||
$handler = TestRouter::request()->getInputHandler();
|
||||
|
||||
// GET
|
||||
$brandsFound = $handler->all(['brands', 'nothing']);
|
||||
|
||||
$this->assertArrayHasKey('brands', $brandsFound);
|
||||
$this->assertArrayHasKey('nothing', $brandsFound);
|
||||
$this->assertEquals($this->brands, $brandsFound['brands']);
|
||||
$this->assertNull($brandsFound['nothing']);
|
||||
|
||||
// POST
|
||||
$namesFound = $handler->all(['names', 'nothing']);
|
||||
|
||||
$this->assertArrayHasKey('names', $namesFound);
|
||||
$this->assertArrayHasKey('nothing', $namesFound);
|
||||
$this->assertEquals($this->names, $namesFound['names']);
|
||||
$this->assertNull($namesFound['nothing']);
|
||||
|
||||
// DEFAULT VALUE
|
||||
$nonExisting = $handler->all([
|
||||
'non-existing'
|
||||
]);
|
||||
|
||||
$this->assertArrayHasKey('non-existing', $nonExisting);
|
||||
$this->assertNull($nonExisting['non-existing']);
|
||||
|
||||
// Reset
|
||||
$_GET = [];
|
||||
$_POST = [];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -25,4 +25,49 @@ class RouterPartialGroupTest extends \PHPUnit\Framework\TestCase
|
||||
$this->assertEquals('param2', $result2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fixed issue with partial routes not loading child groups.
|
||||
* Reported in issue: #456
|
||||
*/
|
||||
public function testPartialGroupWithGroup() {
|
||||
|
||||
$lang = null;
|
||||
|
||||
$route1 = '/lang/da/test/';
|
||||
$route2 = '/lang/da/auth';
|
||||
$route3 = '/lang/da/auth/test';
|
||||
|
||||
TestRouter::partialGroup(
|
||||
'/lang/{test}/',
|
||||
function ($lang = 'en') use($route1, $route2, $route3) {
|
||||
|
||||
TestRouter::get('/test/', function () use($route1) {
|
||||
return $route1;
|
||||
});
|
||||
|
||||
TestRouter::group(['prefix' => '/auth/'], function () use($route2, $route3) {
|
||||
|
||||
TestRouter::get('/', function() use($route2) {
|
||||
return $route2;
|
||||
});
|
||||
|
||||
TestRouter::get('/test', function () use($route3){
|
||||
return $route3;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
$test1 = TestRouter::debugOutput('/lang/da/test', 'get', false);
|
||||
$test2 = TestRouter::debugOutput('/lang/da/auth', 'get', false);
|
||||
$test3 = TestRouter::debugOutput('/lang/da/auth/test', 'get', false);
|
||||
|
||||
$this->assertEquals($test1, $route1);
|
||||
$this->assertEquals($test2, $route2);
|
||||
$this->assertEquals($test3, $route3);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -101,7 +101,7 @@ class RouterRouteTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
public function testPathParamRegex()
|
||||
{
|
||||
TestRouter::get('/{lang}/productscategories/{name}', 'DummyController@param', ['where' => ['lang' => '[a-z]+', 'name' => '[A-Za-z0-9\-]+']]);
|
||||
TestRouter::get('/{lang}/productscategories/{name}', 'DummyController@param', ['where' => ['lang' => '[a-z]+', 'name' => '[A-Za-z0-9-]+']]);
|
||||
$response = TestRouter::debugOutput('/it/productscategories/system', 'get');
|
||||
|
||||
$this->assertEquals('it, system', $response);
|
||||
@@ -144,7 +144,7 @@ class RouterRouteTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
public function testRegEx()
|
||||
{
|
||||
TestRouter::get('/my/{path}', 'DummyController@method1')->where(['path' => '[a-zA-Z\-]+']);
|
||||
TestRouter::get('/my/{path}', 'DummyController@method1')->where(['path' => '[a-zA-Z-]+']);
|
||||
TestRouter::debug('/my/custom-path', 'get');
|
||||
|
||||
$this->assertTrue(true);
|
||||
@@ -182,7 +182,7 @@ class RouterRouteTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
public function testDefaultParameterRegex()
|
||||
{
|
||||
TestRouter::get('/my/{path}', 'DummyController@param', ['defaultParameterRegex' => '[\w\-]+']);
|
||||
TestRouter::get('/my/{path}', 'DummyController@param', ['defaultParameterRegex' => '[\w-]+']);
|
||||
$output = TestRouter::debugOutput('/my/custom-regex', 'get');
|
||||
|
||||
$this->assertEquals('custom-regex', $output);
|
||||
@@ -190,7 +190,7 @@ class RouterRouteTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
public function testDefaultParameterRegexGroup()
|
||||
{
|
||||
TestRouter::group(['defaultParameterRegex' => '[\w\-]+'], function () {
|
||||
TestRouter::group(['defaultParameterRegex' => '[\w-]+'], function () {
|
||||
TestRouter::get('/my/{path}', 'DummyController@param');
|
||||
});
|
||||
|
||||
@@ -199,4 +199,15 @@ class RouterRouteTest extends \PHPUnit\Framework\TestCase
|
||||
$this->assertEquals('custom-regex', $output);
|
||||
}
|
||||
|
||||
public function testClassHint()
|
||||
{
|
||||
TestRouter::get('/my/test/url', ['DummyController', 'method1']);
|
||||
TestRouter::all('/my/test/url', ['DummyController', 'method1']);
|
||||
TestRouter::match(['put', 'get', 'post'], '/my/test/url', ['DummyController', 'method1']);
|
||||
|
||||
TestRouter::debug('/my/test/url', 'get');
|
||||
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -78,10 +78,11 @@ class RouterUrlTest extends \PHPUnit\Framework\TestCase
|
||||
public function testSimilarUrls()
|
||||
{
|
||||
// Match normal route on alias
|
||||
TestRouter::resource('/url11', 'DummyController@method1');
|
||||
TestRouter::resource('/url1', 'DummyController@method1', ['as' => 'match']);
|
||||
TestRouter::get('/url11', 'DummyController@method1');
|
||||
TestRouter::get('/url22', 'DummyController@method2');
|
||||
TestRouter::get('/url33', 'DummyController@method2')->name('match');
|
||||
|
||||
TestRouter::debugNoReset('/url1', 'get');
|
||||
TestRouter::debugNoReset('/url33', 'get');
|
||||
|
||||
$this->assertEquals(TestRouter::getUrl('match'), TestRouter::getUrl());
|
||||
|
||||
@@ -170,4 +171,16 @@ class RouterUrlTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
}
|
||||
|
||||
public function testCustomRegex()
|
||||
{
|
||||
TestRouter::request()->setHost('google.com');
|
||||
|
||||
TestRouter::get('/admin/', function() {
|
||||
return 'match';
|
||||
})->setMatch('/^\/admin\/?(.*)/i');
|
||||
|
||||
$output = TestRouter::debugOutput('/admin/asd/bec/123', 'get');
|
||||
$this->assertEquals('match', $output);
|
||||
}
|
||||
|
||||
}
|
||||
+12
-6
@@ -3,6 +3,11 @@
|
||||
class TestRouter extends \Pecee\SimpleRouter\SimpleRouter
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
static::request()->setHost('testhost.com');
|
||||
}
|
||||
|
||||
public static function debugNoReset($testUrl, $testMethod = 'get')
|
||||
{
|
||||
$request = static::request();
|
||||
@@ -13,7 +18,7 @@ class TestRouter extends \Pecee\SimpleRouter\SimpleRouter
|
||||
static::start();
|
||||
}
|
||||
|
||||
public static function debug($testUrl, $testMethod = 'get')
|
||||
public static function debug($testUrl, $testMethod = 'get', bool $reset = true)
|
||||
{
|
||||
try {
|
||||
static::debugNoReset($testUrl, $testMethod);
|
||||
@@ -22,19 +27,20 @@ class TestRouter extends \Pecee\SimpleRouter\SimpleRouter
|
||||
throw $e;
|
||||
}
|
||||
|
||||
static::router()->reset();
|
||||
if($reset === true) {
|
||||
static::router()->reset();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static function debugOutput($testUrl, $testMethod = 'get')
|
||||
public static function debugOutput($testUrl, $testMethod = 'get', bool $reset = true)
|
||||
{
|
||||
$response = null;
|
||||
|
||||
// Route request
|
||||
ob_start();
|
||||
static::debug($testUrl, $testMethod);
|
||||
$response = ob_get_contents();
|
||||
ob_end_clean();
|
||||
static::debug($testUrl, $testMethod, $reset);
|
||||
$response = ob_get_clean();
|
||||
|
||||
// Return response
|
||||
return $response;
|
||||
|
||||
Reference in New Issue
Block a user