1:  2:  3:  4:  5:  6:  7:  8:  9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 
<?php
namespace Omeka\Installation\Task;

use Omeka\Installation\Installer;

/**
 * Task to clear Doctrine's metadata cache.
 */
class ClearCacheTask implements TaskInterface
{
    public function perform(Installer $installer)
    {
        $em = $installer->getServiceLocator()->get('Omeka\EntityManager');
        $cache = $em->getConfiguration()->getMetadataCacheImpl();

        if (!$cache) {
            return;
        }

        $cache->deleteAll();
    }
}