SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Member
    Join Date
    Jan 2005
    Location
    Barcelona
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Akelos PHP Framework. Rails port to PHP

    This forum was the place were I started to learn about design patterns and lead me to buy the GoF, and Patterns of Enterprise Application Architecture books. Thanks to all the Sitepoint community.

    At that time I rolled my own MVC framework using Active Records and Action Controllers. This framework was similar to what is known today as Ruby on Rails, but I have to admit that David Heinemeier Active Record was superb, so I decided to port it to PHP and Akelos was born.

    Every time I wanted to solve a problem in Akelos I had a look into RoR and found an elegant solution which happened to be fun to port to PHP.

    It's been one year since I released the Akelos PHP Framework and it hasn't been until now that it is starting to catch the attention of those looking for the best PHP Framework for their projects, thanks to a version of the RoR screencast I made using Akelos.

    Right now the code is compatible with PHP4 and PHP5. Version 2.0. will include support for PHP6 (no PHP5 only version planned), namespaces and unicode.

    I would like to know your opinion about the Akelos Source code. Specially the Active Record Implementation.

    There are some hidden bits that you might also find interesting like the version of Markus Baker Lexer/Parser to create a Ruby to PHP converter for sharing view within Ruby and PHP.

    It would also be nice to hear about the features you find in Rails but miss on other PHP frameworks (Rails features not Ruby Language Features).

  2. #2
    SitePoint Addict Jasper Bekkers's Avatar
    Join Date
    May 2007
    Location
    The Netherlands
    Posts
    282
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Right now, you're just another RoR clone to me. I don't want to demotivate you, but how different is this from, say CodeIgniter, CakePHP or Canvas?
    Design patterns: trying to do Smalltalk in Java.
    I blog too, you know.

  3. #3
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    > It would also be nice to hear about the features you find in Rails but miss

    Trust me, I don't miss anything from PHP what RoR has to offer. I am not being negative, however for me on a personal level, part of the enjoyment of development is finding that you have to use your brain and design solutions to your pending problems.

    I actually get a kick out of discovering a new and better approach to something, that I had not thought off previously, and then the challenge of doing something with that discovery in a meaningful way.

    I use my own framework, however I will take a look at your framework at some point and I'll let you know what I think in an honest, if blunt (?) manner

    Glad you've enjoyed your time on Sitepoint, we aim to please...

  4. #4
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great work, bermi! I had only a quick look in svn, but it's very impressive.

    Can you please elaborate on how and where you use lexer/parser? Looks like an interesting idea.

  5. #5
    SitePoint Member
    Join Date
    Jan 2005
    Location
    Barcelona
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jasper Bekkers View Post
    Right now, you're just another RoR clone to me. I don't want to demotivate you, but how different is this from, say CodeIgniter, CakePHP or Canvas?
    Here is a guy that took the time to answer your question by using them and then giving his verdict about how they differ from Rails.

    Quote Originally Posted by Dr Livingston View Post
    Trust me, I don't miss anything from PHP what RoR has to offer.
    I just miss Ruby namespaces.

    Quote Originally Posted by Dr Livingston View Post
    I am not being negative, however for me on a personal level, part of the enjoyment of development is finding that you have to use your brain and design solutions to your pending problems.
    I agree with you, but it is also interesting to see how others have solved your same problems and learn from them.

    Akelos is not a line to line port. I first had a look at interface they used for the developer to access to a framework functionality. If I liked that interface I implemented unit tests for them to work like in the documentation. After that I had to use my brain as I never had before to make all the magic that the Ruby language enables on Rails happen again in PHP.

    Resuming, interfaces are similar, the underlying code differs a lot, plus there are many other features at Akelos that are not available at Rails (integrated image manipulation, internationalization...)

    Quote Originally Posted by Dr Livingston View Post
    ... discovering a new and better approach to something, that I had not thought off previously, and then the challenge of doing something with that discovery in a meaningful way.
    That's exactly how I felt when I read P of EAA. If I can solve problem in an elegant and efficient way using own brewed ideas Great!, but it is wise to observe and learn from others that have already been there.

  6. #6
    SitePoint Member
    Join Date
    Jan 2005
    Location
    Barcelona
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by stereofrog View Post
    Great work, bermi! I had only a quick look in svn, but it's very impressive.

    Can you please elaborate on how and where you use lexer/parser? Looks like an interesting idea.
    Thanks for the encouragement!.

    First of all I modified Markus Lexer in order to accept lookahead/behind regular expressions.

    Then I used it for creating Sintags, the template language that you can use at Akelos if you want to. You can have a look to the unit tests data files for for simple Sintags and Ruby to PHP Sintags. Those files show you the Sintags code and the PHP equivalence generated by the Lexer/Parser.

    Here is the Sintags Lexer, and the the Parser.

    I also made a JavaScript version of the parser for the WYMeditor project.
    You can see an implementation for generating valid XHTML and another one for configuring the editor via CSS conventions.

    You can also have a look to the DokuWiki Parser which is also derived from Markus work.

  7. #7
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    > After that I had to use my brain as I never had before to make all the magic that the
    > Ruby language enables on Rails happen again in PHP.



    One impressive thing about RoR is the scaffolding, in that a lot of the work is automated for you... For the most part at least you are left twiddling your thumbs

    But that isn't RoR magic as a lot of people are left thinking. Impressive as it may be, it can just as easily be done with any language. But I admit it's one thing that draws developers (and designers alike) to it.

    After looking at your podcast, your framework bestows that same magic as does RoR does when you watch those podcasts for the first time so maybe the magic is still there, in regards that it was RoR that kicked the whole thing off?

    > but it is wise to observe and learn from others that have already been there.

    True but I've found that in some cases it can depreciate your own thoughts, but just sometimes your left in awe in how someone managed to something amazing...

  8. #8
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bermi View Post
    T

    Then I used it for creating Sintags, the template language that you can use at Akelos if you want to.
    Thanks, I'll study that.

  9. #9
    SitePoint Guru
    Join Date
    Nov 2002
    Posts
    841
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is not your average "I had a couple free weekends so I made this framework" framework.

    I follow a lot of frameworks, both PHP and not PHP, after rooting around in SVN for a few minutes, I think this is one that I will add to my list to check up on.

    I do disagree with some of the design choices. I could not care less about php 4 support and I am not a fan of code generators where you modify (or even check in) the generated code. However, I understand that these choices do appeal to others.

    My next step in evaluating a framework is usually to run the sample applications. I didn't see any (yet) that I could download and run. I'll check back later.

  10. #10
    SitePoint Member
    Join Date
    Jan 2005
    Location
    Barcelona
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Selkirk View Post
    This is not your average "I had a couple free weekends so I made this framework" framework.
    It is not a weekend project. I've been working with this framework for the last three years.

    My next step in evaluating a framework is usually to run the sample applications. I didn't see any (yet) that I could download and run. I'll check back later.
    Check back in a couple of weeks. I'm Open Sourcing a CMS named Editam which is coded using Akelos and it is a mixture of RadianCMS and Drupal.

  11. #11
    PHP/Rails Developer Czaries's Avatar
    Join Date
    May 2004
    Location
    Central USA
    Posts
    806
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just looked at the code, and I have to say that I am quite impressed with what I saw. Keep pressing on - It's looking good so far!

  12. #12
    SitePoint Guru
    Join Date
    Nov 2002
    Posts
    841
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bermi, it shows that you've spent some time on it. That's what I meant. A lot of "look at my framework" posts are more like "look at what I did last weekend" posts. This is obviously different.

  13. #13
    SitePoint Evangelist tetsuo shima's Avatar
    Join Date
    Oct 2005
    Location
    Switzerland
    Posts
    597
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bermi:your code looks great, and you definitely did an impressive job.
    However, there are tons of frameworks out there, not to mention the Zend Framework that, I am pretty sure, will become the standard in the years to come. So I don't think your project will resist the pressure, even though it's a really good one.

    I am still waiting for people like you (motivated to bring new tools to the community) to focus on writing plug-ins and finding ways to use the major frameworks that are already on the market. Instead of writing new frameworks, even if they are great, I think the time has come to choose an existing framework and give it new features, options etc.

    The SEO Faq thread
    Dependency injection made easy: Phemto

  14. #14
    SitePoint Member
    Join Date
    Jan 2005
    Location
    Barcelona
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bermi:your code looks great, and you definitely did an impressive job.
    Thanks!

    However, there are tons of frameworks out there, not to mention the Zend Framework that, I am pretty sure, will become the standard in the years to come. So I don't think your project will resist the pressure, even though it's a really good one.
    Zend might become the standard Library, but they are missing the point that is making Rails so popular as a framework: it is easy, fun to use, based on conventions, selects the best behavior depending on the scenario so you don't need to repeat yourself and if you don't like the default options it is simple to set your own.

    I don't see any pressure on Akelos yet. More and more developers are using it for their real projects, and while it gets used it will keep evolving. We might not have the press that other frameworks do, but that has started to change this month as Akelos has been featured at Linux Format

    I am still waiting for people like you (motivated to bring new tools to the community) to focus on writing plug-ins and finding
    ways to use the major frameworks that are already on the market. Instead of writing new frameworks, even if they are great,
    I think the time has come to choose an existing framework and give it new features, options etc.

    I would have love to contribute to other PHP frameworks at the time I decided that I wanted a PHP framework that shared Rails vision -- note that I already had coded part of the framework before even knowing about Rails.
    Unfortunately all the other PHP Frameworks "in the market" were discussing design/license/theoretical issues rather than making the framework flexible, powerful and fun to use for the developer. My English level at that time was not that good for getting into design issues, but good enough for starting coding what I needed, whenever I need it for my projects. And I've decided to share it for others to enjoy it

    BTW, I do contribute to other projects where I share a vision with the core team like in the WYMeditor project an standard compliant What You MEAN is What You Get editor.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •