本文整理汇总了PHP中loadClass函数的典型用法代码示例。如果您正苦于以下问题:PHP loadClass函数的具体用法?PHP loadClass怎么用?PHP loadClass使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了loadClass函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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';
}
}
示例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;
}
示例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');
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
}
示例8: __construct
public function __construct()
{
$param = loadClass('param');
define('M', $param->m());
define('C', $param->c());
define('A', $param->a());
$this->init();
}
示例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;
}
示例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;
}
示例11: login
public function login()
{
if (isset($_GET['dosubmit'])) {
echo '<pre>';
print_r($_GET);
} else {
loadClass('form', '', 0);
include $this->tpl('login');
}
}
示例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);
}
}
示例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;
}
示例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);
}
示例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);
}
}
}