Skip to content

Commit

Permalink
Added base layout and index file
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-buckley committed Jan 29, 2017
1 parent dcf9863 commit c6c748b
Show file tree
Hide file tree
Showing 13 changed files with 138 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
config.php

# IDE Fluff
.settings
.buildpath
.project
.metadata
.phpintel
12 changes: 12 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<IfModule mod_headers.c>
RequestHeader unset Proxy
</IfModule>

Options All -Indexes

# Turn on the RewriteEngine
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(jpg|png|ico|jpeg|gif|css|js)$
RewriteRule ^(.*)$ /index.php [NC,L,QSA]
3 changes: 3 additions & 0 deletions cache/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!.htaccess
!.gitignore
1 change: 1 addition & 0 deletions cache/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deny from all
79 changes: 79 additions & 0 deletions config.php.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php

//======= Override Main Module Company Parameters ============

Config::set('main.application_name', 'Cmfive');
Config::set('main.company_name', '2pi Software');
Config::set('main.company_url', 'http://2pisoftware.com');

// enter a valid email address

Config::set('main.company_support_email','');

//=============== Timezone ===================================

date_default_timezone_set('Australia/Sydney');
Config::set("system.timezone", "Australia/Sydney");

//========== Database Configuration ==========================

Config::set("database", array(
"hostname" => "localhost",
"username" => "<username>",
"password" => "<password>",
"database" => "<database>",
"driver" => "mysql"
));

//=========== Email Layer Configuration =====================

Config::append('email', array(
"layer" => "smtp", // smtp or sendmail
"command" => "", // used for sendmail layer only
"host" => "smtp.gmail.com",
"port" => 465,
"auth" => true,
"username" => '<email>',
"password" => '<password>',
));

//========= Anonymous Access ================================

// bypass authentication if sent from the following IP addresses
// specify an IP address and an array of allowed actions from that IP

Config::set("system.allow_from_ip", array(
"10.0.0.0" => array("action1", "action2"),
));

// or bypass authentication for the following modules

Config::set("system.allow_module", array(
// "rest", // uncomment this to switch on REST access to the database objects.
));

// or bypass authentication for the following actions

Config::set('system.allow_action', array(
"auth/login",
"auth/forgotpassword",
"auth/resetpassword",
//"admin/datamigration"
));

//========= REST Configuration ==============================
// check the following configuration carefully to secure
// access to the REST infrastructure.
//===========================================================

// use the API_KEY to authenticate with username and password

Config::set('system.rest_api_key', "abcdefghijklmnopqrstuvwxyz1234567890");

// include class of objects that you want available via REST
// be aware that only the listed objects will be available via
// the REST API

Config::set('system.rest_include', array(
// "Contact"
));
7 changes: 7 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
ini_set("display_errors", 1);
error_reporting(E_ALL);

require_once 'system/web.php';
$web = new Web();
$web->start();
1 change: 1 addition & 0 deletions lib/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deny from all
3 changes: 3 additions & 0 deletions log/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!.htaccess
!.gitignore
1 change: 1 addition & 0 deletions log/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deny from all
2 changes: 2 additions & 0 deletions modules/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
2 changes: 2 additions & 0 deletions robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow: /
2 changes: 2 additions & 0 deletions uploads/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
17 changes: 17 additions & 0 deletions web.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="/index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

0 comments on commit c6c748b

Please sign in to comment.