svn: /phpdoc/doc-base/trunk/scripts/include/ lib-misc.inc.php
| From: | Philip Olson | Date: | Sat, 25 Jun 2011 20:27:14 +0000 |
| Subject: | svn: /phpdoc/doc-base/trunk/scripts/include/ lib-misc.inc.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-8310@lists.php.net to get a copy of this message | ||
philip Sat, 25 Jun 2011 20:27:14 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=312466
Log:
Tired of writing code like this, so am committing it here.
Changed paths:
A phpdoc/doc-base/trunk/scripts/include/lib-misc.inc.php
Added: phpdoc/doc-base/trunk/scripts/include/lib-misc.inc.php
===================================================================
--- phpdoc/doc-base/trunk/scripts/include/lib-misc.inc.php (rev 0)
+++ phpdoc/doc-base/trunk/scripts/include/lib-misc.inc.php 2011-06-25 20:27:14 UTC (rev 312466)
@@ -0,0 +1,25 @@
+<?php
+function list_files($basedir, $extensions = array('xml')) {
+
+ if (!is_dir($basedir)) {
+ return false;
+ }
+
+ $files = array();
+ foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($basedir)) as $file) {
+
+ if (!$file->isFile()) {
+ continue;
+ }
+
+ $filepath = $file->getPathname();
+
+ if (!in_array(pathinfo($filepath, PATHINFO_EXTENSION), $extensions)) {
+ continue;
+ }
+
+ $files[] = $filepath;
+ }
+ return $files;
+}
+
Property changes on: phpdoc/doc-base/trunk/scripts/include/lib-misc.inc.php
___________________________________________________________________
Added: svn:keywords
+ Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL
Added: svn:eol-style
+ native