Created
April 30, 2020 16:59
-
-
Save erickmajor/d68924b3f38001386658abbfb09ef255 to your computer and use it in GitHub Desktop.
Bug fix for baseUri in Phalcon 4 version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @todo Bug fix for baseUri in Phalcon 4 version | |
* @see {@link https://github.com/phalcon/cphalcon/issues/14559 [BUG]: v4 Regression - localhost/project/ - trouble with Application->handle} | |
*/ | |
if ('/' !== $config->application->baseUri) { | |
$tree = explode(DIRECTORY_SEPARATOR, BASE_PATH); | |
$projectDirectory = end($tree); | |
return $application->handle(str_replace("/{$projectDirectory}/",'', $_SERVER['REQUEST_URI']))->getContent(); | |
} else { | |
return $application->handle($_SERVER['REQUEST_URI'])->getContent(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo require 'baseuri.php'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment