logger (new Zend_Log ()); $this->setupLogger (); try { $this->notice ('Commencing...'); $this->setupDatabase (); $download = $this->getDownloader ()->download (TM_Downloader::ENTITY_DICTIONARY); $parser = new Parser_JSON_TMInfoDir (file_get_contents ($download)); $this->setupTypesAndCategories ($parser->parseTypes (), $parser->parseCategories ()); $this->setupPackages($parser->parsePackages()); $this->cleanUpDictionaries (); $this->updateTemplateCount (); $this->setupSettings (); $this->importInitialSettings (); $site = $parser->parseWebSiteAddress (); $this->addConfigSetting ('site_web_address', $site); $this->sendInitialSetupEmail ($site); $this->closeUpInstallation (); } catch (Exception $e) { $this->crit ($e->getMessage ()); throw $e; } $this->notice ('Done.'); } function sendInitialSetupEmail ($site) { $letter = new View_Page ('setup/letterInitialSetup'); $letter->cron = $this->generateCronString (); $letter->login = $this->login; $letter->password = $this->password; $letter->site = $site; $this->sendEmail ("Ready made shop $site is now installed.", $letter->render ()); } protected function setupLogger () { $log_filename = LOGDIR . "/install-manual" . date ('Y-m-d_H-i-s') . '.log'; $file = new Zend_Log_Writer_Stream ($log_filename); $this->logger ()->addWriter ($file); } protected function setupTypesAndCategories ($type_list, $category_list) { $this->notice ('Setting up category list.'); { $categories = new Dictionary_Category (); $categories->update ($category_list, true); unset ($categories); } $this->notice ('Setting up type list.'); { $types = new Dictionary_Type (); $types->update ($type_list, true); unset ($types); } } protected function setupPackages($package_list) { $this->notice ('Setting up package list.'); { $packages = new Dictionary_Package (); $packages->update($package_list, true); unset($packages); } } }