Skip to content
This repository was archived by the owner on May 16, 2018. It is now read-only.
This repository was archived by the owner on May 16, 2018. It is now read-only.

Zend_Locale_Data::disableCache(true) is always reset #363

@croensch

Description

@croensch

issue already filed as: http://framework.zend.com/issues/browse/ZF-11966

  • Patch could be applied _OR_
  • Manual should refer to Zend_Locale_Format::setOptions() instead

I am trying to get rid of the file cache in Zend_Locale_Data so i disabled it in my phpunit bootstrap. Upon closer inspection, i found out that simply creating a Zend_Date object from something invokes a chain of calls that ultimately leads to Zend_Locale_Format telling Zend_Locale_Data to set disableCache to false again.

_hacking Zend/Locale/Data.php:_

    /**
     * Disables the cache
     *
     * @param unknown_type $flag
     */
    public static function disableCache($flag)
    {
        self::$_cacheDisabled = (boolean) $flag;
        Zend_Debug::dump(self::$_cacheDisabled, __METHOD__);
        if (!self::$_cacheDisabled) {
            throw new Exception('ENABLED');
        }
    }

_yields output:_

D:\__project__\tests>phpunit --no-globals-backup
Zend_Locale_Data::disableCache
bool(true)

PHPUnit 3.7.32 by Sebastian Bergmann.

Configuration read from D:\__project__\tests\phpunit.xml

........................................I.IIIII.......E
Zend_Locale_Data::disableCache
bool(false)

...

There was 1 error:
1) _x_Test::test_y_
Exception: ENABLED

D:\_project_\library\Zend\Locale\Data.php:1565
D:\_project_\library\Zend\Locale\Format.php:155
D:\_project_\Zend\Locale\Format.php:774
D:\_project_\library\Zend\Locale\Format.php:1120
D:\_project_\library\Zend\Date.php:2629
D:\_project_\library\Zend\Date.php:1078
D:\_project_\soap_api_hgsdata\library\Zend\Date.php:197
D:\_project_\tests\application\services\_x_Test.php:639

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions