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


PHP JInstaller::abort方法代码示例

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


在下文中一共展示了JInstaller::abort方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testAbortDebug

 /**
  * This test is weak and may need removal at some point
  *
  * @covers  JInstaller::abort
  *
  * @expectedException  RuntimeException
  *
  * @return void
  */
 public function testAbortDebug()
 {
     $configMock = $this->getMock('test', array('get'));
     $configMock->expects($this->atLeastOnce())->method('get')->with($this->equalTo('debug'))->will($this->returnValue(true));
     JFactory::$config = $configMock;
     $this->assertThat($this->object->abort(), $this->isTrue());
 }
开发者ID:shoffmann52,项目名称:install-from-web-server,代码行数:16,代码来源:JInstallerTest.php

示例2: testAbortDebug

	/**
	 * This test is weak and may need removal at some point
	 */
	public function testAbortDebug()
	{


		$configMock = $this->getMock('test', array('get'));

		$configMock->expects($this->atLeastOnce())
			->method('get')
			->will($this->returnValue(true));

		$this->setExpectedError(array('code' => 500));

		//$this->object = JInstaller::getInstance();
		$this->saveFactoryState();

		$newDbo = $this->getMock('test');

		JFactory::$database = &$newDbo;

		$this->object = new JInstaller;

		JFactory::$config = $configMock;

		$this->assertThat(
			$this->object->abort(),
			$this->isTrue()
		);

		$this->restoreFactoryState();

	}
开发者ID:realityking,项目名称:JAJAX,代码行数:34,代码来源:JInstallerTest.php

示例3: testAbortMsg

 /**
  * Test that an abort message results in a raised warning
  */
 public function testAbortMsg()
 {
     $this->saveFactoryState();
     $newDbo = $this->getMock('test');
     JFactory::$database =& $newDbo;
     //$this->object = JInstaller::getInstance();
     $this->object = new JInstaller();
     $this->setExpectedError(array('code' => 100, 'message' => 'Warning Text'));
     $this->assertThat($this->object->abort('Warning Text'), $this->isTrue());
     $this->restoreFactoryState();
 }
开发者ID:realityking,项目名称:oldunittests,代码行数:14,代码来源:JInstallerTest.php

示例4: install

 /**
  * Generic install method for extensions
  *
  * @return  boolean  True on success
  *
  * @since   3.4
  */
 public function install()
 {
     // Get the extension's description
     $description = (string) $this->getManifest()->description;
     if ($description) {
         $this->parent->message = JText::_($description);
     } else {
         $this->parent->message = '';
     }
     // Set the extension's name and element
     $this->name = $this->getName();
     $this->element = $this->getElement();
     /*
      * ---------------------------------------------------------------------------------------------
      * Extension Precheck and Setup Section
      * ---------------------------------------------------------------------------------------------
      */
     // Setup the install paths and perform other prechecks as necessary
     try {
         $this->setupInstallPaths();
     } catch (RuntimeException $e) {
         // Install failed, roll back changes
         $this->parent->abort($e->getMessage());
         return false;
     }
     // Check to see if an extension by the same name is already installed.
     try {
         $this->checkExistingExtension();
     } catch (RuntimeException $e) {
         // Install failed, roll back changes
         $this->parent->abort($e->getMessage());
         return false;
     }
     // Check if the extension is present in the filesystem
     try {
         $this->checkExtensionInFilesystem();
     } catch (RuntimeException $e) {
         // Install failed, roll back changes
         $this->parent->abort($e->getMessage());
         return false;
     }
     // If we are on the update route, run any custom setup routines
     if ($this->route == 'update') {
         try {
             $this->setupUpdates();
         } catch (RuntimeException $e) {
             // Install failed, roll back changes
             $this->parent->abort($e->getMessage());
             return false;
         }
     }
     /*
      * ---------------------------------------------------------------------------------------------
      * Installer Trigger Loading
      * ---------------------------------------------------------------------------------------------
      */
     $this->setupScriptfile();
     try {
         $this->triggerManifestScript('preflight');
     } catch (RuntimeException $e) {
         // Install failed, roll back changes
         $this->parent->abort($e->getMessage());
         return false;
     }
     /*
      * ---------------------------------------------------------------------------------------------
      * Filesystem Processing Section
      * ---------------------------------------------------------------------------------------------
      */
     // If the extension directory does not exist, lets create it
     try {
         $this->createExtensionRoot();
     } catch (RuntimeException $e) {
         // Install failed, roll back changes
         $this->parent->abort($e->getMessage());
         return false;
     }
     // Copy all necessary files
     try {
         $this->copyBaseFiles();
     } catch (RuntimeException $e) {
         // Install failed, roll back changes
         $this->parent->abort($e->getMessage());
         return false;
     }
     // Parse optional tags
     $this->parseOptionalTags();
     /*
      * ---------------------------------------------------------------------------------------------
      * Database Processing Section
      * ---------------------------------------------------------------------------------------------
      */
     try {
//.........这里部分代码省略.........
开发者ID:Rai-Ka,项目名称:joomla-cms,代码行数:101,代码来源:adapter.php

示例5: abort

 public function abort($msg = null, $type = null)
 {
     $this->_error = $msg;
     return parent::abort(null, $type);
 }
开发者ID:janssit,项目名称:www.ondernemenddiest.be,代码行数:5,代码来源:installer.php

示例6: testAbortBadType

 /**
  * Test that if the type is not good we fall back properly
  *
  * @covers  JInstaller::abort
  *
  * @return void
  */
 public function testAbortBadType()
 {
     $this->object->pushStep(array('type' => 'badstep'));
     $this->assertFalse($this->object->abort(null, false));
 }
开发者ID:SysBind,项目名称:joomla-cms,代码行数:12,代码来源:JInstallerTest.php


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