@param null $dir

@return bool
342638
public static function configExists($dir = null)
    {
        $dir = ($dir === null) ? getcwd() : $dir;
        return file_exists($dir . '/docker-compose.yml');
    }
397585
static public function
	MakeDirectory($dir) {
	/*//
	@argv string Directory
	@return bool

	make a directory. returns if successful or not. allows you to
	blindly call it if it already exists to ensure it exists.
	//*/

		// if it already exists...
		if(is_dir($dir)) return true;

		// make it...
		$umask = umask(0);
		@mkdir($dir,0777,true);
		umask($umask);

		// find out if it was successful, lol.
		return is_dir($dir);
	}
371098
public static function cleanDir($dir, $need = true)
	{
		if (!file_exists($dir)) {
			return true;
		}

		if(is_dir($dir)){
			$files = glob($dir . DIRECTORY_SEPARATOR . '*', GLOB_MARK ); //GLOB_MARK adds a slash to directories returned

			foreach($files as $file) {
				static::rm($file, $need);
			}
		}

		return true;
	}
986180
public function rmdirRecursive($dir) {
		if (is_dir($dir)) {
			foreach (array_diff(scandir($dir), array('.', '..')) as $file) {
				@set_time_limit(30);
				$path = $dir . '/' . $file;
				(is_dir($path)) ? $this->rmdirRecursive($path) : @unlink($path);
			}
			return @rmdir($dir);
		} else if (is_file($dir)) {
			return @unlink($dir);
		}
		return false;
	}
888073
public static function deleteDir($dir)
    {
        $d = dir($dir);
        while (false !== ($entry = $d->read())) {
            if ($entry == '.' || $entry == '..') {
                continue;
            }

            $currele = $d->path . '/' . $entry;
            if (is_dir($currele)) {
                if (self::isEmpty($currele)) {
                    rmdir($currele);
                } else {
                    self::deleteDir($currele);
                }
            } else {
                unlink($currele);
            }
        }
        $d->close();

        rmdir($dir);
        return true;
    }
384062
public function dirExists($dir)
    {
        return ($this->isConnected() === true) ? ftp_rmdir($this->connectionString.$dir) : false;
    }
13607
public static function recursiveUnlink($dir) {
        $result = TRUE;

        if(is_dir($dir)) {
            foreach(scandir($dir) as $sub) {
                if(in_array($sub, ['.', '..'])) continue;
                $result &= self::recursiveUnlink("$dir/$sub");
            }

            $result &= rmdir($dir);
        }
        elseif(is_file($dir)) {
            $result &= unlink($dir);
        }
        else {
            $result = FALSE;
        }

        return (bool)$result;
    }
159912
public function ls($dir = '')
    {
        $this->isAlive(true);
        $this->errorHandler->start();
        $dir = ($dir == '' ? ftp_pwd($this->resource) : $dir);
        if (($ls = $this->driver->nlist($this->resource, $dir)) !== false) {
            $this->errorHandler->stop();

            return $ls;
        }
        $this->errorHandler->stop();

        return false;
    }
37173
public function isEmptyDirectory($location = null)
    {
        $returnValue = false;

        if ($location === null) {
            $location = $this->getLocation();
        }

        if (is_readable($location) && is_dir($location)) {
            $iterator = new RecursiveDirectoryIterator($location, RecursiveDirectoryIterator::SKIP_DOTS);
            $returnValue = iterator_count($iterator) === 0;
        }

        return $returnValue;
    }
59005
public static function isEmptyDir($dir)
    {
        $handle = opendir($dir);
        if($handle){
            $item = readdir($handle);
            while($item){
                if ($item != "." && $item != ".."){
                    @closedir($handle);
                    return false;
                }
                $item = readdir($handle);
            }
        }
        return true;
    }
355203
public function rmdirr($dir)
    {
        if ($handle = opendir("$dir")) {
            while ($item = readdir($handle)) {
                if (($item != ".") && ($item != "..")) {
                    if (is_dir("$dir/$item")) {
                        $this->rmdirr("$dir/$item");
                    } else {
                        unlink("$dir/$item");
                    }
                }
            }
            closedir($handle);
            rmdir($dir);
        }
    }
790602
function _is_dir($dir)
    {
        $dirs = explode('/', preg_replace('#^/|/(?=/)|/$#', '', $dir));

        $temp = &$this->dirs;
        foreach ($dirs as $dir) {
            if (!isset($temp[$dir])) {
                return false;
            }
            $temp = &$temp[$dir];
        }
    }
1220044
public static function deleteFiles($dir) {
		$dir = self::normalizePath($dir);
		if (\is_dir($dir)) {
			$files = \scandir($dir);
			foreach ($files as $file) {
				$fullPath = self::normalizePath(self::combinePath($dir, $file));
				if ($file != "." && $file != "..") {
					if (\is_dir($fullPath))
						self::deleteFiles($fullPath);
					else
						@\unlink($fullPath);
				}
			}
			@\rmdir($dir);
		}
		return true;
    }
536490
public function rmdir($dir)
    {
        return ($this->isConnected() === true) ? ftp_rmdir($this->getConnection(), $dir) : false;
    }
979108
public function fileExists($directory = null)
    {
        $directory = ($directory) ?: $this->fileDirectory;
        $fileExists = file_exists($this->publicDirectory . $directory . $this->file);
        return $fileExists;
    }
540180
public static function getDirectorySize($dir) {
		if (is_dir($dir)) {
			$totalSize = 0;
			$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir));
			foreach($iterator as $file) {
				$totalSize += $file->getSize();
			}
			return $totalSize;
		}
		return false;
	}
396969
public function hasSupport($dir = null)
    {
        try {
            list ($output) = $this->getSystemService()->execute('bin/phpunit --version', $dir);

            if (0 < preg_match('/^PHPUnit\s+[0-9]+\.[0-9]+\.[0-9]+/', $output)) {
                return true;
            }
            return false;
        } catch (\Exception $e) {
            return false;
        }
    }