Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.0' into 3.0-i18n-next
Browse files Browse the repository at this point in the history
Conflicts:
	src/Console/Command/BakeShell.php
	src/Console/Command/Task/FixtureTask.php
	src/Console/Command/Task/ModelTask.php
	src/Console/Command/Task/ProjectTask.php
	src/Network/Response.php
	src/Template/Error/missing_view.ctp
	tests/TestCase/BasicsTest.php
  • Loading branch information
lorenzo committed Aug 3, 2014
2 parents 20b934b + becc9aa commit 4f263bc
Show file tree
Hide file tree
Showing 167 changed files with 1,440 additions and 1,151 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -10,6 +10,7 @@

# IDE and editor specific files #
#################################
/nbproject
.idea

# OS generated files #
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -16,7 +16,6 @@ services:
matrix:
allow_failures:
- php: hhvm-nightly
- php: 5.6
fast_finish: true
include:
- php: 5.4
Expand Down
14 changes: 8 additions & 6 deletions Makefile
Expand Up @@ -19,6 +19,8 @@ else
AUTH=-u $(GITHUB_USER) -p$(GITHUB_PASS)
endif

DASH_VERSION=$(shell echo $(VERSION) | sed -e s/\\./-/g)

ALL: help
.PHONY: help install test need-version bump-version tag-version

Expand Down Expand Up @@ -107,7 +109,7 @@ tag-app: guard-VERSION build/app
cd build/app && git push $(REMOTE)
cd build/app && git push $(REMOTE) --tags

dist/cakephp-$(VERSION).zip: build/app build/cakephp composer.phar
dist/cakephp-$(DASH_VERSION).zip: build/app build/cakephp composer.phar
mkdir -p dist
@echo "Installing app dependencies with composer"
# Install deps with composer
Expand All @@ -120,17 +122,17 @@ dist/cakephp-$(VERSION).zip: build/app build/cakephp composer.phar
# Including .git will make zip balls huge, and the zipball is
# intended for quick start non-git, non-cli users
@echo "Building zipball for $(VERSION)"
cd build/app && find . -not -path '*.git*' | zip ../../dist/cakephp-$(VERSION).zip -@
cd build/app && find . -not -path '*.git*' | zip ../../dist/cakephp-$(DASH_VERSION).zip -@

# Easier to type alias for zip balls
package: tag-app dist/cakephp-$(VERSION).zip
package: tag-app dist/cakephp-$(DASH_VERSION).zip



# Tasks to publish zipballs to github.
.PHONY: publish release

