Imports the specified file in the MySql server
@param String $path
@param array $files (optional)
@return boolean
8639
public function importSql($path, $files = array('setup_structure.sql'))
    {
        $status = false;
        $fImport = null;
        if(file_exists($path)) {
            foreach($files as $file) {
                if(file_exists($path.$file)) {
                    $fImport = file_get_contents($path.$file);
                    $this->executeRawQuery($fImport);
                    $this->importTableName = array_merge($this->importTableName, $this->getSqlFileTables($path.$file));
                }
            }
        }

        return $status;
    }
282687
public static function get_migrations( $path )
	{
		$objects = new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator( $path ), \RecursiveIteratorIterator::SELF_FIRST );
		
		$files = array();
		
		foreach( $objects as $name => $object )
		{
			if ( \CCStr::extension( $name ) == 'sql' )
			{
				$files[\CCStr::cut( substr( basename( $name ), strrpos( basename( $name ),  '_' )+1 ), '.' )] = $name;
			}
		}
		
		ksort( $files );
		
		return $files;
	}
425906
protected function _subdirs($path) {
		
		foreach (ftp_rawlist($this->connect, $path) as $str) {
			if (($stat = $this->parseRaw($str)) && $stat['mime'] == 'directory') {
				return true;
			}
		}
		return false;
	}
654923
public function importedAsset($path, $parameters = array())
  {
    if ($this->useController) {
      $path = $this->router->generate(
        "_assetic_" . $this->res->getFormulaeName($path),
        $parameters
      );
    } else {
      $path = $this->assets->getAssetUrl(
        ltrim($path, "/")
      );
    }

    return $path;
  }
1138045
public function addServersFromFiles($files = [])
    {

        // Since we expect an array let us turn a string (i.e. single file) into an array
        if (!is_array($files)) {
            $files = [$files];
        }

        // Iterate over the file(s) and add them
        foreach ($files as $file) {
            // Check to make sure the file exists and we can read it
            if (!file_exists($file) || !is_readable($file)) {
                continue;
            }

            // See if this file is JSON
            if (($servers = json_decode(file_get_contents($file), true)) === null
                && json_last_error() !== JSON_ERROR_NONE
            ) {
                // Type not supported
                continue;
            }

            // Add this list of servers
            $this->addServers($servers);
        }

        return $this;
    }
133057
public function load($path, $file = '.env')
    {
        try {
            $env = new \Dotenv\Dotenv($path, $file);
            $env->load();

            return true;
        } catch (\Dotenv\Exception\InvalidPathException $e) {
            return false;
        }
    }
86094
public function append($path): bool
    {
        $path = Normalize::diskFullPath($path);
        // check if file exist
        if (!File::exist($path)) {
            return false;
        }

        // load file translations
        $addTranslation = require($path);
        if (!Any::isArray($addTranslation)) {
            return false;
        }

        // merge data
        $this->cached = Arr::merge($this->cached, $addTranslation);
        return true;
    }
1285008
public function loadFile($path) {
        $content = trim(file_read($path));
        $config = [];

        if ( ! empty($content)) {
            $config = Yaml::parse($content);
        }

        return $config;
    }
1182138
public static function addPath($path)
    {
        $path = str_replace('//', '/', rtrim($path, '/'));
        if (is_dir($path) && !in_array($path, self::$_paths)) {
            array_unshift(self::$_paths, $path);
        }
    }
3688
public function includePaths($path)
	{
		$paths = is_array($path) ? $path : array($path);
		$this->_paths = array_merge($paths,$this->_paths);
		return $this;
	}
1186140
public function import(array $path,$exts=null){
        $exts = $exts?:$this->path_autoext;
        $ext = '*.{inc.php,fuc.php';
        if($this->sapi=='cli') {
            $ext .= ',cli.php';
            is_string($exts) and $ext .= ','.$exts.'.php';
        }
        else {
            if(is_string($exts)){
                $ext .= ','.$exts.'.php';
            }
            /*
            $host = Request::driver()->host;
            if($host && is_array($exts) && isset($exts[$host])) {
                $ext .= ','.$exts[$host].'.php';
            }
            else if(is_string($exts)){
                $ext .= ','.$exts.'.php';
            }
            */
        }
        $config = [];
        $ext .='}';
        $auto = [];
        foreach ($path as $val) {
            $tmp = glob($val . $ext,GLOB_BRACE);
            $tmp and $auto = array_merge($auto,$tmp);
        }
        foreach ($auto as $v) {
            $conf = include $v;
            is_array($conf) and $config=array_merge($config,$conf);
        }
        $this->config = array_merge($this->config,$config);
    }
556611
public function mkdir($path)
	{
		// If native FTP support is enabled let's use it...
		if (FTP_NATIVE)
		{
			if (@ftp_mkdir($this->conn, $path) === false)
			{
				Log::add(__METHOD__ . 'Bad response.', Log::WARNING, 'jerror');

				return false;
			}

			return true;
		}

		// Send change directory command and verify success
		if (!$this->_putCmd('MKD ' . $path, 257))
		{
			Log::add(
				sprintf('%1$s: Bad response.  Server response: %2$s [Expected: 257].  Path sent: %3$s', __METHOD__, $this->response, $path),
				Log::WARNING, 'jerror'
			);

			return false;
		}

		return true;
	}
546897
protected static function loadPath($from, &$files=array(), $path='') {
		$fileName = ($path === '') ? $from['name'] : apath_get($from['name'], $path);
// 		debug('LoadPath('.$path.') - $fileName', $fileName);
		if( empty($fileName) ) { return $files; }
		if( is_array($fileName) ) {
			if( $path!=='' ) { $path .= '/'; }
			foreach( $fileName as $index => $fn ) {
				static::loadPath($from, $files, $path.$index);
			}
// 			debug('loadPath() Files if name is an array', $files);
			return $files;
		}
		apath_setp($files, $path, new static($fileName, apath_get($from, 'size/'.$path),
			apath_get($from, 'tmp_name/'.$path), apath_get($from, 'error/'.$path)));
// 		debug('loadPath() Files if value is set', $files);
		return $files;
// 		$files[]	= ;
	}
4603
public function add($files = '.')
    {
        if (is_array($files)) {
            $files = implode(' ', array_map('escapeshellarg', $files));
        } else {
            $files = escapeshellarg($files);
        }

        $this->getClient()->run($this, "add $files");

        return $this;
    }
1349185
public static function join($paths)
    {
        $paths = is_array($paths) ? $paths : func_get_args();

        return join(DIRECTORY_SEPARATOR, $paths);
    }
875160
public static function extract($path, $items)
    {
        $paths = explode('.', $path);

        foreach ($paths as $value) {
            if (self::iterable($items) && array_key_exists($value, $items)) {
                $items = $items[$value];
            } else {
                return false;
            }
        }

        return $items;
    }
31950
public function load(array $files = array())
    {
        $loader = new YamlLoader(new FileLocator, new YamlParser);

        foreach ($files as $file) {
            $configValues = $loader->load($file);

            $configValues = $this->loadImports($loader, $file, $configValues);

            $this->params = array_replace_recursive($this->params, $configValues);
        }
    }