Category: Various

PHP 5.4, Zend Framework 2, Zend Studio 9

A lot of things are moving in the PHP ecosystem, but it seems to me that those things are going a little bit out of control and I’ve a few philosophical questions…

PHP 5.4

Hey great, we’ve traits and a built-in web server. Hemmm what about the damn UTF8 support? It’s 2012 and still a substr can split a character in half! And I don’t think the whole world is still using ANSI or ISO-8859, everyone now uses UTF8 and working with UTF8 inside PHP is always a pain. Traits and that web server were really more important?

At least we’ve a useful new feature: array dereferencing, something python had since maybe 10 years (along with the utf8 support…). I’m not telling python is better otherwise I won’t be using 99% PHP since 12 years.

Zend Framework 2

I hated pretty much every MVC framework out there but ZF is really much more than just an MVC framework (also if not so many people can see that). I used its MVC only a little so I won’t talk about that but I loved the entire ZF1 project, it was just perfect, really easy to use, simple code so the documentation is something useless and it was also really easy to include a single element in your project. That was great and it’s ended.

ZF2 is surely a great software but the devs seems not to remember that PHP was born with simplicity in mind and ZF2 is millions light years beyond simplicity:

  • you won’t ever be able to use a single component (let’s say you just want to use zend\db) without having to deal with the autoloader
  • today we’ve ZF2 beta3, I always knew that “beta” meant ”API freeze” and instead from beta2 to beta3 something like EVERYTHING changed! I was writing some code using Zend\Db and I had to throw it all in the garbage because Zend\Db was completely rewritten for beta3. This make me think of a pre-alpha, not a beta.
  • ZF2 is a complete rewrite of ZF1 and thus I bet it will be a hell of bugs for a long long time, in fact I just started using it in real life and I found 2 blocking bugs (blocking for me obvious), one about Zend\Db (unable not to quote values) and one about Zend\Locale (unable to get territory list), both were perfectly working in ZF1
  • ZF bug tracker is like the most silent western movie, you can’t ever hear a voice, that’s just a bit disappointing
  • ZF2 code is so complex that it’s nearly impossible to go through it just to find how a method works so if there won’t be a really great documentation it will really end in a developing pain

Keeping in mind all of the above, would you go back to ZF1 for your new project knowing that in 18 months you’ll have to completely rewrite everything ’cause ZF1 will be out of support? The answer is no but we’re stuck in a limbo.

And a question for the developers, do you really think that pushing things so high about complexity is a good thing for the success of ZF? I’m not so sure about that. ZF1 could be used by every junior dev out there, I wouldn’t say that for ZF2.

Zend Studio 9

At the moment Zend Studio is IHMO the most updated (9.0.2 already supports PHP 5.4) and feature rich PHP IDE but I still can’t understand if the devs are actually using it, just a few examples:

  • Most of the time I’m on ZS it compiles, indexes and refreshes the workspace, completely eating my cpu and sometimes preventing me from saving a file until the indexing process is finished.
  • GIT is widely used now that really big PHP projects are all over the world (anyone said Magento?) but the GIT plugin for ZS is incomplete and caused me some big problem in the testing phase. One feature missing is the support for GIT submodule, but there is not a single project I’ve ever worked on that didn’t have submodule => I’ve to use an external GIT client and this really bothers me

Probably those problems are Eclipse’s problems but that’s not the point.

Conclusions

It’s a long way to the top…

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine

“Magento 1.4 Themes Design Cookbook” review

As I wrote a few days ago, I was asked to review the Magento 1.4 Development Cookbook by Packt so I took the right time to read it deeply and with great attention to point out every pro and con of this mid-length book (249 pages).

First of all the book is available at a price of ~40 USD (~31 EUR) if you want the paper book, or ~32 USD (~25 EUR) for the digital copy (in PDF format), the price is right (maybe just a little high) for a highly technical book like this. You’ll also receive a comprehensive archive of all the code that’s used in the book, really useful for a quick cut&paste to try out things!

Now, I’ve to say that Magento 1.6 is near to be released and still we’ve no book about 1.5, and also if 1.4 documentation is still valid I think that it would be the time to update all the books on the new releases.

Chapter 1: I think it’s completely useless unless for the section about the differences between 1.3 and 1.4, in this moment every designer about to design and/or code a Magento themes already know what can be done and surely has seen enough themes in the wild so I think that we don’t need an introduction or a showcase.

Chapter 2: this is one of my preferred chapters, ok it’s not so difficult but it explains all the basic concept and it’s really needed for the first timers. I think this chapter should have been the first one but anyway it’s great.

Chapter 3: probably it could be merged with the 2nd ’cause it keeps talking about the basic things you need to know when you’re about to start working on a Magento themes, useful but anyway I think none needs a “where do I get inspiration for a favicon” section. The “display products on the homepage” section is instead really useful and raises the level of this chapter.

Chapter 4: first real steps into customizing a default Magento theme to fit your design, with some more basic hits (like enabling template path hints and block names hints) and some detailed info about CMS pages (which actually area managed pretty bad in Magento).

