Ejemplo n.º 1
0
 /**
  * Install the test database schema.
  */
 public static function installSchema()
 {
     $manager = new Installer();
     $manager->setServiceLocator(self::getApplication()->getServiceManager());
     $manager->registerTask('Omeka\\Installation\\Task\\InstallSchemaTask');
     $result = $manager->install();
 }
Ejemplo n.º 2
0
 /**
  * Create the installer service.
  * 
  * @param ServiceLocatorInterface $serviceLocator
  * @return Installer
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $config = $serviceLocator->get('Config');
     if (!isset($config['installer']['tasks'])) {
         throw new Exception\ConfigException('Missing installer configuration');
     }
     $installer = new Installer();
     foreach ($config['installer']['pre_tasks'] as $task) {
         $this->validateTask($task);
         $installer->registerPreTask($task);
     }
     foreach ($config['installer']['tasks'] as $task) {
         $this->validateTask($task);
         $installer->registerTask($task);
     }
     return $installer;
 }