Claudiu Persoiu

Blog-ul lui Claudiu Persoiu

Archive for the ‘zend framework’ tag

Another year has passed and PHP 6 will not arrive

with 4 comments

Another year has passed and PHP 6 will not arrive.

Actually for the last couple of years I’ve been expecting PHP 6, and I believe this is more of a traditional blog for me to close the year.

PHP 6 will not come because the trunk was abandoned and rebuild from a 5.3.

Even if PHP 6 will not be out for a while now, PHP 5.3 is gaining popularity. Frameworks like Zend Framework and Symfony are each preparing in 2011 a 2.0 version that will need PHP 5.3+ to run. Even CodeIgniter, a framework that is was traditional PHP 4 compatible will need at least PHP 5.1.6 for version 2.0.

Even more, the official Zend certification for PHP is now ZCE 5.3, and it’s becoming very popular, even if it was released just few months back.

But a new year is ending and is time to check achievement from last year’s resolution and to write a new one.

Last year I’ve finished my masters, and with it I’ve finished way to many years to want to count of school. In fact this is the firs winter that I’m not in some form of school, maybe this is why I feel like I have so much free time :).

I’ve change my work place, and with it I was forced to use some things that were on my TODO list for quite some time:

  • Linux
  • Symfony Framework
  • Linux was a subject around I was gravitating inevitable for years, but never got to in to deep. It was always on my “todo” list, but never got the time or patience to really get into much detail with it, or didn’t have the continuity when I did it. When I got to my new work place I found my self in front of a Ubuntu computer, and I’ve started to panic a little.

    After few months I’ve made a new step, and for the first time in my life I went to a professional course. The course was organised by Info Academy. Paid from my own pocket and a little overlapped with my work hours. But I’ve reached the conclusion that I had to do it. Probably it does not sound like a big deal, but I usually study on my own, and it was quite weird for me. Now that is over I can say that it was a great investment and I recommend it (to all from Romania that can go to this centre).

    Sometime during that course I’ve realised that it was time to boot in linux from time to time even at home. The next step was to reconfigure the boot manager to boot directly to linux. Now that I’m almost exclusively use linux, I’ve reached the conclusion that is user friendly enough to be a real alternative to Windows.

    Symfony framework is another dusty entry on my “todo” list. Even if I’ve been playing around before with CodeIgniter and Zend Framework, I’ve never even got near to Symfony until last year. I’ve felt the fundamental difference of concept between ZF and Symfony. This was another reason to panic at my new work place, and after all: “all frameworks suck”.

    Is not a very easy to learn framework because of the concepts, but I thing it worth it. What I like most about this framework is the CRUD generating, that is very easy to do but is very powerful and flexible. Another thing is the use of YML files, which was taken from Ruby on Rails, is a way better alternative to the PHP’s native ini files.

    In the end, 2010 was a good year, with lot’s of achievements, even if I didn’t check everything on my last year’s resolution, I think I’ve checked enough.

    And now I wish you a great and full of achievements 2011! Happy new year!

    Written by Claudiu Persoiu

    31 December 2010 at 5:38 PM

    Posted in Diverse,PHP

    Tagged with , , , , ,

    Adobe AIR

    without comments

    Last week I was supposed to create a little project. Requirements were short: interoperability.Given the fact that I’ve never used Adobe AIR before, I thought it was a good opportunity to try it.

    The result was a small project management app. For the server-size I’ve used PHP + SOAP + Zend Framework, and for the client I’ve used Adobe AIR with JavaScript.

    I’ve created the server in a few lines:

    // autoload class for Zend Framework
    include 'Zend/Loader/Autoloader.php';
    // class that deals with SOAP requests
    include 'SOAP.class.php';
    // initialize autloader
    // if it's a request for the WSDL descriptor file
    if(isset($_GET['wsdl'])) {
     $autodiscover = new Zend_Soap_AutoDiscover();
    // if it's a SOAP request
    } else {
     $soap = new Zend_Soap_Server("http://localhost/soap/index.php?wsdl");

    The descriptor is build automatically using PHP Documenter type comments from the class that handles SOAP requests, if this case it’s named “test”.

    This was the easy part so I’ve moved on to the Adobe AIR client following this simple steps:

    • Download and install Aptana Studio
    • Install Adobe AIR plug-in
    • New project -> Adobe AIR
    • and voila! Coding can begin!

    Adobe AIR is using for a JavaScript engine Webkit. Sounds familiar? Webkit is used by Safari and Google Chrome. So the JavaScript code should only be compatible with Webkit!

    Of course there is a “but” and a plus. The “but” is that there are some restrictions, for instance “eval” can only be used to decode JSON, and the text introduced directly in an element (as text) can not be executed:

    div.innerHTML = "<a onclick=\"alert('ceva')\" href=\"#\">click</a>";

    This link will get to the element by will not run anything on “onclick” because the parameter was send as text.

    This was a pretty big disadvantage for me, but I’ve managed to figure out an alternative by building HTML elements using DOM and adding events using addEventListener.

    Briefly Adobe AIR is using this formula:

    Adobe AIR = (Webkit)Web Development - security + air framework.

    It seems very easy for a Web Developer to develop desktop apps with Adobe AIR.

    Of course is not very fast and it’s not looking like a good idea for complex apps. But if your thinking about medium and small apps, if I had to choose between Adobe AIR and PHP GTK for instance, the first option seems a lot more viable and easy to use!

    In the end the project was ready in less then 3 days and the graphics were gorgeous! It didn’t even look like it was build using only HTML and JavaScript!

    Written by Claudiu Persoiu

    6 November 2009 at 11:44 PM

    Generating .CHM manual for Zend Framework using HTML Help Workshop

    without comments

    If your like me you prefer manuals in CHM format.

    Unfortunately Zend Framework manual is only in .pdf and a little less obvious in HTML format.

    Fortunately generating a format CHM manual is easy(really, it is).

    The steps are:

    1. Download and install HTML Help Workshop.

    2. Download the Zend Framework manual in HTML format, the link is in bottom right, not very obvious I believe.

    3. Open HTML Help Workshop.

    4. File->Open and from the folder where the manual files are open htmlhelp.hhp

    5. File->Complile


    The compiled CHM manual is just few steps away!

    Written by Claudiu Persoiu

    9 August 2009 at 10:41 PM

    Zend framework certification

    without comments

    De putin timp Zend a lansat programul Zend Framework Certification. In cadrul programului de certificare, utilizatorul are la dispozitie manualul de referinta, ghidul de studiu, training si un voucher pentru examenul de certificare (si sa nu uitam un tricou foarte interesant 🙂 ).

    Avantajele certificarii sunt aceleasi ca si la ZCE in PHP5.

    Totusi fata de programul de certificare in PHP5, acest program are cateva lucruri diferite, cum ar fi:

    PHP5 Zend framework
    – este universal valabila pentru toti cei care fac programare in PHP5 – este folositoare doar celor care lucreaza cu… ZF
    – este universal – exista si alte frameworkuri
    – trecerea la alte versiune nu implica decat cunoasterea diferentelor – trecerea la alt framework greoaie

    Trecand peste aceste diferente, atitudinea Zend este una bine venita, pana la urma atrage dupa sine un standard pentru in frameworkuri. Problema este ca nu sunt universal valabile, pana la urma chiar daca nu toti folosim un framework de pe piata, avem tendinta sa ne construim propriul framework.

    Invatarea unui astfel de framework are totus avantajul de a oferi o noua perspectiva asupra lucrurilor, ne ajuta sa ne construm o imagine mai clara la ce trebuie sa ne asteptam de la frameworkul folosit. Pe de alta parte, un framework cum este Ruby on Rails a inspirat la randul lui multi programatori in modul cum un framework ar trebui construit, acesta avand echivalente in limbaje cum ar fi Java si evident PHP, fara ca multi dintre ei sa migreze la el. Si ce se intampla daca acum te certifici in el iar apoi te implici in proiecte care folosesc alte frameworkuri?

    Pana la urma aceasta este tendinta, asa cum programarea obiectuala a oferit o perspectiva noua pentru refolosire fata de programarea procedurala, asa un framework are tendinta sa aduca programarea orientata obiect la un alt nivel, sporind gradul de refolosire al codului. Dar… doar Zend Framework este solutia?

    Written by Claudiu Persoiu

    28 September 2008 at 10:51 AM

    Posted in Web stuff

    Tagged with , ,