Created
July 22, 2015 15:21
-
-
Save alpharder/dfaf3cd88d536a2662fe to your computer and use it in GitHub Desktop.
This file contains hidden or 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
diff --git a/admin.php b/admin.php | |
index 2d7210c..864e97f 100644 | |
--- a/admin.php | |
+++ b/admin.php | |
@@ -20,6 +20,7 @@ if (version_compare($php_value, '5.3.0') == -1) { | |
define('AREA', 'A'); | |
define('ACCOUNT_TYPE', 'admin'); | |
+define('ENTRY_SCRIPT', __FILE__); | |
try { | |
require(dirname(__FILE__) . '/init.php'); |
This file contains hidden or 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
diff --git a/api.php b/api.php | |
index 6967150..61ce1d9 100644 | |
--- a/api.php | |
+++ b/api.php | |
@@ -18,6 +18,7 @@ use Tygh\Registry; | |
// Area will be defined in Api::defineArea. | |
define('API', true); | |
define('NO_SESSION', true); | |
+define('ENTRY_SCRIPT', __FILE__); | |
try { | |
require dirname(__FILE__) . '/init.php'; |
This file contains hidden or 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
diff --git a/app/Tygh/Bootstrap.php b/app/Tygh/Bootstrap.php | |
index f9d4f03..7bbec19 100644 | |
--- a/app/Tygh/Bootstrap.php | |
+++ b/app/Tygh/Bootstrap.php | |
@@ -111,9 +111,15 @@ class Bootstrap | |
// resolve symbolic links | |
if (!empty($server['SCRIPT_FILENAME'])) { | |
$server['SCRIPT_FILENAME'] = realpath($server['SCRIPT_FILENAME']); | |
+ } elseif (defined('ENTRY_SCRIPT')) { | |
+ $server['SCRIPT_FILENAME'] = ENTRY_SCRIPT; | |
} | |
- //PHP_AUTH_USER and PHP_AUTH_PW not available when using FastCGI (https://bugs.php.net/bug.php?id=35752) | |
+ if (!isset($server['SCRIPT_NAME']) && isset($server['SCRIPT_FILENAME'])) { | |
+ $server['SCRIPT_NAME'] = $server['SCRIPT_FILENAME']; | |
+ } | |
+ | |
+ // PHP_AUTH_USER and PHP_AUTH_PW not available when using FastCGI (https://bugs.php.net/bug.php?id=35752) | |
$http_auth = ''; | |
if (!empty($server['REDIRECT_HTTP_AUTHORIZATION'])) { | |
$http_auth = base64_decode(substr($server['REDIRECT_HTTP_AUTHORIZATION'], 6)); |
This file contains hidden or 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
diff --git a/index.php b/index.php | |
index 2840244..d6bd339 100644 | |
--- a/index.php | |
+++ b/index.php | |
@@ -19,6 +19,7 @@ if (version_compare($php_value, '5.3.0') == -1) { | |
} | |
define('AREA', 'C'); | |
+define('ENTRY_SCRIPT', __FILE__); | |
try { | |
require(dirname(__FILE__) . '/init.php'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment