<?php
  $email = 'epoehler@classics.umass.edu';
  $password = 'pbmp79CE';
  $name = '';
  $sitetitle = 'My cms';
  $timezone = 'America/New_York';
  $locale = 'Default';
  
  use Omeka\Installation\Installer;
  require 'bootstrap.php';
  $config = require OMEKA_PATH . '/application/config/application.config.php';
  $application = Zend\Mvc\Application::init($config);
  $services = $application->getServiceManager();
  $router = $services->get('Router');
  $router->setRequestUri(new \Zend\Uri\Http('http://pbmp.epoehler.umasscreate.net/cms'));
  $installer = new Installer($services);
  $installer->registerTask('Omeka\Installation\Task\DestroySessionTask');
  $installer->registerTask('Omeka\Installation\Task\ClearCacheTask');
  $installer->registerTask('Omeka\Installation\Task\InstallSchemaTask');
  $installer->registerTask('Omeka\Installation\Task\RecordMigrationsTask');
  $installer->registerTask('Omeka\Installation\Task\InstallDefaultVocabulariesTask');
  $installer->registerTask('Omeka\Installation\Task\InstallDefaultTemplatesTask');
  $installer->registerTask('Omeka\Installation\Task\CreateFirstUserTask');
  $installer->registerTask('Omeka\Installation\Task\AddDefaultSettingsTask');
  $installer->registerVars(
                    'Omeka\Installation\Task\AddDefaultSettingsTask',
                    [
                        'administrator_email' => $email,
                        'installation_title' => $sitetitle,
                        'time_zone' => $timezone,
                        'locale' => $locale,
                    ]
                );
                
  $installer->registerVars(
                    'Omeka\Installation\Task\CreateFirstUserTask',
                    [
                        'name' => $name,
                        'email' => $email,
                        'password' => $password
                    ]
                );

  $runinstall = $installer->install();
