Browse Source

Merge branch 'master' into 2.1

# Conflicts:
#	.travis.yml
#	framework/db/TableSchema.php
#	framework/mutex/PgsqlMutex.php
tags/3.0.0-alpha1
Alexander Makarov 7 years ago
parent
commit
d4e7cf0171
No known key found for this signature in database
GPG Key ID: 3617B79C6A325E4A
  1. 6
      .travis.yml
  2. 4
      framework/console/ExitCode.php
  3. 2
      framework/data/Sort.php
  4. 2
      framework/db/ActiveRecord.php
  5. 2
      framework/db/Schema.php
  6. 2
      framework/mail/BaseMessage.php
  7. 4
      framework/mutex/MysqlMutex.php
  8. 4
      framework/mutex/OracleMutex.php
  9. 8
      framework/mutex/PgsqlMutex.php
  10. 2
      framework/validators/IpValidator.php
  11. 2
      framework/web/CookieCollection.php
  12. 2
      framework/web/UrlNormalizer.php
  13. 2
      framework/web/UrlRule.php

6
.travis.yml

@ -6,7 +6,10 @@
dist: trusty
# faster builds on new travis setup not using sudo
sudo: false
# temporary disable, see https://github.com/travis-ci/travis-ci/issues/6842
#sudo: false
sudo: required
group: edge
# build only on master branches
# commented as this prevents people from running builds on their forks:
@ -61,7 +64,6 @@ matrix:
- language: node_js
node_js: 6
env: TASK_TESTS_PHP=0 TASK_TESTS_JS=1
dist: trusty
# overwrite services used for PHP tests
services:

4
framework/console/ExitCode.php

@ -127,7 +127,7 @@ class ExitCode
*/
public static $reasons = [
self::OK => 'Success',
self::UNSPECIFIED_ERROR => "Unspecified error",
self::UNSPECIFIED_ERROR => 'Unspecified error',
self::USAGE => 'Incorrect usage, argument or option error',
self::DATAERR => 'Error in input data',
self::NOINPUT => 'Input file not found or unreadable',
@ -154,6 +154,6 @@ class ExitCode
*/
public static function getReason($exitCode)
{
return isset($exReasons[$exitCode]) ? $exReasons[$exitCode] : "Unknown exit code";
return isset($exReasons[$exitCode]) ? $exReasons[$exitCode] : 'Unknown exit code';
}
}

2
framework/data/Sort.php

@ -8,8 +8,8 @@
namespace yii\data;
use Yii;
use yii\base\InvalidConfigException;
use yii\base\BaseObject;
use yii\base\InvalidConfigException;
use yii\helpers\Html;
use yii\helpers\Inflector;
use yii\web\Request;

2
framework/db/ActiveRecord.php

