本文整理汇总了PHP中JFile::Delete方法的典型用法代码示例。如果您正苦于以下问题:PHP JFile::Delete方法的具体用法?PHP JFile::Delete怎么用?PHP JFile::Delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JFile
的用法示例。
在下文中一共展示了JFile::Delete方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
// remove obsolete files
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
$removeFiles = array();
$removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'js' . DS . 'jquery-1.4.2.min.js';
$removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'js' . DS . 'jquery.clockpick.1.2.7.min.js';
$removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'css' . DS . 'jquery.clockpick.1.2.7.css';
$removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'images' . DS . 'ol_bg.jpg';
$removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'models' . DS . 'archive.php';
$removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'controllers' . DS . 'archive.php';
$removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'models' . DS . 'suppression.php';
$removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'controllers' . DS . 'suppression.php';
$removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'helpers' . DS . 'cache.php';
$removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'images' . DS . 'templateEditor.png';
$removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'images' . DS . 'clearPosition.png';
$removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'images' . DS . 'apply.png';
foreach ($removeFiles as $rf) {
if (JFile::exists($rf)) {
JFile::Delete($rf);
}
}
// remove obsolete folders
$removeFolders = array();
$removeFolders[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'scripts';
$removeFolders[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'views' . DS . 'archive';
$removeFolders[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'views' . DS . 'suppression';
foreach ($removeFolders as $rf) {
if (JFolder::exists($rf)) {
JFolder::Delete($rf);
}
}
parent::__construct();
$this->registerTask('install', 'install');
$this->registerTask('upgrade', 'upgrade');
}
示例2: onDataError
private function onDataError($params)
{
if (empty($params['data'])) {
JFile::Delete($params['file']);
$this->setError('Cann\'t get any slider data to generate slide in module "' . $this->module_name . '".
<br>Solution: Please insert data at parameter "Setting Item", introduction below.
<br>   1. Field [Title] is require, please insert data here.
<br>   2. After fill info, ==> You must "Save" in this tag "Setting Item" before click [save] of joomla button.
<br>Many thanks!');
}
}
示例3: onLocationError
private function onLocationError($params)
{
$data = json_decode($params['data'], true);
if (is_null($data['query']['results'])) {
JFile::Delete($params['file']);
$this->setError('Cannot get "' . $this->params->get('location') . '" location id in module "' . $this->moduledir . '".');
}
}
示例4: resizeUserAvatar
public function resizeUserAvatar($limitStart, $limit)
{
$db = JFactory::getDbo();
$query = "SELECT avatar FROM #__judirectory_users WHERE avatar != '' LIMIT {$limitStart}, {$limit}";
$db->setQuery($query);
$images = $db->loadObjectList();
if (count($images)) {
foreach ($images as $image) {
$ori_image_path = JPATH_ROOT . "/" . JUDirectoryFrontHelper::getDirectory("avatar_directory", "media/com_judirectory/images/avatar/") . 'original/' . $image->avatar;
if (JFile::exists($ori_image_path)) {
$image_path = JPATH_ROOT . "/" . JUDirectoryFrontHelper::getDirectory("avatar_directory", "media/com_judirectory/images/avatar/") . $image->avatar;
if (JFile::exists($image_path)) {
JFile::Delete($image_path);
}
JUDirectoryHelper::renderImages($ori_image_path, $image_path, 'avatar');
}
}
}
}
示例5: onError
public function onError($params)
{
$data = json_decode($params['data'], true);
if (isset($data['errors']) or isset($data['error'])) {
JFile::Delete($params['file']);
}
}
示例6: onDataError
private function onDataError($params)
{
if (empty($params['data'])) {
JFile::Delete($params['file']);
$this->setError('Cann\'t get any slider data to generate slide in module "' . $this->module_name . '".');
}
}