当前位置: 首页>>代码示例>>PHP>>正文


PHP vmc::base_url方法代码示例

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


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

示例1: flush

 public function flush()
 {
     $base_url = vmc::base_url();
     foreach ($this->db->select('select queue_id from vmc_base_queue limit ' . $this->limit) as $r) {
         $this->runtask($r['queue_id']);
     }
 }
开发者ID:yindonghai,项目名称:msk.com,代码行数:7,代码来源:queue.php

示例2: index

 public function index()
 {
     $desktop_user = vmc::singleton('desktop_user');
     $menus = $desktop_user->get_work_menu();
     $user_id = $this->user->get_id();
     foreach ((array) $menus['workground'] as $key => $value) {
         //if($i++>$workground_count) break;
         $fav_menus[] = $key;
     }
     $this->pagedata['title'] = $title;
     $this->pagedata['title_desc'] = $title_desc;
     $this->pagedata['session_id'] = vmc::singleton('base_session')->sess_id();
     $this->pagedata['uname'] = $this->user->get_login_name();
     $this->pagedata['avatar'] = $this->user->get_avatar();
     $this->pagedata['is_super'] = $this->user->is_super();
     $this->pagedata['param_id'] = $user_id;
     $this->pagedata['menus'] = $menus;
     $this->pagedata['fav_menus'] = (array) $fav_menus;
     $this->pagedata['shop_base'] = vmc::base_url(1);
     $this->pagedata['shopadmin_dir'] = $_SERVER['REQUEST_URI'];
     // 桌面内容替换埋点
     foreach (vmc::servicelist('desktop_content') as $services) {
         if (is_object($services)) {
             if (method_exists($services, 'changeContent')) {
                 $services->changeContent(app::get('desktop'));
                 $services->changeContent($desktop_menu);
             }
         }
     }
     $this->display('index.html');
 }
开发者ID:yindonghai,项目名称:msk.com,代码行数:31,代码来源:default.php

示例3: detail_statics

 public function detail_statics($id)
 {
     $render = app::get('routeplus')->render();
     $render->pagedata['base_url'] = vmc::base_url(true);
     $render->pagedata['app_url_map'] = vmc::$app_url_map;
     $render->pagedata['statics'] = app::get('routeplus')->model('statics')->dump($id);
     return $render->fetch('admin/edit_statics.html');
 }
开发者ID:yindonghai,项目名称:msk.com,代码行数:8,代码来源:statics.php

示例4: show

 public function show($run_id)
 {
     /*
             $oXHProf = $this->app->model('xhprof');
             $this->pagedata["data"] = $oXHProf->read_data($run_id);
             $this->display("/admin/show_data.html");*/
     echo "<iframe src='" . vmc::base_url(1) . "/app/serveradm/vendor/xhprof_html/index.php?run=" . $run_id . "&source=xhprof' width='100%' height='100%'></iframe>";
 }
开发者ID:yindonghai,项目名称:msk.com,代码行数:8,代码来源:xhprof.php

示例5: get_varys

 public function get_varys()
 {
     $varys['HOST'] = vmc::base_url(true);
     //host信息
     $varys['REWRITE'] = defined('URL_REWRITE') ? URL_REWRITE : '';
     //是否有rewirte支持
     return $varys;
 }
开发者ID:yindonghai,项目名称:msk.com,代码行数:8,代码来源:cachevary.php

示例6: base_url

 public function base_url($full = false)
 {
     $c = $full ? 'full' : 'part';
     if (!$this->base_url[$c]) {
         $part = vmc::$app_url_map[$this->app_id];
         $this->base_url[$c] = vmc::base_url($full) . vmc::url_prefix() . $part . ($part == '/' ? '' : '/');
     }
     return $this->base_url[$c];
 }
开发者ID:yindonghai,项目名称:msk.com,代码行数:9,代码来源:app.php

示例7: write_lock_file

 public function write_lock_file($cookie = true)
 {
     $lock_code = md5(microtime()) . md5(print_r($_SERVER, 1));
     if ($this->put_lockfile($this->lockcode_prefix . $lock_code)) {
         $path = vmc::base_url();
         $path = $path ? $path : '/';
         return true;
     } else {
         return false;
     }
 }
开发者ID:yindonghai,项目名称:msk.com,代码行数:11,代码来源:lock.php

示例8: set_cookie

 function set_cookie($name, $value, $expire = false, $path = null)
 {
     if (!$this->cookie_path) {
         $this->cookie_path = vmc::base_url() . '/';
         #$this->cookie_path = substr(PHP_SELF, 0, strrpos(PHP_SELF, '/')).'/';
         $this->cookie_life = $this->app->getConf('system.cookie.life');
     }
     $this->cookie_life = $this->cookie_life > 0 ? $this->cookie_life : 315360000;
     $expire = $expire === false ? time() + $this->cookie_life : $expire;
     setcookie($name, $value, $expire, $this->cookie_path);
     $_COOKIE[$name] = $value;
 }
开发者ID:noikiy,项目名称:msk.com,代码行数:12,代码来源:frontpage.php

示例9: __construct

 public function __construct()
 {
     $this->base_url = vmc::base_url('full') . '/';
     if (!defined('FILE_STORAGER')) {
         define('FILE_STORAGER', 'filesystem');
     }
     $this->class_name = 'base_storage_' . constant('FILE_STORAGER');
     $this->worker = new $this->class_name();
     if (defined('HOST_MIRRORS')) {
         $host_mirrors = preg_split('/[,\\s]+/', constant('HOST_MIRRORS'));
         if (is_array($host_mirrors) && isset($host_mirrors[0])) {
             $this->host_mirrors =& $host_mirrors;
             $this->host_mirrors_count = count($host_mirrors) - 1;
         }
     }
 }
开发者ID:yindonghai,项目名称:msk.com,代码行数:16,代码来源:storager.php

示例10: get_files

 static function get_files($theme_define)
 {
     list($theme_app, $theme_dir) = explode('/', $theme_define);
     $handle = opendir(app::get($theme_app)->app_dir . '/desktop_themes/' . $theme_dir);
     $theme_base_url = vmc::base_url() . '/app/' . $theme_app . '/desktop_themes/' . $theme_dir;
     while (false !== ($file = readdir($handle))) {
         if ($file[0] != '.') {
             if (substr($file, -4, 4) == '.css') {
                 $css[] = $theme_base_url . '/' . $file;
             } elseif (substr($file, -3, 3) == '.js') {
                 $js[] = $theme_base_url . '/' . $file;
             }
         }
     }
     closedir($handle);
     return array($js, $css);
 }
开发者ID:yindonghai,项目名称:msk.com,代码行数:17,代码来源:theme.php

示例11: edit

 public function edit($id)
 {
     $mdl_rstatics = $this->app->model('statics');
     $this->pagedata['base_url'] = vmc::base_url(true);
     $this->pagedata['app_url_map'] = vmc::$app_url_map;
     if ($_POST) {
         $save_data = $_POST;
         if ($save_data['id']) {
             $this->begin();
         } else {
             $this->begin('index.php?app=routeplus&ctl=admin_statics&act=index');
         }
         $this->end($mdl_rstatics->save($save_data));
     } else {
         $this->display('admin/edit_statics.html');
     }
 }
开发者ID:yindonghai,项目名称:msk.com,代码行数:17,代码来源:statics.php

示例12: select_terminator

 public static function select_terminator($part, $ignore_ua_check, $url_app_map)
 {
     if (app::get('mobile')->getConf('select_terminator') == false || app::get('mobile')->getConf('select_terminator') == 'false') {
         return false;
     }
     //地址扩展名
     if (app::get('mobile')->getConf('enable_mobile_uri_expanded') == 'true') {
         $uri_expended_name = app::get('mobile')->getConf('mobile_uri_expanded_name');
     } else {
         $uri_expended_name == 'html';
     }
     foreach ($url_app_map as $k => $v) {
         if ($v['app'] == 'mobile') {
             $mb_map = $k;
         }
     }
     if (($part == '/' || $part == '/index.php' || $part == '/index.' . $uri_expended_name || substr($part, 0, strlen($mb_map) + 1) != $mb_map . '/') && $ignore_ua_check != 1 && $part != $mb_map) {
         header('Location:' . vmc::base_url(1) . (WITH_REWRITE ? '' : '/index.php') . $mb_map . $part);
         exit;
     }
 }
开发者ID:noikiy,项目名称:snk,代码行数:21,代码来源:mobiledetect.php

示例13: destory

 public function destory()
 {
     if (!$this->_session_started) {
         return false;
     }
     $this->_session_started = false;
     $res = $this->_set_session(array(), 1);
     if ($res) {
         $_SESSION = array();
         $this->_session_destoryed = true;
         $cookie_path = vmc::base_url();
         $cookie_path = $cookie_path ? $cookie_path : '/';
         header(sprintf('Set-Cookie: %s=%s; path=%s; httpOnly;', $this->_sess_key, $this->_sess_id, $cookie_path), true);
         unset($this->_sess_id);
         return true;
     } else {
         return false;
     }
 }
开发者ID:noikiy,项目名称:snk,代码行数:19,代码来源:session.php

示例14: display_tmpl

 public final function display_tmpl($tmpl, $fetch = false, $is_preview = false)
 {
     vmc::singleton('site_theme_install')->monitor_change($this->get_theme());
     array_unshift($this->_files, $this->get_theme() . '/' . $tmpl);
     $this->_vars = $this->pagedata;
     $this->_vars['base_url'] = vmc::base_url(true);
     $this->_vars['site_theme_url'] = vmc::get_themes_host_url() . '/' . $this->get_theme();
     //title description
     $title = $this->title ? $this->title : app::get('site')->getConf('site_name', app::get('site')->getConf('page_default_title'));
     $keywords = $this->keywords ? $this->keywords : app::get('site')->getConf('page_default_keywords', $title);
     $description = $this->description ? $this->description : app::get('site')->getConf('page_default_description', $title);
     $this->pagedata = array_merge($this->pagedata, array('title' => htmlspecialchars($title), 'keywords' => htmlspecialchars($keywords), 'description' => htmlspecialchars($description)));
     $this->_vars = array_merge($this->_vars, array('title' => htmlspecialchars($title), 'keywords' => htmlspecialchars($keywords), 'description' => htmlspecialchars($description)));
     $tmpl_file = realpath(vmc::get_themes_root_dir() . '/' . $this->get_theme() . '/' . $tmpl);
     if (!$tmpl_file) {
         $tmpl_file = realpath(vmc::get_themes_root_dir() . '/' . $this->get_theme() . '/default.html');
         if (!$tmpl_file) {
             $unexists_path = vmc::get_themes_root_dir() . '/' . $this->get_theme() . '/' . $tmpl;
             setcookie('CURRENT_THEME', '', time() - 1000, '/');
             unset($_COOKIE['CURRENT_THEME']);
             setcookie('CURRENT_THEME_M', '', time() - 1000, '/');
             unset($_COOKIE['CURRENT_THEME_M']);
             setcookie('THEME_DIR', '', time() - 1000, '/');
             unset($_COOKIE['THEME_DIR']);
             setcookie('THEME_M_DIR', '', time() - 1000, '/');
             unset($_COOKIE['THEME_M_DIR']);
             trigger_error('File not exists [' . $unexists_path . ']', E_USER_ERROR);
         }
     }
     $tmpl_content = file_get_contents($tmpl_file);
     $compile_code = $this->_compiler()->compile($tmpl_content);
     if ($compile_code !== false) {
         $compile_code = $this->fix_statics_dir($compile_code);
     }
     $theme_url = vmc::get_themes_host_url();
     ob_start();
     eval('?>' . $compile_code);
     $content = ob_get_contents();
     ob_end_clean();
     array_shift($this->_files);
     $this->pre_display($content);
     if ($fetch === true) {
         return $content;
     } else {
         echo $content;
     }
 }
开发者ID:yindonghai,项目名称:msk.com,代码行数:47,代码来源:controller.php

示例15: __construct

 public function __construct($app)
 {
     header('Cache-Control:no-store, no-cache, must-revalidate');
     // HTTP/1.1
     header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
     // 强制查询etag
     header('Progma: no-cache');
     if (app::get('base')->getConf('shell_base_url') != vmc::base_url(1)) {
         app::get('base')->setConf('shell_base_url', vmc::base_url(1));
     }
     $this->fix_location();
     $this->defaultwg = $this->defaultWorkground;
     parent::__construct($app);
     vmc::singleton('base_session')->start();
     if ($_COOKIE['autologin'] > 0) {
         vmc::singleton('base_session')->set_sess_expires($_COOKIE['autologin']);
     }
     //如果有自动登录,设置session过期时间,单位:分
     $auth = pam_auth::instance(pam_account::get_account_type('desktop'));
     $account = $auth->account();
     if (get_class($this) != 'desktop_ctl_passport' && !$account->is_valid()) {
         if (get_class($this) != 'desktop_ctl_default') {
             $url = app::get('desktop')->router()->gen_url($_GET, 1);
         } else {
             $url = app::get('desktop')->router()->gen_url(array(), 1);
         }
         $url = base64_encode($url);
         $_SESSION['passport_redirect_url'] = $url;
         echo "<script>top.location = '?ctl=passport'</script>";
         exit;
     }
     $this->user = vmc::singleton('desktop_user');
     if ($_GET['ctl'] != 'passport' && $_GET['ctl'] != '') {
         $this->status = $this->user->get_status();
         if (!$this->status && $this->status == 0) {
             unset($_SESSION['account']);
             $url = app::get('desktop')->router()->gen_url(array(), 1);
             $url = base64_encode($url);
             $_SESSION['passport_redirect_url'] = $url;
             header('Content-Type:text/html; charset=utf-8');
             $this->pagedata['link_url'] = '?ctl=passport';
             echo $this->fetch('auth_error.html');
             exit;
         }
     }
     ###如果不是超级管理员就查询操作权限
     if (!$this->user->is_super()) {
         if (!$this->user->chkground()) {
             echo $this->fetch('auth_error.html');
             exit;
         }
     }
     $this->_finish_modifier = array();
     foreach (vmc::servicelist(sprintf('desktop_controller_content.%s.%s.%s', $_GET['app'], $_GET['ctl'], $_GET['act'])) as $class_name => $service) {
         if ($service instanceof desktop_interface_controller_content) {
             if (method_exists($service, 'modify')) {
                 $this->_finish_modifier[$class_name] = $service;
             }
             if (method_exists($service, 'boot')) {
                 $service->boot($this);
             }
         }
     }
     //修改tab detail 里的内容
     foreach (vmc::servicelist(sprintf('desktop_controller_content_finderdetail.%s.%s.%s.%s', $_GET['app'], $_GET['ctl'], $_GET['act'], (string) (isset($_GET['finderview']) ? $_GET['finderview'] : '0'))) as $class_name => $service) {
         if ($service instanceof desktop_interface_controller_content) {
             if (method_exists($service, 'modify')) {
                 $this->_finish_modifier[$class_name] = $service;
             }
             if (method_exists($service, 'boot')) {
                 $service->boot($this);
             }
         }
     }
     if ($this->_finish_modifier) {
         ob_start();
         register_shutdown_function(array(&$this, 'finish_modifier'));
     }
     $this->url = 'index.php?app=' . $this->app->app_id . '&ctl=' . $_GET['ctl'];
     foreach (vmc::servicelist('desktop_controller_destruct') as $service) {
         if (is_object($service) && method_exists($service, 'construct')) {
             $service->construct();
         }
     }
 }
开发者ID:noikiy,项目名称:snk,代码行数:85,代码来源:controller.php


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