本文整理汇总了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());
}
示例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();
}
示例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();
}
示例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 {
//.........这里部分代码省略.........
示例5: abort
public function abort($msg = null, $type = null)
{
$this->_error = $msg;
return parent::abort(null, $type);
}
示例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));
}