News for hackers. Stuff that matters.
Re:Epiphany, a RESTful micro PHP framework I wrote/use for m... by jacquesm on Friday December 10, 2010 @11:26AM (#1992118)
That was a lot of work!

I went down much the same route (though by the looks of it you've done a better job) and recently have decided to scrap the whole thing in favor of Yii, which I really hope is a good long term decision (always dicey).

What are your long term plans, is this a fire-and-forget thing or are you going to continue to maintain it and accept patches and so on ?

Is there a roadmap where you want to go with this ?

Re:Epiphany, a RESTful micro PHP framework I wrote/use for m... by jmathai on Friday December 10, 2010 @11:30AM (#1992132)
It was a lot of work :). I knew making it usable by others would be as much work as writing it in the first place.

It's definitely not fire and forget. I've been using it for over 4 years so I don't have any plans on ditching it. The main point of documenting it was so others would use it and I can improve on the library.

If you look at another one of my libraries on github (https://github.com/jmathai/twitter-async/issues) you'll see that there have been over 90 issues raised by others which I've resolved. It's what's made that library so solid - hoping for the same here.

Re:Epiphany, a RESTful micro PHP framework I wrote/use for m... by jacquesm on Friday December 10, 2010 @11:34AM (#1992144)
If I can find the time (fairly big if) I promise you that I will go through your code to see if I can either see things that you might improve or spot lurking bugs.

Funny, you're jmathai, I'm jmattheij !

Re:Epiphany, a RESTful micro PHP framework I wrote/use for m... by jmathai on Friday December 10, 2010 @11:52AM (#1992219)
Much appreciated. As far as a roadmap it'll probably continue to be what it's been. The next thing on the list are unit tests but otherwise it's whatever I or others using it feel the framework is missing (but wouldn't add bloat).
Re:Epiphany, a RESTful micro PHP framework I wrote/use for m... by checker on Friday December 10, 2010 @12:38PM (#1992405)
I'll admit I thought you were both the same person until this comment. Thanks for pointing it out.
Re:Epiphany, a RESTful micro PHP framework I wrote/use for m... by karanbhangui on Friday December 10, 2010 @01:46PM (#1992666)
I've never been a fan of using frameworks; I prefer putting libraries together so I have the greatest control over the entire stack. However recently I've been looking into: http://symfony-reloaded.org/

I have a lot of respect for the authors considering the other work they've done. Thanks for the lead on Yii, and OP: your stuff looks pretty good too!

Re:Epiphany, a RESTful micro PHP framework I wrote/use for m... by AlexMuir on Friday December 10, 2010 @12:13PM (#1992290)
You won't regret going the Yii route. I'm amazed that people are still coding the basics from the ground up when there are already top-notch frameworks out there.
Re:Epiphany, a RESTful micro PHP framework I wrote/use for m... by jmathai on Friday December 10, 2010 @12:29PM (#1992369)
I'll check out Yii but if it does code generation on your behalf like the other commenter suggests then it's probably not going to appeal to me.

The same could be said prior to Yii regarding building from the ground up. Yii shouldn't exist based on your own argument :).

Re:Epiphany, a RESTful micro PHP framework I wrote/use for m... by AlexMuir on Friday December 10, 2010 @01:00PM (#1992487)
That's true I guess - it's just more of a community thing rather than build-your-own. I think I've seen three new PHP frameworks pass across the HN front page this week alone. But each to their own.
Re:Epiphany, a RESTful micro PHP framework I wrote/use for m... by petervandijck on Friday December 10, 2010 @12:25PM (#1992345)
Yii's approach of "create db first, then we create heaps of code for you" doesn't appeal to me at all...
Re:Epiphany, a RESTful micro PHP framework I wrote/use for m... by gtcode on Friday December 10, 2010 @03:55PM (#1993141)
Yii has Gii, which is a code generator that can be customized. Thus, the heaps of code can be created to your liking.
Re:Epiphany, a RESTful micro PHP framework I wrote/use for m... by AlexMuir on Friday December 10, 2010 @01:02PM (#1992498)
Out of curiousity (and not snarky at all), what other approaches are there in the PHP world?
Re:Epiphany, a RESTful micro PHP framework I wrote/use for m... by jmathai on Friday December 10, 2010 @04:01PM (#1993163)
I guess I've never been interested in a framework building out classes based on my database tables so I'm not sure what the alternative approaches are. Is that what you meant?

If you prefer than then I do think the larger frameworks are a good fit. What I'm saying is that I don't prefer that :).

Re:Epiphany, a RESTful micro PHP framework I wrote/use for m... by AlexMuir on Friday December 10, 2010 @05:29PM (#1993443)
I've got you, but I'm wondering what your approach is? I'm stuck in a mindset where I work from creating a database to CRUD to functional code.
Re:Epiphany, a RESTful micro PHP framework I wrote/use for m... by jmathai on Friday December 10, 2010 @05:53PM (#1993525)
I write the CRUD statements but only as I need them. For a lot of my tables I never intend on deleting records so a delete method never gets written.

If I need to do a SELECT on a specific field(s) then I write that statement. It's usually a 4 line function in a class that deals primarily with that table (but not necessarily as it may make sense in a different class).

I use static functions for that as well.

   class User {
      public static function getByEmail($email) {
         return getDatabase()->one('SELECT * FROM user WHERE email=:email',
           array(':email' => $email));
      }
   }
I don't typically end up with so many of those that it's unmanageable and writing it takes about 30 seconds.

That's my approach. What's your thought on that coming from the mindset that a lot of that is taken care of by the framework? I'm curious since that's not a mindset I've had yet.