Skip to content

Commit

Permalink
initial scss port
Browse files Browse the repository at this point in the history
  • Loading branch information
fiste788 committed Sep 4, 2014
1 parent 5680ae6 commit 610bfb7
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/lib/UploadHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ protected function orient_image($file_path) {

protected function handle_file_upload($uploaded_file, $name, $size, $type, $error,
$index = null, $content_range = null) {
$file = new stdClass();
$file = new \stdClass();
$file->name = $this->trim_file_name($name, $type, $index, $content_range);
$file->size = $this->fix_integer_overflow(intval($size));
$file->type = $type;
Expand Down
1 change: 1 addition & 0 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"tests"
],
"dependencies": {
"twbs-bootstrap-sass": "latest",
"bootstrap": "latest",
"fancybox": "~2.1.5",
"flot": "latest",
Expand Down
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{
"require": {
"leafo/lessphp": "v0.4.0",
"niahoo/altorouter": "dev-master",
"firephp/firephp-core": "dev-master",
"linkorb/jsmin-php": "dev-master",
"swiftmailer/swiftmailer": "5.2.*@dev",
"natxet/CssMin": "dev-master",
"niahoo/altorouter": "dev-master",
"firephp/firephp-core": "dev-master",
"linkorb/jsmin-php": "dev-master",
"swiftmailer/swiftmailer": "5.2.*@dev",
"natxet/CssMin": "dev-master",
"kriswallsmith/assetic": "1.2.*@dev",
"sybio/image-workshop": "dev-master",
"guzzlehttp/guzzle": "4.0.*@dev",
"symfony/css-selector": "2.4.*@dev",
"symfony/dom-crawler": "2.4.*@dev",
"suin/php-rss-writer": "dev-master",
"monolog/monolog": "1.6.*@dev"
"monolog/monolog": "1.6.*@dev",
"leafo/scssphp": "0.0.12"
}
}
49 changes: 48 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions lib/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Exception;
use FirePHP;
use lessc;
use scssc;
use Monolog\ErrorHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
Expand Down Expand Up @@ -170,18 +171,19 @@ public function setGeneralCss($generalCss) {
$less->checkedCompile($less_fname, $css_fname);
$this->generalCss[$key] = $file . '.css';
}*/
$scss = new scssc();
foreach ($generalCss as $key => $val) {
$file = strpos($val, "/") ? substr($val, strpos($val, "/") + 1) : $val;
$less_fname = LESSDIR . $val . ".less";
$scss_fname = LESSDIR . $val . ".scss";
$css_fname = STYLESHEETSDIR . $file . ".css";
$cache_fname = CACHEDIR . $file . ".cache";
$cache = (file_exists($cache_fname)) ? unserialize(file_get_contents($cache_fname)) : $less_fname;
$new_cache = lessc::cexecute($cache);
$cache = (file_exists($cache_fname)) ? unserialize(file_get_contents($cache_fname)) : $scss_fname;
$new_cache = $scss->cexecute($cache);
if (!is_array($cache) || $new_cache['updated'] > $cache['updated']) {
file_put_contents($cache_fname, serialize($new_cache));
file_put_contents($css_fname, $new_cache['compiled']);
}
lessc::ccompile($less_fname, $css_fname);
lessc::ccompile($scss_fname, $css_fname);
$this->generalCss[$key] = $file . '.css';
}
/*$less_fname = LESSDIR . 'pages' . DS . $this->route['name'] . '.less';
Expand Down

0 comments on commit 610bfb7

Please sign in to comment.