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

PHP loadClass函数代码示例

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

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



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

示例1: CProductListFilter

 /**
  *                     $product_list_params_obj
  *        PRODUCT_LIST_PARAMS   default                              .
  *
  *                                               $product_list_params_obj
  *                              .                             $product_list_params_obj
  *                 default                                                          ,
  *                                  . .
  *
  *    22        2009, Default                                                  :
  * -                           HOME                       ,
  * -                      - SORT_BY_PRODUCT_SORT_ORDER,  . .   ,                  AZ
  * -               ,  . .
  * -                  Customer Zone,                   online          ,
  * -                  Customer Zone,
  *                        HOME,  . .                         ,
  *             ,                                   ,
  * -                  Customer Zone     General Settings        ,
  *                     ,                                           :           Quantity
  *                                           ,                                                    ,
  *                                .
  *
  * @return CProductListFilter
  */
 function CProductListFilter()
 {
     global $application;
     $this->product_list_params_obj = new PRODUCT_LIST_PARAMS();
     $this->product_list_params_obj->category_id = 1;
     $this->product_list_params_obj->select_mode_recursiveness = IN_CATEGORY_ONLY;
     if (modApiFunc('Users', 'getZone') == "CustomerZone") {
         $this->product_list_params_obj->membership_filter = true;
         //                                           ,
         // Bestsellers, Related Products, Featured Products, Random Set
         $product_type_filter = modApiFunc('Catalog', 'getCurrentProductTypeFilter');
         if (is_array($product_type_filter) && !empty($product_type_filter)) {
             $this->product_list_params_obj->filter_product_type_id_list = $product_type_filter;
         }
         $this->product_list_params_obj->select_online_products_only = true;
         if (modApiFunc("Configuration", "getValue", SYSCONFIG_STORE_SHOW_ABSENT) == STORE_SHOW_ABSENT_NOT_SHOW_NOT_BUY) {
             $this->product_list_params_obj->filter_stock_level_min = 1;
         }
         $sort_by_from_config = $application->getAppIni('PRODUCT_LIST_SORTER_DEFAULT');
         $this->product_list_params_obj->sort_by = $sort_by_from_config;
         //                                  Storefront
         loadClass('CCategoryInfo');
         $cat =& $application->getInstance('CCategoryInfo', 1);
         if ($cat->getShowProductsRecursivelyStatus() == CATEGORY_SHOW_PRODUCTS_RECURSIVELY) {
             $this->product_list_params_obj->select_mode_recursiveness = IN_CATEGORY_RECURSIVELY;
         }
     } else {
         $this->product_list_params_obj->sort_direction = 'ASC';
     }
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:54,代码来源:product_list_filter.php


示例2: doLogin

 public function doLogin()
 {
     $curlObj = loadClass('zhCurl');
     //获取登陆页
     $loginSite = "https://www.zhihu.com/";
     $loginHtml = $curlObj->getWebPage($loginSite);
     $html = loadClass('parserDom', $loginHtml['content']);
     $xsrf = $html->find('input[name=_xsrf]', 0)->getAttr('value');
     unset($html);
     //获取验证码并从CLI输入
     $captcha = "https://www.zhihu.com/captcha.gif?r=" . time() . rand(200, 999);
     $result = $curlObj->getWebPage($captcha);
     $captchaFile = dirname(__FILE__) . '/../res/login.gif';
     $handle = fopen($captchaFile, 'w+');
     fwrite($handle, $result['content']);
     fclose($handle);
     fwrite(STDOUT, "Pleate check the login.gif in project 'res' foler and enter it:\n");
     $captchaContent = trim(fgets(STDIN));
     $postParam = array('_xsrf' => $xsrf, 'email' => getConfig('zhAccount'), 'password' => getConfig('zhPassword'), 'remember_me' => 'true', 'captcha' => $captchaContent);
     $postUrl = 'https://www.zhihu.com/login/email';
     $result = $curlObj->getWebPage($postUrl, array(CURLOPT_POSTFIELDS => buildParamFromArray($postParam)));
     $loginResult = json_decode($result['content'], TRUE);
     if ($loginResult['r'] == 0) {
         fwrite(STDOUT, "Login Success\n");
     } else {
         fwrite(STDOUT, "Login Failed: {$loginResult['msg']}\n");
     }
     return $xsrf;
 }
开发者ID:ethanshancn,项目名称:zhSpider,代码行数:29,代码来源:login.php


示例3: NavigationBar

 /**
  * The view constructor.
  *
  * @ finish the functions on this page
  */
 function NavigationBar()
 {
     global $application;
     $this->pCatalog =& $application->getInstance('Catalog');
     $this->mTmplFiller =& $application->getInstance('TmplFiller');
     loadClass('CategoriesBrowserDynamic');
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:12,代码来源:navigation-bar-az.php


示例4: onAction

 function onAction()
 {
     $request = new Request();
     $category_id = $request->getValueByKey('category_id');
     /*
      *       :
      *                                                     ,                     .
      *                                                         default
      *               AZ (                                 AZ).
      *
      *        :
      *                   Catalog::getProductListByGlobalFilter       ,
      *                                                                                      .
      *                                 default                     .
      */
     //              default
     loadClass('CProductListFilter');
     $f = new CProductListFilter();
     $params = $f->getProductListParamsObject();
     $params->category_id = $category_id;
     $params->select_mode_recursiveness = IN_CATEGORY_ONLY;
     //
     $products_array = modApiFunc('Catalog', 'getProductListByFilter', $params, RETURN_AS_ID_LIST);
     $products = array();
     if (!empty($products_array)) {
         foreach ($products_array as $pinfo) {
             $obj = new CProductInfo($pinfo['product_id']);
             $products[] = array('id' => $pinfo['product_id'], 'name' => $obj->getProductTagValue('Name'));
         }
     }
     global $_RESULT;
     $_RESULT['products'] = $products;
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:33,代码来源:ajax_get_plist.php


示例5: getList

 public function getList($page)
 {
     $url = $this->answerUrl . '?page=' . $page;
     $result = $this->curlObj->getWebPage($url, array(CURLOPT_HTTPGET => TRUE));
     $result['content'];
     $webSite = loadClass('parserDom', $result['content']);
     $webSite->find("#zh-profile-answer-list");
     $webSite = loadClass('parserDom', $result['content']);
     $answerList = $webSite->find("#zh-profile-answer-list", 0)->getChildList();
     unset($webSite);
     foreach ($answerList as $key => $val) {
         $arrInf = array();
         $tmp = $val->firstChild()->firstChild();
         $arrTmp = $this->dealAnswerHref($tmp->getAttr("href"));
         $arrInf['iQuestionId'] = $arrTmp['iQuestionId'];
         $arrInf['sContent'] = $tmp->getPlainText();
         $arrInf['sQuestionURL'] = $arrTmp['sQuestionURL'];
         $this->dbModel->addQuestion($arrInf);
         $arrInf = array('iQuestionId' => $arrTmp['iQuestionId'], 'iAnswerId' => $arrTmp['iAnswerId'], 'sAnswerURL' => $arrTmp['sAnswerURL']);
         unset($tmp, $arrTmp);
         $arrInf['sHashId'] = $this->hashId;
         $arrInf['sContent'] = ($tmp = $val->find("div.zm-item-rich-text", 0)) && ($tmp2 = $tmp->firstChild()) ? $tmp2->getPlainText() : '';
         $arrInf['iVoteUp'] = ($tmp = $val->find("button.up", 0)) && ($tmp2 = $tmp->getChild(1)) ? $tmp2->getPlainText() : 0;
         $this->dbModel->addAnswer($arrInf);
     }
 }
开发者ID:ethanshancn,项目名称:zhSpider,代码行数:26,代码来源:answers.php


示例6: onAction

 function onAction()
 {
     loadClass('GiftCertificateCreator');
     $cr = new GiftCertificateCreator();
     //                                    ,                .             ,
     //         $map                 $_POST          .
     //                              ,                     .
     $cr->initByMap($_POST);
     //                     .
     $cr->save();
     if ($cr->isError()) {
         modApiFunc('Session', 'set', 'gc_update_action_result', 'failed');
         modApiFunc('Session', 'set', 'gc_update_action_errors', $cr->errors);
         modApiFunc('Session', 'set', 'SessionPost', $_POST);
     } else {
         modApiFunc('Session', 'set', 'gc_update_action_result', 'created');
         if ($cr->sendtype === GC_SENDTYPE_EMAIL && $cr->status === GC_STATUS_ACTIVE) {
             modApiFunc('EventsManager', 'throwEvent', 'GiftCertificateCreated', $cr);
         }
         $request = new Request();
         $request->setView('GiftCertificateEditView');
         $request->setKey('gc_code', $cr->code);
         global $application;
         $application->redirect($request);
     }
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:26,代码来源:GiftCertificateAddAction.php


示例7: onAction

 function onAction()
 {
     $gc_code = modApiFunc('Request', 'getValueByKey', 'gc_code');
     if (Validator::isNotEmpty($gc_code) && modApiFunc('GiftCertificateApi', 'isCodeValid', $gc_code) && modApiFunc('GiftCertificateApi', 'doesCodeExist', $gc_code)) {
         loadClass('GiftCertificateUpdater');
         //
         $cr = new GiftCertificateUpdater($gc_code);
         //         ,
         if ($cr->isError()) {
             modApiFunc('Session', 'set', 'gc_update_action_result', 'failed');
             modApiFunc('Session', 'set', 'gc_update_action_errors', $cr->errors);
             modApiFunc('Session', 'set', 'SessionPost', $_POST);
             return;
         }
         //                                    ,                .             ,
         //         $map                 $_POST          .
         //                              ,                     .
         $cr->initByMap($_POST);
         //                     .
         $cr->save();
         if ($cr->isError()) {
             modApiFunc('Session', 'set', 'gc_update_action_result', 'failed');
             modApiFunc('Session', 'set', 'gc_update_action_errors', $cr->errors);
             modApiFunc('Session', 'set', 'SessionPost', $_POST);
         } else {
             modApiFunc('Session', 'set', 'gc_update_action_result', 'updated');
             if ($cr->sendtype === GC_SENDTYPE_EMAIL && $cr->status === GC_STATUS_ACTIVE) {
                 modApiFunc('EventsManager', 'throwEvent', 'GiftCertificateCreated', $cr);
             }
         }
     }
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:32,代码来源:GiftCertificateUpdateAction.php


示例8: __construct

 public function __construct()
 {
     $param = loadClass('param');
     define('M', $param->m());
     define('C', $param->c());
     define('A', $param->a());
     $this->init();
 }
开发者ID:iquanxin,项目名称:march,代码行数:8,代码来源:app.cls.php


示例9: output

 function output()
 {
     global $application;
     loadClass('GiftCertificateCreator');
     loadClass('GiftCertificateApi');
     $application->registerAttributes(array('Local_Items', 'Local_GC_id', 'Local_GC_Code', 'Local_GC_From', 'Local_GC_To', 'Local_GC_Amount', 'Local_GC_Remainder', 'Local_GC_Sendtype', 'Local_GC_Status', 'Local_GC_date_Created', 'AddGiftCertificateHref', 'Local_Dell_GC_Href'));
     $res = $this->filler->fill("", "container.tpl.html", array());
     return $res;
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:9,代码来源:gc_list_az.php


示例10: CProductSetTagSettings

 function CProductSetTagSettings()
 {
     global $application;
     $this->template = array('Directory' => 'catalog/product-set/default/', 'Container' => 'product-set-container.tpl.html', 'ContainerEmpty' => 'product-set-container-empty.tpl.html', 'Item' => 'product-set-item.tpl.html', 'ItemOutOfStock' => 'product-set-item-out-of-stock.tpl.html');
     //                c default
     loadClass('CProductListFilter');
     $f = new CProductListFilter();
     $this->filter = $f->getProductListParamsObject();
     $this->filter->use_paginator = true;
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:10,代码来源:product_list_tag_settings.php


示例11: login

 public function login()
 {
     if (isset($_GET['dosubmit'])) {
         echo '<pre>';
         print_r($_GET);
     } else {
         loadClass('form', '', 0);
         include $this->tpl('login');
     }
 }
开发者ID:iquanxin,项目名称:march,代码行数:10,代码来源:index.php


示例12: checkRights

 public static function checkRights($page, $action, $token)
 {
     loadClass('status');
     loadClass('token');
     loadClass('action');
     loadClass('right');
     loadClass('customer');
     if (is_null($action)) {
         Functions::setResponse(400);
     }
     $pagename = str_replace('.php', '', basename($page));
     $actionName = $pagename . '-' . $action;
     $whereClause = 'name=:name';
     $params = array(array('id' => ':name', 'value' => $actionName));
     $result = Action::search($whereClause, $params);
     if (!count($result)) {
         echo 'Please update actions and rights!';
         Functions::setResponse(500);
     }
     $action = $result[0];
     define('LOGGED_OUT_STATUS', 'standard');
     $loggedOut = false;
     if (is_null($token) || strtolower($token) == 'none') {
         $loggedOut = true;
     } else {
         $whereClause = 'value=:value';
         $params = array(array('id' => ':value', 'value' => $token));
         $result = Token::search($whereClause, $params);
         if (!count($result)) {
             Functions::setResponse(498);
         } else {
             $token = $result[0];
             $customer = new Customer($token->get('customerId'));
             $status = new Status($customer->get('statusId'));
         }
     }
     if ($loggedOut) {
         $whereClause = 'name=:name';
         $params = array(array('id' => ':name', 'value' => LOGGED_OUT_STATUS));
         $result = Status::search($whereClause, $params);
         if (!count($result)) {
             Functions::setResponse(500);
         }
         $status = $result[0];
     }
     $whereClause = 'action_id=:action_id AND status_id=:status_id';
     $params = array(array('id' => ':action_id', 'value' => $action->get('id')), array('id' => ':status_id', 'value' => $status->get('id')));
     $result = Right::search($whereClause, $params);
     if (!count($result)) {
         Functions::setResponse(401);
     }
     if ($result[0]->get('right') == 'deny') {
         Functions::setResponse(401);
     }
 }
开发者ID:Babaritech,项目名称:babar2,代码行数:55,代码来源:functions.class.php


示例13: getCurrentGC

 function getCurrentGC()
 {
     loadClass('GiftCertificateCreator');
     $gc = new GiftCertificateCreator();
     if (modApiFunc('Session', 'is_Set', 'SessionPost')) {
         $SessionPost = modApiFunc('Session', 'get', 'SessionPost');
         modApiFunc('Session', 'un_Set', 'SessionPost');
         $gc->initByMap($SessionPost);
     }
     return $gc;
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:11,代码来源:gc_add_az.php


示例14: prepareData

 function prepareData()
 {
     loadClass('CProductInfo');
     $this->__source->run();
     $render_data = array();
     while ($row = $this->__source->fetchRecord()) {
         $row['date'] = $this->__prepareDateToDisplay($row);
         $render_data[] = $row;
     }
     $this->__render_settings->setReportData($render_data);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:11,代码来源:charts_product_views_by_period.php


示例15: TransactionTracking

 /**
  *            .                                               .
  *                       (                 transaction tracking
  *       ) -                                        :
  *                            .
  */
 function TransactionTracking()
 {
     $BundledModules = TransactionTracking::getBundledModules();
     $InstalledModules = TransactionTracking::getInstalledModules();
     foreach ($BundledModules as $bundled_module_id) {
         if (!isset($InstalledModules[$bundled_module_id])) {
             //                        .
             loadClass('TransactionTrackingInstaller');
             TransactionTrackingInstaller::intstallModule($bundled_module_id);
         }
     }
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:18,代码来源:transaction_tracking_api.php


示例16: output

 /**
  * The main function to output the viewer
  */
 function output()
 {
     global $application;
     // filling params for product browser
     $pb_params = array('show_category_path' => true, 'buttons' => array('add' => array('label' => 'BTN_SELECT', 'callback' => 'selectProduct(%PID%, %PNAME%);', 'default_state' => 'disabled', 'enable_condition' => 'product_selected')), 'choosed_control_array' => 'product_array');
     // creating product browser class
     loadClass('ProductsBrowser');
     $this->pb_obj = new ProductsBrowser();
     $template_contents = array('Local_ProductsBrowser' => $this->pb_obj->output($pb_params), 'CallbackForm' => $this->_formname, 'CallbackIDField' => $this->_pidfield, 'CallbackNameField' => $this->_pnamefield, 'CallbackFunction' => $this->_use_callback, 'PrefilledPID' => $this->_prefilledPID);
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     return $this->mTmplFiller->fill('customer_reviews/select_product/', 'container.tpl.html', array());
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:16,代码来源:cr_select_product_az.php


示例17: connect

 public function connect($setting)
 {
     $object = null;
     switch ($this->_config[$setting]['type']) {
         case 'mysqli':
             $object = loadClass('mysqli_db');
             break;
         default:
             $object = loadClass('mysqli_db');
     }
     $object->open($this->_config[$setting]);
     //尝试连接数据库
     return $object;
 }
开发者ID:iquanxin,项目名称:march,代码行数:14,代码来源:db.cls.php


示例18: init

 function init()
 {
     loadClass($this->__source_class_name);
     loadClass($this->__render_settings_class_name);
     loadClass($this->__render_class_name);
     $source_class = $this->__source_class_name;
     $this->__source = new $source_class();
     $this->initSource();
     $settings_class = $this->__render_settings_class_name;
     $this->__render_settings = new $settings_class();
     $this->__render_settings->setReportID(get_class($this));
     $render_class = $this->__render_class_name;
     $this->__render = new $render_class();
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:14,代码来源:report_view.php


示例19: install

 function install()
 {
     $query = new DB_Table_Create(Notifications::getTables());
     loadClass('Notifications_Installer');
     $installer = new Notifications_Installer();
     $installer->doInstall();
     $param_info = array('GROUP_NAME' => 'TIMELINE', 'PARAM_NAME' => 'LOG_EMAIL_SEND', 'PARAM_DESCRIPTION' => array('NAME' => array('NTFCTN', 'ADV_CFG_LOG_EMAIL_SEND_NAME'), 'DESCRIPTION' => array('NTFCTN', 'ADV_CFG_LOG_EMAIL_SEND_DESCR')), 'PARAM_TYPE' => PARAM_TYPE_LIST, 'PARAM_VALUE_LIST' => array(array('VALUE' => 'NO', 'VALUE_DESCRIPTION' => array('NAME' => array('NTFCTN', 'ADV_CFG_LOG_EMAIL_SEND_NO'), 'DESCRIPTION' => array('NTFCTN', 'ADV_CFG_LOG_EMAIL_SEND_NO'))), array('VALUE' => 'YES', 'VALUE_DESCRIPTION' => array('NAME' => array('NTFCTN', 'ADV_CFG_LOG_EMAIL_SEND_YES'), 'DESCRIPTION' => array('NTFCTN', 'ADV_CFG_LOG_EMAIL_SEND_YES')))), 'PARAM_CURRENT_VALUE' => 'YES', 'PARAM_DEFAULT_VALUE' => 'YES');
     modApiFunc('Settings', 'createParam', $param_info);
     $group_info = array('GROUP_NAME' => 'EMAIL_NOTIFICATION_SETTINGS', 'GROUP_DESCRIPTION' => array('NAME' => array('NTFCTN', 'ADV_CFG_NTFCTN_SETTINGS_GROUP_NAME'), 'DESCRIPTION' => array('NTFCTN', 'ADV_CFG_NTFCTN_SETTINGS_GROUP_DESCR')), 'GROUP_VISIBILITY' => 'SHOW');
     /*@ add to constants */
     modApiFunc('Settings', 'createGroup', $group_info);
     $param_info = array('GROUP_NAME' => $group_info['GROUP_NAME'], 'PARAM_NAME' => 'EMAIL_NOTIFICATION_FORMAT', 'PARAM_DESCRIPTION' => array('NAME' => array('NTFCTN', 'ADV_EMAIL_NOTIFICATION_NAME'), 'DESCRIPTION' => array('NTFCTN', 'ADV_EMAIL_NOTIFICATION_DESCR')), 'PARAM_TYPE' => PARAM_TYPE_LIST, 'PARAM_VALUE_LIST' => array(array('VALUE' => 'TEXT', 'VALUE_DESCRIPTION' => array('NAME' => array('NTFCTN', 'ADV_CFG_EMAIL_TEXT'), 'DESCRIPTION' => array('NTFCTN', 'ADV_CFG_EMAIL_TEXT'))), array('VALUE' => 'HTML', 'VALUE_DESCRIPTION' => array('NAME' => array('NTFCTN', 'ADV_CFG_EMAIL_HTML'), 'DESCRIPTION' => array('NTFCTN', 'ADV_CFG_EMAIL_HTML')))), 'PARAM_CURRENT_VALUE' => 'TEXT', 'PARAM_DEFAULT_VALUE' => 'TEXT');
     modApiFunc('Settings', 'createParam', $param_info);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:14,代码来源:notifications_api.php


示例20: _controller_init

 private function _controller_init()
 {
     $classes = array('bank' => 'Bank', 'output' => 'Output', 'view' => 'View');
     foreach ($classes as $var => $class) {
         $this->{$var} =& loadClass($class);
     }
     $_toload = $this->bank->retrieve('config', 'functionality');
     if ($_toload != null && is_array($_toload)) {
         foreach ($_toload as $_toloado) {
             $this->{$_toloado} =& loadClass($_toloado);
         }
         unset($_toloado);
     }
     unset($_toload);
 }
开发者ID:richardw,项目名称:Web,代码行数:15,代码来源:controller.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP loadClassFile函数代码示例发布时间:2022-05-15
下一篇:
PHP loadBean函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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