本文整理汇总了PHP中pc_base::load_app_class方法的典型用法代码示例。如果您正苦于以下问题:PHP pc_base::load_app_class方法的具体用法?PHP pc_base::load_app_class怎么用?PHP pc_base::load_app_class使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pc_base
的用法示例。
在下文中一共展示了pc_base::load_app_class方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
parent::__construct();
$this->api = pc_base::load_app_class('guestbook_api');
$this->db = pc_base::load_model('guestbook_model');
$this->user_db = pc_base::load_model('member_detail_model');
}
示例2: __construct
function __construct()
{
parent::__construct();
$this->db = pc_base::load_model('extend_setting_model');
$this->sites = pc_base::load_app_class('sites');
pc_base::load_sys_class('form', '', 0);
}
示例3: __construct
function __construct()
{
$this->comment_data_db = pc_base::load_model('comment_data_model');
$this->comment_check_db = pc_base::load_model('comment_check_model');
parent::__construct();
$this->comment = pc_base::load_app_class('comment');
}
示例4: get_api
/**
* 获取api操作实例
* @param string $classname 接口调用的类文件名
* @param sting $module 模块名
* @return object
*/
public function get_api($module = 'admin')
{
if (!isset($this->api_list[$module]) || !is_object($this->api_list[$module])) {
$this->api_list[$module] = pc_base::load_app_class('push_api', $module);
}
return $this->api_list[$module];
}
示例5: get
public function get() {
$id = isset($_GET['id']) && intval($_GET['id']) ? intval($_GET['id']) : exit();
if ($data = $this->db->get_one(array('id'=>$id))) {
if (!$str = tpl_cache('dbsource_'.$id,$data['cache'])) {
if ($data['type'] == 1) { //自定义SQL调用
$get_db = pc_base::load_model("get_model");
$sql = $data['data'].(!empty($data['num']) ? " LIMIT $data[num]" : '');
$r= $get_db->query($sql);
while(($s = $get_db->fetch_next()) != false) {
$str[] = $s;
}
} else {
$filepath = PC_PATH.'modules'.DIRECTORY_SEPARATOR.$data['module'].DIRECTORY_SEPARATOR.'classes'.DIRECTORY_SEPARATOR.$data['module'].'_tag.class.php';
if (file_exists($filepath)) {
$pc_tag = pc_base::load_app_class($data['module'].'_tag', $data['module']);
if (!method_exists($pc_tag, $data['action'])) {
exit();
}
$sql = string2array($data['data']);
$sql['action'] = $data['action'];
$sql['limit'] = $data['num'];
unset($data['num']);
$str = $pc_tag->$data['action']($sql);
} else {
exit();
}
}
if ($data['cache']) setcache('dbsource_'.$id, $str, 'tpl_data');
}
echo $this->_format($data['id'], $str, $data['dis_type']);
}
}
示例6: init
public function init()
{
if (isset($_POST['dosubmit']) || isset($_GET['dosubmit'])) {
$page = $_GET['page'] ? intval($_GET['page']) : 0;
$modules = array(array('name' => L('module'), 'function' => 'module'), array('name' => L('sites'), 'mod' => 'admin', 'file' => 'sites', 'function' => 'set_cache'), array('name' => L('category'), 'function' => 'category'), array('name' => L('downservers'), 'function' => 'downservers'), array('name' => L('badword_name'), 'function' => 'badword'), array('name' => L('ipbanned'), 'function' => 'ipbanned'), array('name' => L('keylink'), 'function' => 'keylink'), array('name' => L('linkage'), 'function' => 'linkage'), array('name' => L('position'), 'function' => 'position'), array('name' => L('admin_role'), 'function' => 'admin_role'), array('name' => L('urlrule'), 'function' => 'urlrule'), array('name' => L('sitemodel'), 'function' => 'sitemodel'), array('name' => L('type'), 'function' => 'type', 'param' => 'content'), array('name' => L('workflow'), 'function' => 'workflow'), array('name' => L('dbsource'), 'function' => 'dbsource'), array('name' => L('member_setting'), 'function' => 'member_setting'), array('name' => L('member_group'), 'function' => 'member_group'), array('name' => L('membermodel'), 'function' => 'membermodel'), array('name' => L('member_model_field'), 'function' => 'member_model_field'), array('name' => L('search_type'), 'function' => 'type', 'param' => 'search'), array('name' => L('search_setting'), 'function' => 'search_setting'), array('name' => L('update_vote_setting'), 'function' => 'vote_setting'), array('name' => L('update_link_setting'), 'function' => 'link_setting'), array('name' => L('special'), 'function' => 'special'), array('name' => L('setting'), 'function' => 'setting'), array('name' => L('database'), 'function' => 'database'), array('name' => L('update_formguide_model'), 'mod' => 'formguide', 'file' => 'formguide', 'function' => 'public_cache'), array('name' => L('cache_file'), 'function' => 'cache2database'), array('name' => L('cache_copyfrom'), 'function' => 'copyfrom'), array('name' => L('clear_files'), 'function' => 'del_file'), array('name' => L('video_category_tb'), 'function' => 'video_category_tb'));
$this->cache_api = pc_base::load_app_class('cache_api', 'admin');
$m = $modules[$page];
if ($m['mod'] && $m['function']) {
if ($m['file'] == '') {
$m['file'] = $m['function'];
}
$M = getcache('modules', 'commons');
if (in_array($m['mod'], array_keys($M))) {
$cache = pc_base::load_app_class($m['file'], $m['mod']);
$cache->{$m}['function']();
}
} else {
if ($m['target'] == 'iframe') {
echo '<script type="text/javascript">window.parent.frames["hidden"].location="index.php?' . $m['link'] . '";</script>';
} else {
$this->cache_api->cache($m['function'], $m['param']);
}
}
$page++;
if (!empty($modules[$page])) {
echo '<script type="text/javascript">window.parent.addtext("<li>' . L('update') . $m['name'] . L('cache_file_success') . '..........</li>");</script>';
showmessage(L('update') . $m['name'] . L('cache_file_success'), '?m=admin&c=cache_all&page=' . $page . '&dosubmit=1&pc_hash=' . $_SESSION['pc_hash'], 0);
} else {
echo '<script type="text/javascript">window.parent.addtext("<li>' . L('update') . $m['name'] . L('site_cache_success') . '..........</li>")</script>';
showmessage(L('update') . $m['name'] . L('site_cache_success'), 'blank');
}
} else {
include $this->admin_tpl('cache_all');
}
}
示例7: uninstall
/**
* 模块卸载
*/
public function uninstall() {
if(!isset($_GET['module']) || empty($_GET['module'])) showmessage(L('illegal_parameters'));
$module_api = pc_base::load_app_class('module_api');
if(!$module_api->uninstall($_GET['module'])) showmessage($module_api->error_msg, 'blank');
else showmessage(L('uninstall_success'), '?m=zl_admin&c=module&a=cache&pc_hash='.$_SESSION['pc_hash']);
}
示例8: createindex
/**
* 创建索引
*/
public function createindex()
{
if (isset($_GET['dosubmit'])) {
//重建索引首先清空表所有数据,然后根据搜索类型接口重新全部重建索引
if (!isset($_GET['have_truncate'])) {
$db_tablepre = $this->db->db_tablepre;
//删除该站点全文索引
$this->db->delete(array('siteid' => $this->siteid));
$types = $this->type_db->select(array('siteid' => $this->siteid, 'module' => 'search'));
setcache('search_types', $types, 'search');
} else {
$types = getcache('search_types', 'search');
}
//$key typeid 的索引
$key = isset($_GET['key']) ? intval($_GET['key']) : 0;
foreach ($types as $_k => $_v) {
if ($key == $_k) {
$typeid = $_v['typeid'];
if ($_v['modelid']) {
if ($_v['typedir'] !== 'yp') {
$search_api = pc_base::load_app_class('search_api', 'content');
} else {
$search_api = pc_base::load_app_class('search_api', $_v['typedir']);
}
if (!isset($_GET['total'])) {
$total = $search_api->total($_v['modelid']);
} else {
$total = intval($_GET['total']);
$search_api->set_model($_v['modelid']);
}
} else {
$module = trim($_v['typedir']);
$search_api = pc_base::load_app_class('search_api', $module);
if (!isset($_GET['total'])) {
$total = $search_api->total();
} else {
$total = intval($_GET['total']);
}
}
$pagesize = $_GET['pagesize'] ? intval($_GET['pagesize']) : 50;
$page = max(intval($_GET['page']), 1);
$pages = ceil($total / $pagesize);
$datas = $search_api->fulltext_api($pagesize, $page);
foreach ($datas as $id => $r) {
$this->db->update_search($typeid, $id, $r['fulltextcontent'], $r['title'], $r['adddate'], 1);
}
$page++;
if ($pages >= $page) {
showmessage("正在更新 <span style='color:#ff0000;font-size:14px;text-decoration:underline;' >{$_v['name']}</span> - 总数:{$total} - 当前第 <font color='red'>{$page}</font> 页", "?m=search&c=search_admin&a=createindex&menuid=909&page={$page}&total={$total}&key={$key}&pagesize={$pagesize}&have_truncate=1&dosubmit=1");
}
$key++;
showmessage("开始更新: <span style='color:#ff0000;font-size:14px;text-decoration:underline;' >{$_v['name']}</span> - 总数:{$total}条", "?m=search&c=search_admin&a=createindex&menuid=909&page=1&key={$key}&pagesize={$pagesize}&have_truncate=1&dosubmit=1");
}
}
showmessage('全站索引更新完成', 'blank');
} else {
$big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=search&c=search_type&a=add\', title:\'' . L('add_search_type') . '\', width:\'580\', height:\'240\', lock:true}, function(){var d = window.top.art.dialog({id:\'add\'}).data.iframe;var form = d.document.getElementById(\'dosubmit\');form.click();return false;}, function(){window.top.art.dialog({id:\'add\'}).close()});void(0);', L('add_search_type'));
include $this->admin_tpl('createindex');
}
}
示例9: __construct
function __construct() {
$this->db = pc_base::load_model('content_model');
pc_base::load_app_class('rssbuilder','','','0');
$this->siteid = $_GET['siteid'] ? intval($_GET['siteid']) : '1';
$this->rssid = intval($_GET['rssid']);
define('SITEID', $this->siteid);
}
示例10: __construct
function __construct()
{
parent::__construct();
$this->sites = pc_base::load_app_class('sites', 'admin');
$this->db = pc_base::load_model('wap_model');
$this->type_db = pc_base::load_model('wap_type_model');
}
示例11: respond_post
/**
* 服务器端 POST形式响应
*/
public function respond_post()
{
$_POST['code'] = $_POST['code'] ? $_POST['code'] : $_GET['code'];
if ($_POST['code']) {
$payment = $this->get_by_code($_POST['code']);
if (!$payment) {
error_log(date('m-d H:i:s', SYS_TIME) . '| POST: payment is null |' . "\r\n", 3, CACHE_PATH . 'pay_error_log.php');
}
$cfg = unserialize_config($payment['config']);
$pay_name = ucwords($payment['pay_code']);
pc_base::load_app_class('pay_factory', '', 0);
$payment_handler = new pay_factory($pay_name, $cfg);
$return_data = $payment_handler->notify();
if ($return_data) {
if ($return_data['order_status'] == 0) {
$this->update_member_amount_by_sn($return_data['order_id']);
}
$this->update_recode_status_by_sn($return_data['order_id'], $return_data['order_status']);
$result = TRUE;
} else {
$result = FALSE;
}
$payment_handler->response($result);
}
}
示例12: template_list
/**
* 模板风格列表
* @param integer $siteid 站点ID,获取单个站点可使用的模板风格列表
* @param integer $disable 是否显示停用的{1:是,0:否}
*/
function template_list($siteid = '', $disable = 0)
{
$list = glob(PC_PATH . 'templates' . DIRECTORY_SEPARATOR . '*', GLOB_ONLYDIR);
$arr = $template = array();
if ($siteid) {
$site = pc_base::load_app_class('sites', 'admin');
$info = $site->get_by_id($siteid);
if ($info['template']) {
$template = explode(',', $info['template']);
}
}
foreach ($list as $key => $v) {
$dirname = basename($v);
if ($siteid && !in_array($dirname, $template)) {
continue;
}
if (file_exists($v . DIRECTORY_SEPARATOR . 'config.php')) {
$arr[$key] = (include $v . DIRECTORY_SEPARATOR . 'config.php');
if (!$disable && isset($arr[$key]['disable']) && $arr[$key]['disable'] == 1) {
unset($arr[$key]);
continue;
}
} else {
$arr[$key]['name'] = $dirname;
}
$arr[$key]['dirname'] = $dirname;
}
return $arr;
}
示例13: __construct
function __construct() {
parent::__construct();
$this->db = pc_base::load_model('position_model');
$this->db_data = pc_base::load_model('position_data_model');
$this->db_content = pc_base::load_model('content_model');
$this->sites = pc_base::load_app_class('sites');
}
示例14: __construct
function __construct() {
parent::__construct();
$this->db = pc_base::load_model('linkage_model');
$this->sites = pc_base::load_app_class('sites');
pc_base::load_sys_class('form', '', 0);
$this->childnode = array();
}
示例15: __construct
public function __construct()
{
pc_base::load_app_class('ku6api', 'video', 0);
$this->userid = param::get_cookie('userid');
$this->setting = getcache('video');
if (empty($this->setting)) {
showmessage(L('module_not_exists'));
}
$this->ku6api = new ku6api($this->setting['sn'], $this->setting['skey']);
}