/
var
/
www
/
vhosts
/
nabawater
/
vendor
/
yiisoft
/
yii2
/
base
/
/var/www/vhosts/nabawater/vendor/yiisoft/yii2/base
mkdir
upload
Name
Size
Mode
Actions
Action.php
3809
0644
edit
dl
rm
ActionEvent.php
1280
0644
edit
dl
rm
ActionFilter.php
5206
0644
edit
dl
rm
Application.php
23934
0644
edit
dl
rm
Arrayable.php
3957
0644
edit
dl
rm
ArrayableTrait.php
9620
0644
edit
dl
rm
ArrayAccessTrait.php
2386
0644
edit
dl
rm
BaseObject.php
10570
0644
edit
dl
rm
Behavior.php
3208
0644
edit
dl
rm
BootstrapInterface.php
1992
0644
edit
dl
rm
Component.php
27876
0644
edit
dl
rm
Configurable.php
1050
0644
edit
dl
rm
Controller.php
19929
0644
edit
dl
rm
DynamicContentAwareInterface.php
1290
0644
edit
dl
rm
DynamicContentAwareTrait.php
2427
0644
edit
dl
rm
DynamicModel.php
7226
0644
edit
dl
rm
ErrorException.php
4143
0644
edit
dl
rm
ErrorHandler.php
12306
0644
edit
dl
rm
Event.php
11651
0644
edit
dl
rm
Exception.php
625
0644
edit
dl
rm
ExitException.php
998
0644
edit
dl
rm
InlineAction.php
1945
0644
edit
dl
rm
InvalidArgumentException.php
565
0644
edit
dl
rm
InvalidCallException.php
547
0644
edit
dl
rm
InvalidConfigException.php
545
0644
edit
dl
rm
InvalidParamException.php
631
0644
edit
dl
rm
InvalidRouteException.php
525
0644
edit
dl
rm
InvalidValueException.php
575
0644
edit
dl
rm
Model.php
39836
0644
edit
dl
rm
ModelEvent.php
538
0644
edit
dl
rm
Module.php
28005
0644
edit
dl
rm
NotSupportedException.php
546
0644
edit
dl
rm
Object.php
1042
0644
edit
dl
rm
Request.php
3150
0644
edit
dl
rm
Response.php
1117
0644
edit
dl
rm
Security.php
31893
0644
edit
dl
rm
StaticInstanceInterface.php
1008
0644
edit
dl
rm
StaticInstanceTrait.php
1078
0644
edit
dl
rm
Theme.php
6712
0644
edit
dl
rm
UnknownClassException.php
527
0644
edit
dl
rm
UnknownMethodException.php
556
0644
edit
dl
rm
UnknownPropertyException.php
549
0644
edit
dl
rm
UserException.php
436
0644
edit
dl
rm
View.php
21792
0644
edit
dl
rm
ViewContextInterface.php
657
0644
edit
dl
rm
ViewEvent.php
1096
0644
edit
dl
rm
ViewNotFoundException.php
529
0644
edit
dl
rm
ViewRenderer.php
856
0644
edit
dl
rm
Widget.php
10609
0644
edit
dl
rm
WidgetEvent.php
838
0644
edit
dl
rm
Edit:
/var/www/vhosts/nabawater/vendor/yiisoft/yii2/base/ActionFilter.php
(5206B)
<?php /** * @link http://www.yiiframework.com/ * @copyright Copyright (c) 2008 Yii Software LLC * @license http://www.yiiframework.com/license/ */ namespace yii\base; use yii\helpers\StringHelper; /** * ActionFilter is the base class for action filters. * * An action filter will participate in the action execution workflow by responding to * the `beforeAction` and `afterAction` events triggered by modules and controllers. * * Check implementation of [[\yii\filters\AccessControl]], [[\yii\filters\PageCache]] and [[\yii\filters\HttpCache]] as examples on how to use it. * * For more details and usage information on ActionFilter, see the [guide article on filters](guide:structure-filters). * * @author Qiang Xue <qiang.xue@gmail.com> * @since 2.0 */ class ActionFilter extends Behavior { /** * @var array list of action IDs that this filter should apply to. If this property is not set, * then the filter applies to all actions, unless they are listed in [[except]]. * If an action ID appears in both [[only]] and [[except]], this filter will NOT apply to it. * * Note that if the filter is attached to a module, the action IDs should also include child module IDs (if any) * and controller IDs. * * Since version 2.0.9 action IDs can be specified as wildcards, e.g. `site/*`. * * @see except */ public $only; /** * @var array list of action IDs that this filter should not apply to. * @see only */ public $except = []; /** * {@inheritdoc} */ public function attach($owner) { $this->owner = $owner; $owner->on(Controller::EVENT_BEFORE_ACTION, [$this, 'beforeFilter']); } /** * {@inheritdoc} */ public function detach() { if ($this->owner) { $this->owner->off(Controller::EVENT_BEFORE_ACTION, [$this, 'beforeFilter']); $this->owner->off(Controller::EVENT_AFTER_ACTION, [$this, 'afterFilter']); $this->owner = null; } } /** * @param ActionEvent $event */ public function beforeFilter($event) { if (!$this->isActive($event->action)) { return; } $event->isValid = $this->beforeAction($event->action); if ($event->isValid) { // call afterFilter only if beforeFilter succeeds // beforeFilter and afterFilter should be properly nested $this->owner->on(Controller::EVENT_AFTER_ACTION, [$this, 'afterFilter'], null, false); } else { $event->handled = true; } } /** * @param ActionEvent $event */ public function afterFilter($event) { $event->result = $this->afterAction($event->action, $event->result); $this->owner->off(Controller::EVENT_AFTER_ACTION, [$this, 'afterFilter']); } /** * This method is invoked right before an action is to be executed (after all possible filters.) * You may override this method to do last-minute preparation for the action. * @param Action $action the action to be executed. * @return bool whether the action should continue to be executed. */ public function beforeAction($action) { return true; } /** * This method is invoked right after an action is executed. * You may override this method to do some postprocessing for the action. * @param Action $action the action just executed. * @param mixed $result the action execution result * @return mixed the processed action result. */ public function afterAction($action, $result) { return $result; } /** * Returns an action ID by converting [[Action::$uniqueId]] into an ID relative to the module. * @param Action $action * @return string * @since 2.0.7 */ protected function getActionId($action) { if ($this->owner instanceof Module) { $mid = $this->owner->getUniqueId(); $id = $action->getUniqueId(); if ($mid !== '' && strpos($id, $mid) === 0) { $id = substr($id, strlen($mid) + 1); } } else { $id = $action->id; } return $id; } /** * Returns a value indicating whether the filter is active for the given action. * @param Action $action the action being filtered * @return bool whether the filter is active for the given action. */ protected function isActive($action) { $id = $this->getActionId($action); if (empty($this->only)) { $onlyMatch = true; } else { $onlyMatch = false; foreach ($this->only as $pattern) { if (StringHelper::matchWildcard($pattern, $id)) { $onlyMatch = true; break; } } } $exceptMatch = false; foreach ($this->except as $pattern) { if (StringHelper::matchWildcard($pattern, $id)) { $exceptMatch = true; break; } } return !$exceptMatch && $onlyMatch; } }
Save
cmd:
run