Flourish is currently in beta. For information about the release schedule, please see the roadmap.

Flourish Blog

Around the Web

Flourish is The PHP Unframework, an object-oriented PHP library designed to reduce code and improve security.

It’s not an MVC framework and it doesn’t try to solve every problem. Instead, it focuses on being small, portable, well documented and easy to use.

Why Use Flourish?

Flourish provides classes to simplify many common and repetitive tasks in PHP with class APIs that are simple and intuitive. It is built to improve the compatibility of code across databases, operating systems and different versions of PHP. It helps produce code that is easy to write, and more importantly, easy to read and maintain.

So how can Flourish help you? The How Do I … ? page contains a list of common issues and the classes that can help. Topics include database interaction, UTF-8 string handling, image manipulation, money calculations and much more. Still not quite sure? Check out these code examples to see Flourish in action.

View Example Code

Below is an example of how to retrieve all active users from the database and print their name.

// Connect to our SQLite database
fORMDatabase::attach(new fDatabase('sqlite', '/path/to/database'));
 
// Create an object to represent rows in the database
class User extends fActiveRecord {
    // Return an iterable set of User objects
    public static function findActive() {
        return fRecordSet::build(
            'User',                            // Make User objects
            array('status=' => 'Active'),      // That are active
            array('date_registered' => 'desc') // Ordered by registration date
        );
    }
}
 
// Loop through and display the users' names
foreach (User::findActive() as $user) {
    echo $user->prepareFirstName() . ' ' . $user->prepareLastName() . '<br />';
}

This example shows how to upload an image, resize it, and make a thumbnail.

// Create an fUpload object to handle the file upload
$uploader = new fUpload();
 
// Require the user upload an image (with MIME type checking server-side)
$uploader->setMIMETypes(
    array('image/jpeg', 'image/gif', 'image/png'),
    'Please upload a .jpg, .png, or .gif image'
);
 
// Move the image and then resize to fit a 500x300 canvas
$image = $uploader->move('/path/to/images', 'image')
                  ->resize(500, 300)
                  ->saveChanges();
 
// Create a 32x32 thumbnail of the image
$thumb = $image->duplicate('/path/to/thumbs')
               ->cropToRatio(1,1)
               ->resize(32,32)
               ->saveChanges();

Curious About Features?

Documentation

Compability

Database/ORM

And More…

Check out the class documentation list for a list of all of the Flourish classes.