<?php

error_reporting(E_ALL); ini_set('display_errors', '1');

include_once('connect.php');

if (!count($_GET))
{
  include_once('index.html');
  exit();
}
  
function conf()
{
  return array(
    "ip" => $_SERVER['REMOTE_ADDR'],
    "site" => "http://localhost/phoxy/"
    );
}

if (isset($_GET['api']))
{
  $file = $_GET['api'];
  if ($file == 'htaccess')
    exit('Rewrite engine work SUCCESS');
  if (strpos($file, "/") > -1)
    list($file, $func) = explode("/", $_GET['api']);

  if (!isset($func) || !$func)
    $func = 'Reserve';
    
  session_start();
  
  include_once('include.php');
  $a = IncludeModule('api', $file);
  $f = $func;
  echo $a->$f();
}


<?php

error_reporting(E_ALL); ini_set('display_errors', '1');

include_once('connect.php');

if (!count($_GET))
{
  include_once('index.html');
  exit();
}

if (!function_exists("phoxy_conf"))
  include_once("config.php");
  
function phoxy_default_conf()
{
  return array(
    "ip" => $_SERVER['REMOTE_ADDR'],
    "site" => "http://localhost/phoxy",
    "ejs_dir" => "ejs",
    "js_dir" => "js",
    "api_dir" => "api",
    "get_api_param" => "api",
    );
}

$get_param = phoxy_conf()["get_api_param"];
if (isset($_GET[$get_param]))
{
  $file = $_GET[$get_param];
  if ($file == 'htaccess')
    exit('Rewrite engine work SUCCESS');
  if (strpos($file, "/") > -1)
    list($file, $func) = explode("/", $file);

  if (!isset($func) || !$func)
    $func = 'Reserve';
    
  session_start();
  
  include_once('include.php');
  $a = IncludeModule(phoxy_conf()["api_dir"], $file);
  $f = $func;
  echo $a->$f();
}


Support user config. Located at phoxy_config function
Support user config. Located at phoxy_config function
