コード例 #1
0
ファイル: configurator.php プロジェクト: pombredanne/tuleap
 function _variable($config_item_name, $default_value, $description = '', $jscheck = '')
 {
     $this->config_item_name = $config_item_name;
     if (!$description) {
         $description = text_from_dist($config_item_name);
     }
     $this->description = $description;
     // TODO: get boolean default value from config-default.ini
     if (defined($config_item_name) and !preg_match("/(selection|boolean)/", get_class($this)) and !preg_match("/(SCRIPT_NAME|VIRTUAL_PATH)/", $config_item_name)) {
         $this->default_value = constant($config_item_name);
     } elseif ($config_item_name == $default_value) {
         $this->default_value = '';
     } else {
         $this->default_value = $default_value;
     }
     $this->jscheck = $jscheck;
     if (preg_match("/variable/i", get_class($this))) {
         $this->prefix = "\$";
     } elseif (preg_match("/ini_set/i", get_class($this))) {
         $this->prefix = "ini_get: ";
     } else {
         $this->prefix = "";
     }
 }
コード例 #2
0
ファイル: configurator.php プロジェクト: neymanna/fusionforge
 function boolean_define($config_item_name, $values = false, $description = '', $jscheck = '')
 {
     $this->config_item_name = $config_item_name;
     if (!$description) {
         $description = text_from_dist($config_item_name);
     }
     $this->description = $description;
     // TESTME: get boolean default value from config-default.ini
     if (defined($config_item_name)) {
         $this->default_value = constant($config_item_name);
     } elseif (is_array($values)) {
         list($this->default_value, $dummy) = $values[0];
     }
     if (!$values) {
         $values = array('false' => "Disabled", 'true' => "Enabled");
     }
     $this->values = $values;
     $this->jscheck = $jscheck;
     $this->prefix = "";
 }