@ -195,7 +195,7 @@ class ActiveRecord extends BaseActiveRecord
{
$pk = [];
// disambiguate column names in case ActiveQuery adds a JOIN
foreach($this->getPrimaryKey(true) as $key => $value) {
foreach ($this->getPrimaryKey(true) as $key => $value) {
$pk[static::tableName() . '.' . $key] = $value;
}
/* @var $record BaseActiveRecord */

2
framework/db/Schema.php

@ -8,10 +8,10 @@
namespace yii\db;
use Yii;
use yii\base\BaseObject;
use yii\base\InvalidCallException;
use yii\base\InvalidConfigException;
use yii\base\NotSupportedException;
use yii\base\BaseObject;
use yii\caching\Cache;
use yii\caching\CacheInterface;
use yii\caching\TagDependency;

2
framework/mail/BaseMessage.php

@ -8,8 +8,8 @@
namespace yii\mail;
use Yii;
use yii\base\ErrorHandler;
use yii\base\BaseObject;
use yii\base\ErrorHandler;
/**
* BaseMessage serves as a base class that implements the [[send()]] method required by [[MessageInterface]].

4
framework/mutex/MysqlMutex.php

@ -56,7 +56,7 @@ class MysqlMutex extends DbMutex
*/
protected function acquireLock($name, $timeout = 0)
{
return $this->db->useMaster(function($db) use ($name, $timeout) {
return $this->db->useMaster(function ($db) use ($name, $timeout) {
/** @var \yii\db\Connection $db */
return (bool) $db->createCommand(
'SELECT GET_LOCK(:name, :timeout)',
@ -75,7 +75,7 @@ class MysqlMutex extends DbMutex
{
return $this->db->useMaster(function ($db) use ($name) {
/** @var \yii\db\Connection $db */
return (bool)$db->createCommand(
return (bool) $db->createCommand(
'SELECT RELEASE_LOCK(:name)',
[':name' => $name]
)->queryScalar();

4
framework/mutex/OracleMutex.php

@ -88,7 +88,7 @@ class OracleMutex extends DbMutex
$timeout = abs((int) $timeout);
// inside pl/sql scopes pdo binding not working correctly :(
$this->db->useMaster(function($db) use ($name, $timeout, $releaseOnCommit, &$lockStatus) {
$this->db->useMaster(function ($db) use ($name, $timeout, $releaseOnCommit, &$lockStatus) {
/** @var \yii\db\Connection $db */
$db->createCommand(
'DECLARE
@ -115,7 +115,7 @@ END;',
protected function releaseLock($name)
{
$releaseStatus = null;
$this->db->useMaster(function($db) use ($name, &$releaseStatus) {
$this->db->useMaster(function ($db) use ($name, &$releaseStatus) {
/** @var \yii\db\Connection $db */
$db->createCommand(
'DECLARE

8
framework/mutex/PgsqlMutex.php

@ -71,9 +71,9 @@ class PgsqlMutex extends DbMutex
throw new InvalidArgumentException('PgsqlMutex does not support timeout.');
}
[$key1, $key2] = $this->getKeysFromName($name);
return $this->db->useMaster(function($db) use ($key1, $key2) {
return $this->db->useMaster(function ($db) use ($key1, $key2) {
/** @var \yii\db\Connection $db */
return (bool)$db->createCommand(
return (bool) $db->createCommand(
'SELECT pg_try_advisory_lock(:key1, :key2)',
[':key1' => $key1, ':key2' => $key2]
)->queryScalar();
@ -89,9 +89,9 @@ class PgsqlMutex extends DbMutex
protected function releaseLock($name)
{
[$key1, $key2] = $this->getKeysFromName($name);
return $this->db->useMaster(function($db) use ($key1, $key2) {
return $this->db->useMaster(function ($db) use ($key1, $key2) {
/** @var \yii\db\Connection $db */
return (bool)$db->createCommand(
return (bool) $db->createCommand(
'SELECT pg_advisory_unlock(:key1, :key2)',
[':key1' => $key1, ':key2' => $key2]
)->queryScalar();

2
framework/validators/IpValidator.php

@ -569,7 +569,7 @@ class IpValidator extends Validator
$unpack = unpack('A16', inet_pton($ip));
$binStr = array_shift($unpack);
$bytes = static::IPV6_ADDRESS_LENGTH / 8; // 128 bit / 8 = 16 bytes
$result = '';
$result = '';
while ($bytes-- > 0) {
$result = sprintf('%08b', isset($binStr[$bytes]) ? ord($binStr[$bytes]) : '0') . $result;
}

2
framework/web/CookieCollection.php

@ -9,8 +9,8 @@ namespace yii\web;
use ArrayIterator;
use Yii;
use yii\base\InvalidCallException;
use yii\base\BaseObject;
use yii\base\InvalidCallException;
/**
* CookieCollection maintains the cookies available in the current request.

2
framework/web/UrlNormalizer.php

@ -8,8 +8,8 @@
namespace yii\web;
use Yii;
use yii\base\InvalidConfigException;
use yii\base\BaseObject;
use yii\base\InvalidConfigException;
/**
* UrlNormalizer normalizes URLs for [[UrlManager]] and [[UrlRule]].

2
framework/web/UrlRule.php

@ -8,8 +8,8 @@
namespace yii\web;
use Yii;
use yii\base\InvalidConfigException;
use yii\base\BaseObject;
use yii\base\InvalidConfigException;
/**
* UrlRule represents a rule used by [[UrlManager]] for parsing and generating URLs.

Loading…
Cancel
Save