-
-
Save rexfng/2c0ab693769f26b390fce634d36b12f0 to your computer and use it in GitHub Desktop.
Revisions
-
lavoiesl revised this gist
Jul 15, 2015 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ <?php $base_dir = __DIR__; // Absolute path to your installation, ex: /var/www/mywebsite $doc_root = preg_replace("!${_SERVER['SCRIPT_NAME']}$!", '', $_SERVER['SCRIPT_FILENAME']); # ex: /var/www $base_url = preg_replace("!^${doc_root}!", '', $base_dir); # ex: '' or '/mywebsite' $protocol = empty($_SERVER['HTTPS']) ? 'http' : 'https'; $port = $_SERVER['SERVER_PORT']; $disp_port = ($protocol == 'http' && $port == 80 || $protocol == 'https' && $port == 443) ? '' : ":$port"; $domain = $_SERVER['SERVER_NAME']; $full_url = "${protocol}://${domain}${disp_port}${base_url}"; # Ex: 'http://example.com', 'https://example.com/mywebsite', etc. -
lavoiesl revised this gist
Feb 27, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ <?php $base_dir = __DIR__; // Absolute path to your installation, ex: /var/www/mywebsite $doc_root = preg_replace("!{$_SERVER['SCRIPT_NAME']}$!", '', $_SERVER['SCRIPT_FILENAME']); # ex: /var/www $base_url = preg_replace("!^{$doc_root}!", '', $base_dir); # ex: '' or '/mywebsite' $protocol = empty($_SERVER['HTTPS']) ? 'http' : 'https'; $port = $_SERVER['SERVER_PORT']; -
lavoiesl revised this gist
Feb 20, 2013 . 1 changed file with 8 additions and 8 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ <?php $base_dir = __DIR__; // Absolute path to your installation, ex: /var/www/mywebsite $doc_root = preg_replace("!{$_SERVER['PHP_SELF']}$!", '', $_SERVER['SCRIPT_FILENAME']); # ex: /var/www $base_url = preg_replace("!^{$doc_root}!", '', $base_dir); # ex: '' or '/mywebsite' $protocol = empty($_SERVER['HTTPS']) ? 'http' : 'https'; $port = $_SERVER['SERVER_PORT']; $disp_port = ($protocol == 'http' && $port == 80 || $protocol == 'https' && $port == 443) ? '' : ":$port"; $domain = $_SERVER['SERVER_NAME']; $full_url = "$protocol://{$domain}{$disp_port}{$base_url}"; # Ex: 'http://example.com', 'https://example.com/mywebsite', etc. -
lavoiesl created this gist
Feb 20, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ <?php $base_dir = __DIR__; // Absolute path to your installation, ex: /var/www/mywebsite $doc_root = preg_replace("!{$_SERVER['PHP_SELF']}$!", '', $_SERVER['SCRIPT_FILENAME']); # ex: /var/www $base_url = preg_replace("!^{$doc_root}!", '', $base_dir); # ex: '' or '/mywebsite' $protocol = empty($_SERVER['HTTPS']) ? 'http' : 'https'; $srv_port = $_SERVER['SERVER_PORT']; $port = ($protocol == 'http' && $srv_port == 80 || $protocol == 'https' && $srv_port == 443) ? '' : ":$srv_port"; $domain = $_SERVER['SERVER_NAME']; $full_url = "$protocol://$domain$port$base_url"; # Ex: 'http://example.com', 'https://example.com/mywebsite', etc.