Posts Tagged php
Review of the Apostrophe CMS for symfony
Posted by Avi in Programming on April 21st, 2010
I know I gave my blessing before to diem, and I’ll still admit that it is a very good CMS. However, it has always bothered me a little bit just how invasive this CMS is. While it bills itself as a symfony plugin, it is in truth anything but. You must start out using diem, and then add a little symfony in when you need it.
I was reading, recently, a post on the sympal blog. In this post, Ryan Weaver echoed my latent feelings that a CMS should empower your site with CMS capabilities, but should not take it over completely. In other words, the perfect medium would be in the form of a plugin for symfony 1.x, or bundle perhaps for Symfony 2.x.
There was a comment put in there by somebody from the apostrophe team, which made me realize that, apostrophe was perhaps already meeting this goal. Seeing as I needed to pick a new CMS for an upcoming project, I thought I’d take it for a spin. Read the rest of this entry »
The end of the PHP vs Template language debate?
Posted by Avi in Programming on February 10th, 2010
For years there has been a ferocious debate about whether it is better to abstract away HTML creation with PHP by using a template language, or whether we should stick with PHP itself as the template language. I always thought the best way to go was a with a hybrid. A templating language which resembles XML, sort of like what you get with JSTL. There have been some attempts , which have been pretty good. Facebook, however, just took this one step further, and integrated XML into PHP with XHP. This is sort of reminicient of XML Literals in VB. They have released the code on github already. The best part about it is that every XML element is represented by a class, leaving room to create sophisticated widgets out of XML tags!
CQRS (Command and Query Responsibility Segregation) in PHP
Posted by Avi in Programming on December 10th, 2009
It always seems to me that the PHP world is one step behind the current trends in the “enterprise world”. For example, Rails popularized the “ActiveRecord” pattern a few years ago. Ever since then, there has been an explosion of ActiveRecord implementations in PHP. Many even mistakenly refer to them as an “ORM”, but I won’t beat a dead horse here. ActiveRecord is great for your basic run-of-the-mill address book/cookbook/blog type of app, where it basically data driven, and there’s not much “business logic” to go around. For the majority of PHP applications out there, these tools are a god send.
As PHP matures, especially the object model, advanced developers have started to realize the limits of this pattern. Now the big rage is the DataMapper pattern, and DDD. We try to separate out the domain of application, and the holy grail is now transparent persistence. With great tools like Doctrine 2.0 and Object_Freezer, both of which are only possible with the new additions in PHP 5.3, these dreams are becoming a reality.
Read the rest of this entry »
Templatizer
Posted by Avi in Programming on May 19th, 2009
I released an extension the other day for EE. You can find it here.
The basic idea is that creating templates in Expression Engine, especially if you don’t plan to edit them from the CP, can sometimes be a little repetitive and annoying.
Normally with EE, the templates are stored in the database, and you have the option of also storing them on the filesystem. But in order for them to be recognized by EE, they must reside in the database at least.
Using this extension, you can start your template off as a physical file, and the first time you view it in the browser, it will automatically be recognized by EE and inserted into the database!
ACL in Zend Framework
Posted by Avi in Programming on March 19th, 2009
When I first started using the Zend Framework, one of the most confusing things was the ACL component. Even after I succesfully implemented an ACL solution in my app, something seemed wrong with it.
I would like to argue that the proper use for the Zend ACL is actually impossible, since there is a reported bug in the code which, to my knowledge, has not been fixed.
The use case I will discuss is where you want to only authors to edit articles and only to articles authored by themselves. I think this is a fairly common case.
Read the rest of this entry »
Presenting a list of Timezones to the user
Posted by Avi in Programming on March 12th, 2009
I first got into timezones when I working on an calendar app which displayed various times of day which are pertinent to Jewish daily life. The app would display calculated times which of course would differ based on the timezone of the given location. As I investigated into timezones, I found them to be fairly complicated. Not all timezones are even on the hour…some are at 30 minute offsets, some at 45 minutes, and historically there have been even stranger offsets than that.
To make matters worse, there’s the whole issue of Daylight Saving Time. Apparently some places have it some don’t. Some countries have a set date for DST, some pick a new one each year depending on circumstances. And of course, DST does not mean only adding one hour.
Read the rest of this entry »