Skip to content

Commit

Permalink
Coolops' initial commit
Browse files Browse the repository at this point in the history
- Introduce con-material-admin-dashboard-template

- Introduce clthck/asset-compress-improved plugin, pretty similar to Rails' asset pipeline

- Introduce clthck/cakephp-jade plugin for Jade template engine usage

- Use bower for open source front end package management

- And a few more new stuff ;)
  • Loading branch information
fantastic16 committed Jan 29, 2016
1 parent fc9ce3b commit 3d9f2c7
Show file tree
Hide file tree
Showing 2,542 changed files with 941,682 additions and 252 deletions.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "webroot/assets/components"
}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
/vendor/*
/config/app.php
/config/asset_compress.local.ini
/tmp/*
/logs/*
/node_modules/*
/.sass-cache/*
/mailoutput/*
/webroot/assets/components/*
/webroot/.sass-cache/*
/composer.lock
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
# CakePHP Application Skeleton
# CoolOps Web Application Skeleton based on CakePHP 3

[![Build Status](https://img.shields.io/travis/cakephp/app/master.svg?style=flat-square)](https://travis-ci.org/cakephp/app)
[![License](https://img.shields.io/packagist/l/cakephp/app.svg?style=flat-square)](https://packagist.org/packages/cakephp/app)

A skeleton for creating applications with [CakePHP](http://cakephp.org) 3.x.
A skeleton for creating coolops web applications with [CakePHP](http://cakephp.org) 3.x.

The framework source code can be found here: [cakephp/cakephp](https://github.com/cakephp/cakephp).

## Installation

1. Download [Composer](http://getcomposer.org/doc/00-intro.md) or update `composer self-update`.
2. Run `php composer.phar create-project --prefer-dist cakephp/app [app_name]`.
2. Run `php composer.phar create-project --prefer-dist coolops/web-app [app_name]`.

If Composer is installed globally, run
```bash
composer create-project --prefer-dist cakephp/app [app_name]
composer create-project --prefer-dist coolops/web-app [app_name]
```

You should now be able to visit the path to where you installed the app and see
Expand Down
28 changes: 28 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "coolops-web-app",
"description": "CoolOps web application skeleton (based on CakePHP 3)",
"main": "",
"authors": [
"clthck <joey.corleone92@yahoo.com>"
],
"license": "MIT",
"moduleType": [],
"homepage": "",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"jquery": "~2.1.4",
"underscore": "",
"materialize": "",
"datatables": "~1.10.10",
"datatables-buttons": "~1.1.1",
"datatables-select": "~1.1.0",
"blockUI": "blockui#*"
},
"devDependencies": {}
}
12 changes: 7 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"name": "cakephp/app",
"description": "CakePHP skeleton app",
"homepage": "http://cakephp.org",
"name": "coolops/web-app",
"description": "CoolOps web application skeleton (based on CakePHP 3)",
"homepage": "http://github.com/coolops/web-app",
"type": "project",
"license": "MIT",
"require": {
"php": ">=5.4.16",
"php": ">=7.0.0",
"cakephp/cakephp": "~3.1",
"mobiledetect/mobiledetectlib": "2.*",
"cakephp/migrations": "~1.0",
"cakephp/plugin-installer": "*"
"cakephp/plugin-installer": "*",
"clthck/cakephp-jade": "*",
"clthck/asset-compress-improved": "~3.0"
},
"require-dev": {
"psy/psysh": "@stable",
Expand Down
60 changes: 57 additions & 3 deletions config/app.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
* enable timestamping regardless of debug value.
*/
'Asset' => [
// 'timestamp' => true,
'timestamp' => 'force',
],

