Welcome Guest, Not a member yet? Register   Sign In
Khaos Library (r12)
#1

[eluser]Neophyte[/eluser]
Website - KhaosLibrary - Download - Khaos (r12)

If you use PHP 5.3 or are looking to switch to 5.3 and would like to be able to do some of the following things then the Khaos Library might be what you're looking for.

Code:
// Edit an image
$this->khaos->image('sample.jpg')->fit(150, 150)->grayscale()->save('thumbnail.jpg');

// ACL
if ($this->acl->subject('neophyte')->hasAccess('articles', 'publish'))
    echo 'I have access';

// Akismet spam checking
if ($this->khaos->akismet($comment)->isSpam() == false)
    echo 'Good to go...';

// Basic CRUD
$user = $this->khaos->table('members')->find(1);
$user->email = '[email protected]';
$user->save();

// W3C validation
if ($this->khaos->w3html($url)->isValid())
    echo 'Url is valid ...';

The library makes heavy use of lazy loading and dependency injection which is what makes the above syntax style possible whilst keeping each individual component decoupled. This also means you can keep your config options and general preferences outside of your application logic. The library is also extremely light weight with only exactly what you need being included when needed.

As an example in the above call to manipulate an image only when the call is made are the required classes instantiated, typically this would be the Image class and the GdDrawingPackage class (an instance of the GdDrawingPackage is injected into the Image instance)

Note: This code and accompanying website are under heavy development so if you like what you see any bug reports, feedback or any other help people can offer would be greatly appreciated ! Smile


Messages In This Thread
Khaos Library (r12) - by El Forum - 10-31-2010, 06:49 AM
Khaos Library (r12) - by El Forum - 11-01-2010, 07:25 AM
Khaos Library (r12) - by El Forum - 11-01-2010, 08:59 AM
Khaos Library (r12) - by El Forum - 11-01-2010, 09:53 AM
Khaos Library (r12) - by El Forum - 11-01-2010, 10:01 AM
Khaos Library (r12) - by El Forum - 11-01-2010, 10:23 AM
Khaos Library (r12) - by El Forum - 11-01-2010, 10:49 AM
Khaos Library (r12) - by El Forum - 11-01-2010, 11:12 AM
Khaos Library (r12) - by El Forum - 11-01-2010, 02:31 PM
Khaos Library (r12) - by El Forum - 11-01-2010, 02:35 PM
Khaos Library (r12) - by El Forum - 11-01-2010, 03:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB