コード例 #1
0
ファイル: autoload.php プロジェクト: virtual97/quick-debug
/**
 * Autoload function
 *
 * @param string $class
 * @return bool
 */
function autoLoadFunc($class)
{
    $classPath = str_replace('_', '/', $class) . '.php';
    $paths = explode(PATH_SEPARATOR, get_include_path());
    foreach ($paths as $p) {
        $p = rtrim($p, '\\/');
        $filename = $p . DIRECTORY_SEPARATOR . $classPath;
        if (file_exists($filename)) {
            require_once $classPath;
            return true;
        }
    }
    $paths = implode("\n", $paths);
    qqq1("Class '{$class}' not found in paths: \n{$paths}", 0, 1);
    exit;
}
コード例 #2
0
ファイル: func.php プロジェクト: virtual97/quick-debug
/**
 * Print class name
 *
 * @param object $obj
 * @param bool $exit
 */
function qqqClass($obj, $exit = false)
{
    if (!is_object($obj)) {
        $res = 'NaN';
    } else {
        $res = get_class($obj);
    }
    if ($exit) {
        qqq1($res);
    } else {
        qqq($res);
    }
}