-airtime upgrade script
This commit is contained in:
parent
a881358378
commit
bfbca3f724
|
@ -1,7 +1,33 @@
|
|||
<?php
|
||||
/**
|
||||
* @package Airtime
|
||||
* @subpackage StorageServer
|
||||
* @copyright 2010 Sourcefabric O.P.S.
|
||||
* @license http://www.gnu.org/licenses/gpl.txt
|
||||
*/
|
||||
|
||||
$dir = __DIR__;
|
||||
// Do not allow remote execution
|
||||
$arr = array_diff_assoc($_SERVER, $_ENV);
|
||||
if (isset($arr["DOCUMENT_ROOT"]) && ($arr["DOCUMENT_ROOT"] != "") ) {
|
||||
header("HTTP/1.1 400");
|
||||
header("Content-type: text/plain; charset=UTF-8");
|
||||
echo "400 Not executable\r\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
require_once(dirname(__FILE__).'/installInit.php');
|
||||
|
||||
checkIfRoot();
|
||||
|
||||
echo "******************************** Update Begin *********************************".PHP_EOL;
|
||||
updateINIKeyValues('../build/build.properties', 'project.home', realpath(__dir__.'/../'));
|
||||
|
||||
echo PHP_EOL."*** Updating Database Tables ***".PHP_EOL;
|
||||
doctrineMigrateTables(__DIR__);
|
||||
|
||||
echo PHP_EOL."*** Updating Pypo ***".PHP_EOL;
|
||||
system("python ".__DIR__."/../pypo/install/pypo-install.py");
|
||||
|
||||
echo "******************************* Update Complete *******************************".PHP_EOL;
|
||||
|
||||
$command = "php $dir/../library/doctrine/migrations/doctrine-migrations.phar --configuration=$dir/DoctrineMigrations/migrations.xml --db-configuration=$dir/../library/doctrine/migrations/migrations-db.php --no-interaction migrations:migrate";
|
||||
system($command);
|
||||
|
||||
|
|
|
@ -183,3 +183,8 @@ function createAirtimeDatabaseTables(){
|
|||
$command = __DIR__."/../library/propel/generator/bin/propel-gen ../build/ insert-sql 2>propel-error.log";
|
||||
@exec($command, $output, $results);
|
||||
}
|
||||
|
||||
function doctrineMigrateTables($dir){
|
||||
$command = "php $dir/../library/doctrine/migrations/doctrine-migrations.phar --configuration=$dir/DoctrineMigrations/migrations.xml --db-configuration=$dir/../library/doctrine/migrations/migrations-db.php --no-interaction migrations:migrate";
|
||||
system($command);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue