Code:
<?php
class InstallController extends Zend_Controller_Action {
private $_translator = null;
private $_vendor = null;
private static $_TIME_ZONES = array("Pacific/Apia" => "(GMT-11:00) Midway Island, Samoa", "Pacific/Honolulu" => "(GMT-10:00) Hawaii", "America/Anchorage" => "(GMT-09:00) Alaska", "America/Los_Angeles" => "(GMT-08:00) Pacific Time (US and Canada); Tijuana", "America/Phoenix" => "(GMT-07:00) Arizona", "America/Denver" => "(GMT-07:00) Mountain Time (US and Canada)", "America/Chihuahua" => "(GMT-07:00) Chihuahua, La Paz, Mazatlan", "America/Managua" => "(GMT-06:00) Central America", "America/Regina" => "(GMT-06:00) Saskatchewan", "America/Mexico_City" => "(GMT-06:00) Guadalajara, Mexico City, Monterrey", "America/Chicago" => "(GMT-06:00) Central Time (US and Canada)", "America/Indianapolis" => "(GMT-05:00) Indiana (East)", "America/Bogota" => "(GMT-05:00) Bogota, Lima, Quito", "America/New_York" => "(GMT-05:00) Eastern Time (US and Canada)", "America/Caracas" => "(GMT-04:00) Caracas, La Paz", "America/Santiago" => "(GMT-04:00) Santiago", "America/Halifax" => "(GMT-04:00) Atlantic Time (Canada)", "America/St_Johns" => "(GMT-03:30) Newfoundland", "America/Buenos_Aires" => "(GMT-03:00) Buenos Aires, Georgetown", "America/Godthab" => "(GMT-03:00) Greenland", "America/Sao_Paulo" => "(GMT-03:00) Brasilia", "America/Noronha" => "(GMT-02:00) Mid-Atlantic", "Atlantic/Cape_Verde" => "(GMT-01:00) Cape Verde Is.", "Atlantic/Azores" => "(GMT-01:00) Azores", "Africa/Casablanca" => "(GMT) Casablanca, Monrovia", "Europe/London" => "(GMT) Greenwich Mean Time: Dublin, Edinburgh, Lisbon, London", "Africa/Lagos" => "(GMT+01:00) West Central Africa", "Europe/Berlin" => "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna", "Europe/Paris" => "(GMT+01:00) Brussels, Copenhagen, Madrid, Paris", "Europe/Sarajevo" => "(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb", "Europe/Belgrade" => "(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague", "Africa/Johannesburg" => "(GMT+02:00) Harare, Pretoria", "Asia/Jerusalem" => "(GMT+02:00) Jerusalem", "Europe/Istanbul" => "(GMT+02:00) Athens, Istanbul, Minsk", "Europe/Helsinki" => "(GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius", "Africa/Cairo" => "(GMT+02:00) Cairo", "Europe/Bucharest" => "(GMT+02:00) Bucharest", "Africa/Nairobi" => "(GMT+03:00) Nairobi", "Asia/Riyadh" => "(GMT+03:00) Kuwait, Riyadh", "Europe/Moscow" => "(GMT+03:00) Moscow, St. Petersburg, Volgograd", "Asia/Baghdad" => "(GMT+03:00) Baghdad", "Asia/Tehran" => "(GMT+03:30) Tehran", "Asia/Muscat" => "(GMT+04:00) Abu Dhabi, Muscat", "Asia/Tbilisi" => "(GMT+04:00) Baku, Tbilisi, Yerevan", "Asia/Kabul" => "(GMT+04:30) Kabul", "Asia/Karachi" => "(GMT+05:00) Islamabad, Karachi, Tashkent", "Asia/Yekaterinburg" => "(GMT+05:00) Ekaterinburg", "Asia/Calcutta" => "(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi", "Asia/Katmandu" => "(GMT+05:45) Kathmandu", "Asia/Colombo" => "(GMT+06:00) Sri Jayawardenepura", "Asia/Dhaka" => "(GMT+06:00) Astana, Dhaka", "Asia/Novosibirsk" => "(GMT+06:00) Almaty, Novosibirsk", "Asia/Rangoon" => "(GMT+06:30) Rangoon", "Asia/Bangkok" => "(GMT+07:00) Bangkok, Hanoi, Jakarta", "Asia/Krasnoyarsk" => "(GMT+07:00) Krasnoyarsk", "Australia/Perth" => "(GMT+08:00) Perth", "Asia/Taipei" => "(GMT+08:00) Taipei", "Asia/Singapore" => "(GMT+08:00) Kuala Lumpur, Singapore", "Asia/Hong_Kong" => "(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi", "Asia/Irkutsk" => "(GMT+08:00) Irkutsk, Ulaan Bataar", "Asia/Tokyo" => "(GMT+09:00) Osaka, Sapporo, Tokyo", "Asia/Seoul" => "(GMT+09:00) Seoul", "Asia/Yakutsk" => "(GMT+09:00) Yakutsk", "Australia/Darwin" => "(GMT+09:30) Darwin", "Australia/Adelaide" => "(GMT+09:30) Adelaide", "Pacific/Guam" => "(GMT+10:00) Guam, Port Moresby", "Australia/Brisbane" => "(GMT+10:00) Brisbane", "Asia/Vladivostok" => "(GMT+10:00) Vladivostok", "Australia/Hobart" => "(GMT+10:00) Hobart", "Australia/Sydney" => "(GMT+10:00) Canberra, Melbourne, Sydney", "Asia/Magadan" => "(GMT+11:00) Magadan, Solomon Is., New Caledonia", "Pacific/Fiji" => "(GMT+12:00) Fiji, Kamchatka, Marshall Is.", "Pacific/Auckland" => "(GMT+12:00) Auckland, Wellington", "Pacific/Tongatapu" => "(GMT+13:00) Nuku'alofa");
private static $_DATE_FORMATS = array(0 => "m-d-Y", 1 => "d-m-Y", 2 => "m.d.Y", 3 => "Y-m-d", 4 => "m/d/Y", 5 => "m/d/y", 6 => "F d, Y", 7 => "M. d, y", 8 => "d F Y", 9 => "d-M-y", 10 => "l, F d, Y");
private static $_MODULES = array(0 => "Articles", 1 => "Contact", 2 => "Comment", 3 => "Flight", 4 => "Poll", 5 => "Review", 6 => "Paymentgateway", 7 => "Database", 8 => "Gallery", 9 => "News", 10 => "Newsletter", 11 => "Sitemap", 12 => "Projects", 13 => "Property");
private static $_DATETIME_FORMATS = array(0 => "m-d-Y H:i:s", 1 => "m-d-Y h:i:s A", 2 => "d-m-Y H:i:s", 3 => "d-m-Y h:i:s A", 4 => "m.d.Y H:i:s", 5 => "m.d.Y h:i:s A", 6 => "Y-m-d H:i:s", 7 => "Y-m-d h:i:s A", 8 => "m/d/Y H:i:s", 9 => "m/d/Y h:i:s A", 10 => "m/d/y H:i:s", 11 => "m/d/y h:i:s A", 12 => "F d, Y H:i:s", 13 => "F d, Y h:i:s A", 14 => "M. d, y H:i:s", 15 => "M. d, y h:i:s A", 16 => "d F Y H:i:s", 17 => "d F Y h:i:s A", 18 => "d-M-y H:i:s", 19 => "d-M-y h:i:s A", 20 => "l, F d, Y H:i:s", 21 => "l, F d, Y h:i:s A");
private static $_DATABASES = array("mysqli" => array("name" => "MySQLi", "extensions" => array(0 => "mysqli"), "data" => "/db/eicracms_sample_db_mysqli.sql"), "pdo_mysql" => array("name" => "MySQL (Pdo)", "extensions" => array(0 => "mysql", 1 => "pdo", 2 => "pdo_mysql"), "data" => "/db/eicracms_sample_db_mysqli.sql"));
private static $_LANGUAGES = array("en_US" => array("englishName" => "English", "localName" => "English"), "de_DE" => array("englishName" => "German", "localName" => "Deutsch"), "es_ES" => array("englishName" => "Spanish", "localName" => "Español"), "fr_FR" => array("englishName" => "French", "localName" => "Française"));
private static $_DEFAULT_CHARSET = "utf-8";
private static $_CHARSETS = array("Arabic (ISO-8859-6)" => "iso-8859-6", "Arabic (Windows-1256)" => "windows-1256", "Baltic (ISO-8859-4)" => "iso-8859-4", "Baltic (ISO-8859-13)" => "iso-8859-13", "Baltic (Windows-1257)" => "windows-1257", "Celtic (ISO-8859-14)" => "iso-8859-14", "Central European (ISO-8859-2)" => "iso-8859-2", "Central European (Windows-1250)" => "windows-1250", "Chinese Simplified (GBK)" => "x-gbk", "Chinese Simplified (gb18030)" => "gb18030", "Chinese Traditional (Big5)" => "big5", "Chinese Traditional (Big5-HKSCS)" => "big5-hkscs", "Cyrillic (ISO-8859-5)" => "iso-8859-5", "Cyrillic (Windows-1251)" => "windows-1251", "Cyrillic (KOI8-R)" => "koi8-r", "Cyrillic (KOI8-U)" => "koi8-u", "Greek (ISO-8859-7)" => "iso-8859-7", "Greek (Windows-1253)" => "windows-1253", "Hebrew (ISO-8859-8)" => "iso-8859-8", "Hebrew (ISO-8859-8-I)" => "iso-8859-8-i", "Hebrew (Windows-1255)" => "windows-1255", "Japanese (EUC)" => "euc-jp", "Japanese (ISO-2022-JP)" => "iso-2022-jp", "Japanese (Shift-JIS)" => "shift-jis", "Korean (EUC)" => "euc-kr", "Nordic (ISO-8859-10)" => "iso-8859-10", "Romanian (ISO-8859-16)" => "iso-8859-16", "South European (ISO-8859-3)" => "iso-8859-3", "Thai (ISO-8859-11)" => "iso-8859-11", "Thai (Windows-874)" => "windows-874", "Turkish (ISO-8859-9)" => "iso-8859-9", "Turkish (Windows-1254)" => "windows-1254", "Unicode (UTF-8)" => "utf-8", "Unicode (UTF-16LE)" => "utf-16le", "Vietnamese (Windows-1258)" => "windows-1258", "Western (ISO-8859-1)" => "iso-8859-1", "Western (ISO-8859-15)" => "iso-8859-15", "Western (Macintosh)" => "macintosh", "Western (Windows-1252)" => "windows-1252");
private static $_EXTENSIONS = array(0 => "gd", 1 => "json", 2 => "mbstring", 3 => "simplexml", 4 => "xml", 5 => "xmlreader", 6 => "mysql", 7 => "mysqli", 8 => "zip");
public static $_FUNCTIONS = array(0 => "ioncube_license_properties", 1 => "file_get_contents", 2 => "file_put_contents", 3 => "curl_exec", 4 => "imagettftext", 5 => "imagefilledrectangle", 6 => "imagecopyresampled", 7 => "getimagesize", 8 => "imagealphablending", 9 => "imagedestroy", 10 => "imagepng", 11 => "imagecreatetruecolor", 12 => "imagecreatefrompng", 13 => "imagesx", 14 => "imagesy", 15 => "imagecolorallocate", 16 => "imageftbbox", 17 => "imagefilledellipse", 18 => "imageline", 19 => "imagesetpixel");
private static $_LICENSE_ERROR = array();
function init() {
if (file_exists( APPLICATION_PATH . '/configs/config.ini' )) {
$config = new Zend_Config_Ini( APPLICATION_PATH . '/configs/config.ini' );
$oldVersion = $this->getOldVersionStep2();
$newVersion = Eicra_License_Version::getversion();
if (( null != $config->install and& null != $config->install->date )) {
$action = $this->_request->getActionName();
if ($oldVersion < $newVersion) {
$this->_redirect( $this->view->serverUrl() . $this->view->baseUrl() . '/upgrade.php' );
return null;
}
if ($action != 'stepinstalled') {
$this->_redirect( $this->view->serverUrl() . $this->view->url( array(), 'install_step_already'));
}
}
}
}
function preDispatch() {
$this->_translator = new Eicra_View_Helper_Translator();
$this->view->assign( 'translator', $this->_translator );
$curlObj = new Eicra_License_Version();
if ($curlObj->checkModulesLicense()) {
$curlObj->sendInfo( array('dm' => $this->view->serverUrl()));
if ($curlObj->isLicensed()) {
$module_arr = $curlObj->getLicensedModules();
$this->_vendor = $curlObj->getArrayResult();
return null;
}
self;
$_LICENSE_ERROR = $curlObj->getError();
}
}
function stepinstalledAction() {
$this->view->assign( 'messageError', $this->_translator->translator( 'install_step_installed_error_message' ) );
}
function step1Action() {
if ($this->_request->isPost( )) {
$lang_file = $this->_request->getPost( 'default_language' );
Eicra_Global_Variable::getsession()->sess_lang = $lang_file;
Eicra_Global_Variable::getsession()->site_direction = '';
$this->_translator = new Eicra_View_Helper_Translator( );
$this->_redirect( $this->view->serverUrl() . $this->view->url( array(), 'install_step2' ) );
}