cvs: phd /include buildoptions.php

From: Date: Sat, 24 May 2008 14:39:32 +0000
Subject: cvs: phd /include buildoptions.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-1678@lists.php.net to get a copy of this message
gwynne Sat May 24 14:39:32 2008 UTC Modified files: /phd/include buildoptions.php Log: glob() has different semantics than scandir(), note to self, please be more thorough http://cvs.php.net/viewvc.cgi/phd/include/buildoptions.php?r1=1.2&r2=1.3&diff_format=u Index: phd/include/buildoptions.php diff -u phd/include/buildoptions.php:1.2 phd/include/buildoptions.php:1.3 --- phd/include/buildoptions.php:1.2 Sat May 24 14:37:08 2008 +++ phd/include/buildoptions.php Sat May 24 14:39:32 2008 @@ -1,5 +1,5 @@ <?php -/* $Id: buildoptions.php,v 1.2 2008/05/24 14:37:08 gwynne Exp $ */ +/* $Id: buildoptions.php,v 1.3 2008/05/24 14:39:32 gwynne Exp $ */ class BuildOptionsParser extends OptionParser { @@ -203,17 +203,17 @@ if (is_null($formatList)) { $formatList = array(); foreach (glob($GLOBALS['ROOT'] . "/formats/*.php") as $item) { - $formatList[] = substr($item, 0, -4); + $formatList[] = substr(basename($item), 0, -4); } } if (is_null($themeList)) { $themeList = array(); foreach (glob($GLOBALS['ROOT'] . "/themes/*", GLOB_ONLYDIR) as $item) { - if (!in_array($item, array('CVS', '.', '..'))) { - $maintheme = $item; + if (!in_array(basename($item), array('CVS', '.', '..'))) { + $maintheme = basename($item); $subthemes = array(); - foreach (glob($GLOBALS['ROOT'] . "/themes/" . $item . "/*.php") as $subitem) { - $subthemes[] = substr($subitem, 0, -4); + foreach (glob($item . "/*.php") as $subitem) { + $subthemes[] = substr(basename($subitem), 0, -4); } $themeList[$maintheme] = $subthemes; }

« previous php.doc.cvs (#1678) next »