本文整理汇总了PHP中Error::logError方法的典型用法代码示例。如果您正苦于以下问题:PHP Error::logError方法的具体用法?PHP Error::logError怎么用?PHP Error::logError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Error
的用法示例。
在下文中一共展示了Error::logError方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printPage
public function printPage()
{
if ($this->prepared) {
/* $uri_address = $this->page->address['uri_address'];
if(!substr_count($uri_address,'.html'))
{
$dirname=LOCAL_PATH.'cache/cache'.$uri_address.((substr($uri_address,-1) != '/') ? '/':'');
$filename='index';
$extension='.html';
}
else
{
$dirname=LOCAL_PATH.'cache/cache'.$dirname.((substr($dirname,-1) != '/') ? '/':'');
$filename.='.';
}
$cache_uri_address = $dirname.$filename.$extension;
*/
// $content = file_get_contents(LOCAL_PATH.'cache/'.$this->page->getPageId(), FALSE);
$content = file_get_contents($this->cache_uri_address, FALSE);
if ($content === FALSE) {
Error::logError('CachedPageHandler - Bad permission', 'There is no permition to read cache content from file "' . $this->cache_uri_address . '".');
return FALSE;
}
foreach ($this->page->getHeaders() as $header) {
header($header);
}
print $content;
return TRUE;
}
return FALSE;
}
示例2: get
public static function get($index)
{
$instance = self::getInstance();
if (!$instance->offsetExists($index)) {
Error::logError('No entry is registered for key ' . $index);
throw new VException('No entry is registered for key ' . $index);
}
return $instance->offsetGet($index);
}
示例3: addHeader
public function addHeader($headerBody)
{
$headerBody = trim($headerBody);
if (strlen($headerBody)) {
// checking for "Location" header - it must be the last one
$hasLocation = FALSE;
if (substr_count($this->headers[$tsize], 'Location:')) {
$hasLocation = TRUE;
}
if (substr_count($headerBody, 'Location:')) {
if ($hasLocation) {
Error::logError('Page.addHeader error', 'Error while adding header - "Location" header already exist', __FILE__, __LINE__);
return FALSE;
}
array_push($this->headers, $headerBody);
return TRUE;
}
// checking for "HTTP" header (t.e. "HTTP/1.0 404 Not Found") - it must be the first one
$hasHTTP = FALSE;
if (substr_count($this->headers[$tsize], 'HTTP')) {
$hasHTTP = TRUE;
}
if (substr_count($headerBody, 'HTTP')) {
if ($hasHTTP) {
Error::logError('Page.addHeader error', 'Error while adding header - "HTTP" header already exist', __FILE__, __LINE__);
return FALSE;
}
$this->headers = array_merge((array) $headerBody, $this->headers);
return TRUE;
}
// cheking for identical headers
if (array_search($headerBody, $this->headers[$i]) !== FALSE) {
Error::logError('Page.addHeader error', 'Error while adding header - header "' . $headerBody . '" already exist', __FILE__, __LINE__);
return FALSE;
}
$tsize = sizeof($this->headers);
if ($hasLocation) {
$this->headers = array_merge(array_slice($this->headers, 0, $tsize - 1), (array) $headerBody, (array) $this->headers[$tsize]);
} else {
array_push($this->headers, $headerBody);
}
return TRUE;
}
}
示例4: _connect
private function _connect()
{
if (is_resource($this->_connection)) {
return;
}
if (!empty($this->_settings['port'])) {
$this->_settings['host'] .= ':' . $this->_settings['port'];
}
$this->_connection = mysql_connect($this->_settings['host'], $this->_settings['username'], $this->_settings['password']);
if ($this->_connection === FALSE || mysql_errno()) {
Error::logError('Fail to connect to database.', mysql_error());
throw new VException(mysql_error());
}
if (!mysql_select_db($this->_settings['dbname'], $this->_connection)) {
Error::logError('Fail to select database "' . $this->_settings['dbname'] . '". ', mysql_error($this->_connection));
throw new VException(mysql_error($this->_connection));
}
if (!empty($this->_settings['charset'])) {
mysql_query('SET NAMES ' . $this->_settings['charset'], $this->_connection);
}
}
示例5: _get_few_data
public static function _get_few_data($name, $fields_arr = '*', $where_arr = array(), $num_page = '*', $order_arr = array('id' => 'ASC'))
{
$name = trim($name);
$resResult = array();
if (strlen($name)) {
if (!isset(self::getInstance()->queries[$name])) {
$resResult = self::getInstance()->_adapter->get_few_data($fields_arr, $where_arr, $num_page, $order_arr);
} else {
Error::logError('Execute Query Error', 'The unfetched query with the name "' . $name . '" already exist.');
}
if ($resResult) {
self::getInstance()->queries[$name] = $resResult;
}
} else {
Error::logError('Execute Query or Name Missing', 'The query or name parameter was empty, please provide a name for the query.');
}
return $resResult;
}
示例6: add_data
public function add_data()
{
$result = false;
$data_info = $this->check_post();
$fields_arr = $this->exist_field();
if (count($data_info) > 0) {
$keys = '';
$values = '';
foreach ($data_info as $key => $value) {
if (isset($fields_arr[$key])) {
if (!empty($keys)) {
$keys .= ',';
$values .= ',';
}
$keys .= " {$key}";
$values .= " " . $this->_quote(is_array($value) ? implode(',', $value) : $value) . ' ';
}
}
if (isset($fields_arr['date']) && !isset($data_info['date'])) {
$keys .= ", date";
$values .= ", NOW()";
}
if (isset($fields_arr['ip']) && !isset($data_info['ip'])) {
$keys .= ", ip";
$values .= ", '" . $_SERVER['REMOTE_ADDR'] . "'";
}
$sql = "INSERT INTO " . $this->table_name . "\n\t\t\t( {$keys} )\n\t\t\tVALUES ( {$values} )";
// var_dump($sql);
$this->_connect();
if ($res = $this->_connection->query($sql, false)) {
$result = $this->lastInsertId();
$res->close();
} else {
Error::logError('Query Failed', 'Q: ' . $sql . "\n" . $this->_connection->error);
}
}
$this->closeConnection();
//garbagecat76 06.01.2010
return $result;
}
示例7: log
public static function log($value, $module = NULL, $funcName = NULL, $extraInfo = NULL)
{
if ((bool) PHPWS_LOG_ERRORS == FALSE) {
return;
}
if (!PHPWS_Error::isError($value)) {
$error = PHPWS_Error::get($value, $module, $funcName, $extraInfo);
} else {
$error = $value;
}
$final = PHPWS_Error::printError($error);
Error::logError($final);
}