buildSDK/less-bootstrap-compiler.php
[roojs1] / buildSDK / less-bootstrap-compiler.php
1 <?php
2
3 $cwd = getcwd();
4
5 if (array_pop(explode('/', $cwd)) !== 'roojs1') {
6     echo "this should be run in roojs1 directory...\n";
7     exit;
8 }
9
10 ini_set('include_path', 
11     dirname(__FILE__) . '/../:' .
12     dirname(__FILE__) . '/../../pear:' .
13     ini_get('include_path')
14 );
15
16 $rootDir = dirname(__FILE__) . '/../..';
17
18 $files = array(
19     "{$rootDir}/roojs1/less/bootstrap/bootstrap.less" => array(
20         "roojs1/css-bootstrap/bootstrap.css",
21         "roojs1/css-bootstrap/bootstrap.min.css"
22     ),
23     "roojs1/less/roojs-bootstrap/roojs-bootstrap.less" => array(
24         "roojs1/css-bootstrap/roojs-bootstrap-debug.css",
25         "roojs1/css-bootstrap/roojs-bootstrap.css"
26     )
27 );
28
29 require_once 'HTML/Less.php';
30         
31 $less = new HTML_Less();
32
33 foreach ($files as $src => $file){
34
35     if(!file_exists($src)){
36         echo "{$src} does not exist...\n";
37         continue;
38     }
39     
40     echo "{$src} exist \n";
41
42 //    try {
43 //
44 //        foreach ($file as $f){
45 //            echo "Compiling - {$src} To {$f}\n";
46 //
47 //            $less->compileFile($src, $f);
48 //        }
49 //
50 //    } catch (Exception $ex) {
51 //        echo "lessphp fatal error: {$ex->getMessage()}\n";
52 //    }
53
54 }