本文整理汇总了PHP中Debug::writeError方法的典型用法代码示例。如果您正苦于以下问题:PHP Debug::writeError方法的具体用法?PHP Debug::writeError怎么用?PHP Debug::writeError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debug
的用法示例。
在下文中一共展示了Debug::writeError方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveCache
function saveCache()
{
$cache_file = $this->getCacheFile();
$fp = fopen($cache_file, 'w+');
if ($fp === false)
{
Debug :: writeError("Couldn't create cache file '{$cache_file}', perhaps wrong permissions",
__FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
return;
}
fwrite($fp, "<?php\n");
fwrite($fp, '$cache_resolved_paths = ' . var_export($this->_resolved_paths, true) . ";\n");
fwrite($fp, "\n?>");
fclose($fp);
}
示例2: _browseToHomePage
protected function _browseToHomePage()
{
$ch = curlInit();
curlSetopt($ch, CURLOPT_URL, SHIPPING_FEDEX_HOME_SERVER);
curlSetopt($ch, CURLOPT_USERAGENT, SHIPPING_FEDEX_SERVER_USERAGENT);
curlSetopt($ch, CURLOPT_FAILONERROR, 1);
curlSetopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curlSetopt($ch, CURLOPT_TIMEOUT, SHIPPING_FEDEX_SERVER_TIMEOUT);
curlSetopt($ch, CURLOPT_COOKIEJAR, SHIPPING_FEDEX_SERVER_COOKIE_FILE);
curlSetopt($ch, CURLOPT_RETURNTRANSFER, 1);
curlExec($ch);
if (curlErrno($ch) != 0) {
Debug::writeError('curl error', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('error' => curlError($ch)));
curlClose($ch);
return false;
}
curlClose($ch);
return true;
}
示例3: writeException
function writeException($e)
{
if(is_a($e, 'LimbException'))
Debug :: writeError($e->getMessage(), $e->getBacktrace(), $e->getAdditionalParams());
else
Debug :: writeError($e->getMessage(), $e->getBacktrace());
}
示例4: _parseString
function _parseString(&$contents)
{
$lines =& preg_split("#\r\n|\r|\n#", $contents);
unset($contents);
if ($lines === false)
{
Debug::writeError("'{$this->file_path}' is empty", __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
return false;
}
$current_group = 'default';
if (count($lines) == 0)
return false;
// check for charset
if (preg_match("/#charset[^=]*=(.+)/", $lines[0], $match))
{
$this->charset = trim($match[1]);
}
foreach ($lines as $line)
{
if (($line = trim($line)) == '')
continue;
// removing comments after #, not after # inside ""
$line = preg_replace('/([^"#]+|"(.*?)")|(#[^#]*)/', "\\1", $line);
// check for new group
if (preg_match("#^\[(.+)\]\s*$#", $line, $new_group_name_array))
{
$new_group_name = trim($new_group_name_array[1]);
$current_group = $this->_parseConstants($new_group_name);
if(!isset($this->group_values[$current_group]))
$this->group_values[$current_group] = array();
continue;
}
// check for variable
if (preg_match("#^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_-]*)\]){0,1}(\s*)=(.*)$#", $line, $value_array))
{
$var_name = trim($value_array[1]);
$var_value = trim($value_array[5]);
if (preg_match('/^"(.*)"$/', $var_value, $m))
$var_value = $m[1];
$var_value = $this->_parseConstants($var_value);
if ($value_array[2])//check for array []
{
if ($value_array[3]) //check for hashed array ['test']
{
$key_name = $value_array[3];
if (isset($this->group_values[$current_group][$var_name]) &&
is_array($this->group_values[$current_group][$var_name]))
$this->group_values[$current_group][$var_name][$key_name] = $var_value;
else
$this->group_values[$current_group][$var_name] = array($key_name => $var_value);
}
else
{
if (isset($this->group_values[$current_group][$var_name]) &&
is_array($this->group_values[$current_group][$var_name]))
$this->group_values[$current_group][$var_name][] = $var_value;
else
$this->group_values[$current_group][$var_name] = array($var_value);
}
}
else
{
$this->group_values[$current_group][$var_name] = $var_value;
}
}
}
}
示例5: writeException
static public function writeException($e)
{
if($e instanceof LimbException)
Debug :: writeError($e->getMessage(), $e->getFile() . ' : ' . $e->getLine(), $e->getAdditionalParams());
else
Debug :: writeError($e->getMessage(), $e->getFile() . ' : ' . $e->getLine());
}