<?php
define('D_P', getdirname(__FILE__));
include D_P . 'baselib/base.php';
dispatcher::dispatch();
/**
 * 获取目录路径
 *
 * @param string $path 文件路径
 * @return string
 */
function getdirname($path = null) {
    if (!empty($path)) {
        if (strpos($path, '\\') !== false) {
            return substr($path, 0, strrpos($path, '\\')) . '/';
        } elseif (strpos($path, '/') !== false) {
            return substr($path, 0, strrpos($path, '/')) . '/';
        }
    }
    return './';
}
?>