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


PHP AEUtilLogger::closeLog方法代码示例

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


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

示例1: execute


//.........这里部分代码省略.........
        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;
                $kettenrad->resetWarnings();
            }
            if ($this->input->get('quiet', -1, 'int') == -1 || $stepWarnings) {
                echo <<<ENDSTEPINFO
Last Tick   : {$time}
Domain      : {$array['Domain']}
Step        : {$array['Step']}
Substep     : {$array['Substep']}
Memory used : {$memusage}
Warnings    : {$warnings}


ENDSTEPINFO;
            }
        }
        // Clean up
        AEUtilTempvars::reset(AKEEBA_BACKUP_ORIGIN);
        if (!empty($array['Error'])) {
            echo "An error has occurred:\n{$array['Error']}\n\n";
            $exitCode = 2;
        } else {
            if ($this->input->get('quiet', -1, 'int') == -1) {
                echo "Backup job finished successfully after approximately " . $this->timeago($start_backup, time(), '', false) . "\n";
            }
            $exitCode = 0;
        }
        if ($warnings_flag && $this->input->get('quiet', -1, 'int') == -1) {
            $exitCode = 1;
            echo "\n" . str_repeat('=', 79) . "\n";
            echo "!!!!!  W A R N I N G  !!!!!\n\n";
            echo "Akeeba Backup issued warnings during the backup process. You have to review them\n";
            echo "and make sure that your backup has completed successfully. Always test a backup with\n";
            echo "warnings to make sure that it is working properly, by restoring it to a local server.\n";
            echo "DO NOT IGNORE THIS MESSAGE! AN UNTESTED BACKUP IS AS GOOD AS NO BACKUP AT ALL.\n";
            echo "\n" . str_repeat('=', 79) . "\n";
        } elseif ($warnings_flag) {
            $exitCode = 1;
        }
        if ($this->input->get('quiet', -1, 'int') == -1) {
            echo "Peak memory usage: " . $this->peakMemUsage() . "\n\n";
        }
        $this->close($exitCode);
    }
开发者ID:sillysachin,项目名称:teamtogether,代码行数:101,代码来源:akeeba-backup.php


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