X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=AssetTrait.php;h=5199ef26bbea0c6a1d3e637831ecf435b16f7471;hp=25e45ee461f86f212ffb2fcb1ee981332d8ccfc2;hb=443623f47935eb52acd65a3ff0d84eab1fd5a98b;hpb=f8754baf4d9aa72f262a775c9f80a8fe0a2abc9e diff --git a/AssetTrait.php b/AssetTrait.php index 25e45ee4..5199ef26 100644 --- a/AssetTrait.php +++ b/AssetTrait.php @@ -32,7 +32,9 @@ trait Pman_Core_AssetTrait { $ar = array_merge($ar , glob($dir . '/'. $f)); continue; } - + if (!preg_match('/\.js$/', $f)) { + $f .= ".js"; + } $ar[] = $dir .'/'. $f; } @@ -54,7 +56,7 @@ trait Pman_Core_AssetTrait { $mtime = 0; foreach($ar as $fn) { $f = basename($fn); - if (!preg_match('/\.js$/', $f)) { // only javascript files... (so XXX.Dialog.YYY* works..) + if (!preg_match('/\.js$/', $f) || $fn == '.js' || !file_exists($dir . '/' . $f)) { // only javascript files... (so XXX.Dialog.YYY* works..) continue; } // got the 'module file..' @@ -66,19 +68,12 @@ trait Pman_Core_AssetTrait { ksort($arfiles); // just sort by name so it's consistant for serialize.. - $ui = posix_getpwuid(posix_geteuid()); - - - $compiledir = session_save_path() . '/' . - $ui['name'] . '-' . $ff->project . '-' . $ff->version . '-jscompile'; - - if (!file_exists($compiledir)) { - mkdir($compiledir,0700,true); - } + require_once 'Pman/Core/Asset.php'; + $compiledir = Pman_Core_Asset::getCompileDir('js', '', true); - $lsort = create_function('$a,$b','return strlen($a) > strlen($b) ? 1 : -1;'); + $lsort = function($a,$b) { return strlen($a) > strlen($b) ? 1 : -1; }; usort($files, $lsort); $ff = HTML_FlexyFramework::get(); @@ -217,13 +212,11 @@ trait Pman_Core_AssetTrait { //print_r($relfiles); + + require_once 'Pman/Core/Asset.php'; + $compiledir = Pman_Core_Asset::getCompileDir('css', '', true); - $ui = posix_getpwuid(posix_geteuid()); - - - $compiledir = session_save_path() . '/' . - $ui['name'] . '-' . $ff->project . '-'. $ff->version . '-csscompile'; - + if (!file_exists($compiledir)) { mkdir($compiledir,0700,true); }