You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Object of class Zend\I18n\Translator\TextDomain could not be converted to string
Switching to another adapter (like memory) works fine, looks like this happens because Filesystem doesn’t do any serialization, just:
// Zend\Cache\Storage\Adapter\Filesystem::putFileContent()if (! is_string($data)) {
// Ensure we have a string$data = (string) $data;
}
I’m not sure if Translator should serialize the TextDomain object before storing it, or if this is more a bug in the cache adapter. Perhaps we should check whether the cache can indeed store objects by using $cache->getCapabilities(), and serialize it if not?
try installing zend-serializer and this configuration (i use a global config file for i18n in order to have language files inside a /path/to/app/lang dir, you can use a per-module config with getcwd() call replaced by __DIR__)
Switching to another adapter (like
memory
) works fine, looks like this happens becauseFilesystem
doesn’t do any serialization, just:I’m not sure if
Translator
should serialize theTextDomain
object before storing it, or if this is more a bug in the cache adapter. Perhaps we should check whether the cache can indeed store objects by using$cache->getCapabilities()
, and serialize it if not?Originally posted by @kinglozzer at zendframework/zend-i18n#44
The text was updated successfully, but these errors were encountered: