Saturday, February 6, 2010

Characteristics of PHP

As you may have realized, the PHP language revolves around the central theme of practicality. PHP is about providing the programmer with the necessary tools to get the job done in a quick and efficient fashion. Five important characteristics make PHP’s practical nature possible:

• Familiarity
• Simplicity
• Efficiency
• Flexibility

One final characteristic makes PHP particularly interesting: it’s free!


Programmers from many backgrounds will find themselves already accustomed to the PHP language. Many of the language’s constructs are borrowed from C and Perl, and in many cases PHP code is almost indistinguishable from that found in the typical C or Pascal program. This minimizes the learning curve considerably.


A PHP script can consist of 10,000 lines or one line: whatever you need to get the job done. There is no need to include libraries, special compilation directives, or anything of the sort. The PHP engine simply begins executing the code after the first escape sequence (). If the code is syntactically correct, it will be executed exactly as it is displayed.


Efficiency is an extremely important consideration for working in a multiuser environment such as the WWW. PHP 4.0 introduced resource allocation mechanisms and more pronounced support for object-oriented programming, in addition to session management features. Reference counting has also been introduced in the latest version, eliminating unnecessary memory allocation


PHP provides developers and administrators with a flexible and efficient set of security safeguards. These safeguards can be divided into two frames of reference: system level and application level.

System-Level Security Safeguards

PHP furnishes a number of security mechanisms that administrators can manipulate,providing for the maximum amount of freedom and security when PHP is properly configured. PHP can be run in what is known as safe mode, which can limit users’ attempts to exploit the PHP implementation in many important ways. Limits can also be placed on maximum execution time and memory usage, which if not controlled can have adverse affects on server performance. Much as with a cgi-bin folder, administrators can also place restrictions on the locations in which users can view and execute PHP scripts and use PHP scripts to view guarded server information, such as the passwd file.

Application-Level Security Safeguards

Several trusted data encryption options are supported in PHP’s predefined function set. PHP is also compatible with many third-party applications, allowing for easy-integration with secure ecommerce technologies. Another advantage is that the PHP source code is not viewable through the browser because the script is completely parsed before it is sent back to the requesting user. This benefit of PHP’s server-side architecture prevents the loss of creative scripts to users at least knowledgeable enough to execute a ‘View Source’.

Because PHP is an embedded language, it is extremely flexible towards meeting the needs of the developer. Although PHP is generally touted as being used in conjunction solely with HTML, it can also be integrated alongside languages like JavaScript, WML, XML, and many others. Additionally, as with most other mainstream languages, wisely planned PHP applications can be easily expanded as needed. Browser dependency is not an issue because PHP scripts are compiled entirely on the server side before being sent to the user. In fact, PHP scripts can be sent to just about any kind of device containing a browser, including cell phones, personal digital assistant (PDA) devices, pagers, laptops, not to mention the traditional PC. People who want to develop shell-based applications can also execute PHP from the command line.

Since PHP contains no server-specific code, users are not limited to a specific and perhaps unfamiliar Web server. Apache, Microsoft IIs, Netscape Enterprise Server, Stronghold, and Zeus are all fair game for PHP’s server integration. Because of the various platforms that these servers operate on, PHP is largely platform independent, available for such platforms as UNIX, Solaris, FreeBSD, and Windows 95/98/NT.

Finally, PHP offers access to external components, such as Enterprise Java Beans and Win32 COM objects. These newly added features put PHP in the big league, truly enabling developers to scale PHP projects upward and outward as need be.


The open source development strategy has gained considerable notoriety in the software industry. The prospect of releasing source code to the masses has resulted in undeniably positive outcomes for many projects, perhaps most notably Linux, although the success of the Apache project has certainly been a major contributor in proving the validity of the open source ideal. The same holds true for the developmental history of PHP, as users worldwide have been a huge factor in the advancement of the PHP project.

PHP’s embracing of this open source strategy result in great performance gains for users, and the code is available free of charge. Additionally, an extremely receptive user community numbering in the thousands acts as “customer support,” providing answers to even the most arcane questions in popular
online discussion groups.

PHP Frameworks

Zend Framework

The most hyped framework. Why not; it’s by Zend which develops PHP itself. It has just got out of beta. You will also find it is rich with features too. It was also the fastest. No doubt it has all the corporate stuffs but I still felt it’s a bit tough. Just a little too much for most. It doesn’t have PHP 4 too. But it will definitely more provide support and professional code being backed by a corporate company. This is for those who want to build apps for big enterprises. They will have pro coders and will also be benefited from the components it provides.


