Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 42 lines (31 sloc) 0.861 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
<?php
// $Id: clear_eaccelerator.php,v 1.2 2005/03/27 21:57:40 patrick Exp $

require_once('PEAR/Command.php');
require_once('Console/Getopt.php');

PEAR_Command::setFrontendType('CLI');
$all_commands = PEAR_Command::getCommands();

$argv = Console_Getopt::readPHPArgv();

if (sizeof($argv) < 2)
{
echo 'Usage: ' . $argv[0] . ' <url to eaccelerator.php> [username] [password]' . "\n";
exit();
}

$url = $argv[1];

if (sizeof($argv) == 4)
{
$auth = $argv[2] . ':' . $argv[3];
}
else
{
$auth = 'retrix:';
}

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_USERPWD, $auth);
curl_setopt($curl, CURLOPT_POSTFIELDS, 'clear=Clear');

$response = curl_exec($curl);

curl_close($curl);

?>
Something went wrong with that request. Please try again.