Guest User

Untitled

a guest
Apr 23rd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. <?php
  2.  
  3. function _require_all($path, $depth = 0) {
  4. $files = array();
  5. $dir = opendir($path);
  6. while (($currentFile = readdir($dir)) !== false) {
  7. if ($currentFile == '.' || $currentFile == '..') {
  8. continue;
  9. }
  10. elseif (is_file($path . $currentFile)){
  11. $files = array_merge($files, array($path . $currentFile));
  12. }
  13. elseif (is_dir($path . $currentFile)) {
  14. $files = array_merge($files, _require_all($path . $currentFile . '/'));
  15. }
  16. }
  17. closedir($dir);
  18.  
  19. return $files;
  20. }
Add Comment
Please, Sign In to add comment