iterating though a cages variables

3 views
Skip to first unread message

matt

unread,
Jun 27, 2009, 2:30:00 PM6/27/09
to inspekt
I've run into a case where my app is getting a bunch of GET params and
I need to be able to iterate through all the caged GET params, but
that doesn't seem possible. I see that I could get crazy and access
Inspekt_Cage::_source, but that obviously isn't intended. Is their a
recommend way to accomplish this without having to specify the name of
each param?

Thanks,
Matt

Ed Finkler

unread,
Jun 27, 2009, 4:13:55 PM6/27/09
to ins...@googlegroups.com
Not really, but it sounds like something that should be considered.
Now that we're PHP5-only, we should be able to implement some sort of
iterable interface, I'd think. Do you have any thoughts on how to
accomplish this?

--
Ed Finkler
http://funkatron.com
Twitter:@funkatron
AIM: funka7ron
ICQ: 3922133
XMPP:funk...@gmail.com

matt

unread,
Jun 27, 2009, 5:19:51 PM6/27/09
to inspekt
I'm thinking making the cage's array-like by extending the ArrayObject
[0] class would make accessing and iterating pretty easy. What are
your thoughts?


[0] http://uk2.php.net/arrayobject



On Jun 27, 4:13 pm, Ed Finkler <funkat...@gmail.com> wrote:
> Not really, but it sounds like something that should be considered.
> Now that we're PHP5-only, we should be able to implement some sort of
> iterable interface, I'd think. Do you have any thoughts on how to
> accomplish this?
>
> --
> Ed Finklerhttp://funkatron.com
> Twitter:@funkatron
> AIM: funka7ron
> ICQ: 3922133
> XMPP:funkat...@gmail.com

Ed Finkler

unread,
Jun 27, 2009, 5:32:03 PM6/27/09
to ins...@googlegroups.com
It makes sense. I am not sure what all will be involved in refactoring
the Cage object, and we also need to make sure that we can't modify
the data inside the Cage object. I might ask someone smarter than me
to help with this 8)

--
Ed Finkler
http://funkatron.com
Twitter:@funkatron
AIM: funka7ron
ICQ: 3922133
XMPP:funk...@gmail.com

Alex Vargas

unread,
Jun 28, 2009, 4:30:38 PM6/28/09
to ins...@googlegroups.com
I am not smarter, but I would like to give it a shot :-p
--
Alex J P Vargas
Email: mailto:var...@gmail.com

Ed Finkler

unread,
Jun 28, 2009, 4:39:01 PM6/28/09
to ins...@googlegroups.com
go for it!

Matt McKeon

unread,
Jun 29, 2009, 8:43:32 AM6/29/09
to ins...@googlegroups.com
Ok, I started to get this working, but needs to be cleaned up. Weekend
got a little busy. Hoping to have some code ready for review tonight to
see what you think.

-Matt

Ed Finkler

unread,
Jun 29, 2009, 9:49:21 AM6/29/09
to ins...@googlegroups.com
word up, thx!

Matt McKeon

unread,
Jun 30, 2009, 12:26:30 AM6/30/09
to ins...@googlegroups.com
hey hey,

I branched the project on github and pushed my changes there. Is that
the best way? Anyway, you can see my changes here
<https://github.com/widox/inspekt/commit/6c79f20ba68567eee506ac2c423ed9b3f1d6f115>
I can email if preferred.

Now, I tested with the(some) examples that were already in there. I also
created another one showing looping through caged GET data.

So, if anyone has any suggestions/comments/changes/etc I'm more then
welcome to hear them. Hope this can be useful, if not as an idea starter.


Matt

Ed Finkler

unread,
Jun 30, 2009, 9:08:39 AM6/30/09
to ins...@googlegroups.com
Awesome. I believe you can send me a pull request on GitHub, but I
don't know that this is necessary -- I can just pull from your repo
without it. I'll look into it when I have a minute.

--
Ed Finkler
http://funkatron.com
Twitter:@funkatron
AIM: funka7ron
ICQ: 3922133
XMPP:funk...@gmail.com


Matt McKeon

unread,
Jun 30, 2009, 9:55:11 AM6/30/09
to ins...@googlegroups.com
Let me know if you'd like me to submit a pull request. I'm not all that
familiar with GitHub yet.

Thanks,
Matt

Ed Finkler

unread,
Jun 30, 2009, 10:01:31 AM6/30/09
to ins...@googlegroups.com
Why not? Let's get crazy.

-Ed
Reply all
Reply to author
Forward
0 new messages