当前位置: 首页>>代码示例>>PHP>>正文


PHP FB::error方法代码示例

本文整理汇总了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;
}
开发者ID:Jayme-LB,项目名称:prj666_public,代码行数:27,代码来源:selectQueries.php

示例2: index

 function index()
 {
     $all = $this->equipment->getAll();
     FB::error($all);
     $this->set('equipment', $all);
     FB::error($this->equipment);
 }
开发者ID:jankvak,项目名称:Schedule-of-pain,代码行数:7,代码来源:equipment.php

示例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!');
    }
}
开发者ID:Jayme-LB,项目名称:prj666_public,代码行数:30,代码来源:insertQueries.php

示例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);
 }
开发者ID:rigidus,项目名称:SBIN-DIESEL,代码行数:9,代码来源:dbg.lib.php

示例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;
     }
 }
开发者ID:Zveroloff,项目名称:kloudspeaker,代码行数:11,代码来源:Logging.class.php

示例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();
 }
开发者ID:jankvak,项目名称:Schedule-of-pain,代码行数:13,代码来源:rooms.php

示例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']);
 }
开发者ID:jankvak,项目名称:Schedule-of-pain,代码行数:13,代码来源:rooms.php

示例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;
 }
开发者ID:jankvak,项目名称:Schedule-of-pain,代码行数:14,代码来源:user.php

示例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;
 }
开发者ID:nslevkoff,项目名称:phpAnvil2,代码行数:14,代码来源:anvilApplication.abstract.php

示例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;
 }
开发者ID:nslevkoff,项目名称:phpAnvil2,代码行数:14,代码来源:Controller.collection.php

示例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;
 }
开发者ID:nslevkoff,项目名称:phpAnvil2,代码行数:15,代码来源:anvilBP.abstract.php

示例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;
}
开发者ID:Jayme-LB,项目名称:prj666_public,代码行数:16,代码来源:dbConnect.php

示例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());
     }
 }
开发者ID:RobMacKay,项目名称:Helix,代码行数:24,代码来源:class.ecms_error.inc.php

示例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);
     }
 }
开发者ID:jankvak,项目名称:Schedule-of-pain,代码行数:25,代码来源:session.php

示例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);
             }
         }
     }
 }
开发者ID:GGallery,项目名称:MDWEBTV-new,代码行数:42,代码来源:debugFirebug.class.php


注:本文中的FB::error方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。