本文整理汇总了PHP中error::Ret方法的典型用法代码示例。如果您正苦于以下问题:PHP error::Ret方法的具体用法?PHP error::Ret怎么用?PHP error::Ret使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类error
的用法示例。
在下文中一共展示了error::Ret方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: breathe_shutdown_function
/**
*
*/
function breathe_shutdown_function()
{
$error = error_get_last();
if ($error !== null) {
error::Ret()->Log('breathe_shutdown_function: ' . print_r($error, true));
}
}
示例2: Run
public function Run()
{
if (layout::Ret()->Ready() and $this->output) {
$this->output .= layout::Ret()->Display();
error::Ret()->Warn("Output found from action - " . stack::Ret()->GetAction() . " - and layout - " . layout::Ret()->GetTemplate());
} elseif (layout::Ret()->Ready()) {
$this->output = layout::Ret()->Display();
}
return $this->output;
}
示例3: Set
public function Set($option)
{
// $this->Reset(array('selected'));
$this->selected = array('home' => '', 'about' => '');
if (isset($this->selected[$option])) {
$this->selected[$option] = ' class="selected"';
return $this;
} else {
error::Ret()->Log('Invalid menu option selected(' . $option . ')');
return null;
}
}
示例4: Check
/**
*
* @param type $key
* @param type $default
* @param type $type
* @return type
*/
public function Check($key, $default = null, $type = 'REQUEST')
{
switch (strtoupper($type)) {
case "POST":
return isset($_POST[$key]) ? $_POST[$key] : $default;
break;
case "GET":
return isset($_GET[$key]) ? $_GET[$key] : $default;
break;
case "REQUEST":
return isset($_REQUEST[$key]) ? $_REQUEST[$key] : $default;
break;
case "FILES":
return isset($_FILES[$key]) ? $_FILES[$key] : $default;
break;
default:
error::Ret()->Log('Invalid type( ' . $type . ')');
}
}
示例5: __Bind
/**
*
* @param string $table
* @param array $params
* @param string $type
* @param array $wrappers
* @return string
*/
protected function __Bind($table, $params, $type, $wrappers = array())
{
$param_string_array = array();
foreach ($params as $field => $value) {
$field_selector = $type == 'insert' ? '' : '`' . $table . '`.`' . $field . '` = ';
$param_to_string_array = '';
if ($value === null) {
$param_to_string_array = $field_selector . "''";
error::Ret()->Log('Null values should not be queried this way. Use "IS (NOT) NULL". This param was changed to \'\'.');
} else {
if (is_int($value)) {
$param_to_string_array = $field_selector . $value;
} elseif (is_string($value)) {
$param_to_string_array = $field_selector . "'" . $this->connection->real_escape_string($value) . "'";
} else {
// TODO: objects
error::Ret()->Log('Invalid param ' . $field . ' => ' . print_r($value, TRUE));
continue;
}
}
if (isset($wrappers[$field])) {
$param_to_string_array = $wrappers[$field]['begin'] . $param_to_string_array . $wrappers[$field]['end'];
}
$param_string_array[] = $param_to_string_array;
}
$query = '';
switch (strtolower($type)) {
case 'where':
$query = ' WHERE ' . implode(' AND ', $param_string_array);
break;
case 'update':
$query = ' SET ' . implode(',', $param_string_array);
break;
case 'insert':
$query = ' (`' . implode('`,`', array_keys($params)) . '`) VALUES (' . implode(',', $param_string_array) . ') ';
// this makes the assumptions that the two arrays will stay in order
break;
default:
error::Ret()->Log('Invalid input to protected function __Where ' . print_r(array('table' => $table, 'params' => $params, 'type' => $type)));
}
return $query;
}
示例6: Display
/**
*
*/
public function Display()
{
switch ($this->type) {
case 'smarty':
if ($this->template === null) {
error::Ret()->Log('Call to display without defining template' . print_r(array('stack' => stack::Ret(), 'debug_backtrace' => debug_backtrace()), true));
} else {
$this->CallBack('display');
$this->smarty->assign('url_prefix', URL_PREFIX);
$this->smarty->assign('config', config::Ret());
$this->smarty->assign('server_name', $_SERVER['SERVER_NAME']);
$this->smarty->assign('http_referer', isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] !== '' ? $_SERVER['HTTP_REFERER'] : null);
$this->smarty->assign('session', $_SESSION);
$this->smarty->assign('utility', utility::Ret());
// die('<pre>' . print_r(array($_SESSION,debug_backtrace()),true));
$this->smarty->display($this->template);
}
break;
default:
error::Ret()->Log('Unable to Display(). Undefined type (' . $this->type . ')');
}
}
示例7: CheckPassword
/**
*
* @return boolean
*/
public function CheckPassword()
{
if ($this->id === null) {
$u = stack::Ret()->Check('email', null, 'POST');
$p = stack::Ret()->Check('password', null, 'POST');
if ($u === NULL || $p === NULL) {
return false;
}
$xss = stack::Ret()->Check('xss', null, 'POST');
if ($this->CheckXSS($xss)) {
$pass = strtoupper(hash('sha1', SHA1_SALT . $p));
$sql_check_password = <<<SQL
SELECT
\tid
FROM users
WHERE
\temail = :email
\tAND password = SHA1(:password)
;
SQL;
// TODO: select remaining parameters
database::Ret()->Query($sql_check_password, array(':email' => $u, ':password' => strtoupper(hash('sha1', SHA1_SALT . $p))));
if (database::Ret()->CheckQuery()) {
$user = database::Ret()->Fetch();
$this->id = $user['id'];
return $this->__CreateDatabaseSession();
} else {
error::Ret()->Log('Query failed');
}
} else {
error::Ret()->Log('Failed XSS');
}
} else {
return true;
}
return false;
}
示例8: Define
/**
*
* @param type $key
* @param type $value
* @return boolean
*/
public function Define($key, $value)
{
$key = strtoupper($key);
if (defined($key)) {
error::Ret()->Log('key(' . $key . ') already defined with value(' . constant($key) . ') instead of (' . $value . ')');
return FALSE;
} else {
define($key, $value);
return TRUE;
}
}