Skip to content
Permalink
Browse files

PHP suffix is empty more often by default.

But Opt[phpSuffix] can override.
And some style stuff.
  • Loading branch information...
kohler committed Jul 19, 2019
1 parent 19f631c commit a9f52dfda35a3531dd086de7f2a0607f94bc3cec
Showing with 15 additions and 15 deletions.
  1. +2 −2 README.md
  2. +5 −6 lib/navigation.php
  3. +2 −0 src/distoptions.php
  4. +4 −0 src/initweb.php
  5. +2 −7 test/test02.php
@@ -128,10 +128,10 @@ You can set up everything else through the web site itself.
- Uploaded papers and reviews are limited in size by several PHP
configuration variables, set by default to 15 megabytes in the HotCRP
directory’s `.htaccess` (or `.user.ini` if you are using php-fpm).
directory’s `.user.ini` (or `.htaccess` if using Apache).
- HotCRP PHP scripts can take a lot of memory, particularly if they're
doing things like generating MIME-encoded mail messages. By default
doing things like generating MIME-encoded mail messages. By default
HotCRP sets the PHP memory limit to 128MB.
- Most HotCRP settings are assigned in the conference database’s
@@ -113,14 +113,13 @@ function __construct($server, $index_name = "index") {
$this->base_path = $this->site_path;
$this->base_path_relative = $this->site_path_relative;
$this->php_suffix = ".php";
if ( isset($server["HOTCRP_PHP_SUFFIX"]) )
if (isset($server["HOTCRP_PHP_SUFFIX"]))
$this->php_suffix = $server["HOTCRP_PHP_SUFFIX"];
elseif ((isset($server["SERVER_SOFTWARE"])
&& substr($server["SERVER_SOFTWARE"], 0, 5) === "nginx")
|| (function_exists("apache_get_modules")
&& array_search("mod_rewrite", apache_get_modules()) !== false))
else if (!function_exists("apache_get_modules")
|| array_search("mod_rewrite", apache_get_modules()) !== false)
$this->php_suffix = "";
else
$this->php_suffix = ".php";
}
function self() {
@@ -174,6 +174,8 @@
// it defaults to the conference installation.
// jqueryUrl URL for jQuery. Defaults to the local minified jquery.
// jqueryCdn If true, use the jQuery CDN.
// phpSuffix The suffix for generated HotCRP URLs. Usually empty; for
// some configurations, you may want to set it to ".php".
// BEHAVIOR OPTIONS
@@ -15,6 +15,10 @@
exit;
}
// Check for PHP suffix
if ($Conf->opt("phpSuffix") !== null)
Navigation::get()->php_suffix = $Conf->opt("phpSuffix");
// Collect $Qreq
$Qreq = make_qreq();
@@ -456,16 +456,11 @@ function random_paper_ids() {
xassert_eqq($ns->make_absolute("?confusion=20"), "http://butt.com/fart/barf/?confusion=20");
// Test PHP_SUFFIX override
$ns = new NavigationState(["SERVER_PORT" => 80, "SCRIPT_FILENAME" => __FILE__,
"SCRIPT_NAME" => __FILE__, "REQUEST_URI" => "/fart/barf/?butt",
"HTTP_HOST" => "butt.com", "SERVER_SOFTWARE" => "Apache 2.4"]);
xassert_eqq($ns->php_suffix, ".php");
$ns = new NavigationState(["SERVER_PORT" => 80, "SCRIPT_FILENAME" => __FILE__,
"SCRIPT_NAME" => __FILE__, "REQUEST_URI" => "/fart/barf/?butt",
"HTTP_HOST" => "butt.com", "SERVER_SOFTWARE" => "Apache 2.4",
"HOTCRP_PHP_SUFFIX" => ""]);
xassert_eqq($ns->php_suffix, "");
"HOTCRP_PHP_SUFFIX" => ".xxx"]);
xassert_eqq($ns->php_suffix, ".xxx");
// other helpers
xassert_eqq(ini_get_bytes(null, "1"), 1);

0 comments on commit a9f52df

Please sign in to comment.
You can’t perform that action at this time.