Category: PHP

International PHP-Magazine – Is it dead?

I am a subscriber of International PHP Magazine for years. I bought the subscription looking at the back issues. They were sexy, resourceful and yup, very good. But I think these guys don’t care about the magazine anymore. It became just a funny stuff for them. All the readers/subscribers and viewers doesn’t bring any value to them. Look what they are doing actually

1. one of their issue recently delivered “Riding the Rails”. Huh! I thought I got a wrong issue on my hand and I was wondering how they did it.

2. Their website now shows some peculiar ads like the one below at the top-right corner
“PHPInfo – Coming in -2 Days”

and if you click over that thing, it says “PHPInfo is coming in -1 day”

3. At the middle left section, just below the navigation you find some peculiar ads where alignments got broken, contents are over flooded and they induce you to buy some gadgets!

4. The featured article section contains the”PHP CLI Unveiled!” which has not been updated for years.

5. The book club section offers you to buy “PHP Web Development with Macromedia Dreamweaver MX 2004” for more than a year.

6. The magazine is now a 32-34 page skinny one compared to the old 50+

I remember Davey Shafik wrote an article “Where fore art thou International PHP Magazine?” couple of months ago focusing these things. But the change never came.

If you cant run a service properly, why dont u shut it down?

Making a jobsite using PHP

I was involved in making a job site few days ago. During the development, I have studied how easily anyone can develop a job site using PHP (language independent in true sense) . So I decide to write a blog post about my experience and here it goes. But note that this article is not about scaling or balancing the load on your site during heavy traffic, heh heh.

When you start making a job site, the most complex thing that I’ve found is making the resume-submission-system. Specially the resume editor is more complex than most other parts of a job site. Numbers of sub sections makes it really “not-so-lovely” to code . I am not going to foucs on resume-editor in this article but want to help you on “how easily you can create you can make/run a job site by your own”.

If you want a ready made job-board software which you can just plugin easily under your domain (zero effort, seriously) you can go for “job-a-matic” which is just register-setup-run type one. Please note that it doesn’t come with source code. Its just a customizable solution which you can run under your domain name.

If you love challenge but still want a ready made one with source code then you can go for “Jobberbase“. It is written in pure PHP and uses MySQL in back end. It comes with nice user interface and (more…)

Once upon a time there was Smarty!

With due respect to Monte Ohrt, Zmievski, Messju and those nice guys who contributed their time in Smarty.

I have used Smarty for a long time, even wrote a book on it and created a cheat sheet. But I think now its time to say there is no need to use an external template engine like smarty. With flexible view in MVC frameworks like CodeIgniter and CakePHP (Many others too) is there really any need to learn a separate template language like smarty? Once there was a time when people burnt their hand with RAW code and so called phrameworks and finally realized that they need something to separate the presentation layer from business. Some nice guys over there developed smarty and it saved life of a lot of developers (i mean developers). But that time is over. Seriously why the hell I need to learn a new templating language when a “echo” does the thing much better. Even smart frameworks come with some cool helper libraries where you will find helper functions to do some cool things that smarty’s date and time function does. I just dont need a wrapper over my PHP code which parse regular variable and echo them. Smarty just made itself extremely complex and useless too over the day, seriously.

I seriously don’t think there is need of Smarty anymore. Its dead! If you guys don’t agree with me, you can spend hell lot of time learning that {$name} actually does what you could do with “echo $name”. If you write a dispatcher which is smart enough to bring the variables from a controller scope to the scope of a view, why do u need to learn a separate parser like smarty? Moreover, of course it takes time in parsing the template files into equivalent PHP code and cost me some time. But hell no, I am not pointing to those microseconds I lost in extra parsing, I am pointing to the time I will spend learning smarty which is not needed at all. Learning all those functions, loops, logics, caching and others in smarty takes so much time that I would love to suggest you to learn writing efficient PHP code in template layer rather than learning something like smarty.

Update: Some of you commented that to keep designers away from PHP and to keep it safe, we should go for smarty. But is there really any designer who knows only smarty and no PHP? Is it really possible to write efficient code in smarty without knowing PHP? Nah, not at all. And there is {php} block which allow so called template designers to run unsafe PHP code inside it. Well, you can block executing {php} block from your side, but still smarty is not a solution to think that you are “secured”. And honestly, you should’t let your template designer write template code for you if they dont know PHP. And you should learn about XSS, SQL Injection and CSRF if you really want to live secured.

Sometime it’s better to realize thats its time to unlearn something.

Inside at Trippert Labs

We started our office yesterday here in Bangladesh. We have taken a nice and huge house for us. Here is some pictures from inside@TrippertLabs. FYI, Trippert Labs is a small PHP company who are developing Facebook Applications along with some other inhouse/revenue projects.

