Fix root path registry value in setup mode

This commit is contained in:
Romain Neutron
2013-05-23 12:33:36 +02:00
parent 09940bfedd
commit d280673e13
2 changed files with 12 additions and 4 deletions

View File

@@ -20,6 +20,11 @@ class Setup_Registry implements registryInterface
{
protected $datas = array();
public function __construct()
{
$this->datas['GV_RootPath'] = realpath(__DIR__ . '/../../..') . '/';
}
public function get($key, $defaultvalue = null)
{
return isset($this->datas[$key]) ? $this->datas[$key] : $defaultvalue;

View File

@@ -10,11 +10,11 @@
*/
use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Core\Version;
use MediaAlchemyst\Alchemyst;
use MediaAlchemyst\Specification\Image as ImageSpecification;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpFoundation\File\File as SymfoFile;
use Symfony\Component\Finder\Finder;
/**
*
@@ -349,11 +349,14 @@ class appbox extends base
*/
$upgrader->set_current_message(_('Purging directories'));
$finder = new Symfony\Component\Finder\Finder();
$finder = new Finder();
$finder->in(array(
$this->app['phraseanet.registry']->get('GV_RootPath') . 'tmp/cache_minify/',
$this->app['phraseanet.registry']->get('GV_RootPath') . 'tmp/cache_minify/',
))->ignoreVCS(true)->ignoreDotFiles(true);
$this->app['phraseanet.registry']->get('GV_RootPath') . 'tmp/cache_twig/',
))
->depth(0)
->ignoreVCS(true)
->ignoreDotFiles(true);
foreach ($finder as $file) {
$app['filesystem']->remove($file);