Login   Register  
PHP Classes
elePHPant
Icontem

File: addhost.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Evaldo Barbosa  >  PHP Add Apache Virtual Host  >  addhost.php  >  Download  
File: addhost.php
Role: Application script
Content type: text/plain
Description: Application script
Class: PHP Add Apache Virtual Host
Add a virtual host to Apache configuration
Author: By
Last change: Update addhost.php

Adding new Project Header
Date: 2 months ago
Size: 1,396 bytes
 

Contents

Class file image Download
#!/usr/bin/php -q
<?
require("addhost.class.php");

$lang = require( strtolowerLANGUAGE ) . '.lang.php' );

$addhost = new AddHost$argv[1], $argv[2] );
    
$addhost->writeConsoleHeader();

if ( 
in_array'--removehost'$argv ) ) {
    
    
$log $addhost->removeHost();

} else if ( 
in_array'--checkhost'$argv ) ) {
    
    
$log $addhost->checkHost();

} else {

    
$addhost->setFolder$argv[3] );
    
$addhost->setHTAccessOnin_array'--htaccess'$argv) );
    
$addhost->setComposerDownloadOnin_array'--composer'$argv) );
    
$addhost->setErrorLogOnin_array'--errorlog'$argv) );
    
$addhost->setCNameOnin_array'--cname'$argv) );

    
$log $addhost->run();

}

if ( isset(
$log['success']) && count($log['success']) > ) {
    echo 
"\n===================\n";
    echo 
"| {$lang['success']} (ADDHOST)\n";
    
    foreach (
$log['success'] as $key => $value) {
        echo 
"| {$value}\n";
    }
    
    echo 
"===================\n";

}

if ( isset(
$log['alert']) && count($log['alert']) > ) {
    echo 
"\n===================\n";
    echo 
"| {$lang['alert']} (ADDHOST)\n";
    
    foreach (
$log['alert'] as $key => $value) {
        echo 
"| {$value}\n";
    }
    
    echo 
"===================\n";

}

if ( isset(
$log['error']) && count($log['error']) > ) {
    echo 
"\n===================\n";
    echo 
"| {$lang['error']} ( ADDHOST )\n";

    foreach (
$log['error'] as $key => $value) {
        echo 
"| {$value}\n";
    }

    echo 
"===================\n";
}