public function actionInstall() { $log_msgs = array(); $model = new Addons(); //Step 1: Download or upload package in temp folder array_push($log_msgs, $model->upload()); //Step 2: Unzip it array_push($log_msgs, $model->unzip()); //Step 3: Read the XML Install Script $addons_model = new Addons(); $xml = simplexml_load_file("temp/tempaddonfile/install_addon.xml"); $addons_model->name = $xml->info->name; $addons_model->addon_label = $xml->info->label; $addons_model->type = $xml->info->type; $addons_model->active = $xml->info->active; if ($addons_model->save()) { //Step 4: Install Table array_push($log_msgs, $model->readscript()); //Step 5: Copy files images, javascript and all array_push($log_msgs, $model->copyfiles()); //Step 6: Create Entry in XML file in Config Folder array_push($log_msgs, $model->appendaddonsxml_forinstall($addons_model->name)); /* Step 7: Create entry in table Step 8: Ammend if you want for javascript like in main file. */ } $this->renderPartial('install', array('model' => $model, 'errors' => $addons_model->getErrors(), 'log_msgs' => $log_msgs)); }