当前位置: 首页>>代码示例>>PHP>>正文


PHP Constants::codevRootDir方法代码示例

本文整理汇总了PHP中Constants::codevRootDir方法的典型用法代码示例。如果您正苦于以下问题:PHP Constants::codevRootDir方法的具体用法?PHP Constants::codevRootDir怎么用?PHP Constants::codevRootDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Constants的用法示例。


在下文中一共展示了Constants::codevRootDir方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createConstantsFile

/**
 * Creates constants.php that contains variable
 * definitions that the codev admin may want to tune.
 *
 * WARN: depending on your HTTP server installation, the file may be created
 * by user 'apache', so be sure that this user has write access
 * to the CoDev install directory
 *
 * @return NULL if OK, or an error message starting with 'ERROR' .
 */
function createConstantsFile($mantisPath, $mantisURL, $codevURL)
{
    // --- general ---
    Constants::$homepage_title = 'Welcome';
    Constants::$codevURL = $codevURL;
    Constants::$mantisURL = $mantisURL;
    Constants::$mantisPath = $mantisPath;
    Constants::$codevRootDir = dirname(dirname(__FILE__));
    Constants::$codevtt_logfile = Constants::$codevRootDir . '/codevtt.log';
    // --- database ---
    // already set...
    // --- mantis ---
    // already set...
    // --- status ---
    $status_new = array_search('new', Constants::$statusNames);
    $status_feedback = array_search('feedback', Constants::$statusNames);
    #$status_acknowledged = array_search('acknowledged', Constants::$statusNames);
    $status_open = array_search('open', Constants::$statusNames);
    $status_closed = array_search('closed', Constants::$statusNames);
    Constants::$status_new = $status_new;
    Constants::$status_feedback = $status_feedback;
    Constants::$status_open = NULL != $status_open ? $status_open : 50;
    // (50 = 'assigned' in default mantis workflow)
    Constants::$status_closed = $status_closed;
    // --- resolution ---
    Constants::$resolution_fixed = array_search('fixed', Constants::$resolution_names);
    Constants::$resolution_reopened = array_search('reopened', Constants::$resolution_names);
    // --- relationships ---
    define('BUG_CUSTOM_RELATIONSHIP_CONSTRAINED_BY', 2500);
    define('BUG_CUSTOM_RELATIONSHIP_CONSTRAINS', 2501);
    Constants::$relationship_constrained_by = 2500;
    Constants::$relationship_constrains = 2501;
    $retCode = Constants::writeConfigFile();
    if (!$retCode) {
        // TODO throw exception...
        return "ERROR: Could not create file " . Constants::$config_file;
    }
    return NULL;
}
开发者ID:dfuzeau,项目名称:codev,代码行数:49,代码来源:install_step2.php

