Skip to content

Commit

Permalink
Supprime le dossier cache du dépôt
Browse files Browse the repository at this point in the history
  • Loading branch information
kdubuc committed Aug 23, 2016
1 parent 90d57c0 commit f7fdbc6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ vendor
/nbproject
*.phar
composer.lock
cache
25 changes: 16 additions & 9 deletions application/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function run()

return parent::run();
}

/**
* Initialisation de l'auto-loader
*/
Expand All @@ -32,29 +32,36 @@ protected function _initAutoLoader()
$autoloader = Zend_Loader_Autoloader::getInstance();

$autoloader_application = new Zend_Application_Module_Autoloader(array('basePath' => APPLICATION_PATH, 'namespace' => null));

$autoloader_application->addResourceType('cache', 'cache/', 'Cache');

$autoloader->pushAutoloader($autoloader_application);

return $autoloader;
}

/**
* Initialisation d'un cache standard
* @param array $frontendOptions surcharge des options de configuration du front
* @param array $backendOptions surcharge des options de configuration du back
* @return Cache une instance de cache
*/
protected function getCache(array $frontendOptions = array(), array $backendOptions = array()) {

$options = $this->getOption('cache');


if(!empty($options) && $options['enabled'] && $options['adapter'] == 'File') {
$file = $options['cache_dir'];
if(!file_exists($file)) {
mkdir($file);
}
}

return Zend_Cache::factory(
// front adapter
'Core',
// back adapter
$options['adapter'],
$options['adapter'],
// frontend options
array_merge(array(
'caching' => $options['enabled'],
Expand All @@ -66,7 +73,7 @@ protected function getCache(array $frontendOptions = array(), array $backendOpti
array_merge(array(
'servers' => array(
array(
'host' => $options['host'],
'host' => $options['host'],
'port' => $options['port'],
),
),
Expand Down Expand Up @@ -100,7 +107,7 @@ protected function _initCacheSearch()
return $this->getCache();
}



/**
* Initialisation de la vue
Expand Down
4 changes: 0 additions & 4 deletions cache/.gitignore

This file was deleted.

0 comments on commit f7fdbc6

Please sign in to comment.