Jump to content


Photo

Proposal for the php file unitray_info.php


  • Please log in to reply
2 replies to this topic

#1 Agnaldo

Agnaldo

    Newbie

  • Member
  • Pip
  • 5 posts
  • Gender:Male
  • Main OS: Windows 8

Posted 01 December 2011 - 09:39 AM

<?php /* Assim este arquivo fica bem menor e de fácil manutenção */
/*
###############################################################################
# Name: unitray_info.php
# Developed By: The Uniform Server Development Team
# Modified Last By: jAgnaldo (Ric)
# Unitray Support file
# Displays server information. Ports read from configuration files
# Added support for USB plugin
# V1.0 17-2-2010
###############################################################################
*/
//error_reporting(0); // Disable PHP errors and warnings
// Comment to Enable for testing

chdir(dirname(__FILE__)); // Change wd to this files location
include_once "../main/includes/config.inc.php";
include_once "../main/includes/functions.php";

run_location_tracker(); // Have servers moved if moved update configuration
print"\n";

//=== Check for parameters passed
if($argc == 2){ // Was a parameter passed
$information = $argv[1] ; // yes:
}else{
exit; // no: Give up
}

$mysql_port = get_mysql_port();
$apache_port = get_apache_port();
$ssl_port = get_apache_ssl_port();

$sURL_toStart[-2]="http://localhost:$apache_port/NewSite2/admin";
$sURL_toStart[-1]="http://localhost:$apache_port/NewSite1/admin";
$sURL_toStart[0]="http://www.google.com.br";

$sURL_toStart[1]="http://localhost:$apache_port/apanel/";
$sURL_toStart[2]="http://localhost:$apache_port/apanel/phpmyadmin/";
$sURL_toStart[3]="http://localhost:$apache_port/";
$sURL_toStart[4]="https://localhost:$ssl_port/";
$sURL_toStart[5]="http://localhost:$apache_port/server-info";
$sURL_toStart[6]="start [url="http://localhost:$apache_port/server-status";"]http://localhost:$apache_port/server-status";[/url]
$sURL_toStart[7]="http://localhost:$apache_port/apanel/phpinfo.php";

//### Decide which browser to use either PC default browser or poetable Firefox ###
if(file_exists(USF_HOSTS_PAC)){ // Does PAC file exists use portable Firefox
start_firefox($sURL_toStart[$information]);
exit;
}else { // PAC does not exist use default brower
$command = "start ".$sURL_toStart[$information];
exec($command,$dummy,$return);
exit;
}//end else
exit;
?>
Agnaldo.
Belo Horizonte - MG - Brasil

#2 BobS

BobS

    Project Helper

  • Super Moderator
  • PipPipPip
  • 334 posts
  • Location:Santiago Chile
  • Interests:Retiring, computer systems, system design, model railroads....
  • Wiki ID: BobS
  • Main OS: Windows 7

Posted 06 December 2011 - 10:06 AM

Very interesting, Sehnor Agnaldo! Obrigado.

After looking at the original code, I agree that this is factored much more effectively. I tried out the code, and it works properly. For the general audience, we'd probably not want Google do Brasil. Using your code as a base, I'll set it up for inclusion in an update to 7-Orion. Just now, we're still working on getting 8-Coral fully released.

Ric does a great job of getting things running, but we all need help with the maintenance. Could I send you a list? ;-) (Just kidding, although that might be a line to follow...)

Regards,
BobS

#3 Agnaldo

Agnaldo

    Newbie

  • Member
  • Pip
  • 5 posts
  • Gender:Male
  • Main OS: Windows 8

Posted 10 December 2011 - 02:53 PM

Estou aguardando a lista...
Ajudarei no que for possível. Mas creio que a versão CORAL merece atenção total.
Agnaldo.
Belo Horizonte - MG - Brasil




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users