本文整理汇总了PHP中Container::getErrorLogger方法的典型用法代码示例。如果您正苦于以下问题:PHP Container::getErrorLogger方法的具体用法?PHP Container::getErrorLogger怎么用?PHP Container::getErrorLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Container
的用法示例。
在下文中一共展示了Container::getErrorLogger方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configure
public function configure()
{
if (!$this->changeUser()) {
return;
}
if ($this->container->getConfig()->get('app.debug')) {
error_reporting(E_ALL);
ini_set('display_errors', "On");
} else {
$errorHandler = new ErrorHandler($this->container->getErrorLogger());
set_error_handler([$errorHandler, 'error']);
set_exception_handler([$errorHandler, 'exception']);
register_shutdown_function([$errorHandler, 'shutdown']);
}
}
示例2: configure
public function configure()
{
$config = $this->container->getConfig();
if ($config->get('app.timezone')) {
date_default_timezone_set($config->get('app.timezone'));
}
if ($this->container->getConfig()->get('app.debug')) {
error_reporting(E_ALL);
ini_set('display_errors', "On");
} else {
$errorHandler = new ErrorHandler($this->container->getErrorLogger());
set_error_handler([$errorHandler, 'error']);
set_exception_handler([$errorHandler, 'exception']);
register_shutdown_function([$errorHandler, 'shutdown']);
}
}
示例3: Container
<?php
use Bravicility\Failure\FailureHandler;
use FileSystem\Dearchiver;
use FileSystem\Directory;
use DataSource\XmlReader;
require_once __DIR__ . '/../vendor/autoload.php';
$container = new Container();
$db = $container->getDb();
$logger = $container->getErrorLogger();
FailureHandler::setup(function ($error) use($logger) {
$logger->error($error['message'], $error);
fwrite(STDERR, "В процессе инициализации произошла ошибка:\n{$error['message']}\n");
exit(1);
});
$db->start();
if ($_SERVER['argc'] == 2) {
$path = $_SERVER['argv']['1'];
if (!is_dir($path)) {
$path = Dearchiver::extract($container->getFileDirectory(), $path);
}
$directory = new Directory($path);
} else {
$loader = $container->getUpdateLoader();
$directory = $loader->load();
}
$oldVersionId = UpdateLogHelper::getLastVersionId($db);
$newVersionId = $directory->getVersionId();
if ($newVersionId != $oldVersionId + 1) {
throw new \LogicException("Попытка обновления с версии {$oldVersionId} на версию {$newVersionId}.");
}