| | |
| | | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
| | | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| | | */ |
| | | require_once('aps_base.inc.php'); |
| | | require_once 'aps_base.inc.php'; |
| | | |
| | | @set_time_limit(0); |
| | | @ignore_user_abort(1); |
| | |
| | | * @param $app the application instance (db handle + log method) |
| | | * @param $interface_mode act in interface (true) or server mode (false) |
| | | */ |
| | | |
| | | |
| | | public function __construct($app, $interface_mode = false) |
| | | { |
| | | parent::__construct($app, 'APS installer: ', $interface_mode); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Before the cron is executed, make sure all necessary options are set |
| | |
| | | |
| | | return true; |
| | | } |
| | | |
| | | catch(Exception $e) |
| | | { |
| | | $app->log('Aborting execution because '.$e->getMessage(), 1); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Get a file from a ZIP archive and either return it's content or |
| | |
| | | $zip->close(); |
| | | |
| | | } |
| | | |
| | | catch(Exception $e) |
| | | { |
| | | // The exception message is only interesting for debugging reasons |
| | |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Extract the complete directory of a ZIP file |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Setup the environment with data for the install location |
| | | * |
| | |
| | | $this->putenv[] = 'BASE_URL_HOST='.$this->domain; |
| | | $this->putenv[] = 'BASE_URL_PATH='.$this->sublocation.'/'; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Setup a database (if needed) and the appropriate environment variables |
| | |
| | | $this->putenv[] = 'DB_'.$db_id.'_PORT=3306'; |
| | | $this->putenv[] = 'DB_'.$db_id.'_VERSION='.$mysqlver; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Extract all needed files from the package |
| | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Get all user config variables and set them to environment variables |
| | | * |
| | |
| | | $this->putenv[] = 'SETTINGS_'.$data['name'].'='.$data['value']; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Fetch binary data from a given array |
| | |
| | | } |
| | | curl_multi_close($mh); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * The installation script should be executed |
| | |
| | | WHERE id = "'.$app->db->quote($task['instance_id']).'";'); |
| | | } |
| | | } |
| | | |
| | | catch(Exception $e) |
| | | { |
| | | $app->dbmaster->query('UPDATE aps_instances SET instance_status = "'.INSTANCE_ERROR.'" |
| | |
| | | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Cleanup: Remove install scripts, remove tasks and update the database |
| | |
| | | chdir($this->local_installpath); |
| | | exec("rm -Rf ".escapeshellarg($this->local_installpath).'install_scripts'); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * The main method which performs the actual package installation |
| | |
| | | |
| | | unset($sxe); |
| | | } |
| | | |
| | | } |
| | | |
| | | ?> |