Create your own Facebook in minutes

Elgg is an open, flexible social networking engine, designed to run at the heart of any socially-aware application. Building on Elgg is easy, and because the engine handles common web application and social functionality for you, you can concentrate on developing your idea.

Elgg is open source. That means, when you use Elgg, you have the benefit of being part of a large developer community, with the security and stability that hundreds of eyes can provide. It’s also headed and used by Curverider and its partners, so you can be assured that it’s in commercial use and will cope with the demands of a popular application.

Features

Elgg comes with advanced user management and administration, social networking, cross-site tagging, powerful access control lists, internationalisation support, multiple view support (eg cell phones, iPhone), an advanced templating engine, a widget framework and more.

There are several options:

  • Use Elgg’s out of the box features; this is called a vanilla install
  • Add more by installing plugins – for example, blogs, forums, social bookmarks
  • Develop your own features, or hire someone to do this for you

Project Home Page

How to Build a Web Hosting Infrastructure on EC2

Mike Brittain wrote:

In the months prior to leaving Heavy, I led an exciting project to build a hosting platform for our online products on top of Amazon’s Elastic Compute Cloud (EC2).  We eventually launched our newest product at Heavy using EC2 as the primary hosting platform.

We set out to build a fairly standard LAMP hosting infrastructure where we could easily and quickly add additional capacity.  In fact, we can add new servers to our production pool in under 20 minutes, from the time we call the “run instance” API at EC2, to the time when public traffic begins hitting the new server.  This includes machine startup time, adding custom server config files and cron jobs, rolling out application code, running smoke tests, and adding the machine to public DNS.

What follows is a general outline of how we do this.

Continue reading

PHP Refcard Available

PHP is the world’s most popular server-side Web scripting language. This reference card was created to help you quickly navigate some of PHP’s most commonplace features, including objectoriented programming, array and string manipulation, regular expressions, and MySQL integration.

Features include Configuration, Popular PEAR Packages, Object-Oriented PHP, Regular Expressions, MySQL Integration, Hot Tips and more.

PHP Refcard – Download

Designing a CMS Architecture

François Zaninotto wrote:

When faced with the alternative between an off-the-shelf CMS or a custom development, many companies pick solutions like ezPublish or Drupal. In addition to being free, these CMS seem to fulfill all possible requirements. But while choosing an open-source solution is a great idea, going for a full-featured CMS may prove more expensive than designing and developing your own Custom Management System.

Given number of available open-source CMS solutions, building one on your own sounds like a stupid idea. But if your website is 50% content management and 50% something else, you probably need to start with a web application framework like Symfony or Django, rather than a CMS. These frameworks provide plugins that do part of the Content Management job already, so creating a CMS today is like assembling Lego bricks to build something that exactly fits your needs.

Continue reading

Gartner Research: PHP is going corporate

A recent Gartner Research study found that 10 percent of the PHP community are corporate IT developers, and predicted that during the next five years, that number will grow to 40 percent. That’s good news for PHP developers looking for corporate gigs, and very good news for PHP tools maker Zend Technologies, which cited the Gartner finding at the Zend/PHP Conference last week as evidence of widespread, more strategic adoption of PHP in enterprises.

Zend is trying to position its products, the PHP development framework Zend Framework and the PHP IDE Zend Studio for Eclipse, as the de facto standards for enterprise PHP web development as the language becomes more mainstream. If Zend is judged by the company it keeps, then it has chosen its allies well, forging relationships with IT heavyweights such as IBM, Oracle, Microsoft, and most recently, Adobe.

Continue reading

Leading a Software Development Team

36 steps to success as technical lead

  1. Define early on what success means for you, the team and the business.
  2. Believe in the project: idea, architecture, time, team.
  3. Understand the domain, the business requirements and the technical challenges.
  4. Know your team: strengths, weaknesses, ambitions and personalities.
  5. Have a plan as a result of a planning activity.
  6. Be part in the design of everything.
  7. Get your hands dirty and code.
  8. Act as a communication proxy for your team.
  9. Make sure everybody understands the big picture: their work has implications.
  10. Fight for architecture and design consistency.

Read more

