set_include_path(__DIR__ . '/../../../airtime_mvc/library' . PATH_SEPARATOR . get_include_path()); require_once dirname(__FILE__) . '/../../include/AirtimeInstall.php'; global $CC_CONFIG; function load_airtime_config() { $ini_array = parse_ini_file('/etc/airtime/airtime.conf', true); return $ini_array; } $values = load_airtime_config(); $CC_CONFIG = array('webServerUser' => $values['general']['web_server_user'], 'rabbitmq' => $values['rabbitmq'], 'baseFilesDir' => $values['general']['base_files_dir'], 'storageDir' => $values['general']['base_files_dir'] . "/stor", 'dsn' => array('username' => $values['database']['dbuser'], 'password' => $values['database']['dbpass'], 'hostspec' => $values['database']['host'], 'phptype' => 'pgsql', 'database' => $values['database']['dbname']), 'tblNamePrefix' => 'cc_', 'apiKey' => array($values['general']['api_key']), 'apiPath' => '/api/', 'soundcloud-client-id' => '2CLCxcSXYzx7QhhPVHN4A', 'soundcloud-client-secret' => 'pZ7beWmF06epXLHVUP1ufOg2oEnIt9XhE8l8xt0bBs', 'soundcloud-connection-retries' => $values['soundcloud']['connection_retries'], 'soundcloud-connection-wait' => $values['soundcloud']['time_between_retries'], "rootDir" => __DIR__ . "/../..", 'pearPath' => dirname(__FILE__) . '/../../library/pear', 'zendPath' => dirname(__FILE__) . '/../../library/Zend', 'phingPath' => dirname(__FILE__) . '/../../library/phing'); AirtimeInstall::DbConnect(true); echo PHP_EOL . "*** Updating Database Tables ***" . PHP_EOL; if (AirtimeInstall::DbTableExists('doctrine_migration_versions') === false) { $migrations = array('20110312121200', '20110331111708', '20110402164819'); foreach ($migrations as $migration) { AirtimeInstall::BypassMigrations(__DIR__, $migration); } } AirtimeInstall::MigrateTablesToVersion(__DIR__, '20110406182005'); //setting data for new aggregate show length column. $sql = "SELECT id FROM cc_show_instances"; $show_instances = $CC_DBC->GetAll($sql); foreach ($show_instances as $show_instance) { $sql = "UPDATE cc_show_instances SET time_filled = (SELECT SUM(clip_length) FROM cc_schedule WHERE instance_id = {$show_instance["id"]}) WHERE id = {$show_instance["id"]}"; $CC_DBC->query($sql); } //end setting data for new aggregate show length column. exec("rm -fr /opt/pypo"); exec("rm -fr /opt/recorder"); const CONF_FILE_AIRTIME = "/etc/airtime/airtime.conf"; const CONF_FILE_PYPO = "/etc/airtime/pypo.cfg";