cloudfoundry-samples/cf-ex-code-igniter

Name: cf-ex-code-igniter

Owner: Cloud Foundry Sample Applications

Description: CloudFoundry PHP example application: CodeIgniter

Created: 2013-07-27 13:27:13.0

Updated: 2017-08-17 01:59:12.0

Pushed: 2017-01-20 20:00:00.0

Homepage: null

Size: 385

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

CloudFoundry PHP Example Application: CodeIgniter

This is an example application which can be run on CloudFoundry using the [PHP Build Pack].

This is the CodeIgniter Tutorial application and it demonstrates push a CodeIgniter applications to CloudFoundry.

Usage
  1. Clone the app (i.e. this repo)

    clone https://github.com/cloudfoundry-samples/cf-ex-code-igniter
    f-ex-code-igniter
    
  2. If you don't have one already, create a MySQL service. With Pivotal Web Services, the following command will create a free MySQL database through ClearDb.

    reate-service cleardb spark mysql
    
  3. Push it to CloudFoundry.

    ush
    

    Access your application URL in the browser. You should see the main page and be able to navigate the links. The news section is pulled from the database. Initially it'll be empty, but you can create some news entries with the create page.

Database Details

Previously with this example, it was necessary to create the database manually. Now this happens automatically when you push the application. Here's how this works.

  1. The app is pushed & stages.
  2. Your MySQL service is bound to the app.
  3. The app droplet is run.
  4. The db migration scripts execute.
  5. The app itself starts.

The migration scripts use the technique described here.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.