Example #1
0
function __autoload($class)
{
    $auto = array();
    $dirs = array();
    $custom = APP_PATH . '/custom';
    $dirs[] = $custom;
    $locdirs = array();
    if (!empty($_GET['k'])) {
        $locdirs = explode('/', $_GET['k']);
        $dirs[] = $custom . '/' . $locdirs[0];
        $extdirs = readSubDir($custom . '/' . $locdirs[0]);
    } else {
        $extdirs = readSubDir($custom);
    }
    $dirs = array_merge($dirs, $extdirs);
    $dirs[] = KYPHP_PATH . 'kyclass/kyphp_base';
    foreach ($dirs as $extdir) {
        $file = $extdir . '/' . $class . '.php';
        if (is_file($file)) {
            require_once $file;
        }
    }
    KYPHP::autoload_APP($class, $locdirs);
}
Example #2
0
<?php

define('APP_PATH', dirname(__FILE__));
//当前项目路径
define('KYPHP_PATH', APP_PATH . '/../../kyphp/');
//KYPHP框架路径
require KYPHP_PATH . "kyphp.php";
KYPHP::Run();
/*
//如果要自定义config路径,需要定义__CONFIG__
define('__CONFIG__',APP_PATH.'/inc/config.php');
$config=require(__CONFIG__);
KYPHP::Run($config);
*/
Example #3
0
<?php

define('APP_PATH', dirname(__FILE__));
//当前项目路径
define('KYPHP_PATH', APP_PATH . '/../../kyphp/');
//KYPHP框架路径
define('__CHARSET__', 'gbk');
require KYPHP_PATH . "kyphp.php";
//如果要自定义config路径,需要定义__CONFIG__
define('__CONFIG__', APP_PATH . '/config.php');
$config = (require __CONFIG__);
KYPHP::Run($config);