Created
May 24, 2018 11:39
-
-
Save janjouketjalsma/1bd74643201f23a1c1eae0a3505fc1f9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $dir = __DIR__ . '/../storage/cache'; | |
| if ( is_dir( $dir ) ) { | |
| $it = new RecursiveDirectoryIterator( $dir, RecursiveDirectoryIterator::SKIP_DOTS ); | |
| $files = new RecursiveIteratorIterator( $it, RecursiveIteratorIterator::CHILD_FIRST ); | |
| foreach ( $files as $file ) { | |
| chmod( $file->getRealPath() , 0777); | |
| } | |
| } else { | |
| echo 'Error: Path is not a valid directory.'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment