src/GameOfLife/Utils/FileSystem/FileSystemWriter.php
/**
     * Deletes all files in a directory without deleting the directory.
     *
     * @param String $_directoryPath The path to the directory
     * @param bool $_deleteNonEmptySubDirectories Indicates whether non empty subdirectories should be deleted
     *
     * @throws \Exception The exception when the target directory does not exist
     */
Deletes all files in a directory without deleting the directory.
@param String $_directoryPath The path to the directory
@param bool $_deleteNonEmptySubDirectories Indicates whether non empty subdirectories should be deleted

@throws \Exception The exception when the target directory does not exist
Deletes all files in a directory without deleting the directory . @param String $_directoryPath The path to the directory @param bool $_deleteNonEmptySubDirectories Indicates whether non empty subdirectories should be deleted @throws \ Exception The exception when the target directory does not exist
public function deleteFilesInDirectory(String $_directoryPath, bool $_deleteNonEmptySubDirectories = false)
    {
        $directoryPath = $this->convertSlashes($_directoryPath);
        $files = $this->fileSystemReader->getFileList($directoryPath . "/*");
        foreach ($files as $file)
        {
            if (is_dir($file)) $this->deleteDirectory($file, $_deleteNonEmptySubDirectories);
            else unlink($file);
        }
        if ($this->fileSystemReader->getFileList($directoryPath . "/*") !== array())
        {
            throw new \Exception("Unknown error while deleting the files in the directory \"" . $directoryPath . "\".");
        }
    }
public function deleteFilesInDirectory ( String $ _directoryPath , bool $ _deleteNonEmptySubDirectories = false ) { $ directoryPath = $ this -> convertSlashes ( $ _directoryPath ) ; $ files = $ this -> fileSystemReader -> getFileList ( $ directoryPath . " /* " ) ; foreach ( $ files as $ file ) { if ( is_dir ( $ file ) ) $ this -> deleteDirectory ( $ file , $ _deleteNonEmptySubDirectories ) ; else unlink ( $ file ) ; } if ( $ this -> fileSystemReader -> getFileList ( $ directoryPath . " /* " ) !== array ( ) ) { throw new \ Exception ( " Unknown error while deleting the files in the directory  \" " . $ directoryPath . " \" . " ) ; } }
Deletes all files in a directory without deleting the directory.
Deletes all files in a directory without deleting the directory .