This method is called in response to readdir()

@return string Should return a string representing the next filename, or
false if there is no next file.
@link http://www.php.net/manual/en/function.readdir.php
546373
public function dir_readdir()
    {
        // Skip empty result keys
        if (!$this->objectIterator->valid()) {
            return false;
        }

        // First we need to create a cache key. This key is the full path to
        // then object in s3: protocol://bucket/key.
        // Next we need to create a result value. The result value is the
        // current value of the iterator without the opened bucket prefix to
        // emulate how readdir() works on directories.
        // The cache key and result value will depend on if this is a prefix
        // or a key.
        $cur = $this->objectIterator->current();
        if (isset($cur['Prefix'])) {
            // Include "directories". Be sure to strip a trailing "/"
            // on prefixes.
            $result = rtrim($cur['Prefix'], '/');
            $key = $this->formatKey($result);
            $stat = $this->formatUrlStat($key);
        } else {
            $result = $cur['Key'];
            $key = $this->formatKey($cur['Key']);
            $stat = $this->formatUrlStat($cur);
        }

        // Cache the object data for quick url_stat lookups used with
        // RecursiveDirectoryIterator.
        $this->getCacheStorage()->set($key, $stat);
        $this->objectIterator->next();

        // Remove the prefix from the result to emulate other stream wrappers.
        return $this->openedBucketPrefix
            ? substr($result, strlen($this->openedBucketPrefix))
            : $result;
    }
295795
public function getDirectory()
    {
        $dir = clone $this;
        $dir->path = str_replace(DIRECTORY_SEPARATOR, '/', dirname($this->path));
        if (!$dir->path) $dir->path = '/';

        return $dir;
    }
1199836
function getFilename(){
		if($content_disposition = $this->getHeaderValue("Content-Disposition")){
			if(preg_match('/filename="(.*?)"/',$content_disposition,$matches)){
				return $matches[1];
			}
		}
		if(preg_match("/([^\\/?]+)(\\?.*|)$/",$this->_Uri,$matches)){
			return $matches[1];
		}
	}
861726
public function dir_readdir()
  {
    $each = each($this->_dirFiles);

    if ($each === false) {
      $result = false;
    } else {
      $result = $each["value"];
    }

    return $result;
  }
482735
public function getFileDisplayName()
    {
        $base = str_replace(DIRECTORY_SEPARATOR, '/', DIR_BASE);
        if (strpos($this->filename, $base) === 0) {
            $path = substr($this->filename, strlen($base) + 1);
        } else {
            $path = $this->filename;
        }

        return str_replace('/', DIRECTORY_SEPARATOR, $path);
    }
193895
public function getFileContents() : string
    {
        // No point in continuing if there is no file assigned to this frame.
        if (!$this->file || $this->file === 'Unknown') {
            return '';
        }

        // If the contents aren't cached yet, grab them into our rudimentary in-memory cache.
        // Note: This may cache a boolean false if the retrieval fails for whatever reason. We're gonna handle
        // that afterwards and return an empty string instead.
        if (!isset(static::$files[$this->file])) {
            static::$files[$this->file] = file_get_contents($this->file);
        }

        // Return the cached contents of the file or an empty string if no contents could be fetched.
        return static::$files[$this->file] ?: '';
    }
1103291
private function generateFilename()
    {
        $filename = str_random(100) . "." . $this->extension;

        if(Storage::exists($this->folder . '/' . $filename))
        {
            $this->generateFilename();
        }

        return $filename;
    }
286812
function _dir_readdir()
    {
        if (isset($this->entries[$this->pos])) {
            return $this->entries[$this->pos++];
        }
        return false;
    }