Chapter 5: creating a theme from scratch, pretty advanced things are going on here :) and that’s the kind of things I like the most.

Chapter 6: starts with a useless section about integrating font-face into a Magento theme, actually I don’t understand why this kind of info should be in a Magento book, it should have been in a HTML/CSS one… but finishes with some pretty handy documentation about “navigation” and the “product view” template.

Chapter 7: the part I liked the most about this chapter is about creating a custom block and using it in a layout xml file, other things (adding javascripts or stylesheets) are a little too basic at this point.

Chapter 8: talks about mail templates, pretty basic stuff in the beginning, getting interesting later with variables in emails and a good section about how to integrate external newsletter systems and another one on upgrade-proof email templates.

Chapter 9: integrating social stuff, absolutely basic notions about copying facebook’s html widgets and paste it in your templates…

Chapter 10: print styles, once again I think that this topic should be covered in a HTML/CSS guide.

Conclusions: if you never wrote a Magento theme buy this book, it will help you in a lot of ways. The second time you’ll have to do the same work again… you won’t need it.

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine

What a great monitor for Sony Vaio VPCF11Z1E (i7, 8GB RAM, bluray burner)!

The title is obviously rhetorical, let me explain.

First a bit of introduction, this is an hi-end pc, it has an i7 processor, 8GB RAM, blu ray burner and a 1080p (1920×1080) LCD panel, there are no excuses, this is a quite expensive machine and must be perfect!

I bought the notebook a few months ago and I had troubles with the LCD panel since the first day, at the beginning it had a darker section (~5mm) on all the bottom part of the panel. That’s really annoying. I sent the notebook back to sony 2 times (more than 2 weeks without the newly bought PC):

  • first time the wrote me “ok we replaced your panel”: it simply was not true (IMHO)
  • second time they told me “hey your monitor is perfect, this is our standard”

WHAT??? I see a lot of notebooks every day where I work and in the stores, none has this kind of problems (neither the sony’s). I always heard that SONY LCD were just great, one of the best and instead I’ve the ugliest monitor I ever had!!! In the past I had a few DELL pcs (I know, I did a big mistake chosing SONY against DELL).

Now the problem gets worse, just look at the pictures:

Is this the SONY LCD top quality? ahahhaha just don’t make me laugh!
Actually I’ve to say that the situation shown in the pictures above happens only sometimes (apparently randomly), all other time the problem is less serious but anyway… what if it completely break right after the warranty expiration?

Another great feature of this top class LCD panel is that if you turn down the brightness level to the minimum, half the screen slowly turns off (and then it bounces on and off forever), don’t you believe me? Here you have:
If you want to see it in action check this movie clip.

There’s one more problem, the leather inserts are falling apart, take a look at this picture:

I’ll try to send the notebook to SONY another time (and this is a problem for me ’cause I work with this machine!), will they understand that it has a problem? I’ll keep you updated.

UPDATE: sony changed the motherboard and the leather part, everything not related to the monitor which still have the same problems!!!

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine

“Magento 1.4 Development Cookbook” review

As I wrote a few days ago, I was asked to review the Magento 1.4 Development Cookbook by Packt so I took the right time to read it deeply and with great attention to point out every pro and con of this mid-length book (249 pages).

First of all the book is available at a price of ~40 USD (~31 EUR) if you want the paper book, or ~30 USD (~23 EUR) for the digital copy (in PDF format), the price is right (maybe just a little high) for a highly technical book like this. You’ll also receive a comprehensive archive of all the code that’s used in the book, really useful for a quick cut&paste to try out things!

I’ve to say that I found the first chapter (getting started) not so useful, if I’m a developer and I’m creating a project based on Magento I think I’ve to be able to download and install the software itself, otherwise it should be better if I call another dev with a little more experience… anyway this is just an introduction so don’t worry and keep reading.

Chapter 2 talks about coding some CMS/design functionalities like changing page titles, customizing Magento’s error page, integrating an image rotator and so on. Things are starting to roar in this chapter which will give you some practical examples, definitively useful but please, we would need some more doc about the XML layout files (how they’re used by the system, how they work and what are all their sections).

Chapter 3 is about adding some functionalities like javascript libraries or integrating a WordPress blog. Actually I think this chapter could be a part of the 2nd one, it’s really good for the JS part but it would have needed a lot more details about the WordPress integration, anyway this could be really huge (just think about calling part of the Magento’s theme to render the header and footer of the blog) so this should be considered an overview of a complex task you’ll need to study and experiment on your own.

In the 4th chapter you’ll start looking at store customizations (modify the subscription procedure or creating a featured product shown in home page) and you’ll start to use the great Magento Connect, which is something you absolutely need to know but we can find something not too useful like changing the admin theme plus something that is more admin oriented like creating price rules (which actually is not a developer task IMHO).

Chapter 5 will guide you learning some functional concepts of Magento that you have to know in order to know what you’re doing when developing, like tablerates, adding products to cart with custom querystrings. I din’t like the “add a youtube video to a product” ’cause it’s an admin task or otherwise if should be done differently (adding a custom field to the product data structure and so on).

