0byt3m1n1
Path:
/
data
/
applications
/
aps
/
typo3
/
4.2.1-6
/
standard
/
scripts
/
[
Home
]
File: upgrade-app.php
<?php require_once('app-util.php'); require_once('file-util.php'); function upgrade_app($from_ver, $from_rel, $config_files, $db_ids, $psa_modify_hash, $db_modify_hash, $settings_modify_hash, $crypt_settings_modify_hash, $settings_enum_modify_hash, $additional_modify_hash){ // $upgrade_schema_files = get_upgrade_schema_files($argv[2], $argv[3]); $upgrade_schema_files = array(); // array('upgrade-1.0-1.sql' => 'main') configure($config_files, $upgrade_schema_files, $db_ids, $psa_modify_hash, $db_modify_hash, $settings_modify_hash, $crypt_settings_modify_hash, $settings_enum_modify_hash, $additional_modify_hash); if(!is_file($psa_modify_hash["@@ROOT_DIR@@"].'/typo3conf/ENABLE_INSTALL_TOOL')) touch($psa_modify_hash["@@ROOT_DIR@@"].'/typo3conf/ENABLE_INSTALL_TOOL'); if(!is_file($psa_modify_hash["@@ROOT_DIR@@"].'/typo3conf/cookie.txt')) touch($psa_modify_hash["@@ROOT_DIR@@"].'/typo3conf/cookie.txt'); $ch = curl_init($psa_modify_hash["@@ROOT_URL@@"].'/typo3/install/index.php?TYPO3_INSTALL[type]=update'); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable curl_setopt($ch, CURLOPT_COOKIEJAR, $psa_modify_hash["@@ROOT_DIR@@"].'/typo3conf/cookie.txt'); $post_data = array(); $post_data['password'] = fetch_env_var("SETTINGS_admin_password"); $o=""; foreach ($post_data as $k=>$v) { $o.= "$k=".utf8_encode($v)."&"; } $post_data=substr($o,0,-1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); $result = curl_exec($ch); // run the whole process curl_close($ch); $ch = curl_init($psa_modify_hash["@@ROOT_URL@@"].'/typo3/install/index.php?TYPO3_INSTALL[type]=update'); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable curl_setopt($ch, CURLOPT_COOKIEFILE, $psa_modify_hash["@@ROOT_DIR@@"].'/typo3conf/cookie.txt'); $post_data = array(); $post_data['TYPO3_INSTALL[database_type]'] = "getUserInput"; $post_data['TYPO3_INSTALL[update][changeCompatibilityVersion]'] = "Next"; $o=""; foreach ($post_data as $k=>$v) { $o.= "$k=".utf8_encode($v)."&"; } $post_data=substr($o,0,-1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); $result = curl_exec($ch); // run the whole process curl_close($ch); $ch = curl_init($psa_modify_hash["@@ROOT_URL@@"].'/typo3/install/index.php?TYPO3_INSTALL[type]=update'); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable curl_setopt($ch, CURLOPT_COOKIEFILE, $psa_modify_hash["@@ROOT_DIR@@"].'/typo3conf/cookie.txt'); $post_data = array(); $post_data['TYPO3_INSTALL[database_type]'] = "performUpdate"; $post_data['TYPO3_INSTALL[update][extList][0]'] = "changeCompatibilityVersion"; $post_data['TYPO3_INSTALL[update][changeCompatibilityVersion][compatVersion][all]'] = "1"; $o=""; foreach ($post_data as $k=>$v) { $o.= "$k=".utf8_encode($v)."&"; } $post_data=substr($o,0,-1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); $result = curl_exec($ch); // run the whole process curl_close($ch); copy($psa_modify_hash["@@ROOT_DIR@@"].'/typo3/sysext/install/mod/class.tx_install.php', $psa_modify_hash["@@ROOT_DIR@@"].'/typo3/sysext/install/mod/class.tx_install.php_backedup'); copy('class.tx_install.php', $psa_modify_hash["@@ROOT_DIR@@"].'/typo3/sysext/install/mod/class.tx_install.php'); $ch = curl_init($psa_modify_hash["@@ROOT_URL@@"].'/typo3/install/index.php?TYPO3_INSTALL[type]=database&TYPO3_INSTALL[database_type]=cmpFile|CURRENT_TABLES#bottom'); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable curl_setopt($ch, CURLOPT_COOKIEFILE, $psa_modify_hash["@@ROOT_DIR@@"].'/typo3conf/cookie.txt'); $result = curl_exec($ch); // run the whole process curl_close($ch); unlink($psa_modify_hash["@@ROOT_DIR@@"].'/typo3/sysext/install/mod/class.tx_install.php'); copy($psa_modify_hash["@@ROOT_DIR@@"].'/typo3/sysext/install/mod/class.tx_install.php_backedup', $psa_modify_hash["@@ROOT_DIR@@"].'/typo3/sysext/install/mod/class.tx_install.php'); unlink($psa_modify_hash["@@ROOT_DIR@@"].'/typo3/sysext/install/mod/class.tx_install.php_backedup'); unlink($psa_modify_hash["@@ROOT_DIR@@"].'/typo3conf/ENABLE_INSTALL_TOOL'); unlink($psa_modify_hash["@@ROOT_DIR@@"].'/typo3conf/cookie.txt'); return 0; } ?>