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


PHP Configurator::readOverride方法代码示例

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


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

示例1: post_install

function post_install()
{
    // create directory for external contract pdf files
    $externalContractsPdfDir = "{$GLOBALS['sugar_config']['cache_dir']}/modules/Emails/attachments/";
    mkdir_recursive($externalContractsPdfDir);
    if (file_exists($externalContractsPdfDir)) {
        $GLOBALS['log']->debug("Successfully created directory '{$externalContractsPdfDir}'");
    } else {
        $GLOBALS['log']->fatal("Could not create directory for creation of pdf files: '{$externalContractsPdfDir}'");
    }
    global $sugar_config;
    global $sugar_version;
    $module_list = array('oqc_TextBlock', 'oqc_Offering', 'oqc_Product', 'oqc_Contract', 'oqc_ExternalContract', 'oqc_ProductCatalog', 'oqc_Addition', 'oqc_Task');
    // Add banning of AjaxUI for openqc modules
    require_once 'modules/Configurator/Configurator.php';
    $cfg = new Configurator();
    $overrideArray = $cfg->readOverride();
    if (array_key_exists('addAjaxBannedModules', $overrideArray)) {
        $disabled_modules = $overrideArray['addAjaxBannedModules'];
        $updatedArray = array_merge($disabled_modules, array_diff($module_list, $disabled_modules));
    } else {
        $updatedArray = $module_list;
    }
    $cfg->config['addAjaxBannedModules'] = empty($updatedArray) ? FALSE : $updatedArray;
    $cfg->handleOverride();
    // Configure documents.properties file depending on OS. There is three choices atm
    //1. Default- Linux (OpenSuse, Ubuntu); 2. WinXP; 3. MACOSX
    $oqc_config_directory = 'include/oqc/conf/';
    if (strtoupper(substr(php_uname('s'), 0, 3)) === 'WIN') {
        if (file_exists($oqc_config_directory . 'documents_linux.properties')) {
            unlink($oqc_config_directory . 'documents_linux.properties');
        }
        rename($oqc_config_directory . 'documents.properties', $oqc_config_directory . 'documents_linux.properties');
        rename($oqc_config_directory . 'documents_windows.properties', $oqc_config_directory . 'documents.properties');
    } elseif (strtoupper(substr(php_uname('s'), 0, 3)) === 'DAR') {
        if (file_exists($oqc_config_directory . 'documents_linux.properties')) {
            unlink($oqc_config_directory . 'documents_linux.properties');
        }
        rename($oqc_config_directory . 'documents.properties', $oqc_config_directory . 'documents_linux.properties');
        rename($oqc_config_directory . 'documents_macosx.properties', $oqc_config_directory . 'documents.properties');
    }
    //Do some sanity checks before installing scheduler file if sugar version is lower than 6.3
    if (floatval(substr($sugar_version, 0, 3)) < 6.3) {
        $scheduler_directory = 'custom/modules/Schedulers/';
        if (file_exists($scheduler_directory . '_AddJobsHere.php')) {
            //rename existing file; User can merge oqc file with original one manually
            if (file_exists($scheduler_directory . '_AddJobsHere_original.php')) {
                unlink($scheduler_directory . '_AddJobsHere_original.php');
            }
            rename($scheduler_directory . '_AddJobsHere.php', $scheduler_directory . '_AddJobsHere_original.php');
        }
        rename($scheduler_directory . 'oqc_AddJobsHere.php', $scheduler_directory . '_AddJobsHere.php');
    }
    // Rebuild Roles after install
    require_once 'modules/ACL/install_actions.php';
    //Last, Do a Quick Repair & Rebuild
    $module = array('All Modules');
    $selected_actions = array('clearAll');
    require_once 'modules/Administration/QuickRepairAndRebuild.php';
    $randc = new RepairAndClear();
    $randc->repairAndClearAll($selected_actions, $module, false, false);
}
开发者ID:santara12,项目名称:OpenQuotesAndContracts,代码行数:62,代码来源:post_install.php


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