Re: [fw-general] NumberFormat filter always returns a string?

2013-05-16 Thread Andreas Möller
return str_replace("\xC2\xA0", ' ', $result);

Always returns a string. 

Re: [fw-general] NumberFormat filter always returns a string?

2013-05-16 Thread Andreas Möller

> Did you already check 
> https://github.com/zendframework/zf2/blob/master/tests/ZendTest/I18n/Filter/NumberFormatTest.php
>  ?

That's where I looked in the first place and figured from the second test and 
the data provider, that when a parseable string is passed, a float should be 
returned. 

Since I haven't gotten around to running the tests for only the filter 
components, I mimicked the test by using the data from the provider and the 
code from the test and var_dump'ing the raw and filtered data. I'm getting 
strings returned. 

Unless parsing failed and the raw value is returned, everything is returned as 
a string from filter() as str_replace() is run on the result. 


Best regards,

Andreas


Re: [fw-general] NumberFormat filter always returns a string?

2013-05-16 Thread Marco Pivetta
Did you already check
https://github.com/zendframework/zf2/blob/master/tests/ZendTest/I18n/Filter/NumberFormatTest.php?

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/


On 16 May 2013 18:51, Andreas Möller  wrote:

> Is it just me, or does the NumberFormat filter almost always return a
> string, even if a string was passed to it that could successfully parsed?
>
>
> Best regards,
>
> Andreas
> --
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
>
>
>


[fw-general] NumberFormat filter always returns a string?

2013-05-16 Thread Andreas Möller
Is it just me, or does the NumberFormat filter almost always return a string, 
even if a string was passed to it that could successfully parsed?


Best regards,

Andreas
--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




Re: [fw-general] Modules, the EventManager, and the SharedEventManager

2013-05-16 Thread Jeremiah Small
On May 16, 2013, at 12:32 AM, Marco Pivetta wrote:

> Hey Jeremiah!
> 
> I was wondering what the best format would be to have this both editable and 
> still included in the docs.
> 
> I was looking into YUML ( http://yuml.me/ ), which I already use for 
> DoctrineORMModule and OcraServiceManager, but if I recall this correctly, 
> there's legal issues in hotlinking YUML in the docs, and it's also not well 
> suited for process flow diagrams.
> 
> If someone has a better tool that generates a graph that is maintainable by 
> others too, I can move that document to the official ZF2 documentation :)


http://www.gliffy.com is pretty good, but I'm not sure if they have any kind of 
free license for open source projects.

And then of course there's the existing Google Doc that Evan created. That one 
is already "wiki" style editing.

Jeremiah

Re: [fw-general] template names with dots in name aren't possible after Update to ZF2 2.2