publish: guard-VERSION guard-GITHUB_USER dist/cakephp-$(VERSION).zip
publish: guard-VERSION guard-GITHUB_USER dist/cakephp-$(DASH_VERSION).zip
@echo "Creating draft release for $(VERSION). prerelease=$(PRERELEASE)"
curl $(AUTH) -XPOST $(API_HOST)/repos/$(OWNER)/cakephp/releases -d '{ \
"tag_name": "$(VERSION)", \
Expand All @@ -144,9 +146,9 @@ publish: guard-VERSION guard-GITHUB_USER dist/cakephp-$(VERSION).zip
file_put_contents("./id.txt", $$d["id"]);'
@echo "Uploading zip file to github."
curl $(AUTH) -XPOST \
$(UPLOAD_HOST)/repos/$(OWNER)/cakephp/releases/`cat ./id.txt`/assets?name=cakephp-$(VERSION).zip \
$(UPLOAD_HOST)/repos/$(OWNER)/cakephp/releases/`cat ./id.txt`/assets?name=cakephp-$(DASH_VERSION).zip \
-H 'Content-Type: application/zip' \
-d '@dist/cakephp-$(VERSION).zip'
-d '@dist/cakephp-$(DASH_VERSION).zip'
# Cleanup files.
rm release.json
rm id.txt
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Expand Up @@ -16,4 +16,4 @@
// @license http://www.opensource.org/licenses/mit-license.php MIT License
// +--------------------------------------------------------------------------------------------+ //
////////////////////////////////////////////////////////////////////////////////////////////////////
3.0.0-alpha1
3.0.0-alpha2
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/Cache/Cache.php
Expand Up @@ -56,7 +56,7 @@
*
* See Cache engine documentation for expected configuration keys.
*
* @see app/Config/core.php for configuration settings
* @see config/app.php for configuration settings
* @param string $name Name of the configuration
* @param array $config Optional associative array of settings passed to the engine
* @return array [engine, settings] on success, false on failure
Expand Down Expand Up @@ -493,7 +493,7 @@ public static function enabled() {
* @param string $config The cache configuration to use for this operation.
* Defaults to default.
* @return mixed If the key is found: the cached data, false if the data
* missing/expired, or an error. If the key is not found: boolean of the
* missing/expired, or an error. If the key is not found: boolean of the
* success of the write
*/
public static function remember($key, $callable, $config = 'default') {
Expand Down
1 change: 1 addition & 0 deletions src/Cache/Engine/FileEngine.php
Expand Up @@ -152,6 +152,7 @@ public function write($key, $data) {
if ($this->_config['lock']) {
$this->_File->flock(LOCK_UN);
}
$this->_File = null;

return $success;
}
Expand Down
34 changes: 17 additions & 17 deletions src/Collection/CollectionTrait.php
Expand Up @@ -260,7 +260,7 @@ public function reduce(callable $c, $zero) {
* ];
* $extracted = (new Collection($items))->extract('comment.user.name');
*
* //Result will look like this when converted to array
* // Result will look like this when converted to array
* ['Mark', 'Renan']
* }}}
*
Expand All @@ -279,14 +279,14 @@ public function extract($matcher) {
* ###Examples:
*
* {{{
* //For a collection of employees
* // For a collection of employees
* $max = $collection->max('age');
* $max = $collection->max('user.salary');
* $max = $collection->max(function($e) {
* return $e->get('user')->get('salary');
* });
*
* //Display employee name
* // Display employee name
* echo $max->name;
* }}}
*
Expand All @@ -308,14 +308,14 @@ public function max($callback, $type = SORT_NUMERIC) {
* ###Examples:
*
* {{{
* //For a collection of employees
* // For a collection of employees
* $min = $collection->min('age');
* $min = $collection->min('user.salary');
* $min = $collection->min(function($e) {
* return $e->get('user')->get('salary');
* });
*
* //Display employee name
* // Display employee name
* echo $min->name;
* }}}
*
Expand Down Expand Up @@ -348,10 +348,10 @@ public function min($callback, $type = SORT_NUMERIC) {
* return $user->age;
* });
*
* //alternatively
* // alternatively
* $items = $collection->sortBy('age');
*
* //or use a property path
* // or use a property path
* $items = $collection->sortBy('department.name');
*
* // output all user name order by their age in descending order
Expand Down Expand Up @@ -390,12 +390,12 @@ public function sortBy($callback, $dir = SORT_DESC, $type = SORT_NUMERIC) {
*
* $group = (new Collection($items))->groupBy('parent_id');
*
* //Or
* // Or
* $group = (new Collection($items))->groupBy(function($e) {
* return $e['parent_id'];
* });
*
* //Result will look like this when converted to array
* // Result will look like this when converted to array
* [
* 10 => [
* ['id' => 1, 'name' => 'foo', 'parent_id' => 10],
Expand Down Expand Up @@ -440,12 +440,12 @@ public function groupBy($callback) {
*
* $indexed = (new Collection($items))->indexBy('id');
*
* //Or
* // Or
* $indexed = (new Collection($items))->indexBy(function($e) {
* return $e['id'];
* });
*
* //Result will look like this when converted to array
* // Result will look like this when converted to array
* [
* 1 => ['id' => 1, 'name' => 'foo'],
* 3 => ['id' => 3, 'name' => 'baz'],
Expand Down Expand Up @@ -486,12 +486,12 @@ public function indexBy($callback) {
*
* $group = (new Collection($items))->countBy('parent_id');
*
* //Or
* // Or
* $group = (new Collection($items))->countBy(function($e) {
* return $e['parent_id'];
* });
*
* //Result will look like this when converted to array
* // Result will look like this when converted to array
* [
* 10 => 2,
* 11 => 1
Expand Down Expand Up @@ -567,7 +567,7 @@ public function take($size = 1, $from = 0) {
*
* $extracted = (new Collection($items))->match(['user.name' => 'Renan']);
*
* //Result will look like this when converted to array
* // Result will look like this when converted to array
* [
* ['comment' => ['body' => 'very cool', 'user' => ['name' => 'Renan']]
* ]
Expand Down Expand Up @@ -652,7 +652,7 @@ public function append($items) {
*
* $combined = (new Collection($items))->combine('id', 'name');
*
* //Result will look like this when converted to array
* // Result will look like this when converted to array
* [
* 1 => 'foo',
* 2 => 'bar',
Expand All @@ -661,7 +661,7 @@ public function append($items) {
*
* $combined = (new Collection($items))->combine('id', 'name', 'parent');
*
* //Result will look like this when converted to array
* // Result will look like this when converted to array
* [
* 'a' => [1 => 'foo', 3 => 'baz'],
* 'b' => [2 => 'bar']
Expand Down Expand Up @@ -781,7 +781,7 @@ public function nest($idPath, $parentPath) {
* $ages = [25, 28];
* $inserted = (new Collection($items))->insert('comment.user.age', $ages);
*
* //Result will look like this when converted to array
* // Result will look like this when converted to array
* [
* ['comment' => ['body' => 'cool', 'user' => ['name' => 'Mark', 'age' => 25]],
* ['comment' => ['body' => 'awesome', 'user' => ['name' => 'Renan', 'age' => 28]]
Expand Down
8 changes: 4 additions & 4 deletions src/Configure/Engine/IniConfig.php
Expand Up @@ -15,7 +15,7 @@
namespace Cake\Configure\Engine;

use Cake\Configure\ConfigEngineInterface;
use Cake\Core\App;
use Cake\Core\Plugin;
use Cake\Error;
use Cake\Utility\Hash;

Expand Down Expand Up @@ -72,13 +72,13 @@ class IniConfig implements ConfigEngineInterface {
* Build and construct a new ini file parser. The parser can be used to read
* ini files that are on the filesystem.
*
* @param string $path Path to load ini config files from. Defaults to APP . 'Config' . DS
* @param string $path Path to load ini config files from. Defaults to CONFIG.
* @param string $section Only get one section, leave null to parse and fetch
* all sections in the ini file.
*/
public function __construct($path = null, $section = null) {
if (!$path) {
$path = APP . 'Config/';
$path = CONFIG;
}
$this->_path = $path;
$this->_section = $section;
Expand Down Expand Up @@ -218,7 +218,7 @@ protected function _getFilePath($key) {
}

if ($plugin) {
$file = App::path('Config', $plugin)[0] . $key;
$file = Plugin::configPath($plugin) . $key;
} else {
$file = $this->_path . $key;
}
Expand Down
10 changes: 5 additions & 5 deletions src/Configure/Engine/PhpConfig.php
Expand Up @@ -15,7 +15,7 @@
namespace Cake\Configure\Engine;

use Cake\Configure\ConfigEngineInterface;
use Cake\Core\App;
use Cake\Core\Plugin;
use Cake\Error;

/**
Expand All @@ -37,11 +37,11 @@ class PhpConfig implements ConfigEngineInterface {
/**
* Constructor for PHP Config file reading.
*
* @param string $path The path to read config files from. Defaults to APP . 'Config/'
* @param string $path The path to read config files from. Defaults to CONFIG.
*/
public function __construct($path = null) {
if (!$path) {
$path = APP . 'Config/';
$path = CONFIG;
}
$this->_path = $path;
}
Expand All @@ -50,7 +50,7 @@ public function __construct($path = null) {
* Read a config file and return its contents.
*
* Files with `.` in the name will be treated as values in plugins. Instead of
* reading from the initialized path, plugin keys will be located using App::path().
* reading from the initialized path, plugin keys will be located using Plugin::path().
*
* @param string $key The identifier to read from. If the key has a . it will be treated
* as a plugin prefix.
Expand Down Expand Up @@ -106,7 +106,7 @@ protected function _getFilePath($key) {
$key .= '.php';

if ($plugin) {
$file = App::path('Config', $plugin)[0] . $key;
$file = Plugin::configPath($plugin) . $key;
} else {
$file = $this->_path . $key;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Command/BakeShell.php
Expand Up @@ -73,7 +73,7 @@ public function main() {
$connections = ConnectionManager::configured();
if (empty($connections)) {
$this->out('Your database configuration was not found.');
$this->out('Add your database connection information to App/Config/app.php.');
$this->out('Add your database connection information to config/app.php.');
return false;
}
$this->out('The following commands can be used to generate skeleton code for your application.');
Expand Down
6 changes: 1 addition & 5 deletions src/Console/Command/Task/ControllerTask.php
Expand Up @@ -66,12 +66,8 @@ public function main($name = null) {
* @return void
*/
public function all() {
$controllersCreated = 0;
foreach ($this->listAll() as $table) {
$controller = $this->_controllerName($table);
$this->bake($controller);
$this->bakeTest($controller);
$controllersCreated++;
$this->main($table);
}
}

Expand Down

0 comments on commit 4f263bc

Please sign in to comment.