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


PHP didThisStepRunBefore函数代码示例

本文整理汇总了PHP中didThisStepRunBefore函数的典型用法代码示例。如果您正苦于以下问题:PHP didThisStepRunBefore函数的具体用法?PHP didThisStepRunBefore怎么用?PHP didThisStepRunBefore使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: prepSystemForUpgrade

function prepSystemForUpgrade()
{
    global $sugar_config;
    global $sugar_flavor;
    global $mod_strings;
    global $current_language;
    global $subdirs;
    global $base_upgrade_dir;
    global $base_tmp_upgrade_dir;
    list($p_base_upgrade_dir, $p_base_tmp_upgrade_dir) = getUWDirs();
    ///////////////////////////////////////////////////////////////////////////////
    ////	Make sure variables exist
    if (empty($base_upgrade_dir)) {
        $base_upgrade_dir = $p_base_upgrade_dir;
    }
    if (empty($base_tmp_upgrade_dir)) {
        $base_tmp_upgrade_dir = $p_base_tmp_upgrade_dir;
    }
    sugar_mkdir($base_tmp_upgrade_dir, 0775, true);
    if (!isset($subdirs) || empty($subdirs)) {
        $subdirs = array('full', 'langpack', 'module', 'patch', 'theme');
    }
    $upgrade_progress_dir = $base_tmp_upgrade_dir;
    $upgrade_progress_file = $upgrade_progress_dir . '/upgrade_progress.php';
    if (file_exists($upgrade_progress_file)) {
        if (function_exists('get_upgrade_progress') && function_exists('didThisStepRunBefore')) {
            if (didThisStepRunBefore('end')) {
                include $upgrade_progress_file;
                unset($upgrade_config);
                unlink($upgrade_progress_file);
            }
        }
    }
    // increase the cuttoff time to 1 hour
    ini_set("max_execution_time", "3600");
    // make sure dirs exist
    if ($subdirs != null) {
        foreach ($subdirs as $subdir) {
            sugar_mkdir("{$base_upgrade_dir}/{$subdir}", 0775, true);
        }
    }
    // array of special scripts that are executed during (un)installation-- key is type of script, value is filename
    if (!defined('SUGARCRM_PRE_INSTALL_FILE')) {
        define('SUGARCRM_PRE_INSTALL_FILE', 'scripts/pre_install.php');
        define('SUGARCRM_POST_INSTALL_FILE', 'scripts/post_install.php');
        define('SUGARCRM_PRE_UNINSTALL_FILE', 'scripts/pre_uninstall.php');
        define('SUGARCRM_POST_UNINSTALL_FILE', 'scripts/post_uninstall.php');
    }
    $script_files = array("pre-install" => constant('SUGARCRM_PRE_INSTALL_FILE'), "post-install" => constant('SUGARCRM_POST_INSTALL_FILE'), "pre-uninstall" => constant('SUGARCRM_PRE_UNINSTALL_FILE'), "post-uninstall" => constant('SUGARCRM_POST_UNINSTALL_FILE'));
    // check that the upload limit is set to 6M or greater
    define('SUGARCRM_MIN_UPLOAD_MAX_FILESIZE_BYTES', 6 * 1024 * 1024);
    // 6 Megabytes
    $upload_max_filesize = ini_get('upload_max_filesize');
    $upload_max_filesize_bytes = return_bytes($upload_max_filesize);
    if ($upload_max_filesize_bytes < constant('SUGARCRM_MIN_UPLOAD_MAX_FILESIZE_BYTES')) {
        $GLOBALS['log']->debug("detected upload_max_filesize: {$upload_max_filesize}");
        $admin_strings = return_module_language($current_language, 'Administration');
        echo '<p class="error">' . $admin_strings['MSG_INCREASE_UPLOAD_MAX_FILESIZE'] . ' ' . get_cfg_var('cfg_file_path') . "</p>\n";
    }
}
开发者ID:omusico,项目名称:sugar_work,代码行数:60,代码来源:uw_utils.php