CakePHP is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. Using commonly known design patterns like MVC and ORM within the convention over configuration paradigm, CakePHP reduces development costs and helps developers write less code.

Akelos PHP Framework

The Akelos PHP Framework is a web application development platform based on the MVC (Model View Controller) design pattern. Based on good practices, it allows you to: Write views using Ajax easily, Control requests and responses through a controller, Manage internationalized applications, Communicate models and the database using simple conventions.

Yii- PHP framework

Yii – a high-performance component-based PHP framework best for developing large-scale Web applications. Yii comes with a full stack of features, including MVC, DAO/ActiveRecord, I18N/L10N, caching, jQuery-based AJAX support, authentication and role-based access control, scaffolding, input validation, widgets, events, theming, Web services, and so on. Written in strict OOP, Yii is easy to use and is extremely flexible and extensible.


CodeIgniter is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications. If you’re a developer who lives in the real world of shared hosting accounts and clients with deadlines, and if you’re tired of ponderously large and thoroughly undocumented frameworks.

Symfony – Open-Source PHP Web Framework

Symfony is a full-stack framework, a library of cohesive classes written in PHP5. It provides an architecture, components and tools for developers to build complex web applications faster. Choosing symfony allows you to release your applications earlier, host and scale them without problem, and maintain them over time with no surprise. Symfony is based on experience. It does not reinvent the wheel: it uses most of the best practices of web development and integrates some great third-party libraries.


PRADOTM is a component-based and event-driven programming framework for developing Web applications in PHP 5. PRADO stands for PHP Rapid Application Development Object-oriented.

Zoop Framework

The Zoop Framework: PHP development without the suck. The Zoop Framework is inclusive, cooperating with and containing components integrated from some existing projects including Smarty, the Prototype JS Framework, and a number of Pear Modules.

xAjax Framework

xAjax is an open source PHP class library that allows to create quickly Ajax applications using HTML, CSS, JavaScript, and PHP.

Kohana Framework

Kohana is a PHP 5 framework that uses the model view controller architectural pattern. It aims to be secure, lightweight, and easy to use.


BlueShoes is a comprehensive application framework and content management system. It is written in the widely used web-scripting language PHP. BlueShoes offers excellent support for the popular MySQL database as well as support for Oracle and MSSQL.


Limb is an OpenSource(LGPL) PHP framework mostly aimed for rapid web application prototyping and development. The current actively developed branch of framework is Limb3(there is also Limb2 but it’s not maintained anymore).

Saturday, January 16, 2010

Situation where to use abstract class?.

One example that I like to use is a complex sort algorithm,say a generic quicksort, where you know how to sort but you don't know enough about the final class to complete the class. In other words, you must defer the final implementation to a more knowledgeable class. So you write an abstract quicksort class with an abstract Compare(obj1, obj2) method. The user of the class simply extends the Sorting class and provides a Concrete implementation of the Compare method appropriate for the class. The key here is that methods in the abstract class can call the abstract Compare method that still needs to be implemented! Multiple concrete classes can then reuse your quicksort algorithm.
In an object-oriented drawing application, you can draw circles, rectangles, lines, Bezier curves, and many other graphic objects. These objects all have certain states (for example: position, orientation, line color, fill color) and behaviors (for example: moveTo, rotate, resize, draw) in common. Some of these states and behaviors are the same for all graphic objects—for example: position, fill color, and moveTo. Others require different implementations—for example, resize or draw. All GraphicObjects must know how to draw or resize themselves; they just differ in how they do it. This is a perfect situation for an abstract superclass. You can take advantage of the similarities and declare all the graphic objects to inherit from the same abstract parent object—for example, GraphicObject, as shown in the following figure.

