UltraMega Tech.
29May/091

Snippet: Autoloading Objects (PHP 5)

When writing the PHP that powers TempServers, I wrote the core functions into classes for better organization and efficiency. To make things further organized, each class is stored in individual source files, no matter how small. The problem here is keeping track of which classes are used where, in order to include the appropriate source files. Fortunately, PHP 5 offers a solution: autoloading.

This comes in the form of the __autoload function which automatically gets called if a class is called that does not exist. Here's what it looks like:

function __autoload($class) {
    require_once(strtolower($class) . '.class.php');
}

Usage

  1. Place each PHP class in individual files named after the class followed by .class.php (Example: class MyClass goes in a file named myclass.class.php).
  2. Include the code snipped above into any file that might use one of your classes.

For more details, check out the PHP manual: http://www.php.net/manual/language.oop5.autoload.php

28May/090

Follow us on Twitter

You can now follow UltraMega Tech on Twitter: http://twitter.com/UltraMegaTech

We'll keep you up to date on any projects we're working on as well as any useful information that we find. New blog posts will also be posted there.

Tagged as: No Comments
27May/091

TempServers Beta #2 Launched

The TempServers.com Public Beta #2 has been launched!

If you have been following the previous posts here about TempServers, you know that a lot of improvements have been made to the website and service since the previous beta. Now is your chance to see these changes for yourself and give your opinion. You can also fill out the optional survey to receive 2 free hours to use once the service is live.

Click the image below to visit the website and try the service for free for a limited time.

TempServers

TempServers.com Beta #2

8May/090

TempServers Status Update #2

It's been very quiet around here while we've been focusing on the TempServers project. Last week, I posted an update on the progress of the project and all of the changes that have been or were being made. Since then, all of the mentioned additions have been implemented. This includes user accounts, time zone support, custom configurations, email notifications, as well as some new features that I'll list below. In the coming weeks, the next public beta will be announced where you can try the service for free again for a limited time!

  • IP Reservations. When your reservation is confirmed, you will be notified of the IP address the server will use. So you will now know the IP in advanced rather than finding out at the last minute.
  • Credits. A credit system has been implemented, where one credit is worth 1 hour of server time. There will be multiple opportunities to gain these credits for free, one of which will be available during the next free beta.
  • Support System. There is a simple ticket based support system that can be used for any issues related to the website or servers. This is the preferred way to contact the staff in case something goes wrong.

There are also a number of back end improvements and minor layout adjustments that have been made. Next, we'll be working on finalizing content and testing the site to prepare for the next public test. Stay tuned for details on Beta 2!