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


PHP Log::set方法代码示例

本文整理汇总了PHP中Log::set方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::set方法的具体用法?PHP Log::set怎么用?PHP Log::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Log的用法示例。


在下文中一共展示了Log::set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 function __construct($file, $firstLine = true)
 {
     $this->file = $file;
     $this->db = array();
     $this->dbBackup = array();
     $this->firstLine = $firstLine;
     if (file_exists($file)) {
         // Read JSON file.
         $lines = file($file);
         // Remove the first line, the first line is for security reasons.
         if ($firstLine) {
             unset($lines[0]);
         }
         // Regenerate the JSON file.
         $implode = implode($lines);
         // Unserialize, JSON to Array.
         $array = $this->unserialize($implode);
         if (empty($array)) {
             Log::set(__METHOD__ . LOG_SEP . 'Invalid JSON file: ' . $file . ', cannot be decoded. Check the file content.');
         } else {
             $this->db = $array;
             $this->dbBackup = $array;
         }
     } else {
         Log::set(__METHOD__ . LOG_SEP . 'File ' . $file . ' does not exists');
     }
 }
开发者ID:clstrfcuk,项目名称:bludit,代码行数:27,代码来源:dbjson.class.php

示例2: deleteUser

function deleteUser($args, $deleteContent = false)
{
    global $dbUsers;
    global $dbPosts;
    global $Language;
    global $Login;
    // The user admin cannot be deleted.
    if ($args['username'] == 'admin') {
        return false;
    }
    // The editors cannot delete users.
    if ($Login->role() !== 'admin') {
        return false;
    }
    if ($deleteContent) {
        $dbPosts->deletePostsByUser($args['username']);
    } else {
        $dbPosts->linkPostsToUser($args['username'], 'admin');
    }
    if ($dbUsers->delete($args['username'])) {
        Alert::set($Language->g('User deleted'));
    } else {
        Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to delete the user.');
    }
}
开发者ID:veshinak,项目名称:bludit,代码行数:25,代码来源:edit-user.php

示例3: updateBludit

function updateBludit()
{
    global $Site;
    global $dbPosts;
    // Check if Bludit need to be update.
    if ($Site->currentBuild() < BLUDIT_BUILD || isset($_GET['update'])) {
        // --- Update dates ---
        foreach ($dbPosts->db as $key => $post) {
            $date = Date::format($post['date'], 'Y-m-d H:i', DB_DATE_FORMAT);
            if ($date !== false) {
                $dbPosts->setPostDb($key, 'date', $date);
            }
        }
        $dbPosts->save();
        // --- Update directories ---
        $directories = array(PATH_POSTS, PATH_PAGES, PATH_PLUGINS_DATABASES, PATH_UPLOADS_PROFILES, PATH_UPLOADS_THUMBNAILS, PATH_TMP);
        foreach ($directories as $dir) {
            // Check if the directory is already created.
            if (!file_exists($dir)) {
                // Create the directory recursive.
                mkdir($dir, DIR_PERMISSIONS, true);
            }
        }
        // Set and save the database.
        $Site->set(array('currentBuild' => BLUDIT_BUILD));
        Log::set('updateBludit' . LOG_SEP . 'System updated');
    }
}
开发者ID:electronspin,项目名称:bludit,代码行数:28,代码来源:dashboard.php

示例4: addUser

function addUser($args)
{
    global $dbUsers;
    global $Language;
    // Check if the username already exist in db.
    if (Text::isEmpty($args['username'])) {
        Alert::set($Language->g('username-field-is-empty'));
        return false;
    }
    if ($dbUsers->userExists($args['username'])) {
        Alert::set($Language->g('username-already-exists'));
        return false;
    }
    // Validate password.
    if ($args['password'] != $args['confirm-password'] || Text::isEmpty($args['password'])) {
        Alert::set($Language->g('The password and confirmation password do not match'));
        return false;
    }
    // Add the user.
    if ($dbUsers->add($args)) {
        Alert::set($Language->g('user-has-been-added-successfully'));
        return true;
    } else {
        Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to create the account.');
        return false;
    }
}
开发者ID:roberthchan,项目名称:bludit,代码行数:27,代码来源:add-user.php

示例5: __construct

 public function __construct($form = null)
 {
     Log::set('Initialize Model class');
     if ($form !== false) {
         $this->_form = $form;
     }
     $this->setKeys();
 }
开发者ID:DeDoOozZz,项目名称:brighterycms,代码行数:8,代码来源:Model.php

示例6: __construct

 /**
  * Constructor
  *
  * @access    public
  */
 public function __construct($props = [])
 {
     if (count($props) > 0) {
         $this->initialize($props);
     }
     Log::set('Initialize Upload class');
     //		log_message('debug', "Upload Class Initialized");
 }
开发者ID:DeDoOozZz,项目名称:brighterycms,代码行数:13,代码来源:Upload.php

示例7: destroy

 public static function destroy()
 {
     session_destroy();
     unset($_SESSION);
     self::$started = false;
     Log::set(__METHOD__ . LOG_SEP . 'Session destroyed.');
     return !isset($_SESSION);
 }
开发者ID:joryphillips,项目名称:bludit,代码行数:8,代码来源:session.class.php

示例8: updateBludit

