根据命名空间加载文件
@param string $name
@return boolean
168706
public static function loadByNamespace($name)
    {
        // 相对路径
        $class_path = str_replace('\\', DIRECTORY_SEPARATOR ,$name);
        // 如果是Workerman命名空间，则在当前目录寻找类文件
        if(strpos($name, 'Workerman\\') === 0)
        {
            $class_file = __DIR__.substr($class_path, strlen('Workerman')).'.php';
        }
        else 
        {
            // 先尝试在应用目录寻找文件
            if(self::$_appInitPath)
            {
                $class_file = self::$_appInitPath . DIRECTORY_SEPARATOR . $class_path.'.php';
            }
            // 文件不存在，则在上一层目录寻找
            if(empty($class_file) || !is_file($class_file))
            {
                $class_file = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR . "$class_path.php";
            }
        }
       
        // 找到文件
        if(is_file($class_file))
        {
            // 加载
            require_once($class_file);
            if(class_exists($name, false))
            {
                return true;
            }
        }
        return false;
    }
732848
public function exists($name)
    {
        $loader = $this->environment->getLoader();

        try {
            $loader->getSource((string) $name);
        } catch (\Twig_Error_Loader $e) {
            return false;
        }

        return true;
    }
220324
public function hasArrayOf(string $name) : bool
    {
        return $this->nestedArrayContentGroups
            ->where(function (ContentGroup $contentArea) use ($name) {
                return $contentArea->name === $name;
            })
            ->count() > 0;
    }
1212017
public static function load($name) {
		if( empty($_FILES[$name]['name']) ) { /*text('load() Name not found'); */return null; }
		if( is_array($_FILES[$name]['name']) ) {
// 			text('load() Name is an array');
// 			$r	= array();
			return static::loadPath($_FILES[$name]);
// 			foreach( $_FILES[$name]['name'] as $ind => $fileName ) {
// 				if( empty($fileName) ) { continue; }
// 				static::loadPath($r, $_FILES[$name]);
// // 				$r[] = new static($fileName, $_FILES[$name]['size'][$ind], $_FILES[$name]['tmp_name'][$ind], $_FILES[$name]['error'][$ind]);
// 			}
// 			return $r;
		}
// 		text('load() Name is a single object');
		return new static($_FILES[$name]['name'], $_FILES[$name]['size'], $_FILES[$name]['tmp_name'], $_FILES[$name]['error']);
// 		return !empty($_FILES[$name]['name']) ? new static($_FILES[$name]['name'], $_FILES[$name]['size'], $_FILES[$name]['tmp_name'], $_FILES[$name]['error']) : null;
	}
721335
public static function has(string $name)
    {
        $names = Imi::parseDotRule($name);
        if (isset($names[0]))
        {
            $first = array_shift($names);
            if(isset(static::$configs[$first]))
            {
                return null !== static::$configs[$first]->get($names, null);
            }
            else
            {
                return false;
            }
        }
        else
        {
            return false;
        }
    }
378295
public function isSaved( string $name ): bool
	{
		return $this->load($name) !== false || $this->memcached->getResultCode() !== \Memcached::RES_NOTFOUND;
	}
981101
public function not_empty($name, $value){
        if($value != NULL){
            return TRUE;
        }else{
            $this->add_message($name, 'empty_file');
            return FALSE;
        }
    }
490130
protected function hasSuffix($name)
    {
        $lenSuffix = strlen($this->suffix);

        $hasSuffix = strlen($name) > $lenSuffix;
        $hasSuffix = $hasSuffix && substr_compare($name, $this->suffix, -$lenSuffix, $lenSuffix, true) == 0;

        return $hasSuffix;
    }
593855
public function exists($name)
    {
        if ($this->existsOnSpace(null, $name)) {
            return true;
        }

        foreach ($this->spacePaths as $space => $path) {
            if ($this->existsOnSpace($space, $name)) {
                return true;
            }
        }

        return false;
    }
1123889
protected function rmdir($name = '')
    {
        $result = true;
        $name = preg_replace(array('!\.{1,2}/!', '!^/!', '!/$!'), '', $name);
        $name = $this->dirData.$name;
        if (is_dir($name))
        {
            $files = glob($name.'/{.*,*}', GLOB_BRACE);
            for ($i = 0; $i < count($files); $i++)
            {
                if (substr($files[$i], -2) == '/.' || substr($files[$i], -3) == '/..') continue;
                if (is_dir($files[$i])) $result = $this->rmdir(substr($files[$i], strlen($this->dirData)));
                elseif (is_file($files[$i])) $result = filedelete($files[$i]);
                if (!$result) break;
            }
            if ($result) $result = rmdir($name);
        }
        return $result;
    }
