當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JInstaller::isOverwrite方法代碼示例

本文整理匯總了PHP中JInstaller::isOverwrite方法的典型用法代碼示例。如果您正苦於以下問題:PHP JInstaller::isOverwrite方法的具體用法?PHP JInstaller::isOverwrite怎麽用?PHP JInstaller::isOverwrite使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在JInstaller的用法示例。


在下文中一共展示了JInstaller::isOverwrite方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testIsAndSetOverwrite

 /**
  * Test...
  *
  * @covers  JInstaller::setOverwrite
  * @covers  JInstaller::isOverwrite
  *
  * @return void
  */
 public function testIsAndSetOverwrite()
 {
     $this->object->setOverwrite(false);
     $this->assertThat($this->object->isOverwrite(), $this->equalTo(false), 'Get or Set overwrite failed');
     $this->assertThat($this->object->setOverwrite(true), $this->equalTo(false), 'setOverwrite did not return the old value properly.');
     $this->assertThat($this->object->isOverwrite(), $this->equalTo(true), 'getOverwrite did not return the expected value.');
 }
開發者ID:shoffmann52,項目名稱:install-from-web-server,代碼行數:15,代碼來源: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::isOverwrite方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。