コード例 #1
0
ファイル: Router.class.php プロジェクト: pgfeng/GFPHP
 public static function url($action, $get = false)
 {
     $url = self::$router->_url($action, $get);
     //var_dump(Config::router('hidden_entry'));
     if (Config::router('hidden_entry') !== true) {
         return Config::config('entry') . '/' . $url;
     } else {
         return '/' . Config::config('app_dir') . '/' . $url;
     }
 }
コード例 #2
0
ファイル: PathInfo.class.php プロジェクト: pgfeng/GFPHP
 protected function parse_url()
 {
     if (isset($_SERVER['PATH_INFO'])) {
         $p = explode('/', $_SERVER['PATH_INFO']);
         $c = array('controller' => isset($p[1]) && !empty($p[1]) ? $p[1] : Config::router('default_controller'), 'method' => isset($p[2]) && !empty($p[2]) ? $p[2] : Config::router('default_method'), 'var' => isset($p[3]) && !empty($p[3]) ? array_slice($p, 3) : false);
     } else {
         $c = array('controller' => Config::router('default_controller'), 'method' => Config::router('default_method'), 'var' => false);
     }
     return $c;
 }
コード例 #3
0
 public static function url($action = '', $get = false)
 {
     $url = self::$router->_url($action, $get);
     //====是否要隐藏入口
     if (Config::router('hidden_entry') !== true) {
         return Config::config('entry') . '/' . $url;
     } else {
         $path = dirname(Config::config('entry'));
         //转义掉windows的反斜杠
         $path = str_replace('\\', '/', $path);
         return $path . $url;
     }
 }
コード例 #4
0
ファイル: fakeHtml.class.php プロジェクト: pgfeng/GFPHP
 protected function parse_url()
 {
     if (isset($_SERVER['PATH_INFO'])) {
         $s = substr($_SERVER['PATH_INFO'], 1);
     } else {
         $s = Config::router('default_controller') . '-' . Config::router('default_method');
     }
     $sps = strripos($s, '.html');
     if ($sps) {
         $s = substr($s, 0, $sps);
     }
     $r = explode('-', $s);
     $c = array('controller' => isset($r[0]) && !empty($r[0]) ? $r[0] : Config::router('default_controller'), 'method' => isset($r[1]) && !empty($r[1]) ? $r[1] : Config::router('default_method'), 'var' => isset($r[2]) && !empty($r[2]) ? array_slice($r, 2) : false);
     return $c;
 }
コード例 #5
0
ファイル: station.php プロジェクト: pgfeng/ssy.9icode.club
?>
                        <?php 
echo phpversion();
?>
                    </td>
                    <td class="text-right">缓存驱动:</td>
                    <td colspan="2" class="text-left"><?php 
echo Config::cache('driver');
?>
</td>
                </tr>
                <tr>
                    <td class="text-right">路由驱动:</td>
                    <td colspan="2" class="text-left">
                        <?php 
echo Config::router('driver');
?>
                    </td>
                    <td class="text-right">数据库驱动:</td>
                    <td colspan="2" class="text-left"><?php 
echo Config::database('driver');
?>
</td>
                </tr>
                <tr>
                    <td class="text-right">版权所有:</td>
                    <td colspan="2" class="text-left">济宁亿佰网络</td>
                    <td class="text-right">作 者:</td>
                    <td colspan="2" class="text-left">PGF</td>
                </tr>
                <tr>
コード例 #6
0
ファイル: api.php プロジェクト: astar3086/studio_mn24
<?php

//// Mobile API
// Base Separator
define('DS', '\\');
// Base Application Path
define('BASE_PATH', realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR);
// Base API PAth
define('API_PATH', BASE_PATH . 'mobile-api' . DS);
// Base API Content
define('API_DESIGN', API_PATH . 'design' . DS);
// Base API Content
define('API_CONTENT', API_DESIGN . 'content' . DS);
// Include Main
include_once API_PATH . 'settings' . DS . 'Settings.php';
include_once API_PATH . 'Config.php';
include_once API_PATH . 'Autoloder.php';
include_once API_PATH . 'system' . DS . 'Engine.php';
// Init Config
Settings::init();
// Config View or Send
Config::router();
//Engine Rush!
Engine::init();
echo Engine::view();