Skip to content

Commit ec01556

Browse files
committed
More fixes to avoid segfaults in hhvm
1 parent 65048bd commit ec01556

File tree

5 files changed

+5
-3
lines changed

5 files changed

+5
-3
lines changed

src/Cache/Engine/RedisEngine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public function clearGroup($group) {
237237
* Disconnects from the redis server
238238
*/
239239
public function __destruct() {
240-
if (!$this->_config['persistent']) {
240+
if (empty($this->_config['persistent']) && $this->_Redis instanceof \Redis) {
241241
$this->_Redis->close();
242242
}
243243
}

tests/TestCase/Cache/Engine/MemcachedEngineTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ public function testConfigurationConflict() {
656656
* @return void
657657
*/
658658
public function testClear() {
659-
$this->assertFalse(defined('HHVM_VERSION'), 'Remove me when travis updates hhvm to 2.5');
659+
$this->assertFalse(defined('HHVM_VERSION'), 'Crashes HHVM');
660660
Cache::config('memcached2', array(
661661
'engine' => 'Memcached',
662662
'prefix' => 'cake2_',

tests/TestCase/Cache/Engine/RedisEngineTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class RedisEngineTest extends TestCase {
3333
* @return void
3434
*/
3535
public function setUp() {
36+
$this->assertFalse(defined('HHVM_VERSION'), 'Crashes HHVM');
3637
parent::setUp();
3738
$this->skipIf(!class_exists('Redis'), 'Redis is not installed or configured properly.');
3839

tests/TestCase/Network/SocketTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ public function testReset() {
242242
*/
243243
public function testEnableCryptoSocketExceptionNoSsl() {
244244
$this->skipIf(!extension_loaded('openssl'), 'OpenSSL is not enabled cannot test SSL.');
245+
$this->assertFalse(defined('HHVM_VERSION'), 'Broken on HHVM');
245246
$configNoSslOrTls = array('host' => 'localhost', 'port' => 80, 'timeout' => 0.1);
246247

247248
// testing exception on no ssl socket server for ssl and tls methods

tests/TestCase/Utility/XmlTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class XmlTest extends TestCase {
4747
* @return void
4848
*/
4949
public function setUp() {
50-
$this->assertFalse(defined('HHVM_VERSION'), 'Causes segfault on HHVM');
5150
parent::setUp();
5251
$this->_appEncoding = Configure::read('App.encoding');
5352
Configure::write('App.encoding', 'UTF-8');
@@ -137,6 +136,7 @@ public static function invalidDataProvider() {
137136
* @return void
138137
*/
139138
public function testBuildInvalidData($value) {
139+
$this->assertFalse(defined('HHVM_VERSION') && !empty($value), 'Segfaults HHVM');
140140
Xml::build($value);
141141
}
142142

0 commit comments

Comments
 (0)