本文整理汇总了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();
示例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();
}