Flextrine Tutorial – CRUD in a simple Flex 4 address book: Setting up the server

Setting up the server
Creating the entities
Creating the database schema
Loading the entities
Creating new entities
Deleting entities
Updating entities

Before using Flextrine you need to do some groundwork to get your project ready.

  1. Download the latest version of Flextrine from http://code.google.com/p/flextrine2/downloads/list
  2. Install the Flextrine manager.  This is as simple as copying the manager directory from the Flextrine download into a web-accessible directory.  For the purposes of the tutorial I will assume that you have set the URL pointing at this document root as http://localhost/flextrinemanager.  Note that you will require mod_rewrite to be enabled on your webserver for the manager to function correctly.
  3. Install the Flextrine server side libraries.  These are contained in the flextrine/web/lib directory of the the Flextrine download.  All you need to do to install these is to copy flextrine/web/lib to a directory in your PHP include_path, or ammend the include_path to include the flextrine/web/lib directory.  Note that if you don’t want to change your include_path you can set it explicitly after the next step by uncommenting the $flextrineIncludePAth line in config.php of your project (see http://code.google.com/p/flextrine2/wiki/GettingStarted for more details).
  4. Install the latest version of Doctrine 2 from http://www.doctrine-project.org/projects/orm/download.  Doctrine 2 is the technology that Flextrine is based upon and required for its operation.  The easiest way to install Doctrine is to merely extract the package into flextrine/web/lib as this is already in your PHP include_path.  Alternatively you can add a new entry to your include_path pointing to Doctrine.
  5. Create an empty server-side Flextrine project.  The Flextrine download contains a blank project in flextrine/web/flextrineproject which will be your starting point.  Copy this to a new directory on your machine and make this directory web accessible.  For the purposes of this tutorial I will assume that you have set the URL pointing to this directory as http://localhost/contacts and will refer to the directory as the Flextrine server side component.
  6. Create a new MySQL database called contacts.
  7. In your Flextrine server side component open up config.php and set the database connection options in the $connectionOptions variable.

Note that next time you start a new Flextrine projects you only need to do steps 5 – 6 as steps 1 – 4 only need to be done once.

Now we are ready to use Flextrine!  The next step is to create some entities.

Leave a Reply

Your email address will not be published. Required fields are marked *