本文整理汇总了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;
}
}
}