Permalink
Browse files

fix tmp empty folder, fix glob on empty folder, refactoring

  • Loading branch information...
1 parent e33a03e commit dc759010b9b832b03c62abd65420ad4b33c79c99 @namuit namuit committed Dec 1, 2011
Showing with 17 additions and 6 deletions.
  1. +16 −6 wordless.php
  2. +1 −0 wordless/theme_builder/vanilla_theme/tmp/README.mdown
View
@@ -117,16 +117,27 @@ public static function load_i18n() {
public static function require_helpers() {
require_once 'wordless/helpers.php';
$helpers_path = self::theme_helpers_path();
- foreach (glob("$helpers_path/*.php") as $filename) {
- require_once $filename;
- }
+ self::require_once_dir("$helpers_path/*.php");
}
public static function require_theme_initializers() {
$initializers_path = self::theme_initializers_path();
- foreach (glob("$initializers_path/*.php") as $filename) {
- require_once $filename;
+ self::require_once_dir("$initializers_path/*.php");
+ }
+
+ /**
+ * Require one directory
+ * @param string $path
+ */
+ private static function require_once_dir($path) {
+
+ $list_files = glob($path);
+ if (is_array($list_files)) {
+ foreach ($list_files as $filename) {
+ require_once $filename;
+ }
}
+
}
public static function theme_is_wordless_compatible() {
@@ -142,7 +153,6 @@ public static function theme_is_wordless_compatible() {
);
foreach ($required_directories as $dir) {
if (!file_exists($dir) || !is_dir($dir)) {
- echo $dir;
return false;
}
}
@@ -0,0 +1 @@
+Temp folder

0 comments on commit dc75901

Please sign in to comment.