Chapter from 6 to 12 are for experts and that’s what I like, surely this is the most useful part of the book and that’s why I’m not going to talk about it deeply, things like preventing CSRF attacks, understanding SEO, setting a MySQL master-slave environment, creating a module using the module creator extension and extending it to create a custom shipping method, optimize Magento’s performance and debugging while developign are really great chapters! I din’t like chapter 10 (creating a social widget) too much but it’s a good theory to read anyway.

Conclusions
My personal vote for this book is 7.5/10, it is really good and it deserves to be in your library (especially if you’re not full time dedicated to Magento development), it has practical examples, you’ll get your hands dirty and this is what a developer has to do but this will not be the only book you’ll need about Magento, also because Magento itself is a huge project that’s hard to document in a single book.
I didn’t vote it a 10/10 because I think that some contents could be grouped in different ways (eg: moving things from a chapter to another), because a few things are not too developer-oriented and because it could be longer.

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine

Open Source VMware PHP API experiment

I think this post is not useful anymore, now that VMware release their first PHP API for vCloud, anyway I’ve this little code I wrote as an experiment a few months ago that maybe could be used by someone having an old vCloud (the code you’ll see is wrote to work with VMware’s vCloud 2.5) or maybe who needs a simpler implementation.

I only wrote a few methods:

  • login to the VMware server
  • get info about all VMs
  • get info about a single VM
  • create a new VM setting the RAM amount, CPUs number, disk capacity
  • a useful methods that waits till a task (like a VM creation) is completed

The code you’ll download uses the old nusoap library and directly sends the raw XML to the server ’cause no other SOAP libraries/implementations were working at that time and for the time the experiment lived (I never used vCloud systems and I worked on this project less than a couple of days so…).

Here you have a set of sample calls to the library:

require “vim25.php”;
$vim25 = new vim25(“ip-address-of-the-vcloud-server”, “username”, “password”);

$service_content = $vim25->retrieveServiceContent();
$all_vm_info = $vim25->getAllVMInfo($service_content["rootFolder"], VIM25_SUB_INFO_ALL);
$vm_info = $vim25->getVMInfo(“vm-16″, VIM25_SUB_INFO_GUEST);

$debug = $vim25->createVM(
“vm name”,
“group-id”,
“guest-id”,
“resgroup-id”,
“host-id”,
2, // num CPU
512, // RAM
10485760 // disk capacity in kB (10GB)
);

print_r($debug);

If you want to give a try to the code:

  • download the library code
  • rename to vim25.php
  • download and install nusoap in the “nusoap” folder (at the same level of the vim25.php file)
  • use the code above to script the vim25 class
  • extend it and use it :-)

This work is public domain thus do whatever you want with it and enjoy.

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine

Old blog deleted

Once I had a blog on wordpress.com, when I moved to my own domain I kept the old site alive just as as an old things archive (everything was imported in this new blog anyway so nothing is lost).

Starting today fabrizioballiano.wordpress.com is not available anymore, it simply did not make sense anymore.
Have a great weekend everybody.

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine

The Dark Knight

I’m not a Batman fan (actually I’m not fan of any superhero movie…) but I read a lot of good reviews of the last Batman movie (The Dark Night) that I decided to go watch it.

(picture by wikipedia)

One word: AWESOME. I found it amazing, dark, powerful, evil as I was expecting after reading the title! No words for Heath Ledger’s joker, it’s unbelievable in every scene, may him rest in peace…

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine

New Lancia Delta website… the inverted scrollbar syndrome

I was browsing the new Lancia Delta website, selecting my language, clicking on “enter the website”, skipping the intro and clicking on the “discover” link (I can’t provide a direct link ’cause it’s all flash).

Here I found a weird behavior, try using the scrollbar on the right and you’ll find it by yourself: the scrollbar is working in the opposite way every scrollbar in world works.

Why should a web designer invert the scrollbar behavior? Maybe I can’t understand ’cause I’m not all that creative?

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine

How can firefox 3 reach the guinnes world record…

… if the servers are down?

UPDATE: mozilla.com is up now but pointing to a strange release candidate page (showing 2.0 releases + some 3.0 rc3).

UPDATE 2: mozilla.com is down again (Http/1.1 Service Unavailable).

UPDATE 3: yeah, firefox 3 is out, really :-)

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine

Tango icons…

do no have the “window-close” icon, if I was a designer I would create that by myself.

I’m looking at many icon themes in these days and none is complete, all inherit from gnome default (which is released under gpl thus it’s not usable in many cases).

I think that there’s too much mess in the floss artwork between incomplete works and incompatibilities between licenses.

UPDATE: Jakub Szypulka created the icon window-close icon, I hope his artwork will be uploaded to the official tango icons theme (otherwise none would be able to find it and licensing would be a mess). I want to thank him here also if we found that CC and GPL are not compatible thus we cannot bundle tango icons within P4A :-(

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine