/
var
/
www
/
vhosts
/
nabawater
/
vendor
/
yiisoft
/
yii2
/
web
/
/var/www/vhosts/nabawater/vendor/yiisoft/yii2/web
mkdir
upload
Name
Size
Mode
Actions
migrations/
-
0755
rm
Application.php
5836
0644
edit
dl
rm
AssetBundle.php
8602
0644
edit
dl
rm
AssetConverter.php
4599
0644
edit
dl
rm
AssetConverterInterface.php
698
0644
edit
dl
rm
AssetManager.php
25586
0644
edit
dl
rm
BadRequestHttpException.php
1077
0644
edit
dl
rm
CacheSession.php
3673
0644
edit
dl
rm
CompositeUrlRule.php
4482
0644
edit
dl
rm
ConflictHttpException.php
814
0644
edit
dl
rm
Controller.php
9739
0644
edit
dl
rm
Cookie.php
2002
0644
edit
dl
rm
CookieCollection.php
8094
0644
edit
dl
rm
DbSession.php
7628
0644
edit
dl
rm
ErrorAction.php
6092
0644
edit
dl
rm
ErrorHandler.php
19141
0644
edit
dl
rm
ForbiddenHttpException.php
1126
0644
edit
dl
rm
GoneHttpException.php
1073
0644
edit
dl
rm
GroupUrlRule.php
4696
0644
edit
dl
rm
HeaderCollection.php
7236
0644
edit
dl
rm
HeadersAlreadySentException.php
700
0644
edit
dl
rm
HtmlResponseFormatter.php
1092
0644
edit
dl
rm
HttpException.php
1760
0644
edit
dl
rm
IdentityInterface.php
3661
0644
edit
dl
rm
JqueryAsset.php
459
0644
edit
dl
rm
JsExpression.php
1253
0644
edit
dl
rm
JsonParser.php
1731
0644
edit
dl
rm
JsonResponseFormatter.php
4677
0644
edit
dl
rm
Link.php
2078
0644
edit
dl
rm
Linkable.php
1109
0644
edit
dl
rm
MethodNotAllowedHttpException.php
833
0644
edit
dl
rm
MultiFieldSession.php
4614
0644
edit
dl
rm
MultipartFormDataParser.php
12271
0644
edit
dl
rm
NotAcceptableHttpException.php
1063
0644
edit
dl
rm
NotFoundHttpException.php
808
0644
edit
dl
rm
RangeNotSatisfiableHttpException.php
1212
0644
edit
dl
rm
Request.php
65615
0644
edit
dl
rm
RequestParserInterface.php
669
0644
edit
dl
rm
Response.php
41354
0644
edit
dl
rm
ResponseFormatterInterface.php
543
0644
edit
dl
rm
ServerErrorHttpException.php
827
0644
edit
dl
rm
Session.php
34578
0644
edit
dl
rm
SessionIterator.php
1978
0644
edit
dl
rm
TooManyRequestsHttpException.php
1019
0644
edit
dl
rm
UnauthorizedHttpException.php
1153
0644
edit
dl
rm
UnprocessableEntityHttpException.php
1120
0644
edit
dl
rm
UnsupportedMediaTypeHttpException.php
1094
0644
edit
dl
rm
UploadedFile.php
8836
0644
edit
dl
rm
UrlManager.php
25872
0644
edit
dl
rm
UrlNormalizer.php
5103
0644
edit
dl
rm
UrlNormalizerRedirectException.php
1758
0644
edit
dl
rm
UrlRule.php
21707
0644
edit
dl
rm
UrlRuleInterface.php
1223
0644
edit
dl
rm
User.php
33110
0644
edit
dl
rm
UserEvent.php
1229
0644
edit
dl
rm
View.php
23745
0644
edit
dl
rm
ViewAction.php
4718
0644
edit
dl
rm
XmlResponseFormatter.php
5667
0644
edit
dl
rm
YiiAsset.php
504
0644
edit
dl
rm
Edit:
/var/www/vhosts/nabawater/vendor/yiisoft/yii2/web/Controller.php
(9739B)
<?php /** * @link http://www.yiiframework.com/ * @copyright Copyright (c) 2008 Yii Software LLC * @license http://www.yiiframework.com/license/ */ namespace yii\web; use Yii; use yii\base\InlineAction; use yii\helpers\Url; /** * Controller is the base class of web controllers. * * For more details and usage information on Controller, see the [guide article on controllers](guide:structure-controllers). * * @author Qiang Xue <qiang.xue@gmail.com> * @since 2.0 */ class Controller extends \yii\base\Controller { /** * @var bool whether to enable CSRF validation for the actions in this controller. * CSRF validation is enabled only when both this property and [[\yii\web\Request::enableCsrfValidation]] are true. */ public $enableCsrfValidation = true; /** * @var array the parameters bound to the current action. */ public $actionParams = []; /** * Renders a view in response to an AJAX request. * * This method is similar to [[renderPartial()]] except that it will inject into * the rendering result with JS/CSS scripts and files which are registered with the view. * For this reason, you should use this method instead of [[renderPartial()]] to render * a view to respond to an AJAX request. * * @param string $view the view name. Please refer to [[render()]] on how to specify a view name. * @param array $params the parameters (name-value pairs) that should be made available in the view. * @return string the rendering result. */ public function renderAjax($view, $params = []) { return $this->getView()->renderAjax($view, $params, $this); } /** * Send data formatted as JSON. * * This method is a shortcut for sending data formatted as JSON. It will return * the [[Application::getResponse()|response]] application component after configuring * the [[Response::$format|format]] and setting the [[Response::$data|data]] that should * be formatted. A common usage will be: * * ```php * return $this->asJson($data); * ``` * * @param mixed $data the data that should be formatted. * @return Response a response that is configured to send `$data` formatted as JSON. * @since 2.0.11 * @see Response::$format * @see Response::FORMAT_JSON * @see JsonResponseFormatter */ public function asJson($data) { $response = Yii::$app->getResponse(); $response->format = Response::FORMAT_JSON; $response->data = $data; return $response; } /** * Send data formatted as XML. * * This method is a shortcut for sending data formatted as XML. It will return * the [[Application::getResponse()|response]] application component after configuring * the [[Response::$format|format]] and setting the [[Response::$data|data]] that should * be formatted. A common usage will be: * * ```php * return $this->asXml($data); * ``` * * @param mixed $data the data that should be formatted. * @return Response a response that is configured to send `$data` formatted as XML. * @since 2.0.11 * @see Response::$format * @see Response::FORMAT_XML * @see XmlResponseFormatter */ public function asXml($data) { $response = Yii::$app->getResponse(); $response->format = Response::FORMAT_XML; $response->data = $data; return $response; } /** * Binds the parameters to the action. * This method is invoked by [[\yii\base\Action]] when it begins to run with the given parameters. * This method will check the parameter names that the action requires and return * the provided parameters according to the requirement. If there is any missing parameter, * an exception will be thrown. * @param \yii\base\Action $action the action to be bound with parameters * @param array $params the parameters to be bound to the action * @return array the valid parameters that the action can run with. * @throws BadRequestHttpException if there are missing or invalid parameters. */ public function bindActionParams($action, $params) { if ($action instanceof InlineAction) { $method = new \ReflectionMethod($this, $action->actionMethod); } else { $method = new \ReflectionMethod($action, 'run'); } $args = []; $missing = []; $actionParams = []; foreach ($method->getParameters() as $param) { $name = $param->getName(); if (array_key_exists($name, $params)) { if ($param->isArray()) { $args[] = $actionParams[$name] = (array) $params[$name]; } elseif (!is_array($params[$name])) { $args[] = $actionParams[$name] = $params[$name]; } else { throw new BadRequestHttpException(Yii::t('yii', 'Invalid data received for parameter "{param}".', [ 'param' => $name, ])); } unset($params[$name]); } elseif ($param->isDefaultValueAvailable()) { $args[] = $actionParams[$name] = $param->getDefaultValue(); } else { $missing[] = $name; } } if (!empty($missing)) { throw new BadRequestHttpException(Yii::t('yii', 'Missing required parameters: {params}', [ 'params' => implode(', ', $missing), ])); } $this->actionParams = $actionParams; return $args; } /** * {@inheritdoc} */ public function beforeAction($action) { if (parent::beforeAction($action)) { if ($this->enableCsrfValidation && Yii::$app->getErrorHandler()->exception === null && !Yii::$app->getRequest()->validateCsrfToken()) { throw new BadRequestHttpException(Yii::t('yii', 'Unable to verify your data submission.')); } return true; } return false; } /** * Redirects the browser to the specified URL. * This method is a shortcut to [[Response::redirect()]]. * * You can use it in an action by returning the [[Response]] directly: * * ```php * // stop executing this action and redirect to login page * return $this->redirect(['login']); * ``` * * @param string|array $url the URL to be redirected to. This can be in one of the following formats: * * - a string representing a URL (e.g. "http://example.com") * - a string representing a URL alias (e.g. "@example.com") * - an array in the format of `[$route, ...name-value pairs...]` (e.g. `['site/index', 'ref' => 1]`) * [[Url::to()]] will be used to convert the array into a URL. * * Any relative URL that starts with a single forward slash "/" will be converted * into an absolute one by prepending it with the host info of the current request. * * @param int $statusCode the HTTP status code. Defaults to 302. * See <https://tools.ietf.org/html/rfc2616#section-10> * for details about HTTP status code * @return Response the current response object */ public function redirect($url, $statusCode = 302) { // calling Url::to() here because Response::redirect() modifies route before calling Url::to() return Yii::$app->getResponse()->redirect(Url::to($url), $statusCode); } /** * Redirects the browser to the home page. * * You can use this method in an action by returning the [[Response]] directly: * * ```php * // stop executing this action and redirect to home page * return $this->goHome(); * ``` * * @return Response the current response object */ public function goHome() { return Yii::$app->getResponse()->redirect(Yii::$app->getHomeUrl()); } /** * Redirects the browser to the last visited page. * * You can use this method in an action by returning the [[Response]] directly: * * ```php * // stop executing this action and redirect to last visited page * return $this->goBack(); * ``` * * For this function to work you have to [[User::setReturnUrl()|set the return URL]] in appropriate places before. * * @param string|array $defaultUrl the default return URL in case it was not set previously. * If this is null and the return URL was not set previously, [[Application::homeUrl]] will be redirected to. * Please refer to [[User::setReturnUrl()]] on accepted format of the URL. * @return Response the current response object * @see User::getReturnUrl() */ public function goBack($defaultUrl = null) { return Yii::$app->getResponse()->redirect(Yii::$app->getUser()->getReturnUrl($defaultUrl)); } /** * Refreshes the current page. * This method is a shortcut to [[Response::refresh()]]. * * You can use it in an action by returning the [[Response]] directly: * * ```php * // stop executing this action and refresh the current page * return $this->refresh(); * ``` * * @param string $anchor the anchor that should be appended to the redirection URL. * Defaults to empty. Make sure the anchor starts with '#' if you want to specify it. * @return Response the response object itself */ public function refresh($anchor = '') { return Yii::$app->getResponse()->redirect(Yii::$app->getRequest()->getUrl() . $anchor); } }
Save
cmd:
run