示例2: logThis

     logThis('Upgrade the sugar_version', $path);
     $sugar_config['sugar_version'] = $sugar_version;
     if ($destVersion == $origVersion) {
         require 'config.php';
     }
     if (!write_array_to_file("sugar_config", $sugar_config, "config.php")) {
         logThis('*** ERROR: could not write config.php! - upgrade will fail!', $path);
         $errors[] = 'Could not write config.php!';
     }
     logThis('post_install() done.', $path);
 }
 ///////////////////////////////////////////////////////////////////////////////
 ////	REGISTER UPGRADE
 if (empty($errors)) {
     logThis('Registering upgrade with UpgradeHistory', $path);
     if (!didThisStepRunBefore('commit', 'upgradeHistory')) {
         set_upgrade_progress('commit', 'in_progress', 'upgradeHistory', 'in_progress');
         $file_action = "copied";
         // if error was encountered, script should have died before now
         $new_upgrade = new UpgradeHistory();
         $new_upgrade->filename = $install_file;
         $new_upgrade->md5sum = md5_file($install_file);
         $new_upgrade->name = $zip_from_dir;
         $new_upgrade->description = $manifest['description'];
         $new_upgrade->type = 'patch';
         $new_upgrade->version = $sugar_version;
         $new_upgrade->status = "installed";
         $new_upgrade->manifest = !empty($_SESSION['install_manifest']) ? $_SESSION['install_manifest'] : '';
         if ($new_upgrade->description == null) {
             $new_upgrade->description = "Silent Upgrade was used to upgrade the instance";
         } else {
开发者ID:vsanth,项目名称:dynamic-crm,代码行数:31,代码来源:silentUpgrade_step1.php

示例3: clean_path

if (version_compare($sugar_version, '6.7.0', '<')) {
    require_once clean_path($unzip_dir . '/scripts/upgrade_utils.php');
    require_once $unzip_dir . '/' . $zip_from_dir . '/modules/Forecasts/ForecastsDefaults.php';
    ForecastsDefaults::setupForecastSettings(true, $sugar_version, getUpgradeVersion());
    ForecastsDefaults::upgradeColumns();
    // do the config update to add the 'support' platform to any config with the category of 'portal'
    updatePortalConfigToContainPlatform();
}
// Bug 57216 - Upgrade wizard dying on metadata upgrader because needed files were
// already called but news needed to replace them. This moves the metadata upgrader
// later in the process - rgonzalez
logThis('Checking for mobile/portal metadata upgrade...');
// 6.6 metadata enhancements for portal and wireless, should only be
// handled for upgrades FROM pre-6.6 to a version POST 6.6 and MUST be
// handled AFTER inclusion of the upgrade package files
if (!didThisStepRunBefore('commit', 'upgradePortalMobileMetadata')) {
    if (version_compare($sugar_version, '6.6.0', '<')) {
        if (file_exists('modules/UpgradeWizard/SidecarUpdate/SidecarMetaDataUpgrader.php')) {
            set_upgrade_progress('commit', 'in_progress', 'upgradePortalMobileMetadata', 'in_progress');
            logThis('Sidecar Upgrade: Preparing to upgrade metadata to 6.6.0 compatibility through the silent upgrader ...');
            require_once 'modules/UpgradeWizard/SidecarUpdate/SidecarMetaDataUpgrader.php';
            // Get the sidecar metadata upgrader
            logThis('Sidecar Upgrade: Instantiating the mobile/portal metadata upgrader ...');
            $smdUpgrader = new SidecarMetaDataUpgrader();
            // Run the upgrader
            logThis('Sidecar Upgrade: Beginning the mobile/portal metadata upgrade ...');
            $smdUpgrader->upgrade();
            logThis('Sidecar Upgrade: Mobile/portal metadata upgrade complete');
            // Log failures if any
            $failures = $smdUpgrader->getFailures();
            if (!empty($failures)) {
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:31,代码来源:silentUpgrade_step3.php


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