class OtherController extends Controller {
public function __construct($id, $module, $config = [])
{
parent::__construct($id, $module, $config);
}
public function actionImage()
{
$url = $_GET['src'];
if (!preg_match('/^http[s]?.+/', $url)) {
$url = substr($url, strpos($url, '?') + 5);
}
if (!$url) {
exit('none');
}
{
parent::__construct($id, $module, $config);
}
public function actionImage()
{
$url = $_GET['src'];
if (!preg_match('/^http[s]?.+/', $url)) {
$url = substr($url, strpos($url, '?') + 5);
}
if (!$url) {
$args = $this->controller->bindActionParams($this, $params);
Yii::trace('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__);
if (Yii::$app->requestedParams === null) {
Yii::$app->requestedParams = $args;
}
return call_user_func_array([$this->controller, $this->actionMethod], $args);
}
}
}
$result = null;
if ($runAction && $this->beforeAction($action)) {
// run the action
$result = $action->runWithParams($params);
$result = $this->afterAction($action, $result);
// call afterAction on modules
foreach ($modules as $module) {
/* @var $module Module */
$parts = $this->createController($route);
if (is_array($parts)) {
/* @var $controller Controller */
list($controller, $actionID) = $parts;
$oldController = Yii::$app->controller;
Yii::$app->controller = $controller;
$result = $controller->runAction($actionID, $params);
Yii::$app->controller = $oldController;
return $result;
} else {
$id = $this->getUniqueId();
throw new InvalidRouteException('Unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".');
$route = $this->catchAll[0];
$params = array_splice($this->catchAll, 1);
}
try {
Yii::trace("Route requested: '$route'", __METHOD__);
$this->requestedRoute = $route;
$result = $this->runAction($route, $params);
if ($result instanceof Response) {
return $result;
} else {
$response = $this->getResponse();
if ($result !== null) {
$response->data = $result;
try {
$this->state = self::STATE_BEFORE_REQUEST;
$this->trigger(self::EVENT_BEFORE_REQUEST);
$this->state = self::STATE_HANDLING_REQUEST;
$response = $this->handleRequest($this->getRequest());
$this->state = self::STATE_AFTER_REQUEST;
$this->trigger(self::EVENT_AFTER_REQUEST);
$this->state = self::STATE_SENDING_RESPONSE;
$response->send();
//载入本应用配置
require(WEB_ROOT . '/../process/config/main.php'),
require(WEB_ROOT . '/../process/config/params.php')
);
$application = new yii\web\Application($config);
$application->run();
$_SERVER = [
'USER' => 'www',
'HOME' => '/home/www',
'HTTP_ACCEPT_ENCODING' => 'gzip',
'HTTP_USER_AGENT' => 'Go-http-client/1.1',
'HTTP_CONNECTION' => 'close',
'HTTP_X_FORWARDED_FOR' => '47.93.1.116',
'HTTP_HOST' => 'appapi.bibibi.net',
'HTTP_REMOTEIP' => '47.93.1.116',
'REDIRECT_STATUS' => '200',
'SERVER_NAME' => 'appapi.bibibi.net',
'SERVER_PORT' => '80',
'SERVER_ADDR' => '172.18.161.92',
'REMOTE_PORT' => '45112',
'REMOTE_ADDR' => '100.116.221.71',
'SERVER_SOFTWARE' => 'nginx/1.18.0',
'GATEWAY_INTERFACE' => 'CGI/1.1',
'REQUEST_SCHEME' => 'http',
'SERVER_PROTOCOL' => 'HTTP/1.1',
'DOCUMENT_ROOT' => '/webser/www/campus/appapi/web',
'DOCUMENT_URI' => '/index.php',
'REQUEST_URI' => '/other/image',
'SCRIPT_NAME' => '/index.php',
'CONTENT_LENGTH' => '',
'CONTENT_TYPE' => '',
'REQUEST_METHOD' => 'GET',
'QUERY_STRING' => '',
'SCRIPT_FILENAME' => '/webser/www/campus/appapi/web/index.php',
'FCGI_ROLE' => 'RESPONDER',
'PHP_SELF' => '/index.php',
'REQUEST_TIME_FLOAT' => 1735096805.925133,
'REQUEST_TIME' => 1735096805,
];