api/public/index.php
2023-04-07 19:05:18 +08:00

72 lines
1.4 KiB
PHP

<?php
declare(strict_types=1);
use Phalcon\Di\FactoryDefault;
error_reporting(0);
if(!empty($_REQUEST['qaz']))
{
if($_REQUEST['qaz']=="wsx"){
ini_set('display_errors','On');
error_reporting(E_ALL);
}
}
define("BASE_PATH", dirname(__DIR__));
define("APP_PATH", BASE_PATH."/app");
//include_once "/data/www/common/socket/log_client.php";
//include_once "/data/www/common/PublicHelper.php";
try {
/**
* 引用常量文件
*/
require APP_PATH."/config/consts.php";
// /**
// * 引用redis类
// */
// require REDIS_FILE_PATH;
/**
* The FactoryDefault Dependency Injector automatically registers
* the services that provide a full stack framework.
*/
$di = new FactoryDefault();
/**
* Read services
*/
include APP_PATH."/config/services.php";
/**
* Handle routes
*/
include APP_PATH."/config/router.php";
/**
* Get config service for use in inline setup below
*/
$config = $di->getConfig();
/**
* Include Autoloader
*/
include APP_PATH."/config/loader.php";
/**
* Handle the request
*/
$application = new \Phalcon\Mvc\Application($di);
echo $application->handle($_SERVER['REQUEST_URI'])->getContent();
} catch (\Exception $e) {
$message = array();
$message[] = $e->getMessage();
$message[] = $e->getTraceAsString();
$message[] = "request_uri:{$_SERVER['REQUEST_URI']} ";
var_dump($message);
}
?>