Skip to content

Latest commit

 

History

History
122 lines (93 loc) · 3.52 KB

GettingStarted.wiki

File metadata and controls

122 lines (93 loc) · 3.52 KB

Table of Contents

Getting Started

<<toc></toc>>

Since Flourish isn’t a framework, getting started might seem a little daunting. Let’s start with getting the Flourish code and setting up our pages to include it.

Downloading Flourish

As a first step, download flourish and extract it into a directory on your server. To help ensure that a server misconfiguration won’t expose your PHP (possibly including database credentials), it is best to try and place your includes outside of the document root.

Set Up an Init Script

At the beginning of every page we aren’t going to want to include every class file or configuration file, so a logical first step is to create an initialization script to handle that. I prefer to create the script at:

Inside of init.php, put:

Create a Configuration Script

For better separation, I prefer to put all configuration code into a separate file from the initialization code. I put all of my configuration code in:

Inside of `config.php` we will put our auto-loading function:

Performance tip: If you are running Flourish on a server that has APC, eAccelerator, Turck MMCache or XCache check out the section about class loading.

Start Using Flourish

Now that we have our init script setup, we can start creating pages and using Flourish. Just add this snippet to the top of each of your pages:

Alternatively if you run Apache and have access to the Apache conf file, you can use PHP’s auto_prepend_file setting with the Apache PHP settings directives.

Next Steps

If you haven’t read it already, the How Do I … ? page is a good resource for exploring some of the functionality of Flourish. The /docs documentation includes links to detailed information about each class, class APIs and general documentation.

The Flourish Demo Site is a good way to dive into some code to see how Flourish can be used.

For a simpler more guided introduction to Flourish, try checking out the following classes:

 - fTemplating: Provides a simple templating system to help reduce duplicated
   HTML
 - fRequest: Retrieves information submitted by the user, in a secure fashion
 - fDatabase: Standard SQL interaction with any MySQL, PostgreSQL, SQLite,
   MSSQL, Oracle or DB2 database

The documentation below includes some topics that most PHP developers should know or learn about:

 - <a href="/docs/Security" target="_blank">PHP/web security</a>
 - <a href="/docs/UTF-8" target="_blank">UTF-8 in PHP</a>
 - <a href="/docs/ObjectRelationalMapping" target="_blank">ORM (Object-Relational Mapping)</a>