public static function pickAppDir($path)
    {
        // when relational path.
        if ($path[0] !== '/') return $path;

        $root = null;
        foreach (self::$namespaces as $p => $ns) {
            if (strpos($path, $p) === 0) {
                if ($root === null || strlen($root) < strlen($p)) $root = $p;
            }
        }

        return $root ? $root : $path;
    }