2013-05-16 Thread Matthew Weier O'Phinney
On Wed, May 15, 2013 at 3:48 PM, guenterh  wrote:
> Hi
>
> some files I'm using for layout and / or templates contain dots in their
> name like
> layout/layout.home.phtml
> or
> facet.basic.html
>
> After updating to the latest version of ZF2 (2.2) these files are no longer
> resolved by TemplatePathStack
>
> The error occurs here
> $file = new SplFileInfo($path . $name);
> if ($file->isReadable())
>
> in the resolve method.
>
> For me it's strange because - if I'm not wrong - SplFileInfo type should be
> from standard PHP and not the ZF2 framework itself
> (sorry I'm not really experienced with PHP) and I didn't updated my PHP
> infrastructure (PHP 5.3.3 on CentOS) in between
>
> When I change the name to something like
> layout/layouthome.phtml
> they can be resolved.
>
> Same result (error doesn't occur) when I'm going to switch back to another
> branch running a former version of ZF2

This is very odd; literally the only change in 2.2 (and I think it was
in 2.1.5 as well) was this one:
https://github.com/zendframework/zf2/pull/3996

In looking at your examples, one thing leaps to mind: the template
names typically should not have a suffix applied, as the resolver will
add that for you. Have you tried using just the names
"layout/layouthome", "facet.basic", etc?

--
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

-- 
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




Re: [fw-general] Modules, the EventManager, and the SharedEventManager

2013-05-16 Thread Marco Pivetta
Hey Jeremiah!

I was wondering what the best format would be to have this both editable
and still included in the docs.

I was looking into YUML ( http://yuml.me/ ), which I already use for
DoctrineORMModule and OcraServiceManager, but if I recall this correctly,
there's legal issues in hotlinking YUML in the docs, and it's also not well
suited for process flow diagrams.

If someone has a better tool that generates a graph that is maintainable by
others too, I can move that document to the official ZF2 documentation :)

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/


On 16 May 2013 06:50, Jeremiah Small  wrote:

> I wish I could, but I don't have the expertise to update it, and the
> version I know of is out of date, last I was told :-(
>
>
> https://docs.google.com/drawings/d/1OwFfjgaiXDuKmS2I8nnJNFqoDgEWNNB-_-tUXUPVrgQ/view?pli=1
>
> Does anyone know if it's been updated, and/or could someone who knows the
> details intimately help out Evan and update it?
>
> Or, does anyone know of a different version that is up to date and
> available on the web? I saw a pdf by Martin Keckeis last December, but not
> sure where to get that or who updates it. Seems like having it be "blessed"
> and in the docs will make it more official
>
> On May 15, 2013, at 4:57 PM, Marco Pivetta wrote:
>
> @Jeremiah you can fetch it and add it to the documentation yourself ;)
>
> Marco Pivetta
>
> http://twitter.com/Ocramius
>
> http://ocramius.github.com/
>
>
> On 15 May 2013 18:33, Jeremiah Small  wrote:
>
>> This is a very useful post.
>>
>> Is the application flow map that Evan Coury created as a Google Doc going
>> to get updated and folded into the documentation?
>>
>> I found that very useful, but it fell out of date in the beta rounds. It
>> would be a great addition to the docs, because it's very hard to know what
>> events will fire when without it.
>>
>> Jeremiah
>>
>> On May 13, 2013, at 4:40 AM, Matthew Weier O'Phinney wrote:
>>
>> > On Mon, May 13, 2013 at 12:20 AM, David Muir 
>> wrote:
>> >> On 10/05/13 23:11, Michael Gooden wrote:
>> >>> It should not be firing twice, however you are trying to use the
>> shared
>> >>> event manager the wrong way.
>> >>>
>> >>> If you want to have a listener fire for EVERY dispatch ever, then just
>> >>> attach to normal event manager on EVENT_DISPATCH in one place. If you
>> attach
>> >>> it in the MyModule it will still fire when you access a controller in
>> the
>> >>> Application module. Is that what you need?
>> >>
>> >>
>> >> It was more as an experiment to see what would happen. I was more
>> confused
>> >> by different tutorials showing listeners being attached to the
>> EventManager
>> >> and the SharedEventManager without explaining why one should be used
>> over
>> >> the other.
>> >>
>> >> As for firing twice, I agree, that shouldn't be happening, but
>> >> Zend\Mvc\Application.php triggers MvcEvent::EVENT_DISPATCH on line 309
>> and
>> >> Zend\Mvc\Controller\AbstractController triggers it on line 115.
>> >> In my opinion this is a bug, and those should be two separate events,
>> but
>> >> there's probably not much that can be done about it now without
>> breaking BC.
>> >
>> > They *ARE* two separate events, that simply happen to be named the same.
>> >
>> > What do I mean?
>> >
>> > Each object composes its own EventManager instance. This is not
>> > shared, and the fact that the instance is not shared is purposeful:
>> > it's to allow each object to trigger isolated events, as well as to
>> > prevent naming collisions. This latter is important -- you can have
>> > the same event name in multiple objects, but they will not trigger the
>> > same listeners due to the fact that the EM instances are separate.
>> >
>> > If you want a listener to trigger for the same event name on different
>> > objects, you have two choices:
>> >
>> > - attach to each object's EM instance separately
>> > - attach to the SharedEventManager, specifying identifiers for each
>> object
>> >
>> > The SharedEventManager is a shared container passed to all EM
>> > instances that were originally pulled from the ServiceManager. This
>> > object allows listeners to attach to events on objects with specific
>> > identifiers; when an event is triggered, the event manager will query
>> > the SharedEventManager to see if it has any listeners on identifiers
>> > it is interested in that correspond to the current event; if so, it
>> > will trigger those, too.
>> >
>> > This explains your original question:
>> >
>> >> Can someone explain why the shared event listener attached via the
>> Application module never gets called?
>> >
>> > When you attached to the SharedEventManager, you were attaching the
>> > the identifier "Application", which will only get triggered by an
>> > object that has the identifier "Application" -- most likely, this will
>> > be a controller, as the default controller implementations will add
>> > their top-level namespace as an event identifier.
>> > (Zend\Mv