本文整理汇总了PHP中FB::error方法的典型用法代码示例。如果您正苦于以下问题:PHP FB::error方法的具体用法?PHP FB::error怎么用?PHP FB::error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FB
的用法示例。
在下文中一共展示了FB::error方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: passwordExists
function passwordExists($dbConn, $username, $password)
{
$isValid = false;
$dbQuery = "SELECT Password FROM USERS WHERE Username = '" . $username . "' LIMIT 1";
FB::info('passwordExists() query: ' . $dbQuery);
$dbRows = mysqli_query($dbConn, $dbQuery);
$dbValues = mysqli_fetch_assoc($dbRows);
$dbPassword = $dbValues['Password'];
if (password_verify($password, $dbPassword)) {
$isValid = true;
FB::log('Password is valid!');
// Check if the password needs a rehash.
if (password_needs_rehash($dbPassword, PASSWORD_DEFAULT)) {
FB::log('Rehashing password!');
$dbPassword = password_hash($password, PASSWORD_DEFAULT);
$dbQuery = "UPDATE USERS SET Password = '" . $dbPassword . "' WHERE Username = '" . $username . "'";
FB::info('Password rehash query: ' . $dbQuery);
$dbRows = mysqli_query($dbConn, $dbQuery);
if ($dbRows) {
FB::log('Password rehash successful!');
} else {
FB::error('Password rehash failed: ' . mysqli_error($dbConn));
}
}
}
return $isValid;
}
示例2: index
function index()
{
$all = $this->equipment->getAll();
FB::error($all);
$this->set('equipment', $all);
FB::error($this->equipment);
}
示例3: addUser
function addUser($dbConn, $username, $password, $email)
{
// Add user to USERS table.
$dbQuery = "INSERT INTO USERS(Username, First_name, Last_name, Email, Status, About, Date_joined, Password) " . "VALUES('" . $username . "', '', '', '" . $email . "', 'active', '', CURDATE(), '" . $password . "')";
FB::info('addUser() query:' . $dbQuery);
if ($dbResults = mysqli_query($dbConn, $dbQuery)) {
FB::log('USERS insert success! (I think)');
} else {
FB::error('USERS insert failed!');
}
$userId = mysqli_insert_id($dbConn);
// ID of the latest created user.
FB::info('New User ID: ' . $userId);
// Add user role for newly created user into USER_ROLES table.
$dbQuery = "INSERT INTO USER_ROLES(User_Id, Role_Id)" . "VALUES(" . $userId . ", 1)";
if ($dbResults = mysqli_query($dbConn, $dbQuery)) {
FB::log('USER_ROLES insert success! (I think)');
} else {
FB::error('USER_ROLES insert failed!');
}
// Add default avatar for newly created user into IMAGES table.
$avatar = file('images/default_avatar.png');
// Default avatar for new users.
$dbQuery = "INSERT INTO IMAGES(Description, Image, User_Id) " . "VALUES('test', '" . $avatar . "', " . $userId . ")";
if ($dbResults = mysqli_query($dbConn, $dbQuery)) {
FB::log('IMAGES insert success! (I think)');
} else {
FB::error('IMAGES insert failed!');
}
}
示例4: fire
public static function fire($value)
{
$dbgs = array_shift(debug_backtrace());
$msg = date('[ Y-m-d H:i:s ]' . "\n");
$msg .= 'file: ' . $dbgs['file'] . "\n";
$msg .= 'line: ' . $dbgs['line'] . "\n\n";
FB::warn($msg);
FB::error($value);
}
示例5: logError
public static function logError($m)
{
$s = self::toStr($m);
error_log("KLOUDSPEAKER ERROR: " . $s);
if (self::$firebug) {
FB::error($m);
}
if (self::isDebug()) {
self::$trace[] = $s;
}
}
示例6: save
function save()
{
$this->dbh->TransactionBegin();
$query = "INSERT INTO room (name, capacity, note, room_type)\n\t\t\t VALUES (\$1, \$2, \$3, \$4)";
$this->dbh->query($query, array($this->nazov, $this->kapacita, $this->poznamka, $this->id_miestnost_typ));
$id = $this->dbh->GetLastInsertID();
FB::error($id);
foreach ($this->vybavenie as $eq) {
$query = "INSERT INTO room_equipment (id_room,id_equipment)\n \t VALUES (\$1, \$2)";
$this->dbh->query($query, array($id, $eq));
}
$this->dbh->TransactionEnd();
}
示例7: _invalid_data
private function _invalid_data(&$checked)
{
// nastavi vsetky veci co zadal korektne
$this->set('room', $checked);
// nasledne dve nie su previazane na hodnoty v $this->rooms =>
// ich pouzitie je korektne
$room_types = $this->room_type->getAll();
$this->set('room_types', $room_types);
$equips = $this->rooms->getEquipment();
FB::error($equips);
$this->set('equips', $equips);
$this->set('equip', $_POST['vybavenie']);
}
示例8: findByLogin
public function findByLogin($login)
{
FB::error("robim");
$query = "SELECT p.id, p.login, p.email, p.notification_on, p.ais_id, " . Users::vyskladajMeno("p", "name", false) . "FROM person p\n \t WHERE login = \$1";
$this->dbh->query($query, array($login));
$user = $this->dbh->fetch_assoc();
//fb($user);
if (!empty($user['id'])) {
$user['groups'] = $this->loadGroups($user['id']);
}
//$user['posielat_moje_zmeny'] = ($user['posielat_moje_zmeny'] = 't') ? TRUE : FALSE;
$user['notification_on'] = $this->convertBoolean($user['notification_on']);
return $user;
}
示例9: close
function close()
{
global $phpAnvil;
//---- Check if Site is Set
if (isset($phpAnvil->site)) {
//---- Initialize the Site
$phpAnvil->site->close();
$return = true;
} else {
FB::error('Site not set in phpAnvil.');
}
$phpAnvil->triggerEvent('application.close');
return $return;
}
示例10: offsetGet
public function offsetGet($offset)
{
global $phpAnvil;
global $firePHP;
$return = false;
if (!$this->exists($offset)) {
$msg = 'Controller (' . $offset . ') not found.';
$this->_addTraceInfo(__FILE__, __METHOD__, __LINE__, $msg, self::TRACE_TYPE_ERROR);
FB::error($msg);
} else {
$return = parent::offsetGet($offset);
}
return $return;
}
示例11: process
function process()
{
global $phpAnvil;
$return = false;
$phpAnvil->triggerEvent('application.open');
//---- Check if Site is Set
if (isset($phpAnvil->site)) {
//---- Initialize the Site
$phpAnvil->site->open();
$return = true;
} else {
FB::error('Site not set in phpAnvil.');
}
return $return;
}
示例12: dbConnect
function dbConnect()
{
// Database connection info, which is gained from a file outside the web root directory.
// Contains, in order: host, username, password, schema.
$dbInfo = file('/home/jayme/files/dbinfo');
FB::log('Grabbed DB information');
$dbConn = mysqli_connect(trim($dbInfo[0]), trim($dbInfo[1]), trim($dbInfo[2]), trim($dbInfo[3]));
// Schema
FB::log('Connecting to database');
if (mysqli_connect_errno($dbConn)) {
printf("Database connection failed: " . mysqli_connect_error());
FB::error('Database connection failed: "' . mysqli_connect_error());
}
FB::log('DB connection success!');
return $dbConn;
}
示例13: log_exception
/**
* Logs an exception
*
* @param object $exception_object The Exception object
* @param bool $is_fatal Whether or not to stop execution
* @return void
*/
public static function log_exception($exception_object, $is_fatal = TRUE)
{
if (class_exists('FB')) {
FB::error($exception_object);
}
// Generates an error message
$trace = array_pop($exception_object->getTrace());
$arg_str = implode(',', $trace['args']);
$method = isset($trace['class']) ? "{$trace['class']}::{$trace['function']}" : $trace['function'];
$err = "[" . date("Y-m-d h:i:s") . "] " . $exception_object->getFile() . ":" . $exception_object->getLine() . " - Error with message \"" . $exception_object->getMessage() . "\" was thrown from " . "{$method} ({$trace['file']}:{$trace['line']})" . " with arguments: ('" . implode("', '", $trace['args']) . "')\n";
// Logs the error message
self::_write_log($err);
// Stop script execution if the error was fatal
if ($is_fatal === TRUE) {
die($exception_object->getMessage());
}
}
示例14: writeUser
/**
* Vlozi informacie o userovi do session
* @param <array> $user informacie o userovi, vo formate:
* id - id usera
* meno - meno usera
* login - username
* groups - pole skupin, ktorych je user clenom
*/
public function writeUser($user)
{
// vlozi data noveho usera
FB::error($user);
$this->write('uid', $user['id']);
$this->write('name', $user['name']);
// to je uz vyskladane z DB
$this->write('mail', $user["email"]);
$this->write('username', $user['login']);
$this->write('groups', $user['groups']);
$this->write('semester', $user['semester']);
if ($user['notification_on'] == 't') {
$this->write('notifyMyActions', TRUE);
} else {
$this->write('notifyMyActions', FALSE);
}
}
示例15: msg
/**
* (non-PHPdoc)
* @see debugObject::msg()
*/
public function msg($msg, $level = DEBUG_LOG)
{
if (!empty($msg) && $this->_level & $level) {
if (DEBUG_INFO & $level) {
if (is_array($msg)) {
FB::group(current($msg), array('Collapsed' => true));
FB::info($msg);
FB::groupEnd();
} else {
FB::info($msg);
}
} elseif (DEBUG_ERROR & $level || DEBUG_STRICT & $level) {
if (is_array($msg)) {
FB::group(current($msg), array('Collapsed' => true, 'Color' => '#FF0000'));
FB::error($msg);
FB::groupEnd();
} else {
FB::error($msg);
}
} elseif (DEBUG_WARNING & $level) {
if (is_array($msg)) {
FB::group(current($msg), array('Collapsed' => true, 'Color' => '#FF0000'));
FB::warn($msg);
FB::groupEnd();
} else {
FB::warn($msg);
}
} else {
if (is_array($msg)) {
FB::group(current($msg), array('Collapsed' => true));
FB::log($msg);
FB::groupEnd();
} else {
FB::log($msg);
}
}
}
}