Skip to content

Commit

Permalink
Merge pull request #43 from C-Lodder/develop
Browse files Browse the repository at this point in the history
added script.php
  • Loading branch information
wilsonge committed Mar 24, 2015
2 parents e52ea83 + 48be207 commit 10ef805
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ajax.xml
Expand Up @@ -10,6 +10,8 @@
<license>GNU General Public License version 2, or later.</license>
<version>3.0.0</version>
<description>A Joomla! 1.5/2.5 Ajax interface</description>

<scriptfile>script.php</scriptfile>

<files folder="site">
<filename>ajax.php</filename>
Expand Down
64 changes: 64 additions & 0 deletions script.php
@@ -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();
}
}
}

0 comments on commit 10ef805

Please sign in to comment.