Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function _require_all($path, $depth = 0) {
- $files = array();
- $dir = opendir($path);
- while (($currentFile = readdir($dir)) !== false) {
- if ($currentFile == '.' || $currentFile == '..') {
- continue;
- }
- elseif (is_file($path . $currentFile)){
- $files = array_merge($files, array($path . $currentFile));
- }
- elseif (is_dir($path . $currentFile)) {
- $files = array_merge($files, _require_all($path . $currentFile . '/'));
- }
- }
- closedir($dir);
- return $files;
- }
Add Comment
Please, Sign In to add comment