Пример #1
0
 public function perform(Installer $installer)
 {
     if (version_compare(PHP_VERSION, self::PHP_MINIMUM_VERSION, '<')) {
         $installer->addError(sprintf('The installed PHP version (%1$s) is too low. Omeka requires at least version %2$s', PHP_VERSION, self::PHP_MINIMUM_VERSION));
     }
     foreach (self::$requiredExtensions as $ext) {
         if (!extension_loaded($ext)) {
             $installer->addError(sprintf('Omeka requires the PHP extension %s, and it is not loaded.', $ext));
         }
     }
 }
Пример #2
0
 public function perform(Installer $installer)
 {
     try {
         $connection = $installer->getServiceLocator()->get('Omeka\\Connection');
         $connection->connect();
     } catch (\Exception $e) {
         $installer->addError($e->getMessage());
         return;
     }
     $version = $connection->getWrappedConnection()->getServerVersion();
     if (version_compare($version, self::MYSQL_MINIMUM_VERSION, '<')) {
         $installer->addError(sprintf('Omeka requires at least MySQL version %s, but this server is running version %s.', self::MYSQL_MINIMUM_VERSION, $version));
     }
 }
Пример #3
0
 public function perform(Installer $installer)
 {
     $filesDir = OMEKA_PATH . '/files';
     if (!is_dir($filesDir) || !is_writable($filesDir)) {
         $installer->addError(sprintf('"%s" is not a writable directory.', $filesDir));
         return;
     }
 }
Пример #4
0
 public function perform(Installer $installer)
 {
     $schemaPath = OMEKA_PATH . '/data/install/schema.sql';
     if (!is_readable($schemaPath)) {
         $installer->addError('Could not read the schema installation file.');
         return;
     }
     $schema = file_get_contents($schemaPath);
     $statements = explode(';', $schema);
     $connection = $installer->getServiceLocator()->get('Omeka\\Connection');
     try {
         foreach ($statements as $statement) {
             $statement = trim($statement);
             if ('' === $statement) {
                 continue;
             }
             $connection->exec($statement);
         }
     } catch (DBALException $e) {
         $installer->addError($e->getMessage());
         return;
     }
 }
Пример #5
0
 public function perform(Installer $installer)
 {
     $installer->addError('error_message');
 }