if ($behavior->canGetProperty($name)) {
return $behavior->$name;
}
}
if (method_exists($this, 'set' . $name)) {
throw new InvalidCallException('Getting write-only property: ' . get_class($this) . '::' . $name);
}
throw new UnknownPropertyException('Getting unknown property: ' . get_class($this) . '::' . $name);
}
/**
* Sets the value of a component property.
*
* This method will check in the following order and act accordingly:
*
* - a property defined by a setter: set the property value
* - an event in the format of "on xyz": attach the handler to the event "xyz"
public function __get($name)
{
if ($this->has($name)) {
return $this->get($name);
}
return parent::__get($name);
}
/**
* Checks if a property value is null.
* This method overrides the parent implementation by checking if the named component is loaded.
* @param string $name the property name or the event name
$reviews = Review::find()->where(['radiostation_id' => (string)$station->_id])->all();
$settings['tuneinenabled'] = Settings::find()->Where(['label' => 'tuneinenabled'])->One();
$settings['shoutcastenabled'] = Settings::find()->Where(['label' => 'shoutcastenabled'])->One();
$isMobile = false;
if (Yii::$app->devicedetect->isMobile()) {
$isMobile = Settings::find()->where(['label' => 'streammightnotwork'])->one();
}
$this->setCookies($station);
$this->getCookies($station);
$args = $this->controller->bindActionParams($this, $params);
Yii::debug('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);
if ($oldController !== null) {
Yii::$app->controller = $oldController;
}
return $result;
}
$params = $this->catchAll;
unset($params[0]);
}
try {
Yii::debug("Route requested: '$route'", __METHOD__);
$this->requestedRoute = $route;
$result = $this->runAction($route, $params);
if ($result instanceof Response) {
return $result;
}
$response = $this->getResponse();
if ($result !== null) {
{
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 __DIR__ . '/../vendor/yiisoft/yii2/Yii.php'; require __DIR__ . '/../config/bootstrap.php'; $config = require __DIR__ . '/../config/api.php'; (new yii\web\Application($config))->run();
$_GET = [
'country' => 'greece',
'station' => 'sfera',
];
$_COOKIE = [
'PHPSESSID' => '1bfbf3df923b83f4cd005d293d4fa8ef',
];
$_SESSION = [
'__flash' => [],
'country_code' => 'CA',
'user_region_id' => unserialize('O:21:"MongoDB\\BSON\\ObjectId":1:{s:3:"oid";s:24:"5bd6c17fb5551ee2538b47d8";}'),
];