• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP loader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __construct

 function __construct()
 {
     require_once 'functions/loader.php';
     $loader = new loader();
     $config = $loader->load('configuration');
     require_once 'functions/classes/coinbase/Coinbase.php';
     $this->provider = Coinbase::withApiKey($config->api_key(), $config->api_secret());
 }
开发者ID:iamraghavgupta,项目名称:StarterFaucet,代码行数:8,代码来源:coinbaseapi.php


示例2: __construct

 function __construct()
 {
     require_once 'functions/loader.php';
     $loader = new loader();
     $config = $loader->load('configuration');
     $this->key = $config->api_key();
     $this->coin = $config->coin_code();
 }
开发者ID:iamraghavgupta,项目名称:StarterFaucet,代码行数:8,代码来源:coinarea.php


示例3: logIP

 function logIP()
 {
     $time = time();
     require_once 'functions/loader.php';
     $loader = new loader();
     $config = $loader->load('configuration');
     $ip = $_SERVER[$config->ip_forward()];
     $this->saveLog($ip, $time);
 }
开发者ID:girino,项目名称:StarterFaucet,代码行数:9,代码来源:log.php


示例4: __construct

 function __construct()
 {
     require_once 'functions/loader.php';
     $loader = new loader();
     $config = $loader->load('configuration');
     if ($config->debug_mode()) {
         // Show warnings and errors.
         error_reporting(E_ERROR | E_WARNING);
     } else {
         // Hide all errors, warnings, notices, etc from view of public.
         error_reporting(0);
     }
 }
开发者ID:iamraghavgupta,项目名称:StarterFaucet,代码行数:13,代码来源:template.php


示例5: __construct

 function __construct()
 {
     require_once 'functions/loader.php';
     $loader = new loader();
     $config = $loader->load('configuration');
     switch ($config->api_provider()) {
         case 'coinbase':
             $this->provider = $loader->load('coinbaseapi');
             break;
         default:
             echo '<div class="errormsg">The API provided is not valid, please set up a valid API provider in the configuration.</div>';
             $this->provider = new fakeapi();
             break;
     }
 }
开发者ID:iamraghavgupta,项目名称:StarterFaucet,代码行数:15,代码来源:selectapi.php


