mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
Merge branch '361' into Dev
This commit is contained in:
@@ -48,7 +48,7 @@ class Manager
|
|||||||
$this->parser = new \Symfony\Component\Yaml\Yaml();
|
$this->parser = new \Symfony\Component\Yaml\Yaml();
|
||||||
$this->core = $core;
|
$this->core = $core;
|
||||||
|
|
||||||
$this->registry = $this->parser->parse($file);
|
$this->registry = $this->parser->parse($file) ? : array();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function exists($name)
|
protected function exists($name)
|
||||||
@@ -63,6 +63,8 @@ class Manager
|
|||||||
$this->get($cacheKey, $service_name)->getDriver()->flushAll();
|
$this->get($cacheKey, $service_name)->getDriver()->flushAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file_put_contents($this->cacheFile->getPathname(), '');
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
100
lib/classes/patch/361.class.php
Normal file
100
lib/classes/patch/361.class.php
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2010 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @package
|
||||||
|
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||||
|
* @link www.phraseanet.com
|
||||||
|
*/
|
||||||
|
class patch_361 implements patchInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $release = '3.6.1';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @var Array
|
||||||
|
*/
|
||||||
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function get_release()
|
||||||
|
{
|
||||||
|
return $this->release;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function require_all_upgrades()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return Array
|
||||||
|
*/
|
||||||
|
function concern()
|
||||||
|
{
|
||||||
|
return $this->concern;
|
||||||
|
}
|
||||||
|
|
||||||
|
function apply(base &$appbox)
|
||||||
|
{
|
||||||
|
$Core = \bootstrap::getCore();
|
||||||
|
|
||||||
|
$em = $Core->getEntityManager();
|
||||||
|
|
||||||
|
$repository = $em->getRepository('\Entities\BasketElement');
|
||||||
|
|
||||||
|
foreach($repository->findAll() as $basketElement)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$basketElement->getRecord();
|
||||||
|
}
|
||||||
|
catch(\Exception $e)
|
||||||
|
{
|
||||||
|
$em->remove($basketElement);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$em = $Core->getEntityManager();
|
||||||
|
|
||||||
|
$repository = $em->getRepository('\Entities\Basket');
|
||||||
|
|
||||||
|
foreach($repository->findAll() as $basket)
|
||||||
|
{
|
||||||
|
$htmlDesc = $basket->getDescription();
|
||||||
|
|
||||||
|
$description = trim(strip_tags(str_replace("<br />", "\n", $htmlDesc)));
|
||||||
|
|
||||||
|
if($htmlDesc == $description)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$basket->setDescription($description);
|
||||||
|
}
|
||||||
|
|
||||||
|
$em->flush();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user