public function renderConfSettings()
 {
     $settings = [Config::JIG_COMPILE_CHECK => Jig::COMPILE_CHECK_EXISTS, Config::CACHING_SETTING => LastModifiedStrategy::CACHING_TIME, Config::LIBRATO_STATSSOURCENAME => null, 'environment' => null];
     $output = "";
     $output .= "<table class='table-serverSettings'>";
     $output .= "<thead>";
     $output .= "<th>Conf setting</th>";
     $output .= "<th>Value</th>";
     $output .= "</thead>";
     $config = new Config();
     $output .= "<body>";
     foreach ($settings as $setting => $expectedValue) {
         $value = $config->getKey($setting);
         $class = 'good';
         if ($expectedValue === null) {
             //Do nothing.
         } else {
             if ($value != $expectedValue) {
                 $class = 'bad';
             }
         }
         $value = var_export($value, true);
         $output .= "<tr>";
         $output .= sprintf("<td class='%s'>%s</td><td class='%s'>%s</td>", $class, htmlentities($setting, ENT_DISALLOWED | ENT_HTML401 | ENT_NOQUOTES, 'UTF-8'), $class, htmlentities($value, ENT_DISALLOWED | ENT_HTML401 | ENT_NOQUOTES, 'UTF-8'));
         $output .= "</tr>";
     }
     $output .= "</tbody></table>";
     return $output;
 }
Exemple #2
0
 public static function createScriptInclude(Config $config, \ScriptHelper\ScriptURLGenerator $scriptURLGenerator)
 {
     $packScript = $config->getKey(Config::SCRIPT_PACKING);
     if ($packScript) {
         return new \ScriptHelper\ScriptInclude\ScriptIncludePacked($scriptURLGenerator);
     } else {
         return new \ScriptHelper\ScriptInclude\ScriptIncludeIndividual($scriptURLGenerator);
     }
 }
 public function renderConfSettings()
 {
     $settings = ['JIG_COMPILE_CHECK' => Jig::COMPILE_CHECK_EXISTS, 'CACHING_SETTING' => Caching::CACHING_TIME, 'LIBRATO_STATSSOURCENAME' => null];
     $output = "";
     $output .= "<table class='table-serverSettings'>";
     $output .= "<thead>";
     $output .= "<th>Conf setting</th>";
     $output .= "<th>Value</th>";
     $output .= "</thead>";
     $output .= "<body>";
     foreach ($settings as $setting => $expectedValue) {
         $value = Config::getEnv(constant("ImagickDemo\\Config::{$setting}"));
         $class = 'good';
         if ($expectedValue === null) {
             //Do nothing.
         } else {
             if ($value != $expectedValue) {
                 $class = 'bad';
             }
         }
         $value = var_export($value, true);
         $output .= "<tr>";
         $output .= sprintf("<td class='%s'>%s</td><td class='%s'>%s</td>", $class, htmlentities($setting, ENT_DISALLOWED | ENT_HTML401 | ENT_NOQUOTES, 'UTF-8'), $class, htmlentities($value, ENT_DISALLOWED | ENT_HTML401 | ENT_NOQUOTES, 'UTF-8'));
         $output .= "</tr>";
     }
     $output .= "</tbody></table>";
     return $output;
 }
 public function writeEnvFile()
 {
     $configurator = new Configurator();
     $configurator->addPHPConfig($this->env, __DIR__ . "/../../../../clavis.php");
     $contents = "";
     $config = $configurator->getConfig();
     $envVarsToWrite = \ImagickDemo\Config::getConfigNames();
     foreach ($envVarsToWrite as $key) {
         if (array_key_exists($key, $config) == false) {
             throw new \Exception("Value not set for {$key}");
         }
         $value = $config[$key];
         $key = str_replace('.', "_", $key);
         $contents .= "export \"{$key}\"=\"{$value}\"\n";
     }
     file_put_contents($this->outputFilename, $contents);
 }
Exemple #5
0
function createScriptInclude(Config $config, ScriptVersion $scriptVersion)
{
    $value = $config->getKey(Config::SCRIPT_PACKING);
    if ($value) {
        return new \ScriptServer\Service\ScriptIncludePacked($scriptVersion);
    }
    return new \ScriptServer\Service\ScriptIncludeIndividual($scriptVersion);
}
 public function __construct(Config $config)
 {
     $this->internalDomainName = $config->getKey(Config::DOMAIN_INTERNAL);
 }