[commits] Horde branch master updated. ccee2fce443d415f581d28707d90e4e6fde08984
Gunnar Wrobel
p at rdus.de
Mon Oct 18 12:49:40 UTC 2010
The branch "master" has been updated.
The following is a summary of the commits.
from: 1a670aa19e143666862165e67f730152933580b3
facaa53 Use setlocale. Catch errors when setting locale. Restore environment after test.
29bb2ac Added a mock translation handler and translation factories.
5c3e659 Updated package.xml (includes locale files). Made translation optional.
92f4437 Install files from the 'locale' directory.
ccee2fc It is no longer required to provide a dummy value here.
-----------------------------------------------------------------------
commit facaa53b69d3499289a445f083a8339f09d2878c
Author: Gunnar Wrobel <p at rdus.de>
Date: Mon Oct 18 07:06:13 2010 +0200
Use setlocale. Catch errors when setting locale. Restore environment after test.
For me the test didn't run without also calling setlocale(). Added
this based on the PHPUnit setLocale() call which resets to the
old locale after testing.
In case setting the locale fails the tests will be skipped.
I'm not certain how environment variables will be handled by PHPUnit
but to be on the safe side I rather reset them after the test.
framework/Translation/test/Horde/Translation/GettextTest.php | 30 +++++++++-
1 files changed, 27 insertions(+), 3 deletions(-)
http://git.horde.org/diff.php/framework/Translation/test/Horde/Translation/GettextTest.php?rt=horde-git&r1=1010e163600fb627ed1ce04fe81641b1ed325bc8&r2=facaa53b69d3499289a445f083a8339f09d2878c
-----------------------------------------------------------------------
commit 29bb2aca756f91a2be5c14d86a4c7239dd2b13d9
Author: Gunnar Wrobel <p at rdus.de>
Date: Mon Oct 18 14:36:17 2010 +0200
Added a mock translation handler and translation factories.
Creating new translation handlers within the classes that use
translated texts breaks the idea of dependency injection.
Providing such classes with a factory that delivers the
translation handler on demand seems to be more flexible to me.
Horde_Translation_Factory_Gettext also distinguishes between
repository checkout and installed PEAR package. In both
situations the locale directories are placed into different
locations.
framework/Translation/lib/Horde/Translation/Factory.php | 43 +++++
framework/Translation/lib/Horde/Translation/Factory/Gettext.php | 49 +++++
framework/Translation/lib/Horde/Translation/Factory/Mock.php | 46 +++++
framework/Translation/lib/Horde/Translation/Mock.php | 57 ++++++
framework/Translation/package.xml | 50 +++++-
framework/Translation/test/Horde/Translation/Autoload.php | 23 +++
framework/Translation/test/Horde/Translation/FactoryTest.php | 60 +++++++
framework/Translation/test/Horde/Translation/GettextTest.php | 5 +
framework/Translation/test/Horde/Translation/phpunit.xml | 8 +
9 files changed, 335 insertions(+), 6 deletions(-)
create mode 100644 framework/Translation/lib/Horde/Translation/Factory.php
create mode 100644 framework/Translation/lib/Horde/Translation/Factory/Gettext.php
create mode 100644 framework/Translation/lib/Horde/Translation/Factory/Mock.php
create mode 100644 framework/Translation/lib/Horde/Translation/Mock.php
create mode 100644 framework/Translation/test/Horde/Translation/Autoload.php
create mode 100644 framework/Translation/test/Horde/Translation/FactoryTest.php
create mode 100644 framework/Translation/test/Horde/Translation/phpunit.xml
http://git.horde.org/co.php/framework/Translation/lib/Horde/Translation/Factory.php?rt=horde-git&r=29bb2aca756f91a2be5c14d86a4c7239dd2b13d9
http://git.horde.org/co.php/framework/Translation/lib/Horde/Translation/Factory/Gettext.php?rt=horde-git&r=29bb2aca756f91a2be5c14d86a4c7239dd2b13d9
http://git.horde.org/co.php/framework/Translation/lib/Horde/Translation/Factory/Mock.php?rt=horde-git&r=29bb2aca756f91a2be5c14d86a4c7239dd2b13d9
http://git.horde.org/co.php/framework/Translation/lib/Horde/Translation/Mock.php?rt=horde-git&r=29bb2aca756f91a2be5c14d86a4c7239dd2b13d9
http://git.horde.org/diff.php/framework/Translation/package.xml?rt=horde-git&r1=767c95750d02360bfd40b9e71ce183338f7e4c33&r2=29bb2aca756f91a2be5c14d86a4c7239dd2b13d9
http://git.horde.org/co.php/framework/Translation/test/Horde/Translation/Autoload.php?rt=horde-git&r=29bb2aca756f91a2be5c14d86a4c7239dd2b13d9
http://git.horde.org/co.php/framework/Translation/test/Horde/Translation/FactoryTest.php?rt=horde-git&r=29bb2aca756f91a2be5c14d86a4c7239dd2b13d9
http://git.horde.org/diff.php/framework/Translation/test/Horde/Translation/GettextTest.php?rt=horde-git&r1=facaa53b69d3499289a445f083a8339f09d2878c&r2=29bb2aca756f91a2be5c14d86a4c7239dd2b13d9
http://git.horde.org/co.php/framework/Translation/test/Horde/Translation/phpunit.xml?rt=horde-git&r=29bb2aca756f91a2be5c14d86a4c7239dd2b13d9
-----------------------------------------------------------------------
commit 5c3e6593a08a30e19b0c6f8812a8ad448666c074
Author: Gunnar Wrobel <p at rdus.de>
Date: Mon Oct 18 14:46:47 2010 +0200
Updated package.xml (includes locale files). Made translation optional.
For Horde_Cli I think we should indeed allow to avoid using dependency
injection as that might be too much overhead in some cases. So calling
initTranslation() will try to create the translation factory in case
it exists and has not been provided to the init() call.
framework/Cli/lib/Horde/Cli.php | 80 ++++++++----
framework/Cli/package.xml | 278 +++++++++++++++++++++++++++++++++++++-
2 files changed, 327 insertions(+), 31 deletions(-)
http://git.horde.org/diff.php/framework/Cli/lib/Horde/Cli.php?rt=horde-git&r1=46d05567396378da8bd2c998ff5983a1222089de&r2=5c3e6593a08a30e19b0c6f8812a8ad448666c074
http://git.horde.org/diff.php/framework/Cli/package.xml?rt=horde-git&r1=53de040cfd47d9d163b96c225053b903990bc8eb&r2=5c3e6593a08a30e19b0c6f8812a8ad448666c074
-----------------------------------------------------------------------
commit 92f4437498b4751ab2d66d3d63ec2e34c78677a3
Author: Gunnar Wrobel <p at rdus.de>
Date: Mon Oct 18 14:47:11 2010 +0200
Install files from the 'locale' directory.
components/lib/Components/Pear/Package.php | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
http://git.horde.org/diff.php/components/lib/Components/Pear/Package.php?rt=horde-git&r1=10468cddca5650ef28120fd50610f8df4095ed64&r2=92f4437498b4751ab2d66d3d63ec2e34c78677a3
-----------------------------------------------------------------------
commit ccee2fce443d415f581d28707d90e4e6fde08984
Author: Gunnar Wrobel <p at rdus.de>
Date: Mon Oct 18 14:47:36 2010 +0200
It is no longer required to provide a dummy value here.
framework/bin/install_framework | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
http://git.horde.org/diff.php/framework/bin/install_framework?rt=horde-git&r1=75096304a1e5173cc8a7d0b753bf438f48a574cc&r2=ccee2fce443d415f581d28707d90e4e6fde08984
More information about the commits
mailing list