- This is a complete install of Codeigniter V2.1.4 with Tank Auth V1.0.9 using Apache and MySQL.
- It has a basic infrastructure in place that I use for most sites ( body, header, content, footer, etc ).
- It's designed to run on an Amazon EC2 instance, but should work great on most Linux systems, although some setup may vary.
- If cloning this repo, you will need to follow the System Setup notes below to get the system running correctly.
- install Pure CSS before starting next project
- super clean, mobile friendly, responsive, grid based, css library
- tbj, refer to the rexsi project for implementation
- this will require a rework of the entire css framework in here: header, body, content, etc...
- http://purecss.io/
- update
.htaccess
- update
$config['base_url']
in/config/config.php
- by default,
robots.txt
blocks all robots
- turned on and off for every page in
/core/MY_Controller.php
( on by default ) $this->output->enable_profiler( TRUE );
- libraries: tankauth
- helpers: url
- Google Analytics ( or other analytics ): set in
/core/MY_Controller.php
- Current Class:
$this->class
- Current Method:
$this->method
- Page Meta Data:
- Generic Data: set in
/core/MY_Controller.php
- Page Specific: set in respective Controller
- variables:
$this->head['meta_title']
$this->head['meta_description']
- Generic Data: set in
- Tank Auth: http://konyukhov.com/soft/tank_auth/
- loaded in
config/autoload.php
by default- alternatively, it could be loaded in required controllers
$this->load->library('tank_auth')
- alternatively, it could be loaded in required controllers
- check if user is logged in:
$this->tank_auth->is_logged_in()
- get user id:
$this->tank_auth->get_user_id()
- get user name:
$this->tank_auth->get_username()
- Loaded in common views via
/views/common/head.php
- Any values set in the
$this->head['headers']
array in a controller will be loaded in the of that page - This data does not need to be passed to views. It's loaded automatically.
- Javascript: load via the
$this->head['headers']
array:- eg
$this->head['headers'][] = '<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>';
- eg
- common style sheets are set in
/core/MY_Controller.php
common.css
reset.css
: commented out by default
- to load a specific stylesheet on a page, append a file to the
$this->head['css']
array - basic styles
body
#body_wrapper
: sits inside the body, and wraps all other content#header
#content
: main content, loaded via the$this->content
variable#footer
.block
- Load a main view in a Controller
- The main views load the common head, header, content, and footer views.
- eg.
/views/one_column.php
loads/views/common/header.php
this->load->view( 'one_column.php' )
- Headers: load into `$this->head['headers']
- This does not need to be passed to the main view.
- Main Content: load into
$this->content
- This does not need to be passed to the main view.
- loaded by the common views via the
/views/common/header.php
file - files found in
/views/navigation/
- commented out by default
- these will be set in flashdata in the user session and automatically displayed in the header file
$this->session->set_flashdata( 'error_message', 'Some message to user.' );
- you can use 'message' or 'error_message' for different style alerts
- designed for an AWS EC2 running Amazon Linux CentOS
- Can probably spin up an AMI
- install ( sudo yum install )
- httpd
- php
- php-mysql
- mysql
- mysql-server
- xebug
- check out online_markdown_editor
- https://github.com/Industrial-Interface/online_markdown_editor.git
- check out to your root web direcory as the www folder ( eg. /var/ )
- create symlinks
- /etc/php.ini -> /data/www/external_configs/php.ini
- /etc/httpd/conf/httpd.conf -> /data/www/external_configs/httpd.conf
- /etc/rc.d/rc.local -> /data/www/external_configs/rc.local
- boot mysql:
sudo /etc/init.d/mysqld start
- create some users
- create a database and import
database.sql
- update USER, PASS, and NAME in
codeigniter/application/configs/database.php
- update the encription key in
/config/config.php
- this will start on it's own once the system is configured.
- boot httpd:
- this will start on it's own once the system is configured.
- Codeigniter: http://ellislab.com/codeigniter
- TankAuth: http://konyukhov.com/soft/tank_auth/