markstory/asset_compress — pull request #227 by jadb (2014-11-27 04:19:22+00:00)
Title: 3.0 various fixes

This fixes a couple issues I encountered while trying to use the LessCss filter. Here's a list of the stuff I think I fixed (or totally mis-used?):

1. the filter's settings weren't being read. My config:

```
...
cachePath = WEBROOT/_css/
filters[] = LessCss

[filter_LessCss]
node_path = node_modules/
node = /usr/bin/node
...
```

2. trying to run the `clear` command from the shell was throwing:

```
Exception: DirectoryIterator::__construct(/vagrant/app/tmp/cache/asset_compress): failed to open dir: No such file or directory in [/vagrant/app/plugins/AssetCompress/src/Shell/AssetCompressShell.php, line 129]
2014-11-27 03:31:19 Error: [UnexpectedValueException] DirectoryIterator::__construct(/vagrant/app/tmp/cache/asset_compress): failed to open dir: No such file or directory
Stack Trace:
#0 /vagrant/app/plugins/AssetCompress/src/Shell/AssetCompressShell.php(129): DirectoryIterator->__construct('/vagrant/app/tm...')
#1 /vagrant/app/plugins/AssetCompress/src/Shell/AssetCompressShell.php(109): AssetCompress\Shell\AssetCompressShell->_clearPath('/vagrant/app/tm...', Array, Array)
#2 /vagrant/app/plugins/AssetCompress/src/Shell/AssetCompressShell.php(65): AssetCompress\Shell\AssetCompressShell->_clearBuilds('js')
#3 [internal function]: AssetCompress\Shell\AssetCompressShell->clear()
#4 /vagrant/app/vendor/cakephp/cakephp/src/Console/Shell.php(365): call_user_func_array(Array, Array)
#5 /vagrant/app/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(191): Cake\Console\Shell->runCommand(Array, true)
#6 /vagrant/app/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(163): Cake\Console\ShellDispatcher->_dispatch()
#7 /vagrant/app/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(117): Cake\Console\ShellDispatcher->dispatch()
#8 /vagrant/app/bin/cake.php(22): Cake\Console\ShellDispatcher::run(Array)
#9 {main}
```

Turned out it's because the `CACHE . 'asset_compress'` directory doesn't exist yet.

And when the directory exists, it ends up trying to delete something like this:

```
CACHE . 'asset_compress' . 'filename.css'
```

There's a missing directory separator.

3. Trying to run in debug mode would never compile the LESS files, turned out that it was still using the older `Cake\Utility\Folder` instead of `Cake\Filesystem\Folder`.

That's all, maybe I missed stuff or as i said, complete mis-used it. Just let me know. I will close PR #226 (included in this one).