本文整理汇总了PHP中OC_Installer::isDownloaded方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Installer::isDownloaded方法的具体用法?PHP OC_Installer::isDownloaded怎么用?PHP OC_Installer::isDownloaded使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_Installer
的用法示例。
在下文中一共展示了OC_Installer::isDownloaded方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeApp
/**
* Removes an app
* @param string $name name of the application to remove
* @param array $options options
* @return boolean
*
* This function removes an app. $options is an associative array. The
* following keys are optional:ja
* - keeppreferences: boolean, if true the user preferences won't be deleted
* - keepappconfig: boolean, if true the config will be kept
* - keeptables: boolean, if true the database will be kept
* - keepfiles: boolean, if true the user files will be kept
*
* This function works as follows
* -# including appinfo/remove.php
* -# removing the files
*
* The function will not delete preferences, tables and the configuration,
* this has to be done by the function oc_app_uninstall().
*/
public static function removeApp($name, $options = array())
{
if (isset($options['keeppreferences']) and $options['keeppreferences'] == false) {
// todo
// remove preferences
}
if (isset($options['keepappconfig']) and $options['keepappconfig'] == false) {
// todo
// remove app config
}
if (isset($options['keeptables']) and $options['keeptables'] == false) {
// todo
// remove app database tables
}
if (isset($options['keepfiles']) and $options['keepfiles'] == false) {
// todo
// remove user files
}
if (OC_Installer::isDownloaded($name)) {
$appdir = OC_App::getInstallPath() . '/' . $name;
OC_Helper::rmdirr($appdir);
return true;
} else {
OC_Log::write('core', 'can\'t remove app ' . $name . '. It is not installed.', OC_Log::ERROR);
return false;
}
}