function updateBludit()
{
    global $Site;
    global $dbPosts;
    global $dbPages;
    // Check if Bludit need to be update.
    if ($Site->currentBuild() < BLUDIT_BUILD || isset($_GET['update'])) {
        // LOG
        Log::set('UPDATE SYSTEM - Starting...');
        // LOG
        Log::set('UPDATE SYSTEM - Checking posts.');
        // Update posts
        foreach ($dbPosts->db as $key => $post) {
            // Dates
            $date = Date::format($post['date'], 'Y-m-d H:i', DB_DATE_FORMAT);
            if ($date !== false) {
                $dbPosts->setPostDb($key, 'date', $date);
            }
            // Checksum
            if (empty($post['md5file'])) {
                $checksum = md5_file(PATH_POSTS . $key . DS . FILENAME);
                $dbPosts->setPostDb($key, 'md5file', $checksum);
            }
        }
        $dbPosts->save();
        // LOG
        Log::set('UPDATE SYSTEM - Checking pages.');
        // Update pages
        foreach ($dbPages->db as $key => $page) {
            $date = Date::format($page['date'], 'Y-m-d H:i', DB_DATE_FORMAT);
            if ($date !== false) {
                $dbPages->setPageDb($key, 'date', $date);
            }
            // Checksum
            if (empty($post['md5file'])) {
                $checksum = md5_file(PATH_PAGES . $key . DS . FILENAME);
                $dbPages->setPageDb($key, 'md5file', $checksum);
            }
        }
        $dbPages->save();
        // LOG
        Log::set('UPDATE SYSTEM - Checking directories.');
        // --- Update directories ---
        $directories = array(PATH_POSTS, PATH_PAGES, PATH_PLUGINS_DATABASES, PATH_UPLOADS_PROFILES, PATH_UPLOADS_THUMBNAILS, PATH_TMP);
        foreach ($directories as $dir) {
            // Check if the directory is already created.
            if (!file_exists($dir)) {
                // Create the directory recursive.
                mkdir($dir, DIR_PERMISSIONS, true);
            }
        }
        // Set and save the database.
        $Site->set(array('currentBuild' => BLUDIT_BUILD));
        // LOG
        Log::set('UPDATE SYSTEM - Updated...');
    }
}
开发者ID:vorons,项目名称:bludit,代码行数:57,代码来源:dashboard.php

示例9: __construct

 public function __construct()
 {
     Log::set('Initialize Debug class');
     if (ENVIRONMENT == 'development') {
         if ((!isset($_SERVER['HTTP_X_REQUESTED_WITH']) or $_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest') && !CMD_MODE) {
             $this->displayDebugger();
         }
     }
 }
开发者ID:DeDoOozZz,项目名称:brighterycms,代码行数:9,代码来源:Debug.php

示例10: ping

 private function ping()
 {
     if ($this->getDbField('ping')) {
         // Get the authentication key
         $authKey = $this->getDbField('authKey');
         // Just a request HTTP with the website URL
         Log::set(file_get_contents('https://www.bludit.com/api.php?authKey=' . $authKey));
     }
 }
开发者ID:kaaleth,项目名称:bludit,代码行数:9,代码来源:plugin.php

示例11: addLoginFail

 public function addLoginFail()
 {
     $ip = $this->getUserIp();
     // Save the database
     $this->db[$ip] = (int) $this->db[$ip] + 1;
     if ($this->save() === false) {
         Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to save the database file.');
         return false;
     }
     return true;
 }
开发者ID:joryphillips,项目名称:bludit,代码行数:11,代码来源:security.class.php

示例12: deletePage

function deletePage($key)
{
    global $dbPages;
    global $Language;
    if ($dbPages->delete($key)) {
        Alert::set($Language->g('The page has been deleted successfully'));
        Redirect::page('admin', 'manage-pages');
    } else {
        Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to delete the page.');
    }
}
开发者ID:joryphillips,项目名称:bludit,代码行数:11,代码来源:edit-page.php

示例13: __construct

 public function __construct()
 {
     Log::set('Initialize Input class');
     $this->input = ['cookie' => $_COOKIE, 'get' => $_GET, 'post' => $_POST, 'request' => $_REQUEST, 'files' => $_FILES, 'server' => $_SERVER, 'env' => $_ENV];
     if ($this->cookie('session_id')) {
         session_id($this->cookie('session_id'));
     }
     if (Brightery::SuperInstance()->Config->get('Config.enable_session')) {
         $this->activateSession();
     }
     array_walk_recursive($this->input, 'self::InputFilter');
 }
开发者ID:DeDoOozZz,项目名称:brighterycms,代码行数:12,代码来源:Input.php

示例14: addPage

function addPage($args)
{
    global $dbPages;
    global $Language;
    // Add the page.
    if ($dbPages->add($args)) {
        Alert::set($Language->g('Page added successfully'));
        Redirect::page('admin', 'manage-pages');
    } else {
        Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to create the page.');
    }
}
开发者ID:clstrfcuk,项目名称:bludit,代码行数:12,代码来源:new-page.php

示例15: deletePost

function deletePost($key)
{
    global $dbPosts;
    global $Language;
    if ($dbPosts->delete($key)) {
        // Reindex tags, this function is in 70.posts.php
        reIndexTagsPosts();
        Alert::set($Language->g('The post has been deleted successfully'));
        Redirect::page('admin', 'manage-posts');
    } else {
        Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to delete the post.');
    }
}
开发者ID:clstrfcuk,项目名称:bludit,代码行数:13,代码来源:edit-post.php


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