Merge branch '2.5.x' into cc-5709-airtime-analyzer
Conflicts: airtime_mvc/locale/de_DE/LC_MESSAGES/airtime.po airtime_mvc/locale/es_ES/LC_MESSAGES/airtime.po airtime_mvc/locale/hr_HR/LC_MESSAGES/airtime.po airtime_mvc/locale/hu_HU/LC_MESSAGES/airtime.po airtime_mvc/locale/sr_RS/LC_MESSAGES/airtime.po airtime_mvc/locale/sr_RS@latin/LC_MESSAGES/airtime.po
This commit is contained in:
commit
fe20cc7f63
59 changed files with 51180 additions and 50667 deletions
|
@ -308,62 +308,15 @@ class AirtimeInstall
|
|||
$sql = "DELETE FROM cc_pref WHERE keystr = 'system_version'";
|
||||
$con->exec($sql);
|
||||
|
||||
$sql = "INSERT INTO cc_pref (keystr, valstr) VALUES ('system_version', '$p_version')";
|
||||
$result = $con->exec($sql);
|
||||
if ($result < 1) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
Application_Model_Preference::SetAirtimeVersion($p_version);
|
||||
}
|
||||
|
||||
public static function SetUniqueId()
|
||||
{
|
||||
$con = Propel::getConnection();
|
||||
$uniqueId = md5(uniqid("", true));
|
||||
|
||||
$sql = "INSERT INTO cc_pref (keystr, valstr) VALUES ('uniqueId', '$uniqueId')";
|
||||
$result = $con->exec($sql);
|
||||
if ($result < 1) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
Application_Model_Preference::SetUniqueId($uniqueId);
|
||||
}
|
||||
|
||||
public static function SetDefaultTimezone()
|
||||
{
|
||||
$con = Propel::getConnection();
|
||||
// we need to run php as commandline because we want to get the timezone in cli php.ini file
|
||||
//$defaultTimezone = exec("php -r 'echo date_default_timezone_get().PHP_EOL;'");
|
||||
$defaultTimezone = exec("cat /etc/timezone");
|
||||
$defaultTimezone = trim($defaultTimezone);
|
||||
if((!in_array($defaultTimezone, DateTimeZone::listIdentifiers()))){
|
||||
$defaultTimezone = "UTC";
|
||||
}
|
||||
$sql = "INSERT INTO cc_pref (keystr, valstr) VALUES ('timezone', '$defaultTimezone')";
|
||||
$result = $con->exec($sql);
|
||||
if ($result < 1) {
|
||||
return false;
|
||||
}
|
||||
$sql = "INSERT INTO cc_pref (subjid, keystr, valstr) VALUES (1, 'user_timezone', '$defaultTimezone')";
|
||||
$result = $con->exec($sql);
|
||||
if ($result < 1) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function SetImportTimestamp()
|
||||
{
|
||||
$con = Propel::getConnection();
|
||||
$sql = "INSERT INTO cc_pref (keystr, valstr) VALUES ('import_timestamp', '0')";
|
||||
$result = $con->exec($sql);
|
||||
if ($result < 1) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public static function GetAirtimeVersion()
|
||||
{
|
||||
$con = Propel::getConnection();
|
||||
|
|
|
@ -10,10 +10,19 @@ require_once(__DIR__.'/AirtimeInstall.php');
|
|||
require_once(__DIR__.'/airtime-constants.php');
|
||||
|
||||
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php');
|
||||
|
||||
|
||||
//Propel classes.
|
||||
set_include_path(AirtimeInstall::GetAirtimeSrcDir().'/application/models' . PATH_SEPARATOR . get_include_path());
|
||||
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
require_once 'propel/runtime/lib/Propel.php';
|
||||
Propel::init(AirtimeInstall::GetAirtimeSrcDir()."/application/configs/airtime-conf-production.php");
|
||||
|
||||
//use this class to set new values in the cache as well.
|
||||
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/common/Database.php');
|
||||
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/models/Preference.php');
|
||||
|
||||
echo PHP_EOL."* Database Installation".PHP_EOL;
|
||||
|
||||
AirtimeInstall::CreateDatabaseUser();
|
||||
|
@ -56,10 +65,8 @@ AirtimeInstall::SetAirtimeVersion(AIRTIME_VERSION);
|
|||
|
||||
|
||||
if (AirtimeInstall::$databaseTablesCreated) {
|
||||
AirtimeInstall::SetDefaultTimezone();
|
||||
// set up some keys in DB
|
||||
AirtimeInstall::SetUniqueId();
|
||||
AirtimeInstall::SetImportTimestamp();
|
||||
|
||||
$ini = parse_ini_file(__DIR__."/airtime-install.ini");
|
||||
|
||||
|
|
8
install_minimal/upgrades/airtime-2.5.2/data/upgrade.sql
Normal file
8
install_minimal/upgrades/airtime-2.5.2/data/upgrade.sql
Normal file
|
@ -0,0 +1,8 @@
|
|||
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('hr_HR', 'Hrvatski');
|
||||
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('sr_RS', 'Српски (Ћирилица)');
|
||||
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('sr_RS@latin', 'Srpski (Latinica)');
|
||||
|
||||
UPDATE cc_locale SET locale_lang='Deutsch (Österreich)' WHERE locale_code='de_AT';
|
||||
UPDATE cc_locale SET locale_lang='Português Brasileiro' WHERE locale_code='pt_BR';
|
||||
|
||||
-- NOTE BECAUSE OF CACHING NOW ANY UPGRADES TO cc_pref MUST NOT BE DONE HERE.
|
Loading…
Add table
Add a link
Reference in a new issue