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

Flourish Blog

Thank You!

We just wanted to say thanks to those who have contributed to the project — see who.

Interested in supporting the project? Visit the Support page.

Around the Web

Flourish is a PHP unframework — a general-purpose, object-oriented library.

It has a modular architecture, meaning it isn’t strictly MVC. It focuses on being secure, well documented and easy to use, while solving problems intrinsic to web development.

Why Use Flourish?

You will find Flourish useful if you need to write code that is any of the following:

  • Secure
  • Consistent and easy to understand
  • Needs to model simple or complex databases, especially existing schemas
  • Works with international data
  • Can perform accurate math calculations
  • Easily manipulates images
  • Able to run on different databases (MySQL, PostgreSQL, SQLite, MSSQL, Oracle, DB2)
  • Can be used on closed-source projects
  • Needs to run on PHP 5.1.6
  • Needs an architecture other than MVC
  • Plays nicely with other libraries and frameworks

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 documentation for a list of all of the Flourish classes.