$rootDir = dirname(__FILE__) . '/../..';
$files = array(
- array(
- 'less' => array(
- 'directory' => "{$rootDir}/roojs1/less/bootstrap",
- 'name' => 'bootstrap'
- ),
- 'css' => array(
- 'directory' => "{$rootDir}/roojs1/css-bootstrap/",
- 'name' => 'bootstrap'
- )
+ "{$rootDir}/roojs1/less/bootstrap/bootstrap.less" => array(
+ 'baseDir' => "/home/edward/Downloads/css-compiled", //"{$rootDir}/roojs1/css-bootstrap",
+ 'name' => 'bootstrap.css',
+ 'minify' => 'bootstrap.min.css'
),
- array(
- 'less' => array(
- 'directory' => "{$rootDir}/roojs1/less/roojs-bootstrap",
- 'name' => 'roojs-bootstrap'
- ),
- 'css' => array(
- 'directory' => "{$rootDir}/roojs1/css-bootstrap/",
- 'name' => 'roojs-bootstrap'
- )
+ "{$rootDir}/roojs1/less/roojs-bootstrap/roojs-bootstrap.less" => array(
+ 'baseDir' => "/home/edward/Downloads/css-compiled", //"{$rootDir}/roojs1/css-bootstrap",
+ 'name' => 'roojs-bootstrap-debug.css',
+ 'minify' => 'roojs-bootstrap.css'
)
);
-print_R($files);exit;
-
require_once 'HTML/Less.php';
$less = new HTML_Less();
-require_once 'HTML/CSS/Minify.php';
+//require_once 'HTML/CSS/Minify.php';
+//
+//$minify = new HTML_CSS_Minify();
-$minify = new HTML_CSS_Minify();
+$minify = array();
-foreach ($files as $less => $file){
+foreach ($files as $src => $file){
- if(!file_exists($less)){
+ if(!file_exists($src)){
echo "{$less} does not exist...\n";
continue;
}
- print_R($file);
- exit;
try {
- $css = "{$file['directory']}{$file['name']}.css";
+ $css = "{$file['baseDir']}/{$file['name']}";
- echo "Compiling - {$less} To {$css}\n";
+ echo "Compiling - {$src} To {$css}\n";
- $less->compileFile($less, $css);
+ $less->compileFile($src, $css);
if(!file_exists($css)){
echo "Compile failed?!\n";
continue;
}
-
-
+ $minify[$file['mimify']] = $css;
} catch (Exception $ex) {
echo "lessphp fatal error: {$ex->getMessage()}\n";
}
+}
-}
\ No newline at end of file
+print_R($minify);
\ No newline at end of file