208565
public static function getTemporaryDirectory()
    {
        $check = function ($s) {
            $result = '';
            if (is_string($s) && ($s !== '')) {
                $s = @realpath($s);
                if (($s !== false) && is_dir($s) && is_writable(($s))) {
                    $result = $s;
                }
            }

            return $result;
        };
        $result = '';
        if ($result === '') {
            if (static::$temporaryDirectory !== '') {
                $result = $check(static::$temporaryDirectory);
                if ($result === '') {
                    throw new \Exception('The configured temporary directory is not valid');
                }
            }
        }
        if ($result === '') {
            if (function_exists('sys_get_temp_dir')) {
                $result = $check(@sys_get_temp_dir());
            }
        }
        if ($result === '') {
            if (isset($_ENV) && is_array($_ENV)) {
                foreach (array('TMP', 'TMPDIR', 'TEMP') as $k) {
                    if (isset($_ENV[$k])) {
                        $result = $check($_ENV[$k]);
                        if ($result !== '') {
                            break;
                        }
                    }
                }
            }
        }
        if ($result === '') {
            throw new \Exception('Unable to determine a temporary directory');
        }

        return $result;
    }
692934
protected function read()
	{
		if( $this->useCache )
		{
			$fileName	= $this->pathCache.basename( $this->fileName ).".cache";
			if( file_exists( $fileName ) && file_exists( $this->fileName ) && filemtime( $fileName ) == filemtime( $this->pathConfig.$this->fileName ) )
			{
				return $this->readCache( $fileName );
			}
			else
			{
				$this->readWDDX();
				return $this->writeCache( $fileName );
			}
		}
		return $this->readWDDX();

	}
676025
protected function getFilesToDelete()
    {
        $dirName    = dirname($this->baseFilename);
        $baseName   = basename($this->baseFilename);
        $fileNames  = scandir($dirName);
        $result     = array();
        $prefix     = $baseName . '.';
        $plen       = strlen($prefix);

        foreach ($fileNames as $fileName) {
            if ($fileName == '.' || $fileName == '..') {
                continue;
            }

            if (!strncmp($fileName, $prefix, $plen)) {
                $suffix = substr($fileName, $plen);
                if (preg_match($this->extMatch, $suffix)) {
                    $result[] = $dirName . DIRECTORY_SEPARATOR . $fileName;
                }
            }
        }

        sort($result);
        $rlen = count($result);
        if ($rlen < $this->backupCount) {
            $result = array();
        } else {
            $result = array_slice($result, 0, $rlen - $this->backupCount);
        }
        return $result;
    }
938788
public function dir_readdir()
    {
        $node = $this->currentlyOpenedDir->iterator()->current();
        if (!$node) {
            return false;
        }
        $this->currentlyOpenedDir->iterator()->next();

        return $node->basename();
    }
1304168
public function read()
    {
        $args = array_merge(
            [$this->filename],
            [false, null],
            func_get_args()
        );

        return file_get_contents(...$args);
    }
608960
public function next() {
		if ($this->currentRecord < count($this->files)) {
			$file = $this->files[$this->currentRecord];
			$this->currentRecord++;
			return $file;
		} else {
			return false;
		}
	}
534449
public function getName()
    {
        $name = rtrim($this->path, '/');

        if (strstr($name, DIRECTORY_SEPARATOR)) {
            $name = substr($name, strrpos($name, DIRECTORY_SEPARATOR) + 1);
        }

        return trim($name);
    }
1035764
protected function getFileName()
    {
        if (null === $this->fileName) {
            $this->fileName = $this->lockDirectory.'/'.$this->applicationName.'.pid';
        }

        return $this->fileName;
    }
857343
public function scanDir()
    {
        // only possible in directories
        if (!$this->isDir() || !$this->exists()) {
            return null;
        }

        $fileList = [];
        $fileNameList = scandir($this->absoluteFileName);
        foreach ($fileNameList as $fileName) {
            // do not add . and ..
            if ($fileName === "." or $fileName === "..") {
                continue;
            }
            $absoluteFileName = $this->absoluteFileName . "/" . $fileName;
            $fileList [] = new File ($absoluteFileName);
        }

        return $fileList;
    }