Skip to content

Commit 0d9f3a1

Browse files
committed
!
1 parent 812a8c6 commit 0d9f3a1

File tree

1,032 files changed

+266445
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,032 files changed

+266445
-0
lines changed

CONTRIBUTING.md

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# How to contribute
2+
3+
CakePHP loves to welcome your contributions. There are several ways to help out:
4+
* Create an [issue](https://github.com/cakephp/cakephp/issues) on GitHub, if you have found a bug
5+
* Write test cases for open bug issues
6+
* Write patches for open bug/feature issues, preferably with test cases included
7+
* Contribute to the [documentation](https://github.com/cakephp/docs)
8+
9+
There are a few guidelines that we need contributors to follow so that we have a
10+
chance of keeping on top of things.
11+
12+
## Getting Started
13+
14+
* Make sure you have a [GitHub account](https://github.com/signup/free).
15+
* Submit an [issue](https://github.com/cakephp/cakephp/issues), assuming one does not already exist.
16+
* Clearly describe the issue including steps to reproduce when it is a bug.
17+
* Make sure you fill in the earliest version that you know has the issue.
18+
* Fork the repository on GitHub.
19+
20+
## Making Changes
21+
22+
* Create a topic branch from where you want to base your work.
23+
* This is usually the master branch.
24+
* Only target release branches if you are certain your fix must be on that
25+
branch.
26+
* To quickly create a topic branch based on master; `git branch
27+
master/my_contribution master` then checkout the new branch with `git
28+
checkout master/my_contribution`. Better avoid working directly on the
29+
`master` branch, to avoid conflicts if you pull in updates from origin.
30+
* Make commits of logical units.
31+
* Check for unnecessary whitespace with `git diff --check` before committing.
32+
* Use descriptive commit messages and reference the #issue number.
33+
* Core test cases should continue to pass. You can run tests locally or enable
34+
[travis-ci](https://travis-ci.org/) for your fork, so all tests and codesniffs
35+
will be executed.
36+
* Your work should apply the [CakePHP coding standards](http://book.cakephp.org/2.0/en/contributing/cakephp-coding-conventions.html).
37+
38+
## Which branch to base the work
39+
40+
* Bugfix branches will be based on master.
41+
* New features that are backwards compatible will be based on next minor release
42+
branch.
43+
* New features or other non backwards compatible changes will go in the next major release branch.
44+
45+
## Submitting Changes
46+
47+
* Push your changes to a topic branch in your fork of the repository.
48+
* Submit a pull request to the repository in the cakephp organization, with the
49+
correct target branch.
50+
51+
## Test cases and codesniffer
52+
53+
CakePHP tests requires [PHPUnit](http://www.phpunit.de/manual/current/en/installation.html)
54+
3.7, version 4 is not compatible. To run the test cases locally use the following command:
55+
56+
./lib/Cake/Console/cake test core AllTests --stderr
57+
58+
To run the sniffs for CakePHP coding standards:
59+
60+
phpcs -p --extensions=php --standard=CakePHP ./lib/Cake
61+
62+
Check the [cakephp-codesniffer](https://github.com/cakephp/cakephp-codesniffer)
63+
repository to setup the CakePHP standard. The [README](https://github.com/cakephp/cakephp-codesniffer/blob/master/README.mdown) contains installation info
64+
for the sniff and phpcs.
65+
66+
# Additional Resources
67+
68+
* [CakePHP coding standards](http://book.cakephp.org/2.0/en/contributing/cakephp-coding-conventions.html)
69+
* [Existing issues](https://github.com/cakephp/cakephp/issues)
70+
* [Development Roadmaps](https://github.com/cakephp/cakephp/wiki#roadmaps)
71+
* [General GitHub documentation](https://help.github.com/)
72+
* [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
73+
* #cakephp IRC channel on freenode.org

README.md

+52
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,54 @@
1+
<<<<<<< HEAD
2+
# CakePHP
3+
4+
[![Bake Status](https://secure.travis-ci.org/cakephp/cakephp.png?branch=master)](http://travis-ci.org/cakephp/cakephp)
5+
[![Latest Stable Version](https://poser.pugx.org/cakephp/cakephp/v/stable.svg)](https://packagist.org/packages/cakephp/cakephp)
6+
[![License](https://poser.pugx.org/cakephp/cakephp/license.svg)](https://packagist.org/packages/cakephp/cakephp)
7+
8+
[![CakePHP](http://cakephp.org/img/cake-logo.png)](http://www.cakephp.org)
9+
10+
CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.
11+
Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.
12+
13+
14+
## Some Handy Links
15+
16+
[CakePHP](http://www.cakephp.org) - The rapid development PHP framework
17+
18+
[CookBook](http://book.cakephp.org) - THE CakePHP user documentation; start learning here!
19+
20+
[API](http://api.cakephp.org) - A reference to CakePHP's classes
21+
22+
[Plugins](http://plugins.cakephp.org/) - A repository of extensions to the framework
23+
24+
[The Bakery](http://bakery.cakephp.org) - Tips, tutorials and articles
25+
26+
[Community Center](http://community.cakephp.org) - A source for everything community related
27+
28+
[Training](http://training.cakephp.org) - Join a live session and get skilled with the framework
29+
30+
[CakeFest](http://cakefest.org) - Don't miss our annual CakePHP conference
31+
32+
[Cake Software Foundation](http://cakefoundation.org) - Promoting development related to CakePHP
33+
34+
35+
## Get Support!
36+
37+
[#cakephp](http://webchat.freenode.net/?channels=#cakephp) on irc.freenode.net - Come chat with us, we have cake
38+
39+
[Google Group](https://groups.google.com/group/cake-php) - Community mailing list and forum
40+
41+
[GitHub Issues](https://github.com/cakephp/cakephp/issues) - Got issues? Please tell us!
42+
43+
[Roadmaps](https://github.com/cakephp/cakephp/wiki#roadmaps) - Want to contribute? Get involved!
44+
45+
46+
## Contributing
47+
48+
[CONTRIBUTING.md](CONTRIBUTING.md) - Quick pointers for contributing to the CakePHP project
49+
50+
[CookBook "Contributing" Section (2.x)](http://book.cakephp.org/2.0/en/contributing.html) [(3.0)](http://book.cakephp.org/3.0/en/contributing.html) - Version-specific details about contributing to the project
51+
=======
152
waferpie-cakephp-datasource-test
253
================================
54+
>>>>>>> 812a8c6cff2f7c82613a5eb9dbd543543e9f87d9

Vagrantfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
VAGRANTFILE_API_VERSION = "2"
2+
3+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
4+
5+
config.vm.box = "ubuntu/trusty32"
6+
7+
config.vm.network :forwarded_port, guest: 3306, host: 33066
8+
9+
config.vm.network :forwarded_port, guest: 80, host: 8081
10+
11+
config.vm.synced_folder ".", "/vagrant", mount_options: ['dmode=777','fmode=666']
12+
13+
config.vm.provision :shell, path: "bootstrap.sh"
14+
15+
end

app/.htaccess

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<IfModule mod_rewrite.c>
2+
RewriteEngine on
3+
RewriteRule ^$ webroot/ [L]
4+
RewriteRule (.*) webroot/$1 [L]
5+
</IfModule>

app/Config/Schema/db_acl.php

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?php
2+
/**
3+
* This is Acl Schema file
4+
*
5+
* Use it to configure database for ACL
6+
*
7+
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
8+
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
9+
*
10+
* Licensed under The MIT License
11+
* For full copyright and license information, please see the LICENSE.txt
12+
* Redistributions of files must retain the above copyright notice.
13+
*
14+
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
15+
* @link http://cakephp.org CakePHP(tm) Project
16+
* @package app.Config.Schema
17+
* @since CakePHP(tm) v 0.2.9
18+
* @license http://www.opensource.org/licenses/mit-license.php MIT License
19+
*/
20+
21+
/**
22+
* Using the Schema command line utility
23+
* cake schema run create DbAcl
24+
*
25+
*/
26+
class DbAclSchema extends CakeSchema {
27+
28+
/**
29+
* Before event.
30+
*
31+
* @param array $event The event data.
32+
* @return bool Success
33+
*/
34+
public function before($event = array()) {
35+
return true;
36+
}
37+
38+
/**
39+
* After event.
40+
*
41+
* @param array $event The event data.
42+
* @return void
43+
*/
44+
public function after($event = array()) {
45+
}
46+
47+
/**
48+
* ACO - Access Control Object - Something that is wanted
49+
*/
50+
public $acos = array(
51+
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
52+
'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
53+
'model' => array('type' => 'string', 'null' => true),
54+
'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
55+
'alias' => array('type' => 'string', 'null' => true),
56+
'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
57+
'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
58+
'indexes' => array(
59+
'PRIMARY' => array('column' => 'id', 'unique' => 1),
60+
'idx_acos_lft_rght' => array('column' => array('lft', 'rght'), 'unique' => 0),
61+
'idx_acos_alias' => array('column' => 'alias', 'unique' => 0)
62+
)
63+
);
64+
65+
/**
66+
* ARO - Access Request Object - Something that wants something
67+
*/
68+
public $aros = array(
69+
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
70+
'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
71+
'model' => array('type' => 'string', 'null' => true),
72+
'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
73+
'alias' => array('type' => 'string', 'null' => true),
74+
'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
75+
'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
76+
'indexes' => array(
77+
'PRIMARY' => array('column' => 'id', 'unique' => 1),
78+
'idx_aros_lft_rght' => array('column' => array('lft', 'rght'), 'unique' => 0),
79+
'idx_aros_alias' => array('column' => 'alias', 'unique' => 0)
80+
)
81+
);
82+
83+
/**
84+
* Used by the Cake::Model:Permission class.
85+
* Checks if the given $aro has access to action $action in $aco.
86+
*/
87+
public $aros_acos = array(
88+
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
89+
'aro_id' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
90+
'aco_id' => array('type' => 'integer', 'null' => false, 'length' => 10),
91+
'_create' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
92+
'_read' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
93+
'_update' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
94+
'_delete' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
95+
'indexes' => array(
96+
'PRIMARY' => array('column' => 'id', 'unique' => 1),
97+
'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1),
98+
'idx_aco_id' => array('column' => 'aco_id', 'unique' => 0)
99+
)
100+
);
101+
102+
}

app/Config/Schema/db_acl.sql

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# $Id$
2+
#
3+
# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
4+
#
5+
# Licensed under The MIT License
6+
# For full copyright and license information, please see the LICENSE.txt
7+
# Redistributions of files must retain the above copyright notice.
8+
# MIT License (http://www.opensource.org/licenses/mit-license.php)
9+
10+
CREATE TABLE acos (
11+
id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
12+
parent_id INTEGER(10) DEFAULT NULL,
13+
model VARCHAR(255) DEFAULT '',
14+
foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
15+
alias VARCHAR(255) DEFAULT '',
16+
lft INTEGER(10) DEFAULT NULL,
17+
rght INTEGER(10) DEFAULT NULL,
18+
PRIMARY KEY (id)
19+
);
20+
21+
CREATE TABLE aros_acos (
22+
id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
23+
aro_id INTEGER(10) UNSIGNED NOT NULL,
24+
aco_id INTEGER(10) UNSIGNED NOT NULL,
25+
_create CHAR(2) NOT NULL DEFAULT 0,
26+
_read CHAR(2) NOT NULL DEFAULT 0,
27+
_update CHAR(2) NOT NULL DEFAULT 0,
28+
_delete CHAR(2) NOT NULL DEFAULT 0,
29+
PRIMARY KEY(id)
30+
);
31+
32+
CREATE TABLE aros (
33+
id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
34+
parent_id INTEGER(10) DEFAULT NULL,
35+
model VARCHAR(255) DEFAULT '',
36+
foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
37+
alias VARCHAR(255) DEFAULT '',
38+
lft INTEGER(10) DEFAULT NULL,
39+
rght INTEGER(10) DEFAULT NULL,
40+
PRIMARY KEY (id)
41+
);
42+
43+
/* this indexes will improve acl perfomance */
44+
CREATE INDEX idx_acos_lft_rght ON `acos` (`lft`, `rght`);
45+
46+
CREATE INDEX idx_acos_alias ON `acos` (`alias`);
47+
48+
CREATE INDEX idx_aros_lft_rght ON `aros` (`lft`, `rght`);
49+
50+
CREATE INDEX idx_aros_alias ON `aros` (`alias`);
51+
52+
CREATE INDEX idx_aco_id ON `aros_acos` (`aco_id`);

app/Config/Schema/i18n.php

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
/**
3+
* This is i18n Schema file
4+
*
5+
* Use it to configure database for i18n
6+
*
7+
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
8+
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
9+
*
10+
* Licensed under The MIT License
11+
* For full copyright and license information, please see the LICENSE.txt
12+
* Redistributions of files must retain the above copyright notice.
13+
*
14+
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
15+
* @link http://cakephp.org CakePHP(tm) Project
16+
* @package app.Config.Schema
17+
* @since CakePHP(tm) v 0.2.9
18+
* @license http://www.opensource.org/licenses/mit-license.php MIT License
19+
*/
20+
21+
/**
22+
* Using the Schema command line utility
23+
*
24+
* Use it to configure database for i18n
25+
*
26+
* cake schema run create i18n
27+
*/
28+
class I18nSchema extends CakeSchema {
29+
30+
public $name = 'i18n';
31+
32+
/**
33+
* Before callback.
34+
*
35+
* @param array $event Schema object properties
36+
* @return bool Should process continue
37+
*/
38+
public function before($event = array()) {
39+
return true;
40+
}
41+
42+
/**
43+
* After callback.
44+
*
45+
* @param array $event Schema object properties
46+
* @return void
47+
*/
48+
public function after($event = array()) {
49+
}
50+
51+
public $i18n = array(
52+
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
53+
'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'),
54+
'model' => array('type' => 'string', 'null' => false, 'key' => 'index'),
55+
'foreign_key' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
56+
'field' => array('type' => 'string', 'null' => false, 'key' => 'index'),
57+
'content' => array('type' => 'text', 'null' => true, 'default' => null),
58+
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'locale' => array('column' => 'locale', 'unique' => 0), 'model' => array('column' => 'model', 'unique' => 0), 'row_id' => array('column' => 'foreign_key', 'unique' => 0), 'field' => array('column' => 'field', 'unique' => 0))
59+
);
60+
61+
}

app/Config/Schema/i18n.sql

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# $Id$
2+
#
3+
# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
4+
#
5+
# Licensed under The MIT License
6+
# For full copyright and license information, please see the LICENSE.txt
7+
# Redistributions of files must retain the above copyright notice.
8+
# MIT License (http://www.opensource.org/licenses/mit-license.php)
9+
10+
CREATE TABLE i18n (
11+
id int(10) NOT NULL auto_increment,
12+
locale varchar(6) NOT NULL,
13+
model varchar(255) NOT NULL,
14+
foreign_key int(10) NOT NULL,
15+
field varchar(255) NOT NULL,
16+
content mediumtext,
17+
PRIMARY KEY (id),
18+
# UNIQUE INDEX I18N_LOCALE_FIELD(locale, model, foreign_key, field),
19+
# INDEX I18N_LOCALE_ROW(locale, model, foreign_key),
20+
# INDEX I18N_LOCALE_MODEL(locale, model),
21+
# INDEX I18N_FIELD(model, foreign_key, field),
22+
# INDEX I18N_ROW(model, foreign_key),
23+
INDEX locale (locale),
24+
INDEX model (model),
25+
INDEX row_id (foreign_key),
26+
INDEX field (field)
27+
);

0 commit comments

Comments
 (0)