当前位置: 首页>>代码示例>>PHP>>正文


PHP JInstaller::isUpgrade方法代码示例

本文整理汇总了PHP中JInstaller::isUpgrade方法的典型用法代码示例。如果您正苦于以下问题:PHP JInstaller::isUpgrade方法的具体用法?PHP JInstaller::isUpgrade怎么用?PHP JInstaller::isUpgrade使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JInstaller的用法示例。


在下文中一共展示了JInstaller::isUpgrade方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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.');
 }
开发者ID:nprasath002,项目名称:joomla-platform,代码行数:11,代码来源:JInstallerTest.php

示例2: checkExtensionInFilesystem

 /**
  * Method to check if the extension is present in the filesystem, flags the route as update if so
  *
  * @return  void
  *
  * @since   3.4
  * @throws  RuntimeException
  */
 protected function checkExtensionInFilesystem()
 {
     if (file_exists($this->parent->getPath('extension_root')) && (!$this->parent->isOverwrite() || $this->parent->isUpgrade())) {
         // Look for an update function or update tag
         $updateElement = $this->getManifest()->update;
         // Upgrade manually set or update function available or update tag detected
         if ($this->parent->isUpgrade() || $this->parent->manifestClass && method_exists($this->parent->manifestClass, 'update') || $updateElement) {
             // Force this one
             $this->parent->setOverwrite(true);
             $this->parent->setUpgrade(true);
             if ($this->currentExtensionId) {
                 // If there is a matching extension mark this as an update
                 $this->setRoute('update');
             }
         } elseif (!$this->parent->isOverwrite()) {
             // We didn't have overwrite set, find an update function or find an update tag so lets call it safe
             throw new RuntimeException(JText::sprintf('JLIB_INSTALLER_ABORT_DIRECTORY', JText::_('JLIB_INSTALLER_' . $this->route), $this->type, $this->parent->getPath('extension_root')));
         }
     }
 }
开发者ID:Rai-Ka,项目名称:joomla-cms,代码行数:28,代码来源:adapter.php


注:本文中的JInstaller::isUpgrade方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。