Posts by author noccy

Automatic table upgrades

Automatic table upgrading has been implemented, allowing changes to be performed to the Lepton system tables. This has been done in order to stop things from blowing up as tables are updated during the development process.

This functionality can be undesired for some websites, in which case the configuration key lepton.core.autoupdate can be set to false to stop this.

Nasser on Lepton

We are proud to announce that the new website of international world rally champion  Nasser Al-Attiyah is using Lepton. The site hosts a photo gallery holding over 1 GB of images ranging from 2004 to 2009 as well as a custom news gallery.

The Lepton team would also like to forward our congratulations on the latest victory!

  • Posted: 2010-01-06 17:02
  • Author: noccy
  • Categories: (none)
  • Comments (0)

Dynamic content caching, 0.2 and analytics

As you all may have noticed we busted the 0.2 deadline again. Some things got in the way, and in reality we are probably a month from tagging the 0.2 milestone. We will keep working towards it tho, and any contributions are welcome.

Lepton now has basic (and very beta) support for dynamic content caching, that is storing data in the filesystem and database rather than regenerating it on each request. This is good and very useful for f.ex. galleries where images change often, dynamically generated avatars, and also any textual content that takes time to generate.

Using it is easy, just call the static get() and set() methods of the FsCache class; first attempt to get() it, and if that fails just generate the content and then set() it:

if (!FsCache::get('images/'.$id)) {
   $i = Graphics::load('images/'.$id);
   $i->resize(140,140,ImageCanvas::KEEP_CROP);
   $i->output('image/png');
   $d = $i->output('image/png', 75, true);
   FsCache::set('images/'.$id, 'image/png', $d);
}

Easy to use, albeit still a bit gronky. The handy part tho is that the get() call will handle all the output, including setting the content type.

There is now also support for Google Analytics using the ganalytics library. You can read more about that in the readme file.

Deadline for 0.2 moved

The deadline for 0.2 has been moved to the 5th of January. Hopefully we will be able to commit a few more tickets by then.

Fingers crossed that the tickets as well as documentation is finalized by then.

Inspecting your data

A bunch of methods have been added to various classes to examine the data that is passed around on your site while developing. These are all suitably named inspect() and accept no parameters. They also stop the execution after dumping the data to the browser in a well formatted format.

The classes that currently support inspecting are:

  • Views - Using View::inspect()
  • Request - Using request::inspect()

This is a somewhat experimental feature and it should not be used on live systems. So, only use this while building your site.

UPDATE! You can now also do debug::inspect($var) to inspect a variable.

Almost 0.2

Only a few days left now until Lepton 0.2 is due. At the time of writing this, there are 20 outstanding tickets that needs sorting before this can happen.

Quite a bit has happened over these last few days tho. The graphics library has matured even more, and is how equipped with wrappers around some basic image processing functionality such as watermarks and color transformations. In proper Lepton fashion, you can build on this with your own filters and effect.

$i = Graphics::load('my-image.png');
$i->apply(new WatermarkImageFilter(5,5,'my-logo.png'));
$i->output('image/png');

Thanks to Dav (aka. Miniman) the aspect-maintaining rescale functionality is now properly implemented as well.

We also plugged a nasty security hole as soon as it was discovered. Since the Controller classes inherited from the Lepton base class, the error method was available in all controllers, allowing a call to the error method to possibly execute malicious client side code. Note however that this issue was never exploited, but rather stumbled upon.

  • Posted: 2009-12-21 02:32
  • Author: noccy
  • Categories: (none)
  • Comments (0)

Persistent sessions, user creation, and markup parsing

The sessions have finally got the persistent buff they have been waiting for; marking a key as persistent will now cause it to properly be saved to the database. Keep in mind tho that this feature still has some possible quirks, in that data is only read on login and written when changed. Other clients with active sessions will not receive the updated values until their sessions time out and they log back in.

Users can also be created in a very simple and convenient way. Before, the password had to be assigned after the user had been saved, but the password property has been unlocked for new user records:

// Method 1:
$u = User::create('bob','foobar');
User::createUser($u);

// Method 2:
$u = new UserRecord();
$u->username = 'bob';
$u->password = 'foobar';
User::createUser($u);

It's still a bit gronky, but it's getting there. Ideally the UserRecord::save() method should create the user if it's a new record.

Contributions

Thanks to Dav/Mini who implemented the Human markup parser. The Human parser is excellent for both single- and multi line updates, and besides it's quite simplistic markup scheme can handle (and return) tags, group names, and urls.

Open assignments

If you feel you can help with any of these, let us know!

  • The SQLite and PostgreSQL connectors for DBX
  • Writing test cases for the various components using LUnit

Routing and multi-domain support

It's looking good for the routing and the multi domain support in Lepton. The implementation of a proper routing framework provides for a quick and efficient way to transfer requests on a per-domain basis (or rather per subdomain basis), allowing all cookies to be saved between the various sites without any hassle.

The idea is that the Session class will handle transfer inbetween sites, but using a custom router makes the development even easier.

There is a need to refine the code however, so please post a ticket about any inconsistencies that exist in the code, such as duplicate functionality etc.

In order to use the router, create a class that implements the from the IRouter interface and handle the routeRequest() call. Then simply call on the Controller::invoke() method to fire up the controller.

More to come :)

Unclaimed tickets

Here is an up to date list of the current unclaimed tickets if you are looking for an assignment. For more information on how to commit fixes or get your hands on the source to begin with, check out Use the Source.

  • Posted: 2009-10-08 07:07 (Updated: 2009-10-09 00:48)
  • Author: noccy
  • Categories: tickets
  • Comments (0)

Lepton/PHP

Links:

Roadmap:

0.2 due Apr 01, 2010 [in -120 days, for -120 days]
Lepton 0.2 codename Achernar is the first pre-release of Lepton. It should have reliable APIs to work with databases as well as authentication. The key content management function such as Wiki and Forum should be functional, and if possible also Blog and Comments.

Core

Lepton CMS

  • Content Management (Wiki, Forum, Blog, Comments)
0.2.1 due May 01, 2010 [in -90 days, for 30 days]
This milestone will resolve tickets that could not be closed in time for the 0.2 release and is to be considered a bugfix release.
0.3 due Jun 01, 2010 [in -59 days, for 31 days]
Lepton 0.3 codename Bellatrix:
  • Basic native SMTP implementation
  • Markup working for at least bbcode, safe html subset, and markdown
  • Extensions, Events, and Hooks working
0.4 due Jun 30, 2010 [in -30 days, for 29 days]
Lepton 0.4 codename Chara:
  • All the key modules should have test cases for lUnit
  • Content distribution framework (bittorrent and webseeding)
0.5 due Sep 30, 2010 [in 61 days, for 92 days]
Lepton 0.5 codename Deneb:
  • Installer and Control Panel
  • XMLRPC and SOAP APIs
  • LDWP
1.0 due Dec 31, 2010 [in 153 days, for 92 days]
Lepton 1.0 codename Eltanin:

  • Posted: 2009-10-04 19:57
  • Author: noccy
  • Categories: (none)
  • Comments (0)

Moving on towards 0.2

A number of fixes are pending commits right now, bringing the 0.2 pre-release closer. The testing framework really needs a facelift tho, in order to reliably be able to test all the other components for compliance and regression safety.

Lepton is in need of more developers. It being an open source project (GPL v3 license) there is no money in it. More like the pleasure of being part in something big and awesome.

We need:

  • Unit testing rewrite
  • Graphics and charting code
  • Reliable file mappers

If you are interested, register on the site and post in the forums.

Note that you must preview your post before posting. It might be annoying the first time, but it helps keep the posts proper without markup messup ;)

  • Posted: 2009-10-04 15:21
  • Author: noccy
  • Categories: (none)
  • Comments (0)