Skip to content

Commit

Permalink
More fixes to avoid segfaults in hhvm
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Feb 13, 2014
1 parent 65048bd commit ec01556
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Cache/Engine/RedisEngine.php
Expand Up @@ -237,7 +237,7 @@ public function clearGroup($group) {
* Disconnects from the redis server
*/
public function __destruct() {
if (!$this->_config['persistent']) {
if (empty($this->_config['persistent']) && $this->_Redis instanceof \Redis) {
$this->_Redis->close();
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Cache/Engine/MemcachedEngineTest.php
Expand Up @@ -656,7 +656,7 @@ public function testConfigurationConflict() {
* @return void
*/
public function testClear() {
$this->assertFalse(defined('HHVM_VERSION'), 'Remove me when travis updates hhvm to 2.5');
$this->assertFalse(defined('HHVM_VERSION'), 'Crashes HHVM');
Cache::config('memcached2', array(
'engine' => 'Memcached',
'prefix' => 'cake2_',
Expand Down
1 change: 1 addition & 0 deletions tests/TestCase/Cache/Engine/RedisEngineTest.php
Expand Up @@ -33,6 +33,7 @@ class RedisEngineTest extends TestCase {
* @return void
*/
public function setUp() {
$this->assertFalse(defined('HHVM_VERSION'), 'Crashes HHVM');
parent::setUp();
$this->skipIf(!class_exists('Redis'), 'Redis is not installed or configured properly.');

Expand Down
1 change: 1 addition & 0 deletions tests/TestCase/Network/SocketTest.php
Expand Up @@ -242,6 +242,7 @@ public function testReset() {
*/
public function testEnableCryptoSocketExceptionNoSsl() {
$this->skipIf(!extension_loaded('openssl'), 'OpenSSL is not enabled cannot test SSL.');
$this->assertFalse(defined('HHVM_VERSION'), 'Broken on HHVM');
$configNoSslOrTls = array('host' => 'localhost', 'port' => 80, 'timeout' => 0.1);

// testing exception on no ssl socket server for ssl and tls methods
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Utility/XmlTest.php
Expand Up @@ -47,7 +47,6 @@ class XmlTest extends TestCase {
* @return void
*/
public function setUp() {
$this->assertFalse(defined('HHVM_VERSION'), 'Causes segfault on HHVM');
parent::setUp();
$this->_appEncoding = Configure::read('App.encoding');
Configure::write('App.encoding', 'UTF-8');
Expand Down Expand Up @@ -137,6 +136,7 @@ public static function invalidDataProvider() {
* @return void
*/
public function testBuildInvalidData($value) {
$this->assertFalse(defined('HHVM_VERSION') && !empty($value), 'Segfaults HHVM');
Xml::build($value);
}

Expand Down

0 comments on commit ec01556

Please sign in to comment.