$ff = HTML_FlexyFramework::get();
- if (!empty($ff->Pman['isDev']) && !empty($_REQUEST['isDev'])) {
- echo "<!-- Javascript compile turned off (isDev on) -->\n";
+ if (empty($compiledir) || (!empty($ff->Pman['isDev']) && !empty($_REQUEST['isDev']))) {
+ echo "<!-- Javascript compile turned off (isDev on or mkdir failed) -->\n";
$this->assetArrayToHtml($files,'js');
return;
}
file_put_contents($compiledir.'/'.$output , $x->minify( $this->baseURL.$asset));
clearstatcache();
if (!file_exists($compiledir.'/'.$output) ||
- !filesize($compiledir.'/'.$routput)) {
+ !filesize($compiledir.'/'.$output)) {
echo "<!-- compile did not generate files : " . basename($compiledir) . "/{$output} -->\n";
$this->assetArrayToHtml($files,'css');
return;
function outputSCSS($smod)
{
- // we cant output non-cached versions of this....
+ // we cant output non-cached versions of this....
+
+ // this doesnt really look like it would work!
+ $this->outputSCSSDir("{$this->rootDir}/Pman/{$smod}/scss/{$smod}.scss", $smod);
+
+ }
+ /*
+ * Pman projects - expect
+ * /Pman/MyProject/scss/MyProject.less <<
+ * this should contain includes for the others?
+ * @import "fonts.less";
+ * ....
+ * Then all the files go here.
+ * /Pman/MyProject/scss/*.less
+ *
+ * For a Non Pman project
+ * send:
+ * /MyProject/scss/base.less << could be anything really...
+ *
+ *
+ */
+
+
+ function outputSCSSDir($file, $smod= '')
+ {
+
+
$ff = HTML_FlexyFramework::get();
- $fp = "{$this->rootDir}/Pman/$smod/scss/{$smod}.scss";
- // var_dump($fp);
- if (!file_exists($fp)) {
+ $asset = $ff->project == 'Pman' ? '/Core/Asset/css/' : '/Asset/css/';
+
+
+ if (!file_exists($file)) {
return;
}
- $ar = glob(dirname($fp) . '/*.scss');
- $maxtime = 0;
+ $ar = glob(dirname($file). '/*.scss');
+ $maxtime = filemtime($file);
foreach($ar as $fn) {
- $maxtime=max($maxtime, filemtime($fn));
+ $maxtime= max($maxtime, filemtime($fn));
}
mkdir($compiledir,0700,true);
}
-
-
- $output = date('Y-m-d-H-i-s-', $maxtime). $smod .'-'.md5(serialize(array($this->baseURL, $ar))) .'.css';
+ $output = date('Y-m-d-H-i-s-', $maxtime). $smod .'-less-'.md5(serialize(array($this->baseURL, $ar))) .'.css';
- $asset = $ff->project == 'Pman' ? '/Core/Asset/css/' : '/Asset/css/';
+
// where are we going to write all of this..
// This has to be done via a
-
-
+
if ( !file_exists($compiledir.'/'.$output) || !filesize($compiledir.'/'.$output)) {
die("INSTALL sassc");
}
- $fd = dirname($fp);
-
+
$ver = `$sassc --version`;
- $bits = explode("\n", $ver);
+ $bits = explode("\n", trim($ver));
foreach($bits as $b) {
+
$lr = explode(":", $b);
$vers[trim($lr[0])] = trim($lr[1]);
}
$sm = $vers['sass'] > 3.4 ? ' --sourcemap=auto ' : '--sourcemap';
- $cmd = "{$sassc} --style=compressed {$sm} -I {$fd} -I {$this->rootDir}/roojs1/scss/bootstrap $smod.scss {$compiledir}/{$output}";
+ $cmd = "{$sassc} --style=compressed {$sm} -I ". dirname($file) . " -I {$this->rootDir}/roojs1/scss/bootstrap ". basename($file) . " {$compiledir}/{$output}";
//echo "$cmd\n"; echo `$cmd`;
`$cmd`;
clearstatcache();
if (!file_exists($compiledir.'/'.$output) ||
- !filesize($compiledir.'/'.$routput)) {
+ !filesize($compiledir.'/'.$output)) {
echo "<!-- compile did not generate files : $cmd -->\n";
- echo "<script type=\"text/javascript\">alert('Failed to compile {$fp}');</script>\n";
+ echo "<script type=\"text/javascript\">alert('Failed to compile Less Dir: ". basename($file). "');</script>\n";
return;
}
}
+
+
+
+
}
\ No newline at end of file