api/public/index.php

78 lines
1.5 KiB
PHP
Raw Normal View History

2023-04-07 19:05:18 +08:00
<?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/PublicHelper.php";
try {
/**
* 引用常量文件
*/
require APP_PATH."/config/consts.php";
2023-04-19 16:23:01 +08:00
/**
* 引用日志类
*/
if($_SERVER['HTTP_HOST']!="127.0.0.1"){
include_once "/data/www/common/socket/log_client.php";
}
2023-04-07 19:05:18 +08:00
// /**
// * 引用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);
}
?>