ソースを参照

Merge branch 'master' into 3.next

Mark Story 10 年 前
コミット
67c7d956d4

+ 13 - 7
.travis.yml

@@ -49,11 +49,10 @@ matrix:
 
     - php: hhvm
 
-before_script:
+before_install:
   - sh -c "if [ '$HHVM' != '1' ]; then phpenv config-rm xdebug.ini; fi"
   - composer self-update
   - if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi;
-  - composer install --prefer-dist --no-interaction
 
   - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
   - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test2;'; fi"
@@ -62,16 +61,23 @@ before_script:
   - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi"
   - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test2;' -U postgres -d cakephp_test; fi"
   - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test3;' -U postgres -d cakephp_test; fi"
+  
+  - if [[ $TRAVIS_PHP_VERSION != 'hhvm' ]] ; then pecl channel-update pecl.php.net; fi;
 
-  - sh -c "if [ '$HHVM' != '1' ]; then echo 'extension = memcached.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
-  - sh -c "if [ '$HHVM' != '1' ]; then echo 'extension = redis.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
-  - sh -c "if [ '$HHVM' != '1' ]; then echo 'extension = apc.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
-  - sh -c "if [ '$PHP' = '5.6' ]; then pecl install apc; fi"
-  - sh -c "if [ '$HHVM' = '1' ]; then composer require lorenzo/multiple-iterator=~1.0; fi"
+  - if [[ $TRAVIS_PHP_VERSION != 'hhvm' ]] ; then echo 'extension = memcached.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
+  - if [[ $TRAVIS_PHP_VERSION != 'hhvm' ]] ; then echo 'extension = redis.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
+  - if [[ $TRAVIS_PHP_VERSION != 'hhvm' ]] ; then echo 'extension = apcu.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
+  - if [[ $TRAVIS_PHP_VERSION =~ 5.[56] ]] ; then echo yes | pecl install apcu-4.0.10; fi
+  - if [[ $TRAVIS_PHP_VERSION = 7.* ]] ; then echo yes | pecl install apcu; fi
+  - if [[ $TRAVIS_PHP_VERSION = 7.* ]] ; then pecl config-set preferred_state beta; echo yes | pecl install apcu_bc; fi
+  - if [[ $TRAVIS_PHP_VERSION = 'hhvm' ]] ; then composer require lorenzo/multiple-iterator=~1.0; fi
 
   - phpenv rehash
   - set +H
 
+before_script:
+  - composer install --prefer-dist --no-interaction
+
 script:
   - sh -c "if [ '$DEFAULT' = '1' ]; then vendor/bin/phpunit; fi"
 

+ 2 - 2
src/Controller/Component/SecurityComponent.php

@@ -313,7 +313,7 @@ class SecurityComponent extends Component
      * Validate submitted form
      *
      * @param \Cake\Controller\Controller $controller Instantiating controller
-     * @throws \Cake\Controller\Exception\SecurityException
+     * @throws \Cake\Controller\Exception\AuthSecurityException
      * @return bool true if submitted form is valid
      */
     protected function _validatePost(Controller $controller)
@@ -334,7 +334,7 @@ class SecurityComponent extends Component
             $msg = $this->_debugPostTokenNotMatching($controller, $hashParts);
         }
 
-        throw new SecurityException($msg);
+        throw new AuthSecurityException($msg);
     }
 
     /**

+ 0 - 7
src/Mailer/Email.php

@@ -316,13 +316,6 @@ class Email implements JsonSerializable, Serializable
     protected $_emailPattern = self::EMAIL_PATTERN;
 
     /**
-     * The class name used for email configuration.
-     *
-     * @var string
-     */
-    protected $_configClass = 'EmailConfig';
-
-    /**
      * Constructor
      *
      * @param array|string|null $config Array of configs, or string to load configs from email.php

+ 2 - 1
src/ORM/README.md

@@ -28,7 +28,8 @@ ConnectionManager::config('default', [
 	'driver' => 'Cake\Database\Driver\Mysql',
 	'database' => 'test',
 	'username' => 'root',
-	'password' => 'secret'
+	'password' => 'secret',
+	'cacheMetaData' => false // If set to `true` you need to install the optional "cakephp/cache" package.
 ]);
 ```
 

+ 3 - 3
tests/TestCase/Controller/Component/SecurityComponentTest.php

@@ -477,7 +477,7 @@ class SecurityComponentTest extends TestCase
             'Model' => ['username' => 'nate', 'password' => 'foo', 'valid' => '0'],
             '_Token' => compact('fields', 'unlocked', 'debug')
         ];
-        $this->assertFalse($this->validatePost('SecurityException', 'Unexpected field \'Model.password\' in POST data, Unexpected field \'Model.username\' in POST data'));
+        $this->assertFalse($this->validatePost('AuthSecurityException', 'Unexpected field \'Model.password\' in POST data, Unexpected field \'Model.username\' in POST data'));
     }
 
     /**
@@ -498,7 +498,7 @@ class SecurityComponentTest extends TestCase
             'Model' => ['username' => 'nate', 'password' => 'foo', 'valid' => '0'],
             '_Token' => compact('fields')
         ];
-        $this->assertFalse($this->validatePost('SecurityException', '\'_Token.unlocked\' was not found in request data.'));
+        $this->assertFalse($this->validatePost('AuthSecurityException', '\'_Token.unlocked\' was not found in request data.'));
     }
 
     /**
@@ -517,7 +517,7 @@ class SecurityComponentTest extends TestCase
             'Model' => ['username' => 'nate', 'password' => 'foo', 'valid' => '0'],
             '_Token' => compact('unlocked')
         ];
-        $result = $this->validatePost('SecurityException', '\'_Token.fields\' was not found in request data.');
+        $result = $this->validatePost('AuthSecurityException', '\'_Token.fields\' was not found in request data.');
         $this->assertFalse($result, 'validatePost passed when fields were missing. %s');
     }
 

+ 1 - 1
tests/TestCase/Validation/stubs.php

@@ -13,6 +13,7 @@
  * @license       http://www.opensource.org/licenses/mit-license.php MIT License
  */
 namespace Cake\Validation {
+
     /**
      * Use namespace injection to overwrite is_uploaded_file()
      * during tests.
@@ -25,4 +26,3 @@ namespace Cake\Validation {
         return file_exists($filename);
     }
 }
-