285572
public function get( $name ) {
		// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Calling native WordPress hook.
		foreach ( apply_filters( 'all_plugins', get_plugins() ) as $file => $_ ) {
			if ( "$name.php" === $file ||
				( $name && $file === $name ) ||
				( dirname( $file ) === $name && '.' !== $name ) ) {
				return (object) compact( 'name', 'file' );
			}
		}

		return false;
	}
1040522
public static function toNameStrict( string $name )
	{
		$len = strlen($name);
		if( $len < 1 || $len > 50 )
		{
			return false;
		}

		$name = str_replace("-", "_", $name);
		if(strpos($name, "__") !== false || $name[0] === "_" || $len > 1 && $name[$len-1] === "_")
		{
			return false;
		}

		if( strpos($name, "_") !== false || ! ctype_upper($name[0]) )
		{
			$name = self::toName($name);
		}

		if( is_numeric($name[0]) || preg_match('/[^a-zA-Z0-9]/', $name ) )
		{
			return false;
		}

		return $name;
	}
690543
public function file($name = '')
    {
        if (empty($this->file)) {
            $this->file = isset($_FILES) ? $_FILES : [];
        }
        if (is_array($name)) {
            return $this->file = array_merge($this->file, $name);
        }
        $files = $this->file;
        if (!empty($files)) {
            // 处理上传文件
            $array = [];
            foreach ($files as $key => $file) {
                if (is_array($file['name'])) {
                    $item  = [];
                    $keys  = array_keys($file);
                    $count = count($file['name']);
                    for ($i = 0; $i < $count; $i++) {
                        if (empty($file['tmp_name'][$i]) || !is_file($file['tmp_name'][$i])) {
                            continue;
                        }
                        $temp['key'] = $key;
                        foreach ($keys as $_key) {
                            $temp[$_key] = $file[$_key][$i];
                        }
                        $item[] = (new File($temp['tmp_name']))->setUploadInfo($temp);
                    }
                    $array[$key] = $item;
                } else {
                    if ($file instanceof File) {
                        $array[$key] = $file;
                    } else {
                        if (empty($file['tmp_name']) || !is_file($file['tmp_name'])) {
                            continue;
                        }
                        $array[$key] = (new File($file['tmp_name']))->setUploadInfo($file);
                    }
                }
            }
            if (strpos($name, '.')) {
                list($name, $sub) = explode('.', $name);
            }
            if ('' === $name) {
                // 获取全部文件
                return $array;
            } elseif (isset($sub) && isset($array[$name][$sub])) {
                return $array[$name][$sub];
            } elseif (isset($array[$name])) {
                return $array[$name];
            }
        }
        return;
    }
658117
public function extension(string $name): bool
    {
        $files = $this->app->make('files');

        list($basePath, $sourcePath) = $this->getPathFromExtensionName($name);

        $paths = [
            "{$basePath}/resources/database/migrations/",
            "{$basePath}/resources/migrations/",
            "{$basePath}/database/migrations/",
        ];

        // We don't execute the same migration twice, this little code
        // compare both folder before appending the paths.
        if ($basePath !== $sourcePath && ! empty($sourcePath)) {
            $paths = array_merge($paths, [
                "{$sourcePath}/resources/database/migrations/",
                "{$sourcePath}/resources/migrations/",
                "{$sourcePath}/database/migrations/",
            ]);
        }

        foreach ($paths as $path) {
            if ($files->isDirectory($path)) {
                $this->run($path);
            }
        }

        return true;
    }
1028783
public function up($name=null)
	{
		if(null===$name)
		{
			$files=$this->parseFiles($_FILES);
		}
		else 
		{
			$files=$this->parseFiles(array($name=>$_FILES[$name]));
		}
		$this->result=array();
		$this->files=array();
		$result=true;
		foreach($files as $key=>$item)
		{
			if(isset($item['name']))
			{
				// 单文件上传
				if(!$this->uploadSingle($item,$r))
				{
					$result=false;
				}
			}
			else
			{
				// 多文件上传
				if(!$this->uploadMulti($item,$r))
				{
					$result=false;
				}
			}
			$this->result[$key]=$r;
		}
		return $result;
	}
133601
public function isFile(String $name) : Bool
    {
        $file = Method::files($name);

        if( is_array($file) )
        {
            return (bool) $file[0];
        }

        return (bool) Method::files($name);
    }
1055727
protected function isLoadableTemplate($name)
    {
        return !empty($name) && (empty($this->prefix) || strlen($name) > strlen($this->prefix) && strpos($name, $this->prefix) === 0);
    }