Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from C-Lodder/develop
added script.php
- Loading branch information
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
/** | ||
* File script.php | ||
* Created 8/11/13 10:55 PM | ||
* Author Matt Thomas matt@betweenbrain.com | ||
* Copyright Copyright (C) 2013 betweenbrain llc. | ||
*/ | ||
|
||
/** | ||
* Installation class to perform additional changes during install/uninstall/update | ||
* | ||
* @package Ajax | ||
* @since 3.0 | ||
*/ | ||
class Com_AjaxInstallerScript | ||
{ | ||
/** | ||
* An array of supported database types | ||
* | ||
* @var array | ||
* @since 3.0 | ||
*/ | ||
protected $dbSupport = array('mysql', 'mysqli', 'postgresql', 'sqlsrv', 'sqlazure'); | ||
|
||
/** | ||
* Function to act after the installation process runs | ||
* | ||
* @param string $type The action being performed | ||
* @param JInstallerPackage $parent The class calling this method | ||
* @param array $results The results of each installer action | ||
* | ||
* @return void | ||
* | ||
* @since 3.0 | ||
*/ | ||
public function postflight($type, $parent) | ||
{ | ||
|
||
// Get a db connection. | ||
$db = JFactory::getDbo(); | ||
|
||
// Create a new query object. | ||
$query = $db->getQuery(true); | ||
|
||
//Build the query | ||
$query | ||
->delete($db->quoteName('#__menu')) | ||
->where('title LIKE \'com_ajax\''); | ||
$db->setQuery($query); | ||
|
||
//execute db object | ||
try | ||
{ | ||
// Execute the query | ||
$results = $db->query(); | ||
} | ||
catch (Exception $e) | ||
{ | ||
//print the errors | ||
echo $e->getMessage(); | ||
} | ||
} | ||
} |