refactoring

This commit is contained in:
Simon Vieille 2015-03-05 20:11:39 +01:00
parent caa28b51bf
commit 7380f7302c
2 changed files with 0 additions and 51 deletions

View file

@ -826,50 +826,4 @@ class BaseAdminController extends Controller
{
return $this->preRemove($object);
}
protected function cleanString($text)
{
$text = preg_replace('`</?[^>]+>`U', '', $text);
$encoding = mb_detect_encoding($text);
$text = str_replace(array('&nbsp;', '&rsquo;'), ' ',$text);
$text = html_entity_decode(strip_tags($text));
if ($encoding!='UTF-8') $text = utf8_encode($text);
$text = str_replace(
array(
'à', 'â', 'ä', 'á', 'ã', 'å',
'î', 'ï', 'ì', 'í',
'ô', 'ö', 'ò', 'ó', 'õ', 'ø',
'ù', 'û', 'ü', 'ú',
'é', 'è', 'ê', 'ë',
'ç', 'ÿ', 'ñ',
'À', 'Â', 'Ä', 'Á', 'Ã', 'Å',
'Î', 'Ï', 'Ì', 'Í',
'Ô', 'Ö', 'Ò', 'Ó', 'Õ', 'Ø',
'Ù', 'Û', 'Ü', 'Ú',
'É', 'È', 'Ê', 'Ë',
'Ç', 'Ÿ', 'Ñ',
'\'', '"',
' ', ' ', ' ', ' ', ' '
),
array(
'a', 'a', 'a', 'a', 'a', 'a',
'i', 'i', 'i', 'i',
'o', 'o', 'o', 'o', 'o', 'o',
'u', 'u', 'u', 'u',
'e', 'e', 'e', 'e',
'c', 'y', 'n',
'A', 'A', 'A', 'A', 'A', 'A',
'I', 'I', 'I', 'I',
'O', 'O', 'O', 'O', 'O', 'O',
'U', 'U', 'U', 'U',
'E', 'E', 'E', 'E',
'C', 'Y', 'N',
' ', ' ',
' ', ' ', ' ', ' ', ' '
),$text);
return strtolower($text);
}
}

View file

@ -274,7 +274,6 @@ class PageAdminController extends BaseAdminController
*/
public function cleanAllCacheAction(Request $request)
{
$this->cleanVarnishCache();
$this->cleanCache();
$referer = $request->headers->get('referer');
@ -332,11 +331,7 @@ class PageAdminController extends BaseAdminController
$options = array('command' => 'cache:clear-routing');
$application->run(new \Symfony\Component\Console\Input\ArrayInput($options));
}
protected function cleanVarnishCache()
{
$kernel = $this->get('kernel');
$application = new \Symfony\Bundle\FrameworkBundle\Console\Application($kernel);
$application->setAutoExit(false);