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


PHP DataHandler::load方法代码示例

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


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

示例1: lilina_plugins_init

/**
 * Load plugins
 *
 * Loads in the activated plugins data then loads the plugins.
 */
function lilina_plugins_init()
{
    $data = new DataHandler();
    $plugins = $data->load('plugins.data');
    if ($plugins === null) {
        return;
    }
    $plugins = unserialize($plugins);
    if (!is_array($plugins) || empty($plugins)) {
        return;
    }
    foreach ($plugins as $plugin) {
        if ('' !== $plugin && file_exists(LILINA_CONTENT_DIR . '/plugins/' . $plugin)) {
            include_once LILINA_CONTENT_DIR . '/plugins/' . $plugin;
        }
    }
    global $current_plugins;
    $current_plugins = $plugins;
}
开发者ID:rmccue,项目名称:Lilina,代码行数:24,代码来源:plugin-functions.php

示例2: load_feeds

/**
 * Load feeds into global $data
 *
 * @uses $data
 * @return array
 */
function load_feeds()
{
    global $data;
    $file = new DataHandler(LILINA_CONTENT_DIR . '/system/config/');
    $data = $file->load('feeds.data');
    if ($data !== null) {
        $data = unserialize(base64_decode($data));
    } else {
        $data = array();
    }
    return $data;
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:18,代码来源:feed-functions.php

示例3: define

    //Settings that use other settings variables
    if (!defined('LILINA_CONTENT_DIR')) {
        define('LILINA_CONTENT_DIR', LILINA_PATH . '/content');
    }
    if (!defined('LILINA_CACHE_DIR')) {
        define('LILINA_CACHE_DIR', LILINA_CONTENT_DIR . '/system/cache/');
    }
    if (!defined('LILINA_DATA_DIR')) {
        define('LILINA_DATA_DIR', LILINA_CONTENT_DIR . '/system/data/');
    }
    if (!isset($settings['files'])) {
        $settings['files'] = array('feeds' => LILINA_CONTENT_DIR . '/system/config/feeds.data', 'options' => LILINA_CONTENT_DIR . '/system/config/options.data', 'settings' => LILINA_CONTENT_DIR . '/system/config/settings.php', 'plugins' => LILINA_CONTENT_DIR . '/system/config/plugins.data');
    }
    global $options;
    $data = new DataHandler(LILINA_CONTENT_DIR . '/system/config/');
    $options = $data->load('options.data');
    if ($options !== null) {
        $options = unserialize($options);
    } else {
        $options = array();
    }
    if (!isset($options['cachedir'])) {
        $options['cachedir'] = LILINA_CACHE_DIR;
    }
}
/**
 * Attempt to load the class before PHP fails with an error.
 *
 * This method is called automatically in case you are trying to use a class which hasn't been defined yet.
 * @param string $class_name Class called by the user
 */
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:31,代码来源:conf.php

示例4: delete

 /**
  * Remove a feed
  *
  * @param string $id ID of the feed to remove
  * @return bool
  */
 public function delete($id)
 {
     if (empty($this->feeds[$id])) {
         throw new Exception(_r('Feed does not exist'), Errors::get_code('admin.feeds.invalid_id'));
     }
     //Make a copy for later.
     $removed = $this->feeds[$id];
     $removed = apply_filters('feed-delete', $removed);
     $cache = new DataHandler(get_option('cachedir'));
     if ($cache->load($id . '.ico') !== null) {
         $cache->delete($id . '.ico');
     }
     unset($this->feeds[$id]);
     $this->save();
     return sprintf(_r('Removed "%1$s" &mdash; <a href="%2$s">Undo</a>?'), $removed['name'], 'feeds.php?action=add&amp;add_name=' . urlencode($removed['name']) . '&amp;add_url=' . urlencode($removed['feed']) . '&amp;id=' . urlencode($removed['id']));
 }
开发者ID:JocelynDelalande,项目名称:Lilina,代码行数:22,代码来源:class-feeds.php

示例5: update_nag

/**
 * @todo Document
 * @author WordPress
 */
function update_nag()
{
    $data = new DataHandler();
    $cur = $data->load('core-update-check.data');
    if ($cur === null) {
        return false;
    }
    $cur = unserialize($cur);
    if (!isset($cur->response) || $cur->response != 'upgrade') {
        return false;
    }
    $msg = sprintf(_r('Lilina %1$s is available! <a href="%2$s">Please update now</a>.'), $cur->version, $cur->url);
    echo "<div id='update-nag' class='message'>{$msg}</div>";
}
开发者ID:rmccue,项目名称:Lilina,代码行数:18,代码来源:update-functions.php


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