From 465976818cee1bcbc4dc2dfe082183dfc28742fa Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Thu, 31 Jan 2013 15:01:52 -0500 Subject: [PATCH] Dropped modules, spruced up Dynamic class Dropped the bootstrap submodules since the bootstrap is moving out of this project again. Also dropped LESS, relying on an installed copy (similar to SASS) --- .gitmodules | 15 --------------- README.md | 5 +++-- classes/Dynamic.php | 13 +++++++++++-- jar.php | 13 +++++++++++-- vendors/cloudhead/less.js | 1 - vendors/jquery/jquery | 1 - vendors/jquery/jquery-mobile | 1 - vendors/jquery/jquery-ui | 1 - vendors/twitter/bootstrap | 1 - 9 files changed, 25 insertions(+), 26 deletions(-) delete mode 100644 .gitmodules delete mode 160000 vendors/cloudhead/less.js delete mode 160000 vendors/jquery/jquery delete mode 160000 vendors/jquery/jquery-mobile delete mode 160000 vendors/jquery/jquery-ui delete mode 160000 vendors/twitter/bootstrap diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index d6ef549..0000000 --- a/.gitmodules +++ /dev/null @@ -1,15 +0,0 @@ -[submodule "vendors/twitter/bootstrap"] - path = vendors/twitter/bootstrap - url = git://github.com/twitter/bootstrap -[submodule "vendors/jquery/jquery"] - path = vendors/jquery/jquery - url = git://github.com/jquery/jquery.git -[submodule "vendors/jquery/jquery-ui"] - path = vendors/jquery/jquery-ui - url = git://github.com/jquery/jquery-ui.git -[submodule "vendors/jquery/jquery-mobile"] - path = vendors/jquery/jquery-mobile - url = git://github.com/jquery/jquery-mobile.git -[submodule "vendors/cloudhead/less.js"] - path = vendors/cloudhead/less.js - url = git@github.com:cloudhead/less.js.git diff --git a/README.md b/README.md index b011afd..a98eff3 100644 --- a/README.md +++ b/README.md @@ -22,14 +22,15 @@ PICKLES is in fact not a true MVC system and won't be masquerading around as one ### Highly Recommended Software -* PHP 5.2.0+ for native JSON support or PECL JSON 1.2.1 (included) +* PHP 5.2.0+ for native JSON support or PECL JSON 1.2.1 ### Optional Software +* node, npm & lessc to compile LESS files +* sass to compile SASS files * MySQL with PDO and PDO_MYSQL drivers * PostgreSQL with PDO and PDO_PGSQL drivers * SQLite 3 with PDO and PDO_SQLITE drivers -* Limited support for Mongo with Mongo driver and PECL Mongo 1.0.10 (included) ## Installation diff --git a/classes/Dynamic.php b/classes/Dynamic.php index ce1acf4..99c2f18 100644 --- a/classes/Dynamic.php +++ b/classes/Dynamic.php @@ -170,14 +170,23 @@ class Dynamic extends Object if ($less) { - $command = 'export PATH=$PATH:/usr/local/bin; ' . PICKLES_PATH . 'vendors/cloudhead/less.js/bin/lessc ' . $original_filename . ' > ' . $compiled_filename; + // I couldn't get getenv() to give me the PATH value... so yeah, there's that. + exec('echo $PATH', $path); + putenv('PATH=' . $path[0] . PATH_SEPARATOR . '/usr/local/bin'); + + $command = 'lessc ' . $original_filename . ' > ' . $compiled_filename; } elseif ($sass) { $command = 'sass ' . $original_filename . ':' . $compiled_filename; } - exec($command); + exec($command, $output, $return); + + if ($return !== 0) + { + throw new Exception('There was an error executing `' . $command . '` it returned exit code ' . $return); + } $original_filename = $compiled_filename; } diff --git a/jar.php b/jar.php index 1d25fdd..54e6e16 100755 --- a/jar.php +++ b/jar.php @@ -3180,14 +3180,23 @@ class Dynamic extends Object if ($less) { - $command = 'export PATH=$PATH:/usr/local/bin; ' . PICKLES_PATH . 'vendors/cloudhead/less.js/bin/lessc ' . $original_filename . ' > ' . $compiled_filename; + // I couldn't get getenv() to give me the PATH value... so yeah, there's that. + exec('echo $PATH', $path); + putenv('PATH=' . $path[0] . PATH_SEPARATOR . '/usr/local/bin'); + + $command = 'lessc ' . $original_filename . ' > ' . $compiled_filename; } elseif ($sass) { $command = 'sass ' . $original_filename . ':' . $compiled_filename; } - exec($command); + exec($command, $output, $return); + + if ($return !== 0) + { + throw new Exception('There was an error executing `' . $command . '` it returned exit code ' . $return); + } $original_filename = $compiled_filename; } diff --git a/vendors/cloudhead/less.js b/vendors/cloudhead/less.js deleted file mode 160000 index 8abc60e..0000000 --- a/vendors/cloudhead/less.js +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8abc60ef268f55e8399e06b19506d1c985baae8d diff --git a/vendors/jquery/jquery b/vendors/jquery/jquery deleted file mode 160000 index a60fed4..0000000 --- a/vendors/jquery/jquery +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a60fed4dec85e7b0c3b6fc5741b14cee1552afc4 diff --git a/vendors/jquery/jquery-mobile b/vendors/jquery/jquery-mobile deleted file mode 160000 index 39aea2b..0000000 --- a/vendors/jquery/jquery-mobile +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 39aea2b93315ff668b0aea428b08b4d3d31b66cc diff --git a/vendors/jquery/jquery-ui b/vendors/jquery/jquery-ui deleted file mode 160000 index bae06d2..0000000 --- a/vendors/jquery/jquery-ui +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bae06d2b1ef6bbc946dce9fae91f68cc41abccda diff --git a/vendors/twitter/bootstrap b/vendors/twitter/bootstrap deleted file mode 160000 index c52368d..0000000 --- a/vendors/twitter/bootstrap +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c52368d3c5984b28e6a71e5e1240afdd788fc2e6