本文整理汇总了PHP中Scalr::errorHandler方法的典型用法代码示例。如果您正苦于以下问题:PHP Scalr::errorHandler方法的具体用法?PHP Scalr::errorHandler怎么用?PHP Scalr::errorHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scalr
的用法示例。
在下文中一共展示了Scalr::errorHandler方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run1
protected function run1($stage)
{
$this->console->out(sprintf("Reencrypting %s database from %s/%s to %s/%s!", \Scalr::getContainer()->config->get('scalr.connections.mysql.name'), $this->source->getCryptoAlgo(), $this->source->getCipherMode(), $this->target->getCryptoAlgo(), $this->target->getCipherMode()));
set_error_handler(function ($code, $message, $file, $line, $context) {
\Scalr::errorHandler($code, $message, $file, $line, $context);
if ($code == E_STRICT) {
throw new Exception($message);
}
}, E_USER_ERROR | E_STRICT | E_RECOVERABLE_ERROR | E_ERROR);
try {
$this->db->Execute('START TRANSACTION;');
$this->recrypt('ssh_keys', ['private_key', 'public_key']);
$this->recrypt('services_ssl_certs', ['ssl_pkey', 'ssl_pkey_password']);
$this->recrypt('account_user_settings', ['value'], "WHERE `name` = 'security.2fa.ggl.key'", ['user_id', 'name']);
$this->recrypt('services_chef_servers', ['auth_key', 'v_auth_key']);
$this->recrypt('variables', ['value'], '', ['name'], $this->globals);
$this->recrypt('account_variables', ['value'], '', ['name', 'account_id'], $this->globals);
$this->recrypt('client_environment_variables', ['value'], '', ['name', 'env_id'], $this->globals);
$this->recrypt('role_variables', ['value'], '', ['name', 'role_id'], $this->globals);
$this->recrypt('farm_variables', ['value'], '', ['name', 'farm_id'], $this->globals);
$this->recrypt('farm_role_variables', ['value'], '', ['name', 'farm_role_id'], $this->globals);
$this->recrypt('server_variables', ['value'], '', ['name', 'server_id'], $this->globals);
$reflection = new ReflectionClass('Scalr_Environment');
$method = $reflection->getMethod('getEncryptedVariables');
$method->setAccessible(true);
$this->recrypt('client_environment_properties', ['value'], "WHERE `name` IN ('" . implode("','", array_keys($method->invoke(null))) . "')");
$this->db->Execute("COMMIT;");
} catch (\Exception $e) {
$this->rollback($e->getCode(), $e->getMessage());
restore_error_handler();
throw $e;
}
restore_error_handler();
}