How not to lead geeks

  1. Downplay training.
  2. Give no recognition.
  3. Plan too much overtime.
  4. Use management-speak.
  5. Try to be smarter than the geeks.
  6. Act inconsistently.
  7. Ignore the geeks.
  8. Make decisions without consulting them.
  9. Don’t give them tools.
  10. Forget that geeks are creative workers.

Read more

Nine things developers want more than money

  1. Being set up to succeed.
  2. Having excellent management.
  3. Learning new things.
  4. Exercising creativity and solving the right kind of problems.
  5. Having a voice.
  6. Being recognized for hard work.
  7. Building something that matters.
  8. Building software without an act of congress.
  9. Having few legacy constraints.

Read more

Top 10 ways to demotivate your programming team

  1. Set up impossible deadlines.
  2. Let them work overtime.
  3. Don’t allow breaks.
  4. Place a ban on laughing.
  5. Break the coffee machine.
  6. Don’t shield them from the dirty daily business.
  7. Don’t challenge them.
  8. Underpay them.
  9. Bribe them.
  10. Infiltrate a team member who is demotivated anyway.

Read more

Don’t bring me solutions, bring me problems

(Don’t tell me how you want it to work, tell me what you want it to do)

  1. Where all think alike, no one thinks very much.
  2. Suggesting solutions kills creativity.
  3. Don’t bring me solutions, bring me problems.

Read more

Classic mistakes enumerated

  1. Undermined motivation.
  2. Weak personnel.
  3. Uncontrolled problem employees.
  4. Heroics.
  5. Adding people to a late project.
  6. Noisy, crowded offices.
  7. Friction between developers and customers.
  8. Unrealistic expectations.
  9. Lack of effective project sponsorship.
  10. Lack of stakeholder buy-in.
  11. Lack of user input.
  12. Politics placed over substance.
  13. Wishful thinking.

Read more

Seven practices for healthier, faster software development

The practices discussed in this article are based on Ezequiel Cuellar’s observations. These practices will help any software development team as they come up against common obstacles. They will also contribute to a solid foundation for healthier development and help speed up production. The seven practices are:

  1. Improve business processes before starting development.
  2. Create a solid software development team.
  3. Improve processes for service requests.
  4. Minimize reporting of software metrics.
  5. Improve communication with the business team.
  6. Use the right programming language.
  7. Use the right IDE.

The practices target problems that are better addressed at the management level. Usually, developers can only report the issues to upper management for consideration. Because project managers have the necessary level of authorization, they are the ideal candidates to promote these practices within the organization.

Continue reading

Zend Framework Controller: 22% Drop in Responsiveness

The most important factor in making a Web application fast is its basic design. You must also know what kinds of processing your framework is doing, and what its bottlenecks are. The best way to find the performance bottlenecks is to monitor the performance counters and to have a thorough understanding of the framework your application is using.

Paul M. Jones spotted something interesting a couple of weeks ago:

The difference between the 1.0 release and the 1.5 release of the Zend Framework is quite dramatic: a 25% drop in responsiveness. And then another 10% drop between 1.5 and 1.6.

According to Paul, the Zend Framework lost 35% of their requests per second between 1.0 and 1.6 releases. This means that a Web server will serve 65 instead of 100 requests per second.

Finding Performance Bottlenecks

You should definitely benchmark your application to find out where the bottlenecks are. Even if the overall performance for your application is currently acceptable, you should at least make a plan for each bottleneck and decide how to solve it if someday you really need the extra performance.

After spending a couple of hours playing around with the Zend Framework, I found out that the Zend_Controller_Action_Helper_ViewRenderer component, introduced in May 2007, is the main cause of performance degradation. It currently loads and uses the following classes:

Zend/Filter.php
Zend/Filter/Interface.php
Zend/Filter/Inflector.php
Zend/Filter/PregReplace.php
Zend/Filter/Word/Separator/Abstract.php
Zend/Filter/Word/SeparatorToSeparator.php
Zend/Filter/Word/UnderscoreToSeparator.php
Zend/Filter/Word/CamelCaseToSeparator.php
Zend/Filter/Word/CamelCaseToDash.php
Zend/Filter/StringToLower.php
Zend/Loader/PluginLoader.php
Zend/Loader/PluginLoader/Interface.php

