PHP Classes

File: server.php

Recommend this page to a friend!
  Packages of Moisés Lima   ETL Tools   server.php   Download  
File: server.php
Role: Auxiliary script
Content type: text/plain
Description: Configuration script
Class: ETL Tools
Tools to process data from a PostgreSQL database
Author: By
Last change:
Date: 1 year ago
Size: 399 bytes
 

Contents

Class file image Download
<?php

$port = $argv[1] ?? 8543;
$openBrowser = $argv[2] ?? false; // segundo argumento opcional
$address = "http://localhost:$port";

if ($openBrowser) {
    if (PHP_OS_FAMILY === "Windows") {
        exec("start $address");
    } elseif (PHP_OS_FAMILY === "Darwin") {
        exec("open $address");
    } else {
        exec("xdg-open $address");
    }
}

exec("php -S localhost:$port -t public");