@@ -16,4 +16,4 @@
// @license https://opensource.org/licenses/mit-license.php MIT License
// +--------------------------------------------------------------------------------------------+ //
////////////////////////////////////////////////////////////////////////////////////////////////////
3.7.6
3.7.7
@@ -33,7 +33,7 @@ init:

install:
- IF EXIST C:\php (SET PHP=0)
- ps: appveyor-retry cinst --params '""/InstallDir:C:\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','')
- ps: appveyor-retry cinst --no-progress --params '""/InstallDir:C:\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','')
- cd C:\php
- copy php.ini-production php.ini /Y
- echo date.timezone="UTC" >> php.ini
@@ -44,14 +44,14 @@ install:
- echo extension=php_fileinfo.dll >> php.ini

- curl -fsS https://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/5.2.0/php_pdo_sqlsrv-5.2.0-7.2-nts-vc15-x64.zip -o pdosqlsrv.zip
- 7z x pdosqlsrv.zip -oC:\php\ext php_pdo_sqlsrv.dll > nul
- 7z x pdosqlsrv.zip -oC:\php\ext php_pdo_sqlsrv.dll -aoa > nul
- curl -fsS https://windows.php.net/downloads/pecl/releases/sqlsrv/5.2.0/php_sqlsrv-5.2.0-7.2-nts-vc15-x64.zip -o sqlsrv.zip
- 7z x sqlsrv.zip -oC:\php\ext php_sqlsrv.dll > nul
- 7z x sqlsrv.zip -oC:\php\ext php_sqlsrv.dll -aoa > nul
- echo extension=php_pdo_sqlsrv.dll >> php.ini
- echo extension=php_sqlsrv.dll >> php.ini

- curl -fsS https://windows.php.net/downloads/pecl/releases/wincache/2.0.0.8/php_wincache-2.0.0.8-7.2-nts-vc15-x64.zip -o wincache.zip
- 7z x wincache.zip -oC:\php\ext php_wincache.dll > nul
- 7z x wincache.zip -oC:\php\ext php_wincache.dll -aoa > nul
- echo extension=php_wincache.dll >> php.ini
- echo wincache.enablecli = 1 >> php.ini

@@ -27,6 +27,7 @@ parameters:
- '#Call to an undefined method DOMNode::setAttribute\(\)#'
- '#Binary operation "\+" between array|false and array results in an error#'
- '#Result of method Cake\\Auth\\BaseAuthenticate::unauthenticated\(\) \(void\) is used#'
- '#Call to an undefined method DateTimeInterface::setTimezone\(\)#'
earlyTerminatingMethodCalls:
Cake\Console\Shell:
- abort
@@ -496,14 +496,19 @@ public static function delete($key, $config = 'default')
*
* @param array $keys Array of cache keys to be deleted
* @param string $config name of the configuration to use. Defaults to 'default'
* @return array of boolean values that are true if the value was successfully deleted, false if it didn't exist or
* couldn't be removed
* @return array of boolean values that are true if the value was successfully deleted,
* false if it didn't exist or couldn't be removed.
*/
public static function deleteMany($keys, $config = 'default')
{
$backend = static::pool($config);

return $backend->deleteMultiple($keys);
$return = [];
foreach ($keys as $key) {
$return[$key] = $backend->delete($key);
}

return $return;
}

/**
@@ -395,7 +395,10 @@ protected function _setKey($key, $createKey = false)
if (!$createKey && !$path->isFile()) {
return false;
}
if (empty($this->_File) || $this->_File->getBasename() !== $key) {
if (empty($this->_File) ||
$this->_File->getBasename() !== $key ||
$this->_File->valid() === false
) {
$exists = file_exists($path->getPathname());
try {
$this->_File = $path->openFile('c+');
@@ -162,7 +162,7 @@ public function count()
* the long name (`plugin.command`) will be returned.
*
* @param string $plugin The plugin to scan.
* @return array Discovered plugin commands.
* @return string[] Discovered plugin commands.
*/
public function discoverPlugin($plugin)
{
@@ -176,7 +176,7 @@ public function discoverPlugin($plugin)
* Resolve names based on existing commands
*
* @param array $input The results of a CommandScanner operation.
* @return array A flat map of command names => class names.
* @return string[] A flat map of command names => class names.
*/
protected function resolveNames(array $input)
{
@@ -213,7 +213,7 @@ protected function resolveNames(array $input)
* Commands defined in the application will ovewrite commands with
* the same name provided by CakePHP.
*
* @return array An array of command names and their classes.
* @return string[] An array of command names and their classes.
*/
public function autoDiscover()
{
@@ -162,7 +162,7 @@ public function run(array $argv, ConsoleIo $io = null)
$result = $this->runShell($shell, $argv);
}
if ($shell instanceof Command) {
$result = $shell->run($argv, $io);
$result = $this->runCommand($shell, $argv, $io);
}

if ($result === null || $result === true) {
@@ -352,6 +352,23 @@ protected function resolveName($commands, $io, $name)
return $name;
}

/**
* Execute a Command class.
*
* @param \Cake\Console\Command $command The command to run.
* @param array $argv The CLI arguments to invoke.
* @param \Cake\Console\ConsoleIo $io The console io
* @return int Exit code
*/
protected function runCommand(Command $command, array $argv, ConsoleIo $io)
{
try {
return $command->run($argv, $io);
} catch (StopException $e) {
return $e->getCode();
}
}

/**
* Execute a Shell class.
*
@@ -1086,7 +1086,7 @@ protected function _optionExists($name)
*
* @param string $argument The argument to append
* @param array $args The array of parsed args to append to.
* @return array Args
* @return string[] Args
* @throws \Cake\Console\Exception\ConsoleException
*/
protected function _parseArg($argument, $args)
@@ -264,7 +264,7 @@ public static function config($name, ConfigEngineInterface $engine)
* Use Configure::isConfigured() instead.
*
* @param string|null $name Engine name.
* @return array|bool Array of the configured Engine objects, bool for specific name.
* @return string[]|bool Array of the configured Engine objects, bool for specific name.
*/
public static function configured($name = null)
{
@@ -38,7 +38,7 @@ interface EventListenerInterface
* }
* ```
*
* @return array associative array or event key names pointing to the function
* @return array Associative array or event key names pointing to the function
* that should be called in the object when the respective event is fired
*/
public function implementedEvents();
@@ -24,6 +24,7 @@
use Cake\Http\Exception\NotFoundException;
use Cake\Log\Log;
use DateTime;
use DateTimeInterface;
use DateTimeZone;
use InvalidArgumentException;
use Psr\Http\Message\ResponseInterface;
@@ -1608,7 +1609,7 @@ protected function _setCacheControl()
* `$response->expires(new DateTime('+1 day'))` Will set the expiration in next 24 hours
* `$response->expires()` Will return the current expiration header value
*
* @param string|\DateTime|null $time Valid time string or \DateTime instance.
* @param string|\DateTimeInterface|null $time Valid time string or \DateTime instance.
* @return string|null
* @deprecated 3.4.0 Use withExpires() instead.
*/
@@ -1644,7 +1645,7 @@ public function expires($time = null)
* $response->withExpires(new DateTime('+1 day'))
* ```
*
* @param string|\DateTime $time Valid time string or \DateTime instance.
* @param string|\DateTimeInterface $time Valid time string or \DateTime instance.
* @return static
*/
public function withExpires($time)
@@ -1664,7 +1665,7 @@ public function withExpires($time)
* `$response->modified(new DateTime('+1 day'))` Will set the modification date in the past 24 hours
* `$response->modified()` Will return the current Last-Modified header value
*
* @param string|\DateTime|null $time Valid time string or \DateTime instance.
* @param string|\DateTimeInterface|null $time Valid time string or \DateTime instance.
* @return string|null
* @deprecated 3.4.0 Use withModified() instead.
*/
@@ -1700,7 +1701,7 @@ public function modified($time = null)
* $response->withModified(new DateTime('+1 day'))
* ```
*
* @param string|\DateTime $time Valid time string or \DateTime instance.
* @param string|\DateTimeInterface $time Valid time string or \DateTimeInterface instance.
* @return static
*/
public function withModified($time)
@@ -1885,21 +1886,20 @@ public function withEtag($hash, $weak = false)
* Returns a DateTime object initialized at the $time param and using UTC
* as timezone
*
* @param string|int|\DateTime|null $time Valid time string or \DateTime instance.
* @return \DateTime
* @param string|int|\DateTimeInterface|null $time Valid time string or \DateTimeInterface instance.
* @return \DateTimeInterface
*/
protected function _getUTCDate($time = null)
{
if ($time instanceof DateTime) {
if ($time instanceof DateTimeInterface) {
$result = clone $time;
} elseif (is_int($time)) {
$result = new DateTime(date('Y-m-d H:i:s', $time));
} else {
$result = new DateTime($time);
}
$result->setTimezone(new DateTimeZone('UTC'));

return $result;
return $result->setTimezone(new DateTimeZone('UTC'));
}

/**
@@ -241,7 +241,7 @@ public static function listTimezones($filter = null, $country = null, $options =
}

/**
* Returns true this instance will happen within the specified interval
* Returns true this instance happened within the specified interval
*
* This overridden method provides backwards compatible behavior for integers,
* or strings with trailing spaces. This behavior is *deprecated* and will be
@@ -266,7 +266,7 @@ public function wasWithinLast($timeInterval)
}

/**
* Returns true this instance happened within the specified interval
* Returns true this instance will happen within the specified interval
*
* This overridden method provides backwards compatible behavior for integers,
* or strings with trailing spaces. This behavior is *deprecated* and will be
@@ -78,6 +78,18 @@ public function __destruct()
}
}

/**
* Unserialize handler.
*
* Ensure that the socket property isn't reinitialized in a broken state.
*
* @return void
*/
public function __wakeup()
{
$this->_socket = null;
}

/**
* Connect to the SMTP server.
*
@@ -1223,7 +1223,7 @@ public function __get($name)
'templatePath' => 'getTemplatePath',
'template' => 'getTemplate',
'layout' => 'getLayout',
'layoutPath' => 'setLayoutPath',
'layoutPath' => 'getLayoutPath',
'autoLayout' => 'isAutoLayoutEnabled',
'theme' => 'getTheme',
'request' => 'getRequest',
@@ -1305,7 +1305,6 @@ public function __set($name, $value)
'response' => 'setResponse',
'subDir' => 'setSubDir',
'plugin' => 'setPlugin',
'name' => 'setName',
'elementCache' => 'setElementCache',
];
if (isset($protected[$name])) {
@@ -1330,6 +1329,13 @@ public function __set($name, $value)
return $this->helpers = $value;
}

if ($name === 'name') {
deprecationWarning(
'View::$name is protected now. ' .
'You can use viewBuilder()->setName() to change the name a view uses before building it.'
);
}

$this->{$name} = $value;
}

@@ -1472,6 +1478,17 @@ public function getSubDir()
return $this->subDir;
}

/**
* Returns the View's controller name.
*
* @return string|null
* @since 3.7.7
*/
public function getName()
{
return $this->name;
}

/**
* Returns the plugin name.
*
@@ -41,6 +41,11 @@ public function setUp()
*/
public function testDataAvailable()
{
$this->skipIf(
DS === '\\',
'Skip ConsoleInput tests on Windows as they fail on AppVeyor.'
);

$this->assertFalse($this->in->dataAvailable());
}
}
@@ -1092,6 +1092,10 @@ public function testWithModified()
$new = $response->withModified($now);
$this->assertEquals(gmdate($format) . ' GMT', $new->getHeaderLine('Last-Modified'));

$now = new \DateTimeImmutable();
$new = $response->withModified($now);
$this->assertEquals(gmdate($format) . ' GMT', $new->getHeaderLine('Last-Modified'));

$time = new \DateTime('+1 day', new \DateTimeZone('UTC'));
$new = $response->withModified('+1 day');
$this->assertEquals($time->format($format) . ' GMT', $new->getHeaderLine('Last-Modified'));
@@ -709,4 +709,25 @@ public function testSendDefaults()

$this->SmtpTransport->send($email);
}

/**
* Ensure that unserialized transports have no connection.
*
* @return void
*/
public function testSerializeCleanupSocket()
{
$this->socket->expects($this->at(0))->method('connect')->will($this->returnValue(true));
$this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n"));
$this->socket->expects($this->at(2))->method('write')->with("EHLO localhost\r\n");
$this->socket->expects($this->at(3))->method('read')->will($this->returnValue("250 OK\r\n"));

$smtpTransport = new SmtpTestTransport();
$smtpTransport->setSocket($this->socket);
$smtpTransport->connect();

$result = unserialize(serialize($smtpTransport));
$this->assertAttributeEquals(null, '_socket', $result);
$this->assertFalse($result->connected());
}
}
@@ -2151,6 +2151,20 @@ public function testGetSetLayout()
$this->assertSame($layout, 'foo');
}

/**
* Test getName() and getPlugin().
*
* @return void
*/
public function testGetNamePlugin()
{
$this->assertSame('Posts', $this->View->getName());
$this->assertNull($this->View->getPlugin());

$this->assertSame($this->View, $this->View->setPlugin('TestPlugin'));
$this->assertSame('TestPlugin', $this->View->getPlugin());
}

/**
* Test testHasRendered property
*
@@ -28,6 +28,9 @@ class TestAuthenticate extends BaseAuthenticate

public $authenticationProvider;

/**
* @return array
*/
public function implementedEvents()
{
return [