Jump to content
The Uniform Server Community
Sign in to follow this  
Agnaldo

Proposal for the php file unitray_info.php

Recommended Posts

<?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 http://localhost:$apache_port/server-status";

$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;

?>

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Estou aguardando a lista...

Ajudarei no que for possível. Mas creio que a versão CORAL merece atenção total.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...