Added `QueryInterface::emulateExecution()`, which allows preventing of
the actual query execution.
This allows to cancel `DataProvider` preventing search query execution
in case search model is invalid:
``` php
public function search($params)
{
$query = Item::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
$query->where('0=1');
$query->emulateExecution(); // No SQL execution will be done
return $dataProvider;
}
```
This also fix unecessary query in case of `via()` usage. See #12390.
fixes#12390fixes#6373close#12708
* prepare-travis-for-js:
remove CUBRID env from travis it is unused
Install APC on Ubuntu trusty
Fix MySQL database setup for ubuntu trusty
Switch travis OR from precise to trusty
Switch from precise to trusty is required mainly because of jsdom
dependency. It requires Node.js > 4. Precise has very old Node.js and
NPM versions and they can not be updated because of default versions of
C++ compilers. While it's possible somehow to install Node 6 on Precise,
see this [document](https://github.com/nodesource/distributions/blob/master/OLDER_DISTROS.md),
I think this is not elegant solution and I'm not 100%
sure it will work correctly with Travis and container-based precise dist.
Trusty has v6.3.0 by default which is enough and way better and newer.
Changed timestamp mapping to datetime on MSSQL.
Timestamp is a unique number on MSSQL, not a timestamp.
> https://msdn.microsoft.com/en-us/library/ms182776(v=SQL.90).aspx
> The timestamp data type is just an incrementing number and does not
> preserve a date or a time. To record a date or time, use a datetime data type.
separated from #9191close#9305
* Added documentation about Host header attack
Added info about Host header attack (#13050) to the guide and the Request class.
When we introduce a filter or property to protect against this, these
sections should be updated to link to that option.
In MSIE8 and below, yii.gridView file is not loaded and GridView widget is not working (throws Identifier expected error). The reason is that the variable name 'class' is a reserved word. To correct this, the variable name should be changed into an array key, which eliminates the error.
More info about the causes of error: https://tiffanybbrown.com/2013/09/10/expected-identifier-bug-in-internet-explorer-8/