Jump to content
The Uniform Server Community

Agnaldo

Member
  • Posts

    5
  • Joined

  • Last visited

Posts posted by Agnaldo

  1. Alterações nos scripts do CORAL_8 (jAgnaldo 2011/12)

     

    Como estou utilizando o UniTray para o CORAL_8 (aliás, gosto muito do UniTray pois ele mantém meu servidor visível)

    eu defini uma variável para acomodar o caminho da página de redirecionamentos do unitray, na seção Variables do LANG_tray.ini

    Type: static; Name: RedirPAGE; Value: "%USRoot%\plugins\tray_menu\redirect.wsf"

     

    e por uma questão de padronização, fiz a alteração nas linhas de chamada de cada um dos menus substituindo este texto pela variável:

    o que era assim...

    Type: item; Caption: "WWW Root"; Action: run; FileName: "Wscript.exe"; Parameters: "%USRoot%\plugins\tray_menu\redirect.wsf www"; Glyph: 21

     

    ficou assim...

    Type: item; Caption: "WWW Root"; Action: run; FileName: "Wscript.exe"; Parameters: "%RedirPAGE% www"; Glyph: 21

     

    não houve ganho algum, foi apenas para padronizar, já que o aplicativo oferece o uso de variáveis...

     

    por fim, fiz as linhas de chamada dos meus aplicativos...

    Type: item; Caption: "WebAPP_001"; Action: run; FileName: "Wscript.exe"; Parameters: "%RedirPAGE% 001"; Glyph: 21

    Type: item; Caption: "WebAPP_002"; Action: run; FileName: "Wscript.exe"; Parameters: "%RedirPAGE% 002"; Glyph: 21

    ...

    consequentemente, tive que adicionar estes itens na função us_redirect() (que por sinal fiz uma alteração nela também) no arquivo core_functions_inc.vbs

     

    Para utilizar o Firefox Portable ( nada contra o IE, mas já me acostumei com o ffox )...

    Defini a variável com o caminho do FireFox Portable no core_config_inc.vbs

    USF_FIREFOX_EXE = US_PLUGINS & "\FirefoxPortable\FirefoxPortable.exe"

    Criei uma função no core_config_inc.vbs chamada StartFirefox que tem o parâmetro "page", que é o aplicativo que desejo exibir.

     

    A alteração que fiz na função us_redirect, foi para atender a inclusão da função StartFirefox, uma vez que esta precisa da url para abrir, e a primeira parte da função us_redirect fazia exatamente isso, com esta primeira parte foi criada a função us_create_url, que foi concatenada na função us_redirect ( o que restou dela, afinal devemos preservar o que já está pronto ), criando a string para a criação do redirecionamento, mantendo compatibilidade com o funcionamento anterior. Pois bem, a função us_create_url vai retornar a url de acordo com o aplicativo que desejo exibir, esta url será passada para a instância do firefox chamada na função StartFirefox.

     

    Esta função foi colocada no arquivo redirect.wsf do tray_menu, fazendo com que SE for encontrado o Firefox, ele seja chamado, ao invés do navegador padrão...(na maioria dos casos o IE, eu não gosto de alterar nada nas máquinas que uso, seja no trabalho, ou em manutenções, etc)

     

    na linha 25, salvo engano.

    '--Parameter passed to redirect function

    us_redirect(WScript.Arguments.Item(0))

    ficou assim...

    '--Parameter passed to redirect function

    If us_file_exists(USF_FIREFOX_EXE) then

    StartFireFox(WScript.Arguments.Item(0))

    else

    us_redirect(WScript.Arguments.Item(0))

    end if

     

    Espero que estas alterações não provoquem impacto negativo, a intenção é eliminar linhas de execução repetidas, tornando a manutenção mais fácil.

     

    o script core_functions_inc.vbs tem agora 1768 linhas, a versão original tinha 2170 linhas...

     

    fica aqui um roteiro para o uso do Coral 8.

     

    nota: O TrayMenu ficou muito bom, com atualização do status, exibindo em tempo real o status do servidor.

    Claro que o google.com.br deve ser alterado pela sua página de preferência.

     

    jAgnaldo. estou me tornando um aficcionado pelo UniServer...

    jAgnaldo.CHANGES_CORAL_8.RAR.txt

  2. Corrections in the script core_functions_inc.vbs of the CORAL_8

    The first execution shows a message saying that it cannot locate a determined archive, I was behind the explanation and I found...

    the way of the current installation was not being updated in config_tracker.ini, I did an alteration in the function init () to update it config_tracker.ini before any other.

     

    After to install and to execute the CORAL_8, I checked that after many calls in the menus the memory simply was blowing up, did then some alterations in the script of functions and from that time the memory is holding out...

    Basically this : "Set VAR = Nothing" after the use of the variable VAR.

     

    Besides removing some declarations what I found unnecessary, for ex.:

    dim VAR1

    VAR1 = value

    ... call function (VAR1)

    I passed for

    ... call function (value) in this case eliminating lines "dim VAR1" and "VAR1 = value"

     

    In the end of everything I found very better that the version ORION.

     

    (Attached file is a rar file containing core_functions_inc.vbs file)

     

    To purpose, I did not like the elimination of the FireFox Portable like navigator of the UniServer, I suggest to add it.

     

    VERY MUCH APPROVED in my opinion!!!

     

    I use w7Ultimate - PHP 5.2.17 - Apache 2.2.21 - MySQL 5.5.X

    note: apache x php found in CORAL_8 not run in my system, i decide to replace for this old versions, and it running normaly.

     

    (oh!!, my english, thanks to google translator... )

    includes.2011.12.09.14.15.RAR.txt

  3. <?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;

    ?>

×
×
  • Create New...