Skip to content

Commit

Permalink
fix tmp empty folder, fix glob on empty folder, refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
namuit committed Dec 1, 2011
1 parent e33a03e commit dc75901
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
22 changes: 16 additions & 6 deletions wordless.php
Expand Up @@ -117,16 +117,27 @@ public static function load_i18n() {
public static function require_helpers() { public static function require_helpers() {
require_once 'wordless/helpers.php'; require_once 'wordless/helpers.php';
$helpers_path = self::theme_helpers_path(); $helpers_path = self::theme_helpers_path();
foreach (glob("$helpers_path/*.php") as $filename) { self::require_once_dir("$helpers_path/*.php");
require_once $filename;
}
} }


public static function require_theme_initializers() { public static function require_theme_initializers() {
$initializers_path = self::theme_initializers_path(); $initializers_path = self::theme_initializers_path();
foreach (glob("$initializers_path/*.php") as $filename) { self::require_once_dir("$initializers_path/*.php");
require_once $filename; }

/**
* 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() { public static function theme_is_wordless_compatible() {
Expand All @@ -142,7 +153,6 @@ public static function theme_is_wordless_compatible() {
); );
foreach ($required_directories as $dir) { foreach ($required_directories as $dir) {
if (!file_exists($dir) || !is_dir($dir)) { if (!file_exists($dir) || !is_dir($dir)) {
echo $dir;
return false; return false;
} }
} }
Expand Down
1 change: 1 addition & 0 deletions wordless/theme_builder/vanilla_theme/tmp/README.mdown
@@ -0,0 +1 @@
Temp folder

0 comments on commit dc75901

Please sign in to comment.