Explorar o código

[PHP-5.3-SUPPORT]
- Fixed Zend_Db_Statement_Mysqli usage of missing constant
- Fixed failing Zend_Layout tests

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@16942 44c647ce-9c0f-0410-b52a-842ac1e357ba

ralph %!s(int64=16) %!d(string=hai) anos
pai
achega
db0f0c8483

+ 1 - 1
library/Zend/Db/Adapter/Pdo/Mysql.php

@@ -90,7 +90,7 @@ class Zend_Db_Adapter_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Abstract
 
 
         if (!empty($this->_config['charset'])) {
         if (!empty($this->_config['charset'])) {
             $initCommand = "SET NAMES '" . $this->_config['charset'] . "'";
             $initCommand = "SET NAMES '" . $this->_config['charset'] . "'";
-            $this->_config['driver_options'][PDO::MYSQL_ATTR_INIT_COMMAND] = $initCommand;
+            $this->_config['driver_options'][1002] = $initCommand; // 1002 = PDO::MYSQL_ATTR_INIT_COMMAND
         }
         }
 
 
         parent::_connect();
         parent::_connect();

+ 5 - 3
library/Zend/Layout.php

@@ -174,9 +174,11 @@ class Zend_Layout
     {
     {
         if (null === self::$_mvcInstance) {
         if (null === self::$_mvcInstance) {
             self::$_mvcInstance = new self($options, true);
             self::$_mvcInstance = new self($options, true);
-        } elseif (is_string($options)) {
+        }
+        
+        if (is_string($options)) {
             self::$_mvcInstance->setLayoutPath($options);
             self::$_mvcInstance->setLayoutPath($options);
-        } else {
+        } elseif (is_array($options) || $options instanceof Zend_Config) {
             self::$_mvcInstance->setOptions($options);
             self::$_mvcInstance->setOptions($options);
         }
         }
 
 
@@ -222,7 +224,7 @@ class Zend_Layout
     /**
     /**
      * Set options en masse
      * Set options en masse
      * 
      * 
-     * @param  array $options 
+     * @param  array|Zend_Config $options 
      * @return void
      * @return void
      */
      */
     public function setOptions($options)
     public function setOptions($options)

+ 1 - 0
tests/Zend/Layout/LayoutTest.php

@@ -62,6 +62,7 @@ class Zend_Layout_LayoutTest extends PHPUnit_Framework_TestCase
      */
      */
     public function tearDown()
     public function tearDown()
     {
     {
+        Zend_Layout::resetMvcInstance();
     }
     }
 
 
     public function testDefaultLayoutStatusAtInitialization()
     public function testDefaultLayoutStatusAtInitialization()

+ 1 - 0
tests/Zend/Layout/PluginTest.php

@@ -61,6 +61,7 @@ class Zend_Layout_PluginTest extends PHPUnit_Framework_TestCase
      */
      */
     public function tearDown()
     public function tearDown()
     {
     {
+        Zend_Layout::resetMvcInstance();
     }
     }
 
 
     public function testConstructorWithLayoutObject()
     public function testConstructorWithLayoutObject()