本文整理匯總了PHP中Zend_Log::ERR方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Log::ERR方法的具體用法?PHP Zend_Log::ERR怎麽用?PHP Zend_Log::ERR使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Log
的用法示例。
在下文中一共展示了Zend_Log::ERR方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: importegw14
/**
* import from egroupware
*
* @param Zend_Console_Getopt $_opts
*/
public function importegw14($_opts)
{
$args = $_opts->getRemainingArgs();
if (count($args) < 1 || !is_readable($args[0])) {
echo "can not open config file \n";
echo "see tine20.org/wiki/EGW_Migration_Howto for details \n\n";
echo "usage: ./tine20.php --method=Appname.importegw14 /path/to/config.ini (see Tinebase/Setup/Import/Egw14/config.ini)\n\n";
exit(1);
}
try {
$config = new Zend_Config_Ini($args[0]);
if ($config->{strtolower($this->_applicationName)}) {
$config = $config->{strtolower($this->_applicationName)};
}
} catch (Zend_Config_Exception $e) {
fwrite(STDERR, "Error while parsing config file({$args['0']}) " . $e->getMessage() . PHP_EOL);
exit(1);
}
$writer = new Zend_Log_Writer_Stream('php://output');
$logger = new Zend_Log($writer);
$filter = new Zend_Log_Filter_Priority((int) $config->loglevel);
$logger->addFilter($filter);
$class_name = $this->_applicationName . '_Setup_Import_Egw14';
if (!class_exists($class_name)) {
$logger->ERR(__METHOD__ . '::' . __LINE__ . " no import for {$this->_applicationName} available");
exit(1);
}
try {
$importer = new $class_name($config, $logger);
$importer->import();
} catch (Exception $e) {
$logger->ERR(__METHOD__ . '::' . __LINE__ . " import for {$this->_applicationName} failed " . $e->getMessage());
}
}