To test this, I created an Action Controller that uses the Zend_Controller_Action_Helper_ViewRenderer helper class:

class Blog_IndexController extends Zend_Controller_Action
{
    public function indexAction()
    {
        $this->view->message = 'indexAction';
    }
}

Benchmark:

$ ab -kc 80 -t 60 http://www.zend-test.com/blog/2008/07/14/test

Test result data:

Concurrency Level:      80
Time taken for tests:   60.33175 seconds
Complete requests:      5828
Failed requests:        0
Write errors:           0
Keep-Alive requests:    5790
Total transferred:      2457771 bytes
HTML transferred:       1270504 bytes
Requests per second:    97.08 [#/sec] (mean)
Time per request:       824.066 [ms] (mean)
Time per request:       10.301 [ms]
Transfer rate:          39.98 [Kbytes/sec] received

Rasmus gave an excellent presentation about performance at DrupalCon, where he said: “You need to ask yourself: Does my application need all this classes? If it doesn’t, get rid of them”.

And so I did. I removed the Zend_Controller_Action_Helper_ViewRenderer instance from the Front Controller (line 831):

Zend_Controller_Action_HelperBroker::getStack()->offsetSet(-80, new Zend_Controller_Action_Helper_ViewRenderer());

And instantiated the view object within the Blog Controller:

class Blog_IndexController extends Zend_Controller_Action
{
    public function indexAction()
    {
        $this->initView();
        $this->view->message = 'indexAction';
        this->render();
    }
}

Benchmark:

$ ab -kc 80 -t 60 http://www.zend-test.com/blog/2008/07/14/test

Test result data:

Concurrency Level:      80
Time taken for tests:   60.3663 seconds
Complete requests:      7472
Failed requests:        0
Write errors:           0
Keep-Alive requests:    7435
Total transferred:      3061944 bytes
HTML transferred:       1539232 bytes
Requests per second:    124.53 [#/sec] (mean)
Time per request:       642.438 [ms] (mean)
Time per request:       8.030 [ms]
Transfer rate:          49.83 [Kbytes/sec] received

As you can see, the output is the same, but the response time is lower:

((124 - 97 ) ÷ 124) × 100 = 22%

Conclusion

Even with best planning, you may still have to investigate performance problems during web development. The process of identifying and fixing bottlenecks should be done in a serial manner. Vary only one line of code at a time and then measure performance to verify the impact of the single change. Also, to avoid problems like this, you should put some effort into benchmarking your whole application under the worst possible load.

Zend welcomes and encourages contributions to the Zend Framework community. Anyone may report issues or feature requests and ask questions and/or provide answers on the mailing lists. Zend also encourages you to publish articles or code on your own blog or website. Find out more.

Links

Code Refactoring Guidelines

In software engineering, “refactoring” source code means modifying it without changing its behaviour, and is sometimes informally referred to as “cleaning it up”. Refactoring neither fixes bugs nor adds new functionality, though it might precede either activity. Rather it improves the understandability of the code and changes its internal structure and design, and removes dead code, to make it easier to comprehend, more maintainable and amenable to change. Refactoring is usually motivated by the difficulty of adding new functionality to a program or fixing a bug in it.

Code Refactoring Guidelines

  1. Big Picture
  2. Extreme Abstraction
  3. Extreme Separation
  4. Extreme Readability
  5. Interfaces
  6. Error Handling
  7. General Issues
  8. Security
  9. General Objects

Continue reading

Send SMS messages from your Website using PHP

Attila Szabó wrote a simple PHP class for sending SMS messages through the smsBug gateway. To send a single SMS message and receive the number of credits left, you only need to include two classes:

include('services/smsgateway/class.Transport.php');
include('services/smsgateway/class.SmsGateway.php');

// Send the message
try {
    $oSmsGateway = new SmsGateway();
    $oSmsGateway->SendSingleSms("421xxxxxx", "Hello");
    unset($oSmsGateway);
} catch(TransportException $e) {
    $error = 'SMS proxy error: '. $e->getMessage();
} catch(Excption $e) {
    $error = 'Unexpected error: '. $e->getMessage();
}

More info: Send SMS messages from your Website