示例6: invoices

 public function invoices()
 {
     // Get page
     $page = is_numeric(input::get('page')) && input::get('page') > 0 ? input::get('page') : 1;
     // Parameters
     $params = array('join_columns' => array('`t`.`user_id`=' . session::item('user_id')));
     // Process query string
     $qstring = $this->parseQuerystring(config::item('invoices_per_page', 'billing'), session::item('total_transactions'));
     // Get invoices
     $invoices = array();
     if (session::item('total_transactions')) {
         $invoices = $this->transactions_model->getTransactions($params['join_columns'], '', $qstring['limit']);
     } else {
         view::setInfo(__('no_invoices_user', 'billing_transactions'));
     }
     // Set pagination
     $config = array('base_url' => config::siteURL('billing/invoices?'), 'total_items' => session::item('total_transactions'), 'items_per_page' => config::item('invoices_per_page', 'billing'), 'current_page' => $page, 'uri_segment' => 'page');
     $pagination = loader::library('pagination', $config, null);
     // Assign vars
     view::assign(array('invoices' => $invoices, 'pagination' => $pagination));
     // Set title
     view::setTitle(__('invoices', 'billing_transactions'));
     // Load view
     view::load('billing/invoices');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:25,代码来源:invoices.php


示例7: addScalableButtonCSS

 public function addScalableButtonCSS()
 {
     $basepath = base::baseUrl();
     echo "<style type=\"text/css\"> @import \"{$basepath}/core/styles/btn.php\"; </style>";
     $lib = loader::load("library");
     $lib->jsm->loadButtonJS();
 }
开发者ID:mustafakarali,项目名称:orchidframework,代码行数:7,代码来源:cssm.php


示例8: _createtable

function _createtable($sql)
{
    $db =& loader::database();
    $type = strtoupper(preg_replace("/^\\s*CREATE TABLE\\s+.+\\s+\\(.+?\\).*(ENGINE|TYPE)\\s*=\\s*([a-z]+?).*\$/isU", "\\2", $sql));
    $type = in_array($type, array('MYISAM', 'HEAP', 'MEMORY')) ? $type : 'MYISAM';
    return preg_replace("/^\\s*(CREATE TABLE\\s+.+\\s+\\(.+?\\)).*\$/isU", "\\1", $sql) . ($db->version() > '4.1' ? " ENGINE={$type} DEFAULT CHARSET=utf8" : " TYPE={$type}");
}
开发者ID:vluo,项目名称:myPoto,代码行数:7,代码来源:upgrade.php


示例9: render

 /**
  * render Add Blog dialog
  */
 public function render()
 {
     if ($_REQUEST['akID']) {
         $akID = $_REQUEST['akID'];
         if ($_REQUEST['akID']) {
             if ($_REQUEST['akID'] == 'same_tags') {
                 $key = CollectionAttributeKey::getByHandle('tags');
                 $akID = $key->getAttributeKeyID();
             }
         }
         $html = '<fieldset>';
         $db = loader::db();
         $r = $db->execute("SELECT * FROM atSelectOptions WHERE akID = ?", array($akID));
         while ($row = $r->fetchrow()) {
             $id = $row['ID'];
             $options[$id] = $row['value'];
         }
         if (is_array($options)) {
             foreach ($options as $key => $option) {
                 $html .= '<input type="checkbox" name="fields[]" value="' . $option . '">' . $option . '<br/>';
             }
         }
         $html .= '</fieldset>';
         //print json_encode($options);
         print $html;
         exit;
     }
 }
开发者ID:baardev,项目名称:lbtb,代码行数:31,代码来源:nab_attribute.php


示例10: render

 public function render()
 {
     $id = $this->options['id'];
     $type = $this->options['type'];
     $data = $this->options['data'];
     $style = $this->options['style'];
     $class = $this->options['class'];
     $callback = $this->options['callback'];
     $name = $this->options['name'];
     $theme = $this->options['theme'];
     $refreshinterval = $this->options['refreshinterval'];
     $position = $this->options['position'];
     if ($type == "text" || $type == "html") {
         //process text based widgets
         $output = "<div id='{$id}' class='widget {$class}' style='{$style}'>";
         if (!empty($name)) {
             $output .= "<h2 class='widgettitle'>{$name}</h2>";
         }
         $output .= "<div class='widgetdata'>{$data}</div>";
         $output .= "</div>";
     } else {
         if ($type == "rss") {
             $url = $data;
             $config = loader::load("config");
             $googleApiKey = $config->google_api;
             $output = "\n\t\t\t\t\n\t\t\t\t<div id='{$id}' class='widget {$class}' style='{$style}'>\n\t\t\t\t<h2 class='widgettitle'>{$name}</h2>\n\t\t\t\t<div class='widgetdata'>\n\t\t\t\t<script type=\"text/javascript\" src=\"http://www.google.com/jsapi?key={$googleApiKey}\"></script>\n\t\t\t    <script type=\"text/javascript\">\n\t\t\t\t    \$('#{$id}').gFeed({  \n\t\t\t\t        url: '{$data}', \n\t\t\t\t        title: ''\n\t\t\t\t    });     \n\t\t\t    </script>\n\t\t\t    </div>\n\t\t\t    ";
         }
     }
     return $output;
 }
开发者ID:mustafakarali,项目名称:orchidframework,代码行数:30,代码来源:widgets.php


示例11: manage

 public function manage()
 {
     // Assign user from session to variable
     $user = session::section('session');
     // Get fields
     $fields = array();
     foreach (config::item('usertypes', 'core', 'keywords') as $categoryID => $keyword) {
         $fields[$categoryID] = $this->fields_model->getFields('users', $categoryID, 'view', 'in_list');
     }
     // Parameters
     $params = array('total' => $user['total_blocked'], 'profiles' => true);
     // Process query string
     $qstring = $this->parseQuerystring($params['total']);
     // Get blocked users
     $users = array();
     if ($params['total']) {
         $users = $this->users_blocked_model->getUsers(session::item('user_id'), $qstring['order'], $qstring['limit'], $params);
     } else {
         view::setInfo(__('no_blocked_users', 'users_blocked'));
     }
     // Set pagination
     $config = array('base_url' => config::siteURL('users/blocked/manage?' . $qstring['url']), 'total_items' => $params['total'], 'items_per_page' => config::item('blocked_per_page', 'users'), 'current_page' => $qstring['page'], 'uri_segment' => 'page');
     $pagination = loader::library('pagination', $config, null);
     // Assign vars
     view::assign(array('user' => $user, 'users' => $users, 'fields' => $fields, 'pagination' => $pagination));
     // Set title
     view::setTitle(__('blacklist', 'users'));
     // Load view
     view::load('users/blocked/manage');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:30,代码来源:blocked.php


示例12: sendTemplate

 public function sendTemplate($keyword, $email, $tags = array(), $language = '')
 {
     loader::model('system/emailtemplates');
     if (!$language) {
         $language = config::item('language_id', 'system');
     }
     if (is_numeric($language)) {
         $language = config::item('languages', 'core', 'keywords', $language);
     } elseif (!in_array($language, config::item('languages', 'core', 'keywords'))) {
         return false;
     }
     if (!($template = config::item($keyword . '_' . $language, '_system_emails_cache'))) {
         if (!($template = $this->cache->item('core_email_template_' . $keyword . '_' . $language))) {
             $template = $this->emailtemplates_model->prepareTemplate($keyword, $language);
             if (count($template) == 3) {
                 if ($template[$keyword]['active']) {
                     $template = array('subject' => $template[$keyword]['subject'], 'message_html' => utf8::trim($template['header']['message_html'] . $template[$keyword]['message_html'] . $template['footer']['message_html']), 'message_text' => utf8::trim($template['header']['message_text'] . "\n\n" . $template[$keyword]['message_text'] . "\n\n" . $template['footer']['message_text']));
                 } else {
                     $template = 'none';
                 }
             } else {
                 error::show('Could not fetch email template from the database: ' . $keyword);
             }
             $this->cache->set('core_email_template_' . $keyword . '_' . $language, $template, 60 * 60 * 24 * 30);
         }
         config::set(array($keyword . '_' . $language => $template), '', '_system_emails_cache');
     }
     $retval = true;
     if (is_array($template) && $template) {
         $retval = $this->sendEmail($email, $template['subject'], $template['message_text'], $template['message_html'], $tags);
     }
     return $retval;
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:33,代码来源:email.php


示例13: __construct

 function __construct($base = null)
 {
     if (!$base) {
         $base = loader::get_root() . '../cache/';
     }
     $this->set_root($base);
 }
开发者ID:rustyJ4ck,项目名称:moswarBot,代码行数:7,代码来源:sape_cacher.php


示例14: load

 /**
  * 加载语言文件
  */
 public static function load()
 {
     $agrs = func_get_args();
     for ($i = 0, $n = count($agrs); $i < $n; $i++) {
         ($lang = loader::language($agrs[$i])) && (self::$sfLang = array_merge(self::$sfLang, (array) $lang));
     }
 }
开发者ID:GitBeBest,项目名称:sf-framwork,代码行数:10,代码来源:language.class.php


示例15: fetch

 function fetch($file, $templateid = null, $tpldir = null)
 {
     global $base_path;
     $output =& loader::lib('output');
     $params = $output->getAll();
     extract($params);
     if (!$templateid) {
         $templateid = TEMPLATEID;
     }
     $style_path = $base_path . TPLDIR . '/';
     $setting =& loader::model('setting');
     $theme_config = $setting->get_conf('theme_' . $templateid, array());
     if (isset($_config)) {
         if ($theme_config) {
             $_config = array_merge($_config, $theme_config);
         }
     } else {
         $_config = $theme_config;
     }
     $footer = '<script src="' . $statics_path . 'js/common.js" type="text/javascript"></script>';
     if (isset($loggedin) && $loggedin) {
         $footer .= '<script src="' . $statics_path . 'js/admin.js" type="text/javascript"></script>';
     }
     $footer .= 'Pow' . 'ered by <a href="http://mei' . 'upic.m' . 'eiu.cn/" target="_blank">Mei' . 'uPic ' . MPIC_VERSION . '</a> ';
     $footer .= safe_invert($setting->get_conf('site.footer'), true);
     $show_process_info = $setting->get_conf('system.show_process_info');
     ob_start();
     include $this->template($file, $templateid, $tpldir);
     $content = ob_get_clean();
     return $content;
 }
开发者ID:jorkin,项目名称:meiupic,代码行数:31,代码来源:template.mdl.php


示例16: view

 public function view()
 {
     $ct = CollectionType::getByHandle('pb_post');
     $ctID = $ct->getPageTypeID();
     if ($this->targetCID > 0) {
         $target = Page::getByID($this->targetCID);
         $this->set('target', $target);
     } else {
         $target = Page::getByPath('/blogsearch');
         $this->set('target', $target);
     }
     if (!$this->page_type) {
         $this->page_type = 'pb_post';
     }
     $page_type = trim($this->page_type);
     $query = "SELECT MIN(cv.cvDatePublic) as firstPost\n\t\t\tFROM CollectionVersions cv\n            INNER JOIN Pages pp ON cv.cID = pp.cID\n\t\t\tINNER JOIN PageTypes pt ON pp.ptID = pt.ptID\n\t\t\tWHERE pt.ptHandle = ? and cv.cvIsApproved = 1\n\t\t\tAND cv.cvDatePublic < CURDATE()\n            ORDER BY firstPost ASC";
     $db = Loader::db();
     $firstPost = $db->getOne($query, array($page_type));
     if (strlen($firstPost)) {
         $firstPost = new \DateTime($firstPost);
         $this->set('firstPost', $firstPost);
     }
     $this->set('numMonths', $this->numMonths);
     $this->set('navigation', loader::helper('navigation'));
 }
开发者ID:baardev,项目名称:lbtb,代码行数:25,代码来源:controller.php


示例17: __construct

 public function __construct($config = array())
 {
     parent::__construct();
     $this->config = $config;
     $this->config['driver'] = 'recaptcha';
     loader::library('captcha', $this->config);
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:7,代码来源:recaptcha.php


示例18: getPictures

 public static function getPictures($params = array())
 {
     if (!session::permission('users_groups_browse', 'users') && !session::permission('users_types_browse', 'users')) {
         return '';
     }
     loader::model('pictures/pictures');
     $template = isset($params['template']) ? $params['template'] : 'pictures/helpers/pictures';
     $user = isset($params['user']) && $params['user'] ? $params['user'] : array();
     $userID = $user ? $user['user_id'] : (isset($params['user_id']) ? $params['user_id'] : 0);
     $params['albums'] = true;
     if ($userID) {
         $params['join_columns'][] = '`p`.`user_id`=' . $userID;
     }
     if (!$userID || $userID != session::item('user_id')) {
         if ($userID) {
             $params['privacy'] = $userID;
         } else {
             $params['join_columns'][] = '`a`.`public`=1';
             $params['join_columns'][] = '`u`.`verified`=1';
             $params['join_columns'][] = '`u`.`active`=1';
             $params['join_columns'][] = '`u`.`group_id` IN (' . implode(',', session::permission('users_groups_browse', 'users')) . ')';
             $params['join_columns'][] = '`u`.`type_id` IN (' . implode(',', session::permission('users_types_browse', 'users')) . ')';
         }
     }
     $params['limit'] = isset($params['limit']) ? $params['limit'] : 10;
     $params['order'] = isset($params['order']) ? $params['order'] : '';
     $pictures = codebreeder::instance()->pictures_model->getPictures('in_list', $params['join_columns'], array(), $params['order'], $params['limit'], $params);
     view::assign(array('pictures' => $pictures, 'user' => $user, 'params' => $params), '', $template);
     return view::load($template, array(), 1);
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:30,代码来源:pictures.php


示例19: connect

 /**
  * @param array
  *   server = path to file
  */
 function connect()
 {
     if (!class_exists('SQLite3', 0)) {
         throw new dbal_exception('Sqlite support not compiled with PHP!');
     }
     if (empty($this->dbname)) {
         throw new dbal_exception('Sqlite connect empty database!');
     }
     // check is relative path (to site root)
     // $dbname = (substr($this->dbname, 0, 1) == '/')
     //    ? substr($this->dbname, 1)
     //    : ('../' . $this->dbname);
     $this->_db_file = loader::get_root($this->dbname);
     if (!file_exists($this->_db_file)) {
         throw new dbal_exception('No database: ' . $this->_db_file);
     }
     core::dprint(array('CONNECT %s %s', __CLASS__, $this->_db_file), core::E_SQL);
     $error = '';
     $this->_connect_id = new SQLite3($this->_db_file, SQLITE3_OPEN_READWRITE);
     if ($this->_connect_id) {
         $this->_connect_id->exec('PRAGMA short_column_names = 1');
         $this->_connect_id->exec('PRAGMA encoding = "UTF-8"');
     } else {
         throw new dbal_exception('Cant connect to database ' . $this->_db_file);
     }
     return $this->_connect_id;
 }
开发者ID:egregor-dev,项目名称:SatCMS,代码行数:31,代码来源:sqlite3.php


示例20: postBlog

 public function postBlog($items, $users)
 {
     $stream = array();
     loader::model('blogs/blogs');
     $params = array('select_users' => false);
     // Get blogs
     $columns = array('`b`.`blog_id` IN (' . implode(',', array_keys($items)) . ')');
     $blogs = codebreeder::instance()->blogs_model->getBlogs('in_list', $columns, array(), false, count($items), $params);
     foreach ($items as $itemID => $data) {
         if (isset($blogs[$itemID]) && isset($users[$blogs[$itemID]['user_id']])) {
             foreach ($data as $actionID => $item) {
                 $stream[$itemID][$actionID]['html'] = view::load('blogs/timeline/blog', array('user' => $users[$blogs[$itemID]['user_id']], 'blog' => $blogs[$itemID], 'params' => $item['params']), true);
                 $stream[$itemID][$actionID]['rating']['total_votes'] = $blogs[$itemID]['total_votes'];
                 $stream[$itemID][$actionID]['rating']['total_score'] = $blogs[$itemID]['total_score'];
                 $stream[$itemID][$actionID]['rating']['total_rating'] = $blogs[$itemID]['total_rating'];
                 $stream[$itemID][$actionID]['rating']['total_likes'] = $blogs[$itemID]['total_likes'];
                 $stream[$itemID][$actionID]['rating']['type'] = config::item('blog_rating', 'blogs');
                 $stream[$itemID][$actionID]['comments']['total_comments'] = $blogs[$itemID]['total_comments'];
                 $stream[$itemID][$actionID]['comments']['privacy'] = $blogs[$itemID]['comments'];
                 $stream[$itemID][$actionID]['comments']['post'] = $blogs[$itemID]['comments'] && codebreeder::instance()->users_model->getPrivacyAccess($blogs[$itemID]['user_id'], $blogs[$itemID]['comments'], false, $users[$blogs[$itemID]['user_id']]['friends'] ? 1 : 0) ? true : false;
             }
         }
     }
     return $stream;
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:25,代码来源:timeline.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP locale类代码示例发布时间:2022-05-23
下一篇:
PHP load类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap