Last active
August 29, 2015 14:09
-
-
Save quilime/cbc77d61f3280d3f2dd3 to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
function get_patches($dir) { | |
global $c, $inc, $offset_left, $offset_top; | |
$inc = 0; | |
$dir_array = []; | |
$path = realpath($dir); | |
$dirs = new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS); | |
$objects = new RecursiveIteratorIterator($dirs, RecursiveIteratorIterator::SELF_FIRST); | |
$section = basename($dir); | |
// script_header($section); | |
// filter unique paths: loop through all objects and store names in dir_array | |
foreach($objects as $name => $object){ | |
$basename = $object->getBasename(); | |
if($object->isDir() && $basename[0] != '.') { | |
array_push($dir_array, $name); | |
} | |
} | |
return $dir_array; | |
} | |
$result = get_patches('CNMAT-MMJ-Depot-master/examples/demos/'); | |
print_r($result); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment