本文整理汇总了PHP中Addons::readscript方法的典型用法代码示例。如果您正苦于以下问题:PHP Addons::readscript方法的具体用法?PHP Addons::readscript怎么用?PHP Addons::readscript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Addons
的用法示例。
在下文中一共展示了Addons::readscript方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionInstall
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));
}