Classes Rectangle, Line, Bezier, and Circle inherit from GraphicObject
First, you declare an abstract class, GraphicObject, to provide member variables and methods that are wholly shared by all subclasses, such as the current position and the moveTo method. GraphicObject also declares abstract methods for methods, such as draw or resize, that need to be implemented by all subclasses but must be implemented in different ways. The GraphicObject class can look something like this:
abstract class GraphicObject {
int x, y;
void moveTo(int newX, int newY) {
abstract void draw();
abstract void resize();
Each non-abstract subclass of GraphicObject, such as Circle and Rectangle, must provide implementations for the draw and resize methods:
class Circle extends GraphicObject {
void draw() {
void resize() {
class Rectangle extends GraphicObject {
void draw() {
void resize() {

Wednesday, January 13, 2010

difference between asynchronous and synchronous request

The difference between asynchronous and synchronous interaction is that when it is synchronous you have to do each step at the time. You cannot do two things - or what is called multitasking.

Take uploading a file. To do this, you have to:

1. Select the files you want to upload
2. Click the upload button
3. Wait for the files to be uploaded
4. Work with them

You cannot chose to upload another set of files while the first ones are being uploaded, nor can you start to work with them (like adding tags) before the upload process has completed. The interaction is synchronous.
With asynchronous interaction you can do other things while the system uploads the file.

Or take a kitchen, which is asynchronous by design. While you are e.g. baking bread, cooking spaghetti and frying some meat - you are also making the salad. The result of this multitasking behavior is that you can prepare a nice dinner in about 30 minutes. If you had to do the same in a synchronous fashion it would take hours, and most of the food would have gotten cold before everything was finished.

The Future of CakePHP

Wow - it's 2010. The future is here and appropriately we'll look to CakePHP lead cosmonaut Nate Abele to take us on an odyssey of both Cake and PHP. Join us this January as we mark NYPHP's ninth year and sit back while the monolith evolves your understanding of HAL CakePHP and the future of PHP frameworks - and we'll see you in 3001.

Now that the major PHP frameworks have reached sustained maturity, where do we go from here? With the long-awaited release of PHP 5.3, many are gearing up to take advantage of the available features with new major versions, which will change the way we create web applications. We'll take a sneak peak at the next major version of CakePHP to see what this evolution might look like, and how you can apply new techniques in your own projects.

Nate Abele is the lead developer of the CakePHP framework, an internationally ignored author and speaker, and has come to be known as the Johnny Cash of the PHP community. Having lived in the midwestern US and both coasts, Nate has currently taken up residence in the most desolate place on the planet: New Jersey. When not code-monkey'ing or yelling at people for "doin' it rong", Nate enjoys snowboarding, playing guitar, being a beach bum, and writing about himself in the third person.

Thank you to IBM for providing a great presentation space in Midtown Manhattan. As a service to our community, New York PHP Community meetings are always free and open to the public.

Monday, January 11, 2010

jQuery feature

Query provides many general function to build a rich pages. jQuery feature:
  • Ajax
    jQuery is one of the ajax framework that used mostly by many web master.
  • Shortcut access to DOM
    instead of using bulk of code in accessing DOM, jQuery have the shortcut.
  • Manipulating the element content
    With jQuery, we can freely insert, update and delete every HTML element.
  • Easy event handling
    Event handling is no fear again in web pages, jQuery make the process simple.
  • Animation
    by default, jQuery already have ability to perform general animation on the pages.
  • Action Chaining
    Instead of using many temporary variable and repetition lines, we can easily unite several lines of code that have same characteristic to a line code with chaining.
  • CSS Compliance
    The jQuery selector is CSS Compliance, that make any designer that already have knowledge about CSS is able to learn jQuery easily.
  • Cross browser
    using jQuery, no more hack for IE… the framework has done it automatically.

Small Businesses Benefit from Drupal

Small businesses today are quickly recognizing the power of content management systems and website platforms that allow you to interact with your customers. The days of an old static website that simply lists your phone number are long gone. Today, your website visitors demand that you engage them in dialogue, provide resources at their fingertips, and give them an easy way of understanding what you do and how to buy it from you.

This might seem difficult or expensive, but it doesn't have to be. Orchestra provides Drupal, a leading open source Content Management System, to our clients for a price and timeline built for small business. Drupal is free and open source, so we're able to offer an enterprise level website solution for a very affordable price.

As you'll see below, Orchestra has crafted a solution for small and midsize companies to take advantage of web 2.0 and the growth in internet marketing. And it's not just B2C that benefits, one of the fastest growing sectors of the web is B2B. For small businesses in the B2B space, having an engaging website that positions your company as a market leader and thought driver is imperative.

So, lets get right into the "meat and potatoes" as they say:

Big Features for Small Networks

Business computer networks come in two basic varieties. Larger companies, from giant corporations to medium-size operations, use nets that are typically built around Novell NetWare or Windows NT servers. These nets demand care and feeding from highly trained administrators. Small businesses, if they are wired at all, usually string together a few computers using the simple Windows or Macintosh built-in networking.

The increasing importance of computers in even very small businesses is exposing the weaknesses of these simple networks: They offer little security, no data backups, no easy way to share an Internet connection, and they become difficult to manage if they grow beyond a handful of computers. Help is on the way. A new breed of server can deliver big office features at low cost and require little technical skill. Eventually, they may even find their way into your home.