本文整理汇总了PHP中gpPlugin::GetDataFolder方法的典型用法代码示例。如果您正苦于以下问题:PHP gpPlugin::GetDataFolder方法的具体用法?PHP gpPlugin::GetDataFolder怎么用?PHP gpPlugin::GetDataFolder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gpPlugin
的用法示例。
在下文中一共展示了gpPlugin::GetDataFolder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Confirm_Uninstall
function Confirm_Uninstall()
{
global $config, $langmessage, $dataDir, $gp_titles, $gp_menu, $gp_index;
$addon =& $_POST['addon'];
if (!isset($config['addons'][$addon])) {
message($langmessage['OOPS']);
return;
}
$order = false;
if (isset($config['addons'][$addon]['order'])) {
$order = $config['addons'][$addon]['order'];
}
//tracking
$history = array();
$history['name'] = $config['addons'][$addon]['name'];
$history['action'] = 'uninstalled';
if (isset($config['addons'][$addon]['id'])) {
$history['id'] = $config['addons'][$addon]['id'];
}
unset($config['addons'][$addon]);
//remove links
$installedGadgets = $this->GetInstalledComponents($config['gadgets'], $addon);
$this->RemoveFromHandlers($installedGadgets);
//remove from gp_index, gp_menu
$installedLinks = $this->GetInstalledComponents($gp_titles, $addon);
foreach ($installedLinks as $index) {
if (isset($gp_menu[$index])) {
unset($gp_menu[$index]);
}
$title = common::IndexToTitle($index);
if ($title) {
unset($gp_index[$title]);
}
}
$this->RemoveFromConfig($config['gadgets'], $addon);
$this->RemoveFromConfig($config['admin_links'], $addon);
$this->RemoveFromConfig($gp_titles, $addon);
$this->CleanHooks($addon);
if (!admin_tools::SaveAllConfig()) {
message($langmessage['OOPS']);
$this->Uninstall();
return false;
}
/*
* Delete the data folders
*/
$installFolder = $dataDir . '/data/_addoncode/' . $addon;
if (file_exists($installFolder)) {
gpFiles::RmAll($installFolder);
}
$data_folder_name = gpPlugin::GetDataFolder($addon);
$dataFolder = $dataDir . '/data/_addondata/' . $data_folder_name;
if (file_exists($dataFolder)) {
gpFiles::RmAll($dataFolder);
}
/*
* Record the history
*/
$history['time'] = time();
$this->addonHistory[] = $history;
$this->SaveAddonData();
if ($order) {
$img_path = common::IdUrl('ci');
common::IdReq($img_path);
}
message($langmessage['SAVED']);
}
示例2: SetDataFolder
/**
* Set global path variables for the current addon
* @param string $addon_key Key used to identify a plugin uniquely in the configuration
*
*/
function SetDataFolder($addon_key)
{
global $dataDir, $config;
global $addonDataFolder, $addonCodeFolder;
//deprecated
global $addonRelativeCode, $addonRelativeData, $addonPathData, $addonPathCode, $addonFolderName, $addon_current_id, $addon_current_version;
if (!isset($config['addons'][$addon_key])) {
return;
}
gpPlugin::StackPush();
$data_folder = gpPlugin::GetDataFolder($addon_key);
$addon_current_id = $addon_current_version = false;
if (isset($config['addons'][$addon_key]['id'])) {
$addon_current_id = $config['addons'][$addon_key]['id'];
}
if (isset($config['addons'][$addon_key]['version'])) {
$addon_current_version = $config['addons'][$addon_key]['version'];
}
$addonFolderName = $addon_key;
$addonPathCode = $addonCodeFolder = $dataDir . '/data/_addoncode/' . $addon_key;
$addonPathData = $addonDataFolder = $dataDir . '/data/_addondata/' . $data_folder;
$addonRelativeCode = common::GetDir('/data/_addoncode/' . $addon_key);
$addonRelativeData = common::GetDir('/data/_addondata/' . $data_folder);
}