本文整理匯總了PHP中JInstaller::setUpgrade方法的典型用法代碼示例。如果您正苦於以下問題:PHP JInstaller::setUpgrade方法的具體用法?PHP JInstaller::setUpgrade怎麽用?PHP JInstaller::setUpgrade使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JInstaller
的用法示例。
在下文中一共展示了JInstaller::setUpgrade方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testIsAndSetUpgrade
/**
* @covers JInstaller::setUpgrade
* @covers JInstaller::isUpgrade
*/
public function testIsAndSetUpgrade()
{
$this->object->setUpgrade(false);
$this->assertThat($this->object->isUpgrade(), $this->equalTo(false), 'Get or Set Upgrade failed');
$this->assertThat($this->object->setUpgrade(true), $this->equalTo(false), 'setUpgrade did not return the old value properly.');
$this->assertThat($this->object->isUpgrade(), $this->equalTo(true), 'getUpgrade did not return the expected value.');
}
示例2: testGetAndSetUpgrade
/**
* @todo Implement testGetOverwrite().
*/
public function testGetAndSetUpgrade()
{
$this->saveFactoryState();
$newDbo = $this->getMock('test');
JFactory::$database =& $newDbo;
$this->object = JInstaller::getInstance();
$this->object->setUpgrade(false);
$this->assertThat($this->object->getUpgrade(), $this->equalTo(false), 'Get or Set Upgrade failed');
$this->assertThat($this->object->setUpgrade(true), $this->equalTo(false), 'setUpgrade did not return the old value properly.');
$this->assertThat($this->object->getUpgrade(), $this->equalTo(true), 'getUpgrade did not return the expected value.');
$this->restoreFactoryState();
}
示例3: update
/**
* Generic update method for extensions
*
* @return boolean True on success
*
* @since 3.4
*/
public function update()
{
// Set the overwrite setting
$this->parent->setOverwrite(true);
$this->parent->setUpgrade(true);
// And make sure the route is set correctly
$this->setRoute('update');
// Now jump into the install method to run the update
return $this->install();
}
示例4: installFrameworkAction
public function installFrameworkAction()
{
$packageFile = JFactory::getConfig()->get('tmp_path') . '/jsn-tpl_framework.zip';
// Checking downloaded template package
if (!is_file($packageFile)) {
throw new Exception(JText::_('JSN_TPLFW_ERROR_DOWNLOAD_PACKAGE_FILE_NOT_FOUND'));
}
// Load install library
jimport('joomla.installer.helper');
// Turn off debug mode to catch install error
$conf = JFactory::getConfig();
$conf->set('debug', 0);
$unpackedInfo = JInstallerHelper::unpack($packageFile);
$installer = new JInstaller();
$installer->setUpgrade(true);
$installResult = $installer->install($unpackedInfo['dir']);
// Clean up temporary data
JInstallerHelper::cleanupInstall($packageFile, $unpackedInfo['dir']);
// Clean up compressed files
$this->_cleanCache();
// Send error if install is failure
if (class_exists('JError')) {
$error = JError::getError();
if (!empty($error)) {
throw $error;
}
}
}