Diem, my new CMS of choice
Posted by Avi in Programming on January 4th, 2010
Every since I started getting frustrated with Expression Engine, I was always looking out for something different. A CMS aimed at developers. Just about every CMS on the market is aimed at letting less technical people get out their and create content. There are a few CMSs that bill themselves as a Content Management Framework. In other words, they provide with the tools to create your own custom CMS. In fact, I would actually put Expression Engine in that category. Others that come to mind are Drupal and EzPublish. Both of these, for some reason, I was never able to wrap my head around. Then again, I never spent much time with them either. Drupal is written procedurally (at least they admit it) which is not my style. Something always goes wrong when I try to install EzPublish.
Then of course there is the option of RDBMSWAAS. When thinking about that last option, there are two frameworks that come to mind, Symfony, and Django. I tried Django before for a small project, and it worked out well, but I had never really given Symfony the time of day. When looking at the Symfony website, I stumbled across a nice hidden gem. Read the rest of this entry »
Quick code review of Expression Engine 2.0
Posted by Avi in Programming on December 29th, 2009
I just got a hold of the public beta of Expression Engine 2.0. I have been using Expression Engine 1.x for a number of years now, and I’ll admit, I wasn’t the most experienced PHP programmer at the time. It was probably the first large PHP program that I had ever used, and I was a little bit awed at how such a massively big OO program could be written.
Since then, I’ve improved my skills tremendously. I’ve learned about SOLID, and DRY. Dependency Injection and Test driven design. I’ve learned about domain modeling, and proper OO design. The code in EE 1.x is utter crap, of course! Global variables scattered everywhere. Copy & Paste style coding. Non-resuable components. No coherent API to speak of. Purely designed plugin system. Who could blame them, though. The code was written almost 10 years ago, in PHP4–with no intention of dropping PHP4 support.
I think I first heard about EE 2.0 almost two years ago. It was coming out that summer. Ever little bit of news that came out made me a little more gittier. It was going to be built on Code Igniter, an MVC framework. Boy was I suprised. Read the rest of this entry »
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 »
Alternative to Zend_Form ViewScript decorator
Posted by Avi in Programming on November 29th, 2009
Zend_Form is great for prototyping forms. It takes a lot of the drudge work out, and makes forms easily “reusable”. The decorator system, which is admittedly a little scary for the uninitiated, is actually very powerful. I’m suer that eventually, however, we’ve all reached that point. The point where you spend more time configuring the form to do what you want, then actually doing something with it. Read the rest of this entry »
Making Zend_Auth more “Object Oriented”
Posted by Avi in Programming on October 29th, 2009
Recently Giorgio Sironi wrote a post on Zend_Auth. When I saw the title, I was expecting something along the lines of most of his posts, which have been discussing many OO topics. The content was rather disappointing, and I’ll tell you why.
Read the rest of this entry »
Fixing PATH_INFO on bluehost and other shared hosts
Posted by Avi in Programming on August 7th, 2009
The first time I setup an Expression Engine site on bluehost, and removed the index.php file via the .htaccess file, I ran into a problem where every template was redirecting back to the main index template. At the time, I traced this down to fact that the “segments” were not getting populated properly.
A brief search led to the EE wiki, which advocated swapping out PATH_INFO for ORIG_PATH_INFO. Although not being a fan of hacking core stuff, I was kind of cornered into this, so I went for it. This has been my running solution for the past two years.
Recently, I ran into an issue where the $_SERVER['PHP_SELF'] was not returning anything after the file name. In other words, for http://mysite/foo.php/bar, PHP_SELF should be equal to foo.php/bar.
I spoke with my host about it (a similar host to bluehost), and they said to put the following in the php.ini file: cgi.fix_pathinfo=Off
After, I did this, PHP_SELF worked fine. Unfortunately, I ran into a similar situation like I described at the outset. Then it hit me…I changed ORIG_PATH_INFO back to PATH_INFO and…it worked!
So now I listed this as another potential solution in the EE wiki.
The joys of the command line
Posted by Avi in Programming on July 13th, 2009
I’ve always loved the unix command line and its power. I recently found the website http://www.commandlinefu.com which people can submit their own command line goodies. This really shows off the power of the command line!
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!
Antipodes
Posted by Avi in Miscellanious on March 25th, 2009
When I was growing up, we would often speak about digging a hole in our backyards and winding up in China. As I got older, I always wondered if this was, in fact, true. It turns out that you have to be somewhere in Argentina to pull this off.