#!/Applications/emamp/system/bin/php
<?php
//static class used to keep global connection to pdo
class pdo_global
{
private static $conn;
public static function dba()
{
if(is_null(self::$conn))
{
try
{
self::$conn=new PDO("sqlite:/Applications/emamp/system/emamp.sqlite3");
}
catch(PDOException $e)
{
trigger_error("Unable to connect to EMAMP sqlite database: ".$e->getMessage(),E_USER_ERROR);
}
}
return self::$conn;
}
}
$module="php5.2.10";
$remove=pdo_global::dba()->prepare("DELETE FROM modules WHERE name='$module'");
$remove->execute();
$removeVariables=pdo_global::dba()->prepare("DELETE FROM variables WHERE module='$module'");
$removeVariables->execute();
@unlink("/Applications/emamp/system/www/include/$module.php");
exec("rm -rf /Applications/emamp/$module/",$ret);
foreach($ret as $output)
{
echo $output."<br />";
}
#done
echo "Done";