1. The Powerstation

Powerstation

2. Powerstation at Full Throttle

null

3. Refreshment

null

4. The Kitchen King – Ahsan

null

5. Afif – the little Einstein

null

6. Powerstation (Ahsan and Me )

null

7. No Mans Land

null

8. Green Room

null

9. Manzil Cleaned it up

null

10. The hallway

null

You can check other photos at my flickr at http://www.flickr.com/photos/storyteller

We are close to release Orchid, the new Framework

orchid framework

Am I talking about another framework? Well yeah. I thought it will be real fun for web application developers to use orchid to build their apps. Orchid is still in preview state and we are planning to release it by the mid of January. But if you are interested you can check the orchid blog and checkout the nightly build version from svn repository. Orchid is very fast and lightweight and really painless to kickstart the development.

URL : http://orchid.phpxperts.net

Some of the core features of Orchid which I think are really helpful to develop real world applications, are listed here

1. Caching Engine with support of Memcache, MySQL and SQLite as Storage
2. MVC
3. RoR like Layout and segregated template components.
4. Partial Caching in Template
5. Very efficient object loading and dispatching
6. DAL for MySQL (Both MySQL and MySQLi), SQLite, PostgreSQL and MSSQL
7. Support for PDO
8. Builtin Unit Testing Library where you can write unit tests inside the controller without extra pain.
9. Internationalization using Language files
10. Session Manager (Regular and DB Based)
11. Bundled Google Map Library
12. Bundled Google Chart Library
13. Bundled JSON Library
14. Bundled Prototype, jQuery, Scriptaculous and SWFObject Scripts with on-demand gzip support
15. On demand gzipping for javascripts
16. Active Record
17. Excellent Benchmarking and Profiling support which you can use to profile your application
18. CSS based Button Manager (What is this???? — checkout)
19. AJAX Library

Beside many other features it also comes with an exceptional feature which is hard to find elsewhere 🙂 which is the following one

20. Bundled “Colorful Moments”

🙂

Orchid is planned to release by mid januray, as I told. Currently some of us are working on documentation. But you can still check out the code and sample controllers.

Ifthese sounds interesting – you can visit the official blog of orchid at http://orchid.phpxperts.net

My book on OOP-PHP5 has been published

Packt is pleased to announce the release of a new book titled Object-Oriented Programming with PHP5. Written by Me, this book will teach users to understand the core object-oriented programming concepts with PHP and to write manageable applications with ease.

OOPPHP5

Object-oriented programming (OOP) is a programming paradigm that uses “objects” and their interactions to design applications and computer programs. It was basically introduced to ease the development process as well as reduce the time of development by reducing the amount of code needed.

PHP is one of the most popular languages for web application development, and PHP5 supports OOP very well. This book will help users to master core OOP features in PHP as well as advanced Topics like Design Patterns including Model-View-Controller (MVC), and Unit Testing.

Comprehensive documentation and working examples on the Standard PHP Library (SPL), which are hard to find elsewhere, are provided in this book. Users will find this book useful to leverage PHP’s OOP features to write manageable applications with ease.

Object-Oriented Programming with PHP5 is published and is available with Packt. For more information about this book, please visit www.PacktPub.com.

Source: PHPMagazine.Net (They published the news, so what I’ve done is “copy and paste”, he he)

NeedForSpeed – Our First Facebook Application for Electronic Arts

I am a big fan of NeedForSpeed since version 2. You remember that? Those days were complete fun chasing with FZR2000 or McLaren F1. I specially liked to run on Hollywood track in NFS2SE.

Today, a new version of NFS (ProStreet) has been released. And we, a small developers team in Trippert Labs released the Facebook app named NeedForSpeed for this game . This is built using PHP and MySQL having MemCached as caching engine.

Lets have some Racing!

did you know "you can have cheese burger" could be a variable name?

Well, I didn’t know. But I figured it out while working with SimpleXML to parse an XML document where the node name had a hyphen in it. I was finding a way to refer that element as a SimpleXMLElement and found a nifty note in PHP Manual. It says if you have unsupported (unsupported in PHP Lexicon for a variable name) characters inside the name of a node, you can access it using a special pattern {‘name’}.

So I tried the following code and it show that you can have a class variable named “i can have cheese burger”

$s = new stdClass();
$s->{'i can have cheese burger'} = "Oh Yeaaah";
echo $s->{'i can have cheese burger'}; //it will output "Oh Yeeah"

and if you print_f the object $s, you will see the following

stdClass Object
(
[i can have cheese burger] => Oh Yeeah
)

Well, Its funny! – I love having some fun writing PHP code!