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


PHP Installer::log方法代碼示例

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


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

示例1: foreach

    {
        $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($directory), \RecursiveIteratorIterator::CHILD_FIRST);
        /** @var \SplFileInfo $path */
        foreach ($iterator as $path) {
            if ($path->isDir()) {
                rmdir($path->getPathname());
            } else {
                unlink($path->getPathname());
            }
        }
        rmdir($directory);
    }
}
$installer = new Installer();
try {
    $installer->log('phpDocumentor installer for manual installations');
    if ($argv[1] == 'dev') {
        $installer->log('> Downloading development application from Github');
        $installer->downloadDevelopmentPhpDocumentorArchive();
    } else {
        $installer->log('> Downloading application from Github');
        $installer->downloadLatestPhpDocumentorArchive();
    }
    $installer->log('> Extracting application');
    $installer->extractPhpDocumentorToCurrentDirectory();
    $installer->log('> Preparing dependencies');
    $composer_location = '';
    if (!$installer->testForComposer()) {
        // composer is not installed, install it to a temporary directory
        $composer_location = sys_get_temp_dir();
        $installer->log();
開發者ID:nosenaoki,項目名稱:phpDocumentor2,代碼行數:31,代碼來源:installer.php

示例2: header

    global $installer;
    $error = error_get_last();
    if ($error['type'] == 1) {
        header('HTTP/1.1 500 Internal Server Error');
        $errorMsg = htmlspecialchars_decode(strip_tags($error['message']));
        echo $errorMsg;
        if (isset($installer)) {
            $installer->log('Fatal error: %s on line %s in file %s', $errorMsg, $error['line'], $error['file']);
        }
        exit;
    }
}
/*
 * Bootstrap the installer
 */
require_once 'Lang.php';
require_once 'InstallerException.php';
require_once 'InstallerRewrite.php';
require_once 'Installer.php';
try {
    $installer = new Installer();
    $installer->cleanLog();
    $installer->log('Host: %s', php_uname());
    $installer->log('PHP version: %s', PHP_VERSION);
    $installer->log('Server software: %s', isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : 'Unknown');
    $installer->log('Operating system: %s', PHP_OS);
    $installer->log('Memory limit: %s', ini_get('memory_limit'));
    $installer->log('Max execution time: %s', ini_get('max_execution_time'));
} catch (Exception $ex) {
    $fatalError = $ex->getMessage();
}
開發者ID:awaysoft,項目名稱:install,代碼行數:31,代碼來源:boot.php


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