设置配置
@param $name
@param $data
@param $path
@param $namespace
763544
public function set_config($name,$data,$path,$namespace = '')
    {
        //写入文件
        $str = '';
        $this->set_head($str,$name,$namespace);
        $this->set_content($data,$str);
        Func:: M('file') ::createDir($path);
        file_put_contents($path.$name.'.php',$str);
        //mkdir($path.$name.'.php',0777);
    }
1015635
public function post($path, $data)
    {
        if (false === $json = $this->runRequest($path, 'POST', $data)) {
            return false;
        }

        return $this->decode($json);

    }
1016201
public function prependPath($path, $namespace = self::MAIN_NAMESPACE)
    {
        $path = rtrim($path, '/\\');

        if (!isset($this->paths[$namespace])) {
            $this->paths[$namespace][] = $path;
        } else {
            array_unshift($this->paths[$namespace], $path);
        }
    }
897616
protected function loadConfigurationFiles($path, $namespace)
	{
		foreach ($this->getConfigurationFiles($path) as $key => $file)
		{
			$configs = require $file;
			$this->setConfigsInNamespace($configs, $key, $namespace);
		}
	}
295537
public function save($name, $data)
    {
        try {
            return $this->loader($name)->save($data);
        } catch (NotFound\Path $exception) {
            File::touch($this->buildPath($name, $this->extensions[0]));
            return $this->save($name, $data);
        }
    }
333863
public static function set($namespace, $path)
    {
        $namespace = trim($namespace, '\\');
        $path = rtrim($path, '/');

        if (!isset(self::$_namespace_list[$namespace])) {
            self::$_namespace_list[$namespace] = [];
        }

        self::$_namespace_list[$namespace][] = $path;
    }
282836
public function register($name, $path)
    {
        if (!Str::contains($path, '.js')) {
            throw new \Exception('Path should lead to javascript file');
        }
        $this->modules->push(compact('name', 'path'));
    }
1322657
protected function _resource($data, $name)
    {
        $data = get_resource_type($data);
        $this->_renderNode('Resource', $name, $data);
    }
131781
public function move($nameold,$pathnew,$path){
        if($this->validNameFile($nameold,false) && preg_match_all("#^/{1}$|^/[a-z0-9A-Z]{1}([a-z0-9A-Z-_/])*(/|[a-z0-9A-Z-_]{1,})+$#",$pathnew) > 0){
            $nameold = $this->clearNameFile($nameold);
            $fullpath = $this->sanitizeNameFolder($this->getFullPath().$path,true);
            $fullpathnew = $this->sanitizeNameFolder($this->getFullPath().$pathnew,true);
            if( $this->config['debug'] ) $this->_log('$fullpath - '.$fullpath);
            if( $this->config['debug'] ) $this->_log('$fullpathnew - '.$fullpathnew);
            if( $this->config['debug'] ) $this->_log('$fullpath/$nameold - '.$fullpath.'/'.$nameold);
            if( $this->config['debug'] ) $this->_log('$fullpathnew/$nameold - '.$fullpathnew.'/'.$nameold);

            if($fullpath == $fullpathnew || $fullpath.'/'.$nameold==$fullpathnew.'/'.$nameold){
                if( $this->config['debug'] ) $this->_log('$path == $pathnew Equals');
                $result = array("query"=>"BE_MOVE_PATH_NOT_VALID","params"=>array());
                $this->setInfo(array("msg"=>$result, "status"=>0));
                return;
            }elseif(strpos($fullpathnew.'/'.$nameold,$fullpath.'/'.$nameold.'/')!==false ){
                if( $this->config['debug'] ) $this->_log('$pathnew internal of source - '.$pathnew);
                $result = array("query"=>"BE_MOVE_PATH_NOT_VALID","params"=>array());
                $this->setInfo(array("msg"=>$result, "status"=>0));
                return;
            }elseif(strpos($fullpath.'/'.$nameold,$fullpathnew.'/'.$nameold.'/')!==false ){
                if( $this->config['debug'] ) $this->_log('$pathnew not moved in same folder - '.$pathnew);
                $result = array("query"=>"BE_MOVE_PATH_NOT_VALID","params"=>array());
                $this->setInfo(array("msg"=>$result, "status"=>0));
                return;
            }
            $file = new Filesystem;
            if($file->exists($fullpath.'/'.$nameold)){
                if(is_dir($fullpath.'/'.$nameold)){
                    if($file->exists($fullpathnew.'/'.$nameold)===false){
                        if($file->exists($fullpathnew)==false){
                            $file->mkdir($fullpathnew);
                        }
                        $file->rename($fullpath.'/'.$nameold,$fullpathnew.'/'.$nameold);
                        $result = array("query"=>"BE_MOVE_MOVED","params"=>array());
                        $fullpathnew_result = $this->sanitizeNameFolder($pathnew.'/'.$nameold,true);
                        $this->setInfo(array("msg"=>$result,"data"=>array("namefile" => $fullpathnew_result)));
                    }else{
                        $result = array("query"=>"BE_MOVE_FOLDER_EXISTED","params"=>array());
                        $this->setInfo(array("msg"=>$result, "status"=>0));
                    }

                }elseif(is_file($fullpath.'/'.$nameold)){
                    if($this->validExt($nameold)){
                        if($file->exists($fullpathnew.'/'.$nameold)===false){
                            if($file->exists($fullpathnew)==false){
                                $file->mkdir($fullpathnew);
                            }
                            $file2 = new \SplFileInfo($fullpath.'/'.$nameold);
                            if(in_array($file2->getExtension(), $this->config['images']['images_ext'])){
                                $filename = $file2->getFilename();
                                foreach ($this->config['images']['resize'] as $key => $value) {
                                    $image_info = $this->imageSizeName($path,$filename,$value);
                                    $filename_old = $image_info['name'];
                                    $fullpaththumb_name = $this->getFullPath().'/'.$this->config['folder_thumb'].$path.$filename_old;
                                    $file->remove($fullpaththumb_name);
                                }
                            }
                            $file->rename($fullpath.'/'.$nameold,$fullpathnew.'/'.$nameold);
                            $result = array("query"=>"BE_MOVE_MOVED","params"=>array());
                            $fullpathnew_result = $this->sanitizeNameFolder($pathnew.'/'.$nameold,true);
                            $this->setInfo(array("msg"=>$result,"data"=>array("namefile" => $fullpathnew_result)));
                        }else{
                            $result = array("query"=>"BE_MOVE_EXISTED","params"=>array());
                            $this->setInfo(array("msg"=>$result, "status"=>0));
                        }
                    }else{
                        $result = array("query"=>"BE_MOVE_FILENAME_NOT_VALID","params"=>array());
                        $this->setInfo(array("msg"=>$result, "status"=>0));
                    }
                }
            }else{
                $result = array("query"=>"BE_MOVE_NOT_EXISTS","params"=>array());
                $this->setInfo(array("msg"=>$result, "status"=>0));
            }
        }else{
            $result = array("query"=>"BE_MOVE_FILENAME_NOT_VALID","params"=>array());
            $this->setInfo(array("msg"=>$result, "status"=>0));
        }
    }
669615
private function listCommands(array &$list, $path, $namespace)
    {
        $classes = [];
        list_classes($classes, $path, $namespace);
        foreach ($classes as $class) {
            /** @var CommandContract $command */
            $command = new $class;
            $name = $command->name();
            $description = trim($command->description() ?: '');
            $list[$name] = compact('class', 'name', 'description');
        }
    }
1357578
public function ext($name, $path)
    {
        if(null === $path)
        {
            $path = File::path(dirname(Imi::getNamespacePath(App::getNamespace())), 'ide-helper');
        }
        foreach($name as $extName)
        {
            echo 'Generating ', $extName, '...', PHP_EOL;
            $extensionReflection = new ExtensionReflection($extName);
            $extensionReflection->save(File::path($path, $extName));
        }
        echo 'Complete!', PHP_EOL;
    }
1326729
public static function alias( $name, $path = null ) 
	{
		if ( is_array( $name ) ) 
		{
			static::$aliases = array_merge( static::$aliases, $name ); return;
		}
		static::$aliases[$name] = $path;
	}
529220
public function attach($name,$data){
		$name=strtolower($name);
		$this->sqls[$name]=$data;
	}
1272693
function addNameSpace($name, $path)
    {
        if (!is_dir($path))
        {
            throw new \Exception("$path is not real path.");
        }
        Swoole\Loader::addNameSpace($name, $path);
    }
1012987
public function controller($path, $class, array $names = [])
    {
        $methods = get_class_methods($class);

        foreach ($methods as $method)
        {
            // xxxxAction
            if (! preg_match('/(.+)Action$/i', $method, $matches))
                continue;

            if (is_object($class))
                $rule = $this->any($path, [$class, $method]);
            else
                $rule = $this->any($path, $class . '::' . $method);

            $rule->restful(false);
            $rule->setPath($path . '/' . $rule->methodName2URL($method));
        }
    }
1299767
public static function bind( $name, $path = null ) 
	{
		if ( is_array( $name ) ) 
		{
			static::$classes = array_merge( static::$classes, $name ); return;
		}
		static::$classes[$name] = $path;
	}
52464
public static function registerNamespace(string $namespace, string $path): void
    {
        if ($namespace === '') {
            throw new InvalidArgumentException('Cannot register the default namespace');
        }

        if (!Str::endsWith($path, '/')) {
            throw new InvalidArgumentException('Paths must end with a directory separator');
        }

        self::$namespaces[$namespace] = $path;
    }