本文整理汇总了PHP中JFile::move方法的典型用法代码示例。如果您正苦于以下问题:PHP JFile::move方法的具体用法?PHP JFile::move怎么用?PHP JFile::move使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JFile
的用法示例。
在下文中一共展示了JFile::move方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: readContentElementFile
/**
* Read content files
*
* @return void
*
* @throws Exception
*/
public function readContentElementFile()
{
NenoLog::log('Method readContentElementFile of NenoControllerGroupsElements called', 3);
jimport('joomla.filesystem.file');
NenoLog::log('Trying to move content element files', 3);
$input = JFactory::getApplication()->input;
$fileData = $input->files->get('content_element');
$destFile = JFactory::getConfig()->get('tmp_path') . '/' . $fileData['name'];
$extractPath = JFactory::getConfig()->get('tmp_path') . '/' . JFile::stripExt($fileData['name']);
// If the file has been moved successfully, let's work with it.
if (JFile::move($fileData['tmp_name'], $destFile) === true) {
NenoLog::log('Content element files moved successfully', 2);
// If the file is a zip file, let's extract it
if ($fileData['type'] == 'application/zip') {
NenoLog::log('Extracting zip content element files', 3);
$adapter = JArchive::getAdapter('zip');
$adapter->extract($destFile, $extractPath);
$contentElementFiles = JFolder::files($extractPath);
} else {
$contentElementFiles = array($destFile);
}
// Add to each content file the path of the extraction location.
NenoHelper::concatenateStringToStringArray($extractPath . '/', $contentElementFiles);
NenoLog::log('Parsing element files for readContentElementFile', 3);
// Parse element file(s)
NenoHelperBackend::parseContentElementFile(JFile::stripExt($fileData['name']), $contentElementFiles);
NenoLog::log('Cleaning temporal folder for readContentElementFile', 3);
// Clean temporal folder
NenoHelperBackend::cleanFolder(JFactory::getConfig()->get('tmp_path'));
}
NenoLog::log('Redirecting to groupselements view', 3);
$this->setRedirect('index.php?option=com_neno&view=groupselements')->redirect();
}
示例2: install
function install($adapter)
{
$installer = $this->installer;
$installer->AddSQLFromFile('install.bids.inserts.sql');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
JFolder::move(JPATH_SITE . DS . 'components' . DS . 'com_bids' . DS . 'templates-dist', JPATH_SITE . DS . 'components' . DS . 'com_bids' . DS . 'templates');
JFile::move(JPATH_SITE . DS . 'components' . DS . 'com_bids' . DS . 'options.php-dist', JPATH_SITE . DS . 'components' . DS . 'com_bids' . DS . 'options.php');
JFolder::create(JPATH_SITE . DS . 'images' . DS . 'auctions');
$installer->AddMenuItem("Auction Factory MENU", "List Auctions", "list-auctions", "index.php?option=com_bids&task=listauctions", 1);
$installer->AddMenuItem("Auction Factory MENU", "Categories", "categories-auctions", "index.php?option=com_bids&task=listcats", 1);
$installer->AddMenuItem("Auction Factory MENU", "Search", "search-auctions", "index.php?option=com_bids&task=search", 1);
$installer->AddMenuItem("Auction Factory MENU", "New Auction", "post-offer", "index.php?option=com_bids&task=newauction", 2);
$installer->AddMenuItem("Auction Factory MENU", "My Auctions", "my-auctions", "index.php?option=com_bids&task=myauctions", 2);
$installer->AddMenuItem("Auction Factory MENU", "Watchlist", "watchlist", "index.php?option=com_bids&task=mywatchlist", 2);
$installer->AddMenuItem("Auction Factory MENU", "My Bids", "my-bids", "index.php?option=com_bids&task=mybids", 2);
$installer->AddMenuItem("Auction Factory MENU", "Profile", "profile-auctions", "index.php?option=com_bids&task=userdetails", 2);
$installer->AddCBPlugin('Bids MyAuctions', 'My Auctions', 'bids.myauctions', 'getmyauctionsTab');
$installer->AddCBPlugin('Bids MyBids', 'My Bids', 'bids.mybids', 'getmybidsTab');
$installer->AddCBPlugin('Bids MyRatings', 'My Ratings', 'bids.myratings', 'getmyratingsTab');
$installer->AddCBPlugin('Bids MySettings', 'My Settings', 'bids.mysettings', 'getmysettingsTab');
$installer->AddCBPlugin('Bids MyTaskpad', 'My Taskpad', 'bids.mytaskpad', 'myTaskPad');
$installer->AddCBPlugin('Bids MyWatchlist', 'My Watchlist', 'bids.mywatchlist', 'getmywatchlistTab');
$installer->AddCBPlugin('Bids MyWonBids', 'My Won Bids', 'bids.mywonbids', 'getmywonbidsTab');
$installer->AddMessage("Thank you for purchasing <strong>Auctions Factory</strong>");
$installer->AddMessageFromFile('install.notes.txt');
$installer->AddMessage("Please set up your <strong>Auctions Factory</strong> in the <a href='" . JURI::root() . "administrator/index.php?option=com_bids&task=settingsmanager'>admin panel</a></p>");
$installer->AddMessage("Visit us at <a target='_blank' href='http://www.thefactory.ro'>thefactory.ro</a> to learn about new versions and/or to give us feedback<br>");
$installer->AddMessage("© 2006-" . date('Y') . " thefactory.ro");
$installer->insertDefaultCategory();
$installer->install();
}
示例3: postflight
public function postflight($type, $parent)
{
$db = JFactory::getDBO();
$db->setQuery("UPDATE #__extensions SET enabled = 0 WHERE client_id = 1 AND element = " . $db->Quote($parent->get('element')));
$db->query();
$status = new stdClass();
$status->plugins = array();
$src = $parent->getParent()->getPath('source');
$manifest = $parent->getParent()->manifest;
$plugins = $manifest->xpath('plugins/plugin');
foreach ($plugins as $plugin) {
$name = (string) $plugin->attributes()->plugin;
$group = (string) $plugin->attributes()->group;
$path = $src . '/plugins/' . $group . '/' . $name;
$installer = new JInstaller();
$result = $installer->install($path);
if ($result) {
if (JFile::exists(JPATH_SITE . '/plugins/' . $group . '/' . $name . '/' . $name . '.xml')) {
JFile::delete(JPATH_SITE . '/plugins/' . $group . '/' . $name . '/' . $name . '.xml');
}
JFile::move(JPATH_SITE . '/plugins/' . $group . '/' . $name . '/' . $name . '.j25.xml', JPATH_SITE . '/plugins/' . $group . '/' . $name . '/' . $name . '.xml');
}
$query = "UPDATE #__extensions SET enabled=1, ordering=99 WHERE type='plugin' AND element=" . $db->Quote($name) . " AND folder=" . $db->Quote($group);
$db->setQuery($query);
$db->query();
$status->plugins[] = array('name' => $name, 'group' => $group, 'result' => $result);
}
$this->installationResults($status);
}
示例4: uploadAction
/**
* Method to handle upload action
*
* @return void
*/
public function uploadAction()
{
if ($this->request->getMethod() != 'POST') {
return;
}
if (isset($_FILES['font-upload']) and $_FILES['font-upload']['error'] == 0) {
// Verify font file
if (!preg_match('/\\.(ttf|otf|eot|svg|woff)$/', $_FILES['font-upload']['name'])) {
exit(JText::_('JSN_TPLFW_FONT_FILE_NOT_SUPPORTED'));
}
// Prepare directory to store uploaded font file
$path = JPATH_ROOT . "/templates/{$this->template['name']}/uploads/fonts";
if (!is_dir($path) and !JFolder::create($path)) {
exit(JText::_('JSN_TPLFW_UPLOAD_CREATE_DIR_FAIL'));
}
// Check if the directory is writable
$buffer = '<html><head></head><body></body></html>';
if (!JFile::write("{$path}/index.html", $buffer)) {
exit(JText::_('JSN_TPLFW_UPLOAD_CREATE_DIR_FAIL'));
}
// Move uploaded file to temporary folder
$path .= '/' . str_replace(' ', '-', $_FILES['font-upload']['name']);
if (!JFile::move($_FILES['font-upload']['tmp_name'], $path)) {
exit(JText::_('JSN_TPLFW_UPLOAD_MOVE_FILE_FAIL'));
}
} else {
exit(JText::sprintf('JSN_TPLFW_UPLOAD_FAIL', isset($_FILES['font-upload']) ? $_FILES['font-upload']['error'] : 'unknown'));
}
exit('OK');
}
示例5: install
function install(&$plg)
{
$src = dirname(__FILE__) . DS . 'component';
$dest = JPATH_ROOT . DS . 'components' . DS . 'com_jshopping';
$lang =& JFactory::getLanguage();
$inst =& JInstaller::getInstance();
$desc = (string) $inst->getManifest()->description;
$lang->load('plg_jshoppingcheckout_' . $this->_name . '.sys', JPATH_ADMINISTRATOR, null, true);
$inst->set('message', JText::_($desc));
if (!JFolder::exists($dest)) {
return false;
}
if (JFolder::exists($src)) {
foreach (JFolder::folders($src) as $f) {
JFolder::copy($src . DS . $f, $dest . DS . $f, '', true);
}
}
// Конфигурирование JoomShopping (установка дополнений)
$this->jshoppingUpdate();
$res = false;
$path = JPATH_ROOT . DS . 'components' . DS . 'com_jshopping' . DS . 'shippings' . DS . $this->_name . DS;
if (extension_loaded('ionCube Loader')) {
// use ionCube
$res = true;
} else {
// check zend loader/optimizer
$list = get_loaded_extensions();
foreach ($list as &$item) {
if (preg_match("/zend.*(loader|optimizer)/i", $item)) {
$res = true;
break;
}
}
if ($res) {
// Zend was found, detect php version
if (version_compare(phpversion(), "5.3") >= 0) {
// php > 5.3
JFile::move($this->_name . '_5.3.php', $this->_name . '.php', $path);
} else {
JFile::move($this->_name . '_5.2.php', $this->_name . '.php', $path);
}
}
}
if (JFile::exists($path . $this->_name . '_5.2.php')) {
JFile::delete($path . $this->_name . '_5.2.php');
}
if (JFile::exists($path . $this->_name . '_5.3.php')) {
JFile::delete($path . $this->_name . '_5.3.php');
}
if ($res) {
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('PED_INSTALL_NOTIFY'), 'notice');
} else {
JError::raiseNotice('500', JText::_('PED_ZEND_NOT_LOADED'));
}
return true;
}
示例6: postflight
public function postflight($type, $parent)
{
if (parent::postflight($type, $parent)) {
JLoader::import('joomla.filesystem.file');
JFile::move('com_redmigrator.xml', 'redmigrator.xml', JPATH_ADMINISTRATOR . '/components/com_redmigrator');
return true;
}
return false;
}
示例7: install
function install()
{
acymailing_increasePerf();
$newConfig = new stdClass();
$newConfig->installcomplete = 1;
$config = acymailing_config();
$updateHelper = acymailing_get('helper.update');
if (!$config->save($newConfig)) {
$updateHelper->installTables();
return;
}
jimport('joomla.filesystem.folder');
$frontLanguages = JFolder::folders(JPATH_ROOT . DS . 'language', '-');
$backLanguages = JFolder::folders(JPATH_ADMINISTRATOR . DS . 'language', '-');
$installedLanguages = array_unique(array_merge($frontLanguages, $backLanguages));
if (($key = array_search('en-GB', $installedLanguages)) !== false) {
unset($installedLanguages[$key]);
}
if (!empty($installedLanguages)) {
$js = 'try{
var ajaxCall = new Ajax("index.php?option=com_acymailing&ctrl=file&task=installLanguages&tmpl=component&languages=' . implode(',', $installedLanguages) . '",{
method: "get",
onComplete: function(responseText, responseXML) {
container = document.getElementById("acymailing_div");
container.innerHTML = responseText+container.innerHTML;
}
}).request();
}catch(err){
new Request({
url:"index.php?option=com_acymailing&ctrl=file&task=installLanguages&tmpl=component&languages=' . implode(',', $installedLanguages) . '",
method: "get",
onSuccess: function(responseText, responseXML) {
container = document.getElementById("acymailing_div");
container.innerHTML = responseText+container.innerHTML;
}
}).send();
}';
$doc = JFactory::getDocument();
$doc->addScriptDeclaration($js);
}
$updateHelper->initList();
$updateHelper->installTemplates();
$updateHelper->installNotifications();
$updateHelper->installMenu();
$updateHelper->installExtensions();
$updateHelper->installBounceRules();
$updateHelper->fixDoubleExtension();
$updateHelper->addUpdateSite();
$updateHelper->fixMenu();
if (ACYMAILING_J30) {
JFile::move(ACYMAILING_BACK . 'acymailing_j3.xml', ACYMAILING_BACK . 'acymailing.xml');
}
$acyToolbar = acymailing::get('helper.toolbar');
$acyToolbar->setTitle('AcyMailing', 'dashboard');
$acyToolbar->display();
$this->_iframe(ACYMAILING_UPDATEURL . 'install&fromversion=' . JRequest::getCmd('fromversion') . '&fromlevel=' . JRequest::getCmd('fromlevel'));
}
示例8: postflight
function postflight($type, $parent)
{
$db = JFactory::getDbo();
// Enable the cronjob plugin
$db->setQuery("UPDATE " . $db->quoteName('#__extensions') . " SET " . $db->quoteName('enabled') . " = 1 WHERE " . $db->quoteName('element') . " = 'easyjoomlabackupcronjob' AND " . $db->quoteName('type') . " = 'plugin'");
$db->execute();
// Move CLI script to the CLI folder
JFile::move(JPATH_ROOT . '/administrator/components/com_easyjoomlabackup/ejb_cli.php', JPATH_ROOT . '/cli/ejb_cli.php');
}
示例9: postflight
public function postflight($type, $parent)
{
$db = JFactory::getDBO();
$status = new stdClass();
$status->modules = array();
$status->plugins = array();
$manifest = $parent->getParent()->manifest;
$plugins = $manifest->xpath('plugins/plugin');
$modules = $manifest->xpath('modules/module');
$src = $parent->getParent()->getPath('source');
// Migrate plugin settings to component. Only for first time installs
$db->setQuery("SELECT params FROM #__extensions WHERE type='plugin' AND folder = 'content' AND element = 'jw_sigpro'");
$params = $db->loadResult();
if ($params && $params != '{}') {
$db->setQuery("UPDATE #__extensions SET params = " . $db->quote($params) . " WHERE type='component' AND element = 'com_sigpro'");
$db->query();
$db->setQuery("UPDATE #__extensions SET params = '{}' WHERE type='plugin' AND folder = 'content' AND element = 'jw_sigpro'");
$db->query();
}
foreach ($plugins as $plugin) {
$name = (string) $plugin->attributes()->plugin;
$group = (string) $plugin->attributes()->group;
$path = $src . '/plugins/' . $group . '/' . $name;
$installer = new JInstaller();
$result = $installer->install($path);
if ($result) {
if (JFile::exists(JPATH_SITE . '/plugins/' . $group . '/' . $name . '/' . $name . '.xml')) {
JFile::delete(JPATH_SITE . '/plugins/' . $group . '/' . $name . '/' . $name . '.xml');
}
JFile::move(JPATH_SITE . '/plugins/' . $group . '/' . $name . '/' . $name . '.j25.xml', JPATH_SITE . '/plugins/' . $group . '/' . $name . '/' . $name . '.xml');
$query = "UPDATE #__extensions SET enabled=1 WHERE type='plugin' AND element=" . $db->Quote($name) . " AND folder=" . $db->Quote($group);
$db->setQuery($query);
$db->query();
}
$status->plugins[] = array('name' => $name, 'group' => $group, 'result' => $result);
}
foreach ($modules as $module) {
$name = (string) $module->attributes()->module;
$client = (string) $module->attributes()->client;
if (is_null($client)) {
$client = 'site';
}
$client == 'administrator' ? $path = $src . '/administrator/modules/' . $name : ($path = $src . '/modules/' . $name);
$installer = new JInstaller();
$result = $installer->install($path);
if ($result) {
$root = $client == 'administrator' ? JPATH_ADMINISTRATOR : JPATH_SITE;
if (JFile::exists($root . '/modules/' . $name . '/' . $name . '.xml')) {
JFile::delete($root . '/modules/' . $name . '/' . $name . '.xml');
}
JFile::move($root . '/modules/' . $name . '/' . $name . '.j25.xml', $root . '/modules/' . $name . '/' . $name . '.xml');
}
$status->modules[] = array('name' => $name, 'client' => $client, 'result' => $result);
}
$this->installationResults($status);
}
示例10: convertLanguages15
public static function convertLanguages15()
{
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
$config = JFactory::getConfig();
if ($config->getValue('config.legacy')) {
$dirs = array(JCOMMENTS_BASE . DS . 'languages' => JPATH_ROOT . DS . 'language', JCOMMENTS_BASE . DS . 'languages' . DS . 'administrator' => JPATH_ROOT . DS . 'administrator' . DS . 'language');
foreach ($dirs as $srcLanguageDir => $dstLanguageDir) {
if (is_writable($dstLanguageDir)) {
$languages = JFolder::files($srcLanguageDir, '\\.ini', false, false);
foreach ($languages as $language) {
$languageCode = substr((string) $language, 0, 5);
$languageDir = $dstLanguageDir . DS . $languageCode;
if (is_dir($languageDir)) {
JFile::move($srcLanguageDir . DS . $language, $languageDir . DS . $language);
}
}
unset($languages);
}
}
}
// frontend language files
$files = JFolder::files(JPATH_SITE . DS . 'language', '\\.(com_jcomments|plg_search_jcomments)\\.ini', true, true);
foreach ($files as $file) {
$content = JFile::read($file);
$content = self::_replaceCommentsAndQuotes($content);
if (strpos($content, 'DATETIME_FORMAT') !== false) {
$content = str_replace('Y-m-d', '%Y-%m-%d', $content);
$content = str_replace('d-m-Y', '%d-%m-%Y', $content);
$content = str_replace('d/m/Y', '%d/%m/%Y', $content);
$content = str_replace('d.m.Y', '%d.%m.%Y', $content);
$content = str_replace('H:i', '%H:%M', $content);
}
JFile::write($file, $content);
}
// backend language files
$files = JFolder::files(JPATH_BASE . DS . 'language', '(com_jcomments|plg_content_jcomments|plg_search_jcomments|plg_system_jcomments|plg_user_jcomments|plg_editors-xtd_jcommentsoff|plg_editors-xtd_jcommentson)(\\.sys)?\\.ini', true, true);
foreach ($files as $file) {
if (preg_match('#\\.sys\\.ini#is', $file)) {
if (preg_match('#\\.com_jcomments\\.sys\\.ini#is', $file)) {
$content = JFile::read($file);
$content = self::_replaceCommentsAndQuotes($content);
$content = str_replace('COM_JCOMMENTS_', 'COM_JCOMMENTS.', $content);
$content = str_replace('COM_JCOMMENTS.COMMENTS_VIEW_', 'COM_JCOMMENTS_COMMENTS_VIEW_', $content);
$content = str_replace('COM_JCOMMENTS.BASIC_', 'COM_JCOMMENTS_BASIC_', $content);
JFile::write(str_replace('.sys.', '.menu.', $file), $content);
}
JFile::delete($file);
} else {
$content = JFile::read($file);
$content = self::_replaceCommentsAndQuotes($content);
JFile::write($file, $content);
}
}
}
示例11: _log
static function _log($item, $prepend = "")
{
global $jTips, $mosConfig_absolute_path;
$file_path = $mosConfig_absolute_path . "/components/com_jtips/jtips.log";
$level = empty($prepend) ? 'INFO' : strtoupper($prepend);
if (isset($jTips['DebugLevel']) and !in_array($level, $jTips['DebugLevel'])) {
return true;
}
if (isJoomla15()) {
jimport('joomla.filesystem.file');
if (JFile::exists($file_path)) {
$size = filesize($file_path);
$human = round($size / (1024 * 1024), 4);
if ($human >= 10) {
if (JFile::exists($file_path . ".0")) {
JFile::delete($file_path . ".0");
}
JFile::move($file_path, $file_path . ".0");
}
}
} else {
if (file_exists($file_path)) {
$size = filesize($file_path);
$human = round($size / (1024 * 1024), 4);
if ($human >= 10) {
if (file_exists($file_path . ".0")) {
@unlink($file_path . ".0");
}
@rename($file_path, $file_path . ".0");
}
}
}
if (!empty($prepend) and is_string($prepend)) {
$prepend .= " ";
}
$log = "jLOG " . gmdate('Y-m-d H:i:s') . ": " . $prepend . stripslashes(print_r($item, true)) . "\n";
if (isJoomla15()) {
$data = '';
if (JFile::exists($file_path)) {
$data = JFile::read($file_path);
$data .= $log;
}
return JFile::write($file_path, $data);
} else {
if (!($handle = fopen($file_path, 'a'))) {
jTipsLogger::jTipsDebug("FAILED TO OPEN LOG FILE!", false);
} else {
if (fwrite($handle, $log) === false) {
jTipsLogger::jTipsDebug("FAILED TO WRITE TO LOG FILE!", false);
return false;
}
return fclose($handle);
}
}
}
示例12: install
function install($parent)
{
jimport('joomla.filesystem.file');
$src = dirname(__FILE__) . DS . 'admin' . DS . 'cron' . DS . 'update_lowfares.php';
$dest = JPATH_ROOT . DS . 'cli' . DS . 'update_lowfares.php';
if (!JFile::move($src, $dest)) {
echo '<span style="color: red;">ERROR: no se pudo copiar el archivo del CRON necesario pora Actualizar las mejores tarifas.</span>';
} else {
echo '<span style="color: #090;">**Recuerda que debes agregar al CRON el archivo ubicado en /cli/update_lowfares.php, para pasar la certificacion de P2P</span>';
}
}
示例13: com_install
/**
* Installs and publishes JWF system core plugin, Both under J! 1.5 and J! 1.6
*
* @access public
*/
function com_install()
{
list($major, $minor, $version) = explode('.', JVERSION);
if ($major == 1 && $minor == 5) {
$db =& JFactory::getDBO();
/* Install plugin */
if (!JFile::exists(JPATH_ROOT . DS . 'plugins' . DS . 'system' . DS . 'jwf.php')) {
JFile::move(JWF_BACKEND_PATH . DS . 'plugins' . DS . 'system' . DS . 'jwf.php', JPATH_ROOT . DS . 'plugins' . DS . 'system' . DS . 'jwf.php');
JFile::move(JWF_BACKEND_PATH . DS . 'plugins' . DS . 'system' . DS . 'jwf.xml', JPATH_ROOT . DS . 'plugins' . DS . 'system' . DS . 'jwf.xml');
JFile::move(JWF_BACKEND_PATH . DS . 'plugins' . DS . 'system' . DS . 'jwf.cron.php', JPATH_ROOT . DS . 'plugins' . DS . 'system' . DS . 'jwf.cron.php');
}
JFolder::delete(JWF_BACKEND_PATH . DS . 'plugins' . DS . 'system');
$query = 'SELECT `published` FROM `#__plugins` WHERE `element`="jwf"';
$db->setQuery($query);
$result = $db->loadObject();
if ($result == null) {
$query = "INSERT INTO `#__plugins` ( `name`, `element`, `folder`, `access`, `ordering`, `published`, `iscore`, `client_id`, `checked_out`, `checked_out_time`, `params`)" . "\nVALUES" . "\n('System - JWF', 'jwf', 'system', 0, 0, 1, 0, 0, 0, '0000-00-00 00:00:00', '')";
$db->setQuery($query);
$db->query();
} else {
$query = 'UPDATE `#__plugins` SET `published` = 1 WHERE `element`="jwf"';
$db->setQuery($query);
$db->query();
}
/* Done installing plugin */
$db->setQuery("UPDATE #__components SET admin_menu_img='../media/com_jwf/images/logo-16.png' WHERE admin_menu_link='option=com_jwf'");
$res = $db->query();
}
if ($major == 1 && $minor == 6) {
$db =& JFactory::getDBO();
/* Install plugin */
if (!JFile::exists(JPATH_ROOT . DS . 'plugins' . DS . 'system' . DS . 'jwf.php')) {
JFile::move(JWF_BACKEND_PATH . DS . 'plugins' . DS . 'system' . DS . 'jwf.php', JPATH_ROOT . DS . 'plugins' . DS . 'system' . DS . 'jwf.php');
JFile::move(JWF_BACKEND_PATH . DS . 'plugins' . DS . 'system' . DS . 'jwf.xml', JPATH_ROOT . DS . 'plugins' . DS . 'system' . DS . 'jwf.xml');
JFile::move(JWF_BACKEND_PATH . DS . 'plugins' . DS . 'system' . DS . 'jwf.cron.php', JPATH_ROOT . DS . 'plugins' . DS . 'system' . DS . 'jwf.cron.php');
}
JFolder::delete(JWF_BACKEND_PATH . DS . 'plugins' . DS . 'system');
$query = 'SELECT `enabled` FROM `#__extensions` WHERE `type`="plugin" AND `element`="jwf"';
$db->setQuery($query);
$result = $db->loadObject();
if ($result == null) {
$query = "INSERT INTO `#__extensions` (`name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`)" . "\nVALUES" . "\n( 'System - JWF', 'plugin', 'jwf', 'system', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 1, 0)";
$db->setQuery($query);
$db->query();
} else {
$query = 'UPDATE `#__extensions` SET `enabled`=1 WHERE `type`="plugin" AND `element`="jwf"';
$db->setQuery($query);
$db->query();
}
/* Done installing plugin */
$db->setQuery("UPDATE #__components SET admin_menu_img='../media/com_jwf/images/logo-16.png' WHERE admin_menu_link='option=com_jwf'");
$res = $db->query();
}
}
示例14: postflight
function postflight($type, $parent)
{
// Rename manifest file
$path = $parent->getParent()->getPath('extension_root');
$name = $parent->get('name');
if (JFile::exists("{$path}/{$name}.j25.xml")) {
if (JFile::exists("{$path}/{$name}.xml")) {
JFile::delete("{$path}/{$name}.xml");
}
JFile::move("{$path}/{$name}.j25.xml", "{$path}/{$name}.xml");
}
}
示例15: installCrawler
private function installCrawler($parent)
{
$success = false;
$src = $parent->getParent()->getPath('extension_administrator') . '/cli/jharvest.php';
$cli = JPATH_ROOT . '/cli/jharvest.php';
if (JFile::exists($src)) {
if ($success = JFile::move($src, $cli)) {
JFolder::delete($parent->getParent()->getPath('extension_administrator') . '/cli');
}
}
return $success;
}