當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Kernel::Log方法代碼示例

本文整理匯總了PHP中Kernel::Log方法的典型用法代碼示例。如果您正苦於以下問題:PHP Kernel::Log方法的具體用法?PHP Kernel::Log怎麽用?PHP Kernel::Log使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Kernel的用法示例。


在下文中一共展示了Kernel::Log方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Constructs the class and verifies if the requirements have been met
  * @param string $id_field Column to identify the user through
  */
 public function __construct($id_field = 'id')
 {
     self::$id_field = $id_field;
     $req_columns = array('id', 'username', 'email', 'password', 'lastactive');
     if (Sql::tableExists('accounts') < 1) {
         Kernel::Log('The accounts table doesn\'t exist');
         return false;
     }
     if (Sql::hasColumns('accounts', $req_columns) !== true) {
         Kernel::Log('The accounts table does not have the required columns');
         return false;
     }
     return true;
 }
開發者ID:studio-wolfree,項目名稱:sonicwulf-php,代碼行數:18,代碼來源:Users.php

示例2: getVars

 /**
  * Returns all the sitevars on the database
  * @return array Sitevars
  */
 static function getVars()
 {
     $query = SQL::Query("SELECT * FROM sitevars");
     if (!$query) {
         Kernel::Log('Could not retrieve sitevars.');
         trigger_error('Could not retrieve sitevars.', E_USER_ERROR);
         return false;
     }
     foreach ($query as $reg) {
         $sitevars[$reg['name']] = $reg['value'];
     }
     return $sitevars;
 }
開發者ID:studio-wolfree,項目名稱:codeboom,代碼行數:17,代碼來源:Tpl.php

示例3: __set

 /**
  * Modifies an user's database information if we're modifying a cached column. Otherwise it just sets a property.
  * @param string $name  Name of the property
  * @param string $value New value of the property
  * @return void
  */
 public function __set($name, $value)
 {
     if ($this->boot) {
         Users::$id_field = $this->id_field;
         $disallowedKeys = array('id_field', 'user_id', 'boot');
         if (!in_array($name, $disallowedKeys)) {
             $q = Users::modifyUser($this->user_id, $name, $value);
         }
         if (!$q) {
             Kernel::Log('User with ' . $this->id_field . " " . $this->user_id . " could not be modified (" . $name . ")");
             return false;
         }
         $this->{$name} = $value;
     }
 }
開發者ID:studio-wolfree,項目名稱:sonicwulf-php,代碼行數:21,代碼來源:User.php

示例4: Update

 /**
  * Updates a table's row
  * @param string $table    Table to work with
  * @param array $array     Array to use
  * @param string $criteria Criteria to add at the end of the query
  * @return bool            Returns false if the query was not successful
  */
 static function Update($table, $array, $criteria = null)
 {
     $bridge = self::$bridge;
     $sets = array();
     $values = array();
     $index = 0;
     foreach ($array as $key => $value) {
         $values[$index] = $value;
         $sets[] = 'SET ' . $key . ' = :' . $index;
         $index++;
     }
     $stmt = $bridge->prepare("UPDATE {$table} " . implode(', ', $sets) . " " . $criteria . ";");
     foreach ($values as $key => $i) {
         $stmt->bindParam(':' . $key, $i);
     }
     try {
         $stmt->execute();
     } catch (PDOException $e) {
         Kernel::Log('Could not execute query. Server returned "' . $e->getMessage() . '"');
         return false;
     }
     return true;
 }
開發者ID:studio-wolfree,項目名稱:sonicwulf-php,代碼行數:30,代碼來源:Sql.php

示例5: __set

 /**
  * Overwatches template and query configuration, if it's not either of those, sets it as an option
  * @param string $name  Name of the property
  * @param string $value New value of the property
  * @return bool         May return false if the template or query configuration weren't successful
  */
 public function __set($name, $value)
 {
     if ($name == 'template') {
         $columns = Text::parseStringVar($value);
         foreach ($columns as $key => $i) {
             if (in_array($i, array_keys($this->vars))) {
                 unset($columns[$key]);
             }
         }
         if (!Sql::hasColumns($this->table, $value)) {
             Kernel::Log('The template uses columns that do not exist on the ' . $this->table . ' table');
             return false;
         }
     } elseif ($name == 'query') {
         if (!Sql::testQuery($value)) {
             Kernel::Log('The desired query did not run successfully. Please try another one. Your database wasn\'t affected.');
             return false;
         }
     } else {
         $this->options[$name] = $value;
     }
 }
開發者ID:studio-wolfree,項目名稱:sonicwulf-php,代碼行數:28,代碼來源:Listing.php

示例6: __set

 /**
  * Sets content or attributes of an HTMLObj
  * @param string $name  Name of the property
  * @param string $value New value of the property
  * @return void
  */
 public function __set($name, $value)
 {
     $disallowed = array('attr', 'elname', 'content', 'children', 'html');
     if (in_array($name, $disallowed)) {
         Kernel::Log('Could not modify attribute of element ' . $this->elname);
         return false;
     } else {
         if ($name == "content") {
             $this->content = array($value);
         } else {
             $this->attr[$name] = $value;
         }
     }
 }
開發者ID:studio-wolfree,項目名稱:sonicwulf-php,代碼行數:20,代碼來源:HtmlObj.php

示例7: addRecipientBulk

 /**
  * Adds recipients in bulk using a multidimensional arrays
  * @param array $array Array of recipients ([] => [email, name, type])
  * @return bool        Returns true if the recipients were added successfully
  */
 public function addRecipientBulk($array)
 {
     if (!is_array($array)) {
         Kernel::Log('The only argument for addRecipientBulk must be an array composed of the name, address and type of the recipient');
         return false;
     } else {
         foreach ($array as $i) {
             $this->recipients[] = $i[0];
             switch ($i[2]) {
                 case 'normal':
                     $this->headers['To'][] = $i[1] . ' <' . $i[0] . '>';
                     break;
                 case 'cc':
                     $this->headers['Cc'][] = $i[0];
                     break;
                 case 'bcc':
                     $this->headers['Bcc'][] = $i[0];
                     break;
             }
         }
         return true;
     }
 }
開發者ID:studio-wolfree,項目名稱:codeboom,代碼行數:28,代碼來源:Mail.php


注:本文中的Kernel::Log方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。