/**
Expand Down Expand Up @@ -206,7 +206,11 @@
* See vendor\cakephp\cakephp\src\Database\Driver for complete list
*/
'Datasources' => [
'default' => [
'default' => [],
/**
* The connection is used during development (debug) mode.
*/
'dev' => [
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'persistent' => false,
Expand All @@ -219,7 +223,50 @@
//'port' => 'non_standard_port_number',
'username' => 'my_app',
'password' => 'secret',
'database' => 'my_app',
'database' => 'my_app_dev',
'encoding' => 'utf8',
'timezone' => 'UTC',
'flags' => [],
'cacheMetadata' => true,
'log' => false,

/**
* Set identifier quoting to true if you are using reserved words or
* special characters in your table or column names. Enabling this
* setting will result in queries built using the Query Builder having
* identifiers quoted when creating SQL. It should be noted that this
* decreases performance because each query needs to be traversed and
* manipulated before being executed.
*/
'quoteIdentifiers' => false,

/**
* During development, if using MySQL < 5.6, uncommenting the
* following line could boost the speed at which schema metadata is
* fetched from the database. It can also be set directly with the
* mysql configuration directive 'innodb_stats_on_metadata = 0'
* which is the recommended value in production environments
*/
//'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
],

/**
* The connection is used during production mode.
*/
'prod' => [
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'persistent' => false,
'host' => 'localhost',
/**
* CakePHP will use the default DB port based on the driver selected
* MySQL on MAMP uses port 8889, MAMP users will want to uncomment
* the following line and set the port accordingly
*/
//'port' => 'non_standard_port_number',
'username' => 'my_app',
'password' => 'secret',
'database' => 'my_app_prod',
'encoding' => 'utf8',
'timezone' => 'UTC',
'flags' => [],
Expand Down Expand Up @@ -325,5 +372,12 @@
*/
'Session' => [
'defaults' => 'php',
'timeout' => 0,
],

/**
* Custom configuration
*/
'Custom' => [
],
];
77 changes: 77 additions & 0 deletions config/asset_compress.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
; General settings control basic behavior of the plugin
;
; * cacheConfig - set to true to cache the parsed configuration data
; so it doesn't get parsed on each request.
;
; * alwaysEnableController - Set to true to always enable the
; AssetsController. Generally you will want to disable the controller
; in production, as it could allow an attacker to request expensive
; resources repeatedly. However, if you need the controller available
; in production. You can enable this flag.
;
; * themes - Define which plugins are themes. Theme plugins will be scanned
; for asset files when building targets containing themed files.
;
[General]
cacheConfig = false
alwaysEnableController = false

[filter_PostCSS]
options = '-u autoprefixer --autoprefixer.browsers "> 5%" -u cssnano'

[filter_Uglifyjs]
options = "-m"

; Define an extension type.
;
; _filters, _targets and other keys prefixed with this value
; are connected when the ini file is parsed.
;
; * cachePath - is where built files will be output
; * timestamp - Set to true to add a timestamp to build files.
; * paths - An array of paths where files used in builds can be found
; Supports glob expressions.
; * filters - A list of filters to be applied to all build files
; using this extension.
; * baseUrl - Set the base url this type of asset is served off of, good
; for using with CDN's
[js]
baseUrl =
timestamp = true
paths[] = WEBROOT/assets/javascripts/**/*
paths[] = WEBROOT/assets/components/**/*
paths[] = WEBROOT/assets/components_premium/**/*
cachePath = WEBROOT/js
filters[] = Sprockets
filters[] = Uglifyjs

; Each target should have a section defining the files
; everything after js_* is considered the build file.
; all files included in the build are relative to the parent
; paths key.
;
; targets can include their own filters.
[application.js]
files[] = application.js

; Create the CSS extension
[css]
paths[] = WEBROOT/assets/stylesheets/**/*
paths[] = WEBROOT/assets/components/**/*
paths[] = WEBROOT/assets/components_premium/**/*
cachePath = WEBROOT/css
timestamp = true
filters[] = ScssFilter
filters[] = PostCSS

[cake_default.css]
files[] = base.css
files[] = cake.css

[application.css]
files[] = nanoscroller.css
files[] = font-awesome.min.css
files[] = material-design-icons.min.css
files[] = ionicons.min.css
files[] = weather-icons.min.css
files[] = application.scss
18 changes: 18 additions & 0 deletions config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
*/
ini_set('intl.default_locale', 'en_US');

ini_set('max_execution_time', 3600);

/**
* Register application error and exception handlers.
*/
Expand Down Expand Up @@ -133,6 +135,15 @@
unset($httpHost, $s);
}

/**
* Use different database for dev mode and production mode.
*/
if (Configure::read('debug')) {
Configure::write('Datasources.default', Configure::read('Datasources.dev'));
} else {
Configure::write('Datasources.default', Configure::read('Datasources.prod'));
}

Cache::config(Configure::consume('Cache'));
ConnectionManager::config(Configure::consume('Datasources'));
Email::configTransport(Configure::consume('EmailTransport'));
Expand Down Expand Up @@ -181,6 +192,8 @@
*/

Plugin::load('Migrations');
Plugin::load('clthck/JadeView');
Plugin::load('AssetCompress', ['bootstrap' => true]);

// Only try to load DebugKit in development mode
// Debug Kit should not be installed on a production system
Expand All @@ -201,3 +214,8 @@
*/
Type::build('date')->useLocaleParser();
Type::build('datetime')->useLocaleParser();

/**
* Include custom constants and functions here.
*/
include 'custom_global.php';
8 changes: 8 additions & 0 deletions config/custom_global.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
/**
* Define custom global constants
*/

/**
* Define custom global functions
*/
10 changes: 10 additions & 0 deletions config/form_template.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
/**
* This is a custom template config FormHelper will be using.
*
* @link http://book.cakephp.org/3.0/en/views/helpers/form.html#customizing-the-templates-formhelper-uses
*/
return [
// 'inputContainer' => '{{content}}',
// 'inputContainerError' => '{{content}}{{error}}',
];
5 changes: 5 additions & 0 deletions config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
*/
Router::defaultRouteClass('DashedRoute');

Router::scope('/ajax', function ($routes) {

$routes->connect('/:controller/:action', [], ['routeClass' => 'AjaxDashedRoute']);
});

Router::scope('/', function ($routes) {
/**
* Here, we are connecting '/' (base path) to a controller called 'Pages',
Expand Down
Loading

0 comments on commit 3d9f2c7

Please sign in to comment.