示例2: parseConfigFile

 /**
  * get config from ini file
  */
 public static function parseConfigFile()
 {
     // TODO workaround
     $file = self::$config_file;
     if (!file_exists($file)) {
         if (!self::$quiet) {
             self::$logger->error("ERROR: parseConfigFile() file " . $file . " NOT found !");
             echo "ERROR: parseConfigFile() file " . $file . " NOT found !";
         }
         return FALSE;
     }
     $ini_array = parse_ini_file($file, true);
     #print_r($ini_array);
     $general = $ini_array['general'];
     self::$codevInstall_timestamp = $general['codevInstall_timestamp'];
     self::$codevtt_logfile = $general['codevtt_logfile'];
     self::$codevOutputDir = $general['codevtt_output_dir'];
     self::$homepage_title = $general['homepage_title'];
     if (array_key_exists('logo_image', $general)) {
         self::$logoImage = $general['logo_image'];
     }
     self::$codevURL = $general['codevtt_url'];
     self::$codevRootDir = $general['codevtt_dir'];
     self::$mantisPath = $general['mantis_dir'];
     self::$mantisURL = $general['mantis_url'];
     $database = $ini_array['database'];
     self::$db_mantis_host = $database['db_mantis_host'];
     self::$db_mantis_database = $database['db_mantis_database'];
     self::$db_mantis_user = $database['db_mantis_user'];
     self::$db_mantis_pass = $database['db_mantis_pass'];
     $mantis = $ini_array['mantis'];
     self::$statusNames = Tools::doubleExplode(':', ',', $mantis['status_enum_string']);
     self::$priority_names = Tools::doubleExplode(':', ',', $mantis['priority_enum_string']);
     self::$resolution_names = Tools::doubleExplode(':', ',', $mantis['resolution_enum_string']);
     self::$severity_names = Tools::doubleExplode(':', ',', $mantis['severity_enum_string']);
     self::$bug_resolved_status_threshold = $mantis['bug_resolved_status_threshold'];
     self::$status_enum_workflow = json_decode($mantis['status_enum_workflow'], true);
     // jsonStr to array
     $status = $ini_array['status'];
     self::$status_new = $status['status_new'];
     self::$status_feedback = $status['status_feedback'];
     #self::$status_acknowledged = $status['status_acknowledged'];
     self::$status_open = $status['status_open'];
     self::$status_closed = $status['status_closed'];
     $resolution = $ini_array['resolution'];
     self::$resolution_fixed = $resolution['resolution_fixed'];
     self::$resolution_reopened = $resolution['resolution_reopened'];
     $relationships = $ini_array['relationships'];
     self::$relationship_constrained_by = $relationships['relationship_constrained_by'];
     self::$relationship_constrains = $relationships['relationship_constrains'];
     define('BUG_CUSTOM_RELATIONSHIP_CONSTRAINED_BY', $relationships['relationship_constrained_by']);
     define('BUG_CUSTOM_RELATIONSHIP_CONSTRAINS', $relationships['relationship_constrains']);
     $perf = $ini_array['perf'];
     if ($perf != null && array_key_exists('max_tooltips_per_page', $perf)) {
         self::$maxTooltipsPerPage = $perf['max_tooltips_per_page'];
     }
     $doodles = $ini_array['doodles'];
     if (is_array($doodles)) {
         $today = date("md");
         self::$doodles = array();
         // remove default doodles
         foreach ($doodles as $key => $value) {
             self::$doodles[$key] = $value;
             if (substr($key, 0, 11) === 'logo_image_' && (substr($key, 11, 4) <= $today && substr($key, 16, 4) >= $today) && file_exists(self::$codevRootDir . DIRECTORY_SEPARATOR . $value)) {
                 self::$logoImage = $value;
             }
         }
     }
     $timesheets = $ini_array['timesheets'];
     if (null != $timesheets && array_key_exists('task_duration_list', $timesheets)) {
         self::$taskDurationList = Tools::doubleExplode(':', ',', $timesheets['task_duration_list']);
     }
     $internet = $ini_array['internet'];
     if (is_array($internet)) {
         if (array_key_exists('proxy', $internet)) {
             self::$proxy = $internet['proxy'];
         }
         if (array_key_exists('check_latest_version', $internet)) {
             self::$isCheckLatestVersion = $internet['check_latest_version'];
         }
     }
     $dashboards = $ini_array['dashboardDefaultPlugins'];
     if (is_array($dashboards)) {
         foreach ($dashboards as $domain => $plugins) {
             self::$dashboardDefaultPlugins[$domain] = explode(',', $plugins);
         }
     }
     $emailSettings = $ini_array['email'];
     if (is_array($emailSettings)) {
         foreach ($emailSettings as $key => $val) {
             self::$emailSettings[$key] = $val;
         }
     }
     // -----
     /* FIXME WORKAROUND: SQL procedures still use codev_config_table.bug_resolved_status_threshold ! */
     $desc = "bug resolved threshold as defined in Mantis (g_bug_resolved_status_threshold)";
     self::$logger->warn("WORKAROUND update codev_config_table.bug_resolved_status_threshold = " . self::$bug_resolved_status_threshold);
//.........这里部分代码省略.........
开发者ID:siebrand,项目名称:codev,代码行数:101,代码来源:constants.class.php


注:本文中的Constants::codevRootDir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。