當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AEUtilLogger::openLog方法代碼示例

本文整理匯總了PHP中AEUtilLogger::openLog方法的典型用法代碼示例。如果您正苦於以下問題:PHP AEUtilLogger::openLog方法的具體用法?PHP AEUtilLogger::openLog怎麽用?PHP AEUtilLogger::openLog使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AEUtilLogger的用法示例。


在下文中一共展示了AEUtilLogger::openLog方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

 /**
  * Loads the factory from the storage (if it exists) and returns a reference to the
  * Kettenrad object.
  *
  * @param $tag string The backup tag to load
  *
  * @return AECoreKettenrad A reference to the Kettenrad object
  */
 public static function &load($tag = null)
 {
     if (is_null($tag) && defined('AKEEBA_BACKUP_ORIGIN')) {
         $tag = AKEEBA_BACKUP_ORIGIN;
     }
     // In order to load anything, we need to have the correct profile loaded. Let's assume
     // that the latest backup record in this tag has the correct profile number set.
     $config = AEFactory::getConfiguration();
     if (empty($config->activeProfile)) {
         // Only bother loading a configuration if none has been already loaded
         $statList = AEPlatform::getInstance()->get_statistics_list(array('filters' => array(array('field' => 'tag', 'value' => $tag)), 'order' => array('by' => 'id', 'order' => 'DESC')));
         if (is_array($statList)) {
             $stat = array_pop($statList);
             $profile = $stat['profile_id'];
             AEPlatform::getInstance()->load_configuration($profile);
         }
     }
     AEUtilLogger::openLog($tag);
     AEUtilLogger::WriteLog(_AE_LOG_DEBUG, "Kettenrad :: Attempting to load from database ({$tag})");
     $serialized_factory = AEUtilTempvars::get($tag);
     if ($serialized_factory !== false) {
         AEUtilLogger::WriteLog(_AE_LOG_DEBUG, " -- Loaded stored Akeeba Factory ({$tag})");
         AEFactory::unserialize($serialized_factory);
     } else {
         // There is no serialized factory. Nuke the in-memory factory.
         AEUtilLogger::WriteLog(_AE_LOG_DEBUG, " -- Stored Akeeba Factory ({$tag}) not found - hard reset");
         AEFactory::nuke();
         AEPlatform::getInstance()->load_configuration();
     }
     unset($serialized_factory);
     return AEFactory::getKettenrad();
 }
開發者ID:greyhat777,項目名稱:vuslinterliga,代碼行數:40,代碼來源:kettenrad.php

示例2: execute


//.........這裏部分代碼省略.........
                echo "Backup engine returned an error. Technical information:\n";
                echo "Error message:\n\n";
                echo $e->getMessage() . "\n\n";
                echo "Path to " . basename(__FILE__) . ":" . __DIR__ . "\n";
                echo "Path to factory file: {$factoryPath}\n";
                die("\n");
            }
        }
        // Forced CLI mode settings
        define('AKEEBA_PROFILE', $profile);
        define('AKEEBA_BACKUP_ORIGIN', 'cli');
        // Force loading CLI-mode translation class
        $dummy = new AEUtilTranslate();
        // Load the profile
        AEPlatform::getInstance()->load_configuration($profile);
        // Reset Kettenrad and its storage
        AECoreKettenrad::reset(array('maxrun' => 0));
        AEUtilTempvars::reset(AKEEBA_BACKUP_ORIGIN);
        // Setup
        $kettenrad = AEFactory::getKettenrad();
        $options = array('description' => $description, 'comment' => '');
        if (!empty($overrides)) {
            AEPlatform::getInstance()->configOverrides = $overrides;
        }
        $kettenrad->setup($options);
        // Dummy array so that the loop iterates once
        $array = array('HasRun' => 0, 'Error' => '');
        $warnings_flag = false;
        while ($array['HasRun'] != 1 && empty($array['Error'])) {
            // Recycle the database conenction to minimise problems with database timeouts
            $db = AEFactory::getDatabase();
            $db->close();
            $db->open();
            AEUtilLogger::openLog(AKEEBA_BACKUP_ORIGIN);
            AEUtilLogger::WriteLog(true, '');
            // Apply overrides in the command line
            if (!empty($overrides)) {
                $config = AEFactory::getConfiguration();
                foreach ($overrides as $key => $value) {
                    $config->set($key, $value);
                }
            }
            // Apply engine optimization overrides
            $config = AEFactory::getConfiguration();
            $config->set('akeeba.tuning.min_exec_time', 0);
            $config->set('akeeba.tuning.nobreak.beforelargefile', 1);
            $config->set('akeeba.tuning.nobreak.afterlargefile', 1);
            $config->set('akeeba.tuning.nobreak.proactive', 1);
            $config->set('akeeba.tuning.nobreak.finalization', 1);
            $config->set('akeeba.tuning.settimelimit', 0);
            $config->set('akeeba.tuning.nobreak.domains', 0);
            $kettenrad->tick();
            AEFactory::getTimer()->resetTime();
            $array = $kettenrad->getStatusArray();
            AEUtilLogger::closeLog();
            $time = date('Y-m-d H:i:s \\G\\M\\TO (T)');
            $memusage = $this->memUsage();
            $warnings = "no warnings issued (good)";
            $stepWarnings = false;
            if (!empty($array['Warnings'])) {
                $warnings_flag = true;
                $warnings = "POTENTIAL PROBLEMS DETECTED; " . count($array['Warnings']) . " warnings issued (see below).\n";
                foreach ($array['Warnings'] as $line) {
                    $warnings .= "\t{$line}\n";
                }
                $stepWarnings = true;
開發者ID:sillysachin,項目名稱:teamtogether,代碼行數:67,代碼來源:akeeba-backup.php


注:本文中的AEUtilLogger::openLog方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。