Jarves\Translation\Utils::readDirectory PHP Method

readDirectory() public method

public readDirectory ( string $path ) : array | null
$path string
return array | null
    public function readDirectory($path)
    {
        $root = realpath($this->getJarves()->getRootDir() . '/../');
        if (!file_exists($root . '/' . $path)) {
            return null;
        }
        $h = opendir($root . '/' . $path);
        $result = [];
        while ($file = readdir($h)) {
            if ($file == '.' || $file == '..' || $file == '.svn') {
                continue;
            }
            if (is_dir($path . '/' . $file)) {
                $result = array_merge($result, $this->readDirectory($path . '/' . $file));
            } else {
                $result = array_merge($result, $this->extractFile($root . '/' . $path . '/' . $file));
            }
        }
        return $result;
    }