Skip to content

Instantly share code, notes, and snippets.

@martinklepsch
Created October 16, 2009 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinklepsch/212144 to your computer and use it in GitHub Desktop.
Save martinklepsch/212144 to your computer and use it in GitHub Desktop.
#!/opt/local/bin/php
<?php
namespace VhostsManager;
/**
* autoload needed classes
*/
function __autoload( $class ){
require_once 'classes/' . $class . '.php';
}
$operation = $argv[1];
$localdomain = $argv[2];
$directory = $argv[3];
/**
* Check for used operation and run appropriate functions.
*/
switch($operation) {
case 'create':
$virtualhost = new VhostDebug($localdomain, $directory);
$virtualhost->createVhost();
break;
case 'delete':
echo 'Deleting a Vhost is not supported right now.';
break;
case 'edit':
echo 'Editing a Vhost is not supported right now.';
break;
default:
echo 'You entered a wrong command. [create|delete|edit]';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment