Setting up first Lithium project

I’m now starting my first Lithium project. So I thought I’d jot down notes while playing with it. Just random stuff. I’m not trying to accomplish anything in particular with this post. It might be interesting to you if you’re planning to try it out. Especially, if like me, you’re used to Zend Framework.

So far the docs are a little better than I expected, as we aren’t yet at release 1.0. But we should expect some speed bumps.

The first thing I noticed is the suggestion to install the whole framework under the docroot. To see the homepage you go to http://localhost/lithium . I’m sure that will change though so that your application code doesn’t live under your docroot. If you’re doing anything other than development, obviously you can and should fix this in production.

Something I like about the Zend Framework coding standards is the lack of an end php tag ?>. Having been bitten by that spacing after the endtag “bug” before, it now looks weird to me to see the end tag closing up a file. Hopefully #LI3 will follow Zend’s lead on that.

If you’d like to peruse the #LI3 coding standards, they are here. Overall I really like them.

Not sure what’s wrong with casting using shortcuts. Is it really ambiguous to say (int) $var rather than (integer) $var? (not a big deal in the scheme of things though)

Side note, I wish the PHP community would come to a consensus with the underscore thing before _protected methods.

I got used to it with Zend Framework. Now there’s a poll about removing it or not and last I looked it seemed that it was going away.

I just hope everyone keeps it…or removes it…but we make a community decision so that we don’t have another of these tabs vs spaces debates for the next 10 years. Which leads me to my next point. Kudos to #LI3 for choosing correctly with tabs😉 I thought I was in the minority about that. Certainly seems that way in the Open Source community.

One more thing. Just installed the Lithium Documentation Tool. This is so cool. Really excited to learn more.

I’m going to end this post with a little list of #LI3 RSS feeds that I started to follow. It may be updated periodically and do let me know if you know of any others:

http://nitschinger.at/
http://dev.lithify.me/lithium/wiki/blog.rss

2 responses to “Setting up first Lithium project

  1. Hi,
    great that you spread the word about Lithium. One note: Please set your docroot to /app/webroot (!), mod_rewrite and the framework will care about the rest.

    you can even move the lithium folder away from your app (maybe to /usr/share/lithium) and serve many apps with one core lib.

    regards,
    mike

  2. Hi Joe, nice post. A couple quick points of clarification:

    First, as you mention, those instructions are for development setup, not production. We have individual guides for each web server platform that explain where to set the docroot (webroot/), etc.

    Secondly, you may notice that our coding standard is quite a bit more detailed than others you may have seen, and that it places a lot of emphasis not only on correctness, but on symmetry. We even have a QA tool that we use to check the conformance of our code.

    This attention to detail is why we include closing tags. Omitting them is a sloppy and lazy solution to being sloppy and lazy about how you write your code. What’s more, those same QA tools are able to tell us immediately if we’ve made a mistake with whitespace.

    However, you’re still more than welcome to omit closing tags in your own code

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s