本文整理汇总了PHP中vmc::serviceList方法的典型用法代码示例。如果您正苦于以下问题:PHP vmc::serviceList方法的具体用法?PHP vmc::serviceList怎么用?PHP vmc::serviceList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vmc
的用法示例。
在下文中一共展示了vmc::serviceList方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dorecycle
function dorecycle($mdl_name, $filter = null)
{
$oRecycle = app::get('desktop')->model('recycle');
list($app_id, $table) = explode('_mdl_', $mdl_name);
$o = app::get($app_id)->model($table);
$recycle_item = array();
$recycle_item['drop_time'] = time();
$recycle_item['item_type'] = $o->table_name();
$dbschema = $o->get_schema();
$textColumn = $dbschema['textColumn'];
$pkey = $dbschema['idColumn'];
foreach ($dbschema['columns'] as $k => $col) {
if ($col['is_title'] && $col['sdfpath']) {
$textColumn = $col['sdfpath'];
break;
}
}
$rows = $o->getList('*', $filter, 0, -1);
if (method_exists($o, 'pre_recycle')) {
if (!$o->pre_recycle($rows)) {
return false;
}
}
$menus = app::get('desktop')->model('menus');
$permission_id = $menus->permissionId($_GET);
foreach ($rows as $k => $v) {
$pkey_value = $v[$pkey];
$v = $o->dump($v[$pkey], '*', 'delete');
$recycle_item['item_sdf'] = $v;
$recycle_item['app_key'] = $app_id;
$recycle_item['item_title'] = $v[$textColumn];
if (method_exists($o, 'title_recycle')) {
$recycle_item['item_title'] = $o->title_recycle($v);
}
$tmp = $recycle_item;
$tmp['permission'] = $permission_id;
$return = $oRecycle->save($tmp);
unset($tmp[$pkey]);
$o->delete(array($pkey => $pkey_value));
#↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓记录管理员操作日志@lujy↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
if ($obj_operatorlogs = vmc::service('operatorlog.system')) {
if (method_exists($obj_operatorlogs, 'dorecycle')) {
$obj_operatorlogs->dorecycle($v);
}
}
#↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑记录管理员操作日志@lujy↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
}
if (method_exists($o, 'suf_recycle')) {
if (!$o->suf_recycle($_POST)) {
return false;
}
}
$services = vmc::serviceList('desktop_finder_callback.' . get_class($o));
foreach ($services as $service) {
if (method_exists($service, 'recycle')) {
$service->recycle($_POST);
}
}
return true;
}
示例2: pre_display
public function pre_display(&$content)
{
if ($this->_ignore_pre_display === false) {
foreach (vmc::serviceList('base_render_pre_display') as $service) {
if (method_exists($service, 'pre_display')) {
$service->pre_display($content);
}
}
}
}
示例3: getList
/**
* 重写getList方法
*/
public function getList($cols = '*', $filter = array(), $offset = 0, $limit = -1, $orderType = null)
{
$arr_list = parent::getList($cols, $filter, $offset, $limit, $orderType);
$obj_extends_order_service = vmc::serviceList('b2c_order_extends_actions');
if ($obj_extends_order_service) {
foreach ($obj_extends_order_service as $obj) {
$obj->extend_list($arr_list);
}
}
$info_object = vmc::service('sensitive_information');
if (is_object($info_object)) {
$info_object->opinfo($arr_list, 'b2c_mdl_orders', __FUNCTION__);
}
return $arr_list;
}
示例4: getList
public function getList($cols = '*', $filter = array('status' => 'false'), $offset = 0, $limit = -1, $orderby = null)
{
$services = vmc::serviceList('passport');
foreach ($services as $service) {
if ($service instanceof pam_interface_passport) {
$a_temp = $service->get_config();
$item['passport_id'] = $a_temp['passport_id']['value'];
$item['passport_name'] = $a_temp['passport_name']['value'];
$item['passport_status'] = $a_temp['passport_status']['value'];
$item['passport_version'] = $a_temp['passport_version']['value'];
$ret[] = $item;
}
}
return $ret;
}
示例5: save
public function save()
{
$this->begin('index.php?app=content&ctl=admin_node&act=index');
$post = $this->_request->get_post('node');
$node_id = $this->_request->get_post('node_id');
if (empty($post)) {
$this->end(false, '错误请求');
}
if ($post['parent_id']) {
//存在父类目时,查看父类目是否启用
$aInfo = vmc::singleton("content_article_node")->get_node($post['parent_id']);
if ($aInfo['ifpub'] == 'false' && $post['ifpub']) {
if ($post['ifpub'] != $aInfo['ifpub']) {
$post['ifpub'] = $aInfo['ifpub'];
$msg = '父栏目未发布!';
}
}
}
$post['uptime'] = time();
$post['homepage'] = 'true';
if ($node_id > 0) {
$res = app::get('content')->model('article_nodes')->update($post, array('node_id' => $node_id));
if ($res) {
$services = vmc::serviceList('content_article_node');
foreach ($services as $service) {
if ($service instanceof content_interface_node) {
$service->update($node_id, $post);
}
}
$this->end(true, '保存成功!' . $msg);
} else {
$this->end(false, '保存失败!' . $msg);
}
} else {
$res = app::get('content')->model('article_nodes')->insert($post);
if ($res) {
$services = vmc::serviceList('content_article_node');
foreach ($services as $service) {
if ($service instanceof content_interface_node) {
$service->insert($post);
}
}
$this->end(true, '添加成功!' . $msg);
} else {
$this->end(false, '添加失败!' . $msg);
}
}
}
示例6: _exception_handler
private static function _exception_handler($exception)
{
foreach (vmc::serviceList('base_exception_handler') as $service) {
if (method_exists($service, 'pre_display')) {
$service->pre_display($content);
}
}
$message = $exception->getMessage();
$code = $exception->getCode();
$file = $exception->getFile();
$line = $exception->getLine();
$trace = $exception->getTrace();
$trace_message = $exception->getTraceAsString();
$trace_message = null;
$root_path = realpath(ROOT_DIR);
$output = ob_end_clean();
$position = str_replace($root_path, '»', $file) . ':' . $line;
$i = 0;
$trace = array_reverse($trace);
$count_trace = count($trace);
foreach ($trace as $t) {
if (!($t['class'] == 'vmc' && $t['function'] == 'exception_error_handler')) {
$t['file'] = str_replace($root_path, 'ROOT:', $t['file']);
$basename = basename($t['file']);
if ($i == $count_trace - 1) {
$trace_message .= '<li style="color:#333;font-weight:bold;"><strong style="color:#f00">»</strong>';
} else {
$trace_message .= '<li style="color:#999;"><strong> </strong>';
}
if ($t['args']) {
// var_dump(debug_backtrace());
$args = array();
foreach ($t['args'] as $arg_info) {
if (is_array($arg_info) || is_string($arg_info) && strlen($arg_info) > 20) {
$args[] = "<a href='javascript:;' onclick=\"alert(this.nextSibling.innerHTML)\">...</a><span style='display:none'>" . self::_var_export($arg_info) . "</span>";
} else {
if (is_object($arg_info)) {
$arg_detail = self::_var_export($arg_info);
$arg_info = get_class($arg_info);
$args[] = "object(<a href='javascript:;' onclick=\"alert(this.nextSibling.innerHTML)\">{$arg_info}</a><span style='display:none'>{$arg_detail}</span>)";
} else {
$args[] = var_export(htmlspecialchars($arg_info), 1);
}
}
}
$args = implode(',', $args);
} else {
$args = '';
}
if ($t['line'] && $basename) {
$trace_message .= "[{$basename}:{$t['line']}] {$t['class']}{$t['type']}{$t['function']}({$args})</li>";
} else {
$trace_message .= "{$t['class']}{$t['type']}{$t['function']}({$args})</li>";
}
$i++;
}
}
$output = <<<EOF
<h1>{$message}
<small>{$position}</small>
</h1>
<ol>
{$trace_message}
</ol>
EOF;
self::output($output, 'Track');
}
示例7: get_global_varys
public static function get_global_varys()
{
$app_varys = array();
$serviceList = vmc::serviceList('cachemgr_global_vary');
foreach ($serviceList as $service) {
$class_name = get_class($service);
$p = strpos($class_name, '_');
$varys = null;
if (method_exists($service, 'get_varys')) {
$varys = (array) $service->get_varys();
}
if (is_array($varys) && $p) {
$app_id = substr($class_name, 0, $p);
if (isset($app_varys[$app_id])) {
$app_varys[$app_id] = array_merge($app_varys[$app_id], $varys);
} else {
$app_varys[$app_id] = $varys;
}
ksort($app_varys[$app_id]);
}
}
ksort($app_varys);
return $app_varys;
}
示例8: save
public function save()
{
$post = $this->_request->get_post('node');
$node_id = $this->_request->get_post('node_id');
if (empty($post)) {
$this->splash('error', array('app' => 'seller', 'ctl' => 'site_node', 'act' => 'index'), '错误请求');
}
if ($post['parent_id']) {
//存在父类目时,查看父类目是否启用
$aInfo = vmc::singleton("content_article_node")->get_node($post['parent_id']);
if ($aInfo['ifpub'] == 'false' && $post['ifpub']) {
if ($post['ifpub'] != $aInfo['ifpub']) {
$post['ifpub'] = $aInfo['ifpub'];
$msg = '父栏目未发布!';
}
}
}
$post['uptime'] = time();
$post['homepage'] = 'true';
if ($node_id > 0) {
$res = app::get('content')->model('article_nodes')->update($post, array('node_id' => $node_id));
if ($res) {
$services = vmc::serviceList('content_article_node');
foreach ($services as $service) {
if ($service instanceof content_interface_node) {
$service->update($node_id, $post);
}
}
$this->splash('success', array('app' => 'seller', 'ctl' => 'site_node', 'act' => 'index'), '保存成功');
} else {
$this->splash('error', array('app' => 'seller', 'ctl' => 'site_node', 'act' => 'index'), '错误请求');
}
} else {
$res = app::get('content')->model('article_nodes')->insert($post);
if ($res) {
$services = vmc::serviceList('content_article_node');
foreach ($services as $service) {
if ($service instanceof content_interface_node) {
$service->insert($post);
}
}
$this->splash('success', array('app' => 'seller', 'ctl' => 'site_node', 'act' => 'index'), '保存成功');
} else {
$this->splash('error', array('app' => 'seller', 'ctl' => 'site_node', 'act' => 'index'), '错误请求');
}
}
}
示例9: save
public function save()
{
$this->begin('index.php?app=content&ctl=admin_article');
$post = $this->_request->get_post('article');
$article_id = $this->_request->get_post('article_id');
$post['indexs']['pubtime'] = time();
if ($article_id > 0) {
$res = app::get('content')->model('article_indexs')->update($post['indexs'], array('article_id' => $article_id));
if ($res) {
$res = app::get('content')->model('article_bodys')->update($post['bodys'], array('article_id' => $article_id));
if ($res) {
$services = vmc::serviceList('content_article_index');
foreach ($services as $service) {
if ($service instanceof content_interface_index) {
$service->update($article_id, $post);
}
}
$this->end(true, '保存成功');
} else {
$this->end(false, '保存失败');
}
} else {
$this->end(false, '保存失败');
}
} else {
$res = app::get('content')->model('article_indexs')->insert($post['indexs']);
if ($res) {
$post['bodys']['article_id'] = $res;
$res = app::get('content')->model('article_bodys')->insert($post['bodys']);
if ($res) {
$services = vmc::serviceList('content_article_index');
foreach ($services as $service) {
if ($service instanceof content_interface_index) {
$service->insert($post);
}
}
$this->end(true, '添加成功', null, array('id' => $post['bodys']['article_id']));
} else {
$this->end(false, '添加失败');
}
} else {
$this->end(false, '添加失败');
}
}
}