Flight Skeleton
Simple Flight micro Framework skeleton application with Twig & Monolog & Eloquent ORM. This package is suitable for any web hosting with php version higher 5.3. Use this skeleton application to quickly setup and start working on a new application. This application does not use latest version libraries: Monolog, Eloquent ORM - since the more recent versions use a higher php version., (*1)
Installation use composer
$ composer create-project andrey900/flight-skeleton path/to/install
Composer will create a new Flight Skeleton project under the path/to/install
directory., (*2)
Installation use git
$ git clone andrey900/Flight-Skeleton path/to/install
Git will create a new Flight Skeleton project under the path/to/install
directory., (*3)
Installation of the unix console (not realization)
$ mkdir path/to/install && cd path/to/install
$ wget -c https://github.com/andrey900/Flight-Skeleton/archive/master.zip -O FlightSkeleton.zip
$ unzip FlightSkeleton.zip && rm FlightSkeleton.zip
Installation use browser
Download the zip archive use link, or use button "Clone or download -> Download zip". Uncompressed archive in you hosting or local directory., (*4)
Remember: The string "path/to/install" should be replaced by your folder path., (*5)
First start
Open file src/bootstrap/config.php for edit, and enter the correct data for your connection db. More info for config file link, (*6)
Copy files to you root webserver folder. Open browser input you host.
Local start use php in unix:, (*7)
$ cd path/to/install
$ php -S 127.0.0.1:8080
After open browser use link: http://localhost:8080, (*8)
Folder structure
.
โโโ .git # git repository folder
โโโ cache # Cache folder
โ โโโ ... # Cache type, etc
โโโ log # Logs files
โโโ src # Folder for you application source code
โ โโโ App # You namespace for library and classes
โ โ โโโ ... # Make you structure, etc
โ โโโ bootstrap # Files using for starting application
โ โโโ Controllers # Controllers for you application
โ โโโ Models # Model for you application
โโโ templates # Templates use in you application
โ โโโ main # Holds name for template, use for many templates and easy substitution
โ โโโ ... # Make you template, etc
โโโ uploads # Static files
โโโ ... # Make you folder, etc
Files structure
.
โโโ src
โ โโโ App
โ โ โโโ Routes # Example: Routes namespace
โ โ โ โโโ RouteGenerator.php # Example: Make array for config, and init this routers
โ โ โโโ Utils.php # Example: Class for utilities
โ โโโ bootstrap
โ โ โโโ config.php # Config array for you application: @return array
โ โ โโโ dependencies.php # Init dependencies and class in Flight
โ โ โโโ routes.php # Init routes in Flight
โ โ โโโ start.php # Boot file for you application
โ โโโ Controllers
โ โ โโโ FrontController.php # Example: Base controller and logic for front-end
โ โ โโโ PageController.php # Example: Specific controller for type page
โ โโโ Models
โ โโโ Pages.php # Example: Page model for sql table "pages"
โโโ templates
โโโ main # Example: template
โโโ base.twig # Base template layout
โโโ home.twig # Home template
โโโ pageLists.twig # List pages template
โโโ pageDetail.twig # Detail page template
โโโ 404.twig # 404 error - page not found template
Config example
Structure file config - multidimensional array. This file must return always array for correctly functioning your application!, (*9)
First level - key for config library
Second level - array - with a convenient structure for use, most often used key-value, (*10)
Example:, (*11)
return array(
...
"you_key" => array(
"you_first_key" => "value1",
"you_second_key" => "value2",
),
);
Install example site and db structure
Follow for link: /install-example/ and click button "Install"., (*12)
Remember: You must first start and correctly configure a database connection., (*13)
More links and docs
More information can be found in the documentation of individual system modules:
- Flight
- Twig
- Illuminate ORM
- Monolog, (*14)