本文整理汇总了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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
}
示例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;
}
}
}
示例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;
}
}