Skip to content

Commit

Permalink
Merge branch 'master' into 3.0
Browse files Browse the repository at this point in the history
Conflicts:
	en/controllers/request-response.rst
	en/development/routing.rst
  • Loading branch information
markstory committed Sep 22, 2012
2 parents 621620c + 45663b1 commit 2700e52
Show file tree
Hide file tree
Showing 237 changed files with 50,815 additions and 784 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.pyc
build/*
*/_build/*
.DS_Store
.DS_Store
.project
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ website-dirs:
website: website-dirs html populate-index epub pdf
# Move HTML
$(foreach lang, $(LANGS), cp -r build/html/$(lang) $(DEST)/$(lang);)

# Move EPUB files
$(foreach lang, $(LANGS), cp -r build/epub/$(lang)/*.epub $(DEST)/_downloads/$(lang) || true;)

Expand Down
2 changes: 1 addition & 1 deletion config/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,4 +280,4 @@
epub_tocdup = False

# Languages available.
languages = ['en', 'pt', 'es', 'ja', 'ru']
languages = ['en', 'pt', 'es', 'ja', 'ru', 'fr']
23 changes: 17 additions & 6 deletions en/appendices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,24 @@ Appendices
Appendices contain information regarding the new features
introduced in 2.0, and the migration path from 1.3 to 2.0.

2.0 Migration Guide
2.3 Migration Guide
===================

2.3 is still under development, and any documented changes
may only be available in the ``2.3`` branch in git.

.. toctree::
:maxdepth: 1

appendices/2-0-migration-guide
appendices/new-features-in-cakephp-2-0
appendices/phpunit-migration-hints
appendices/2-3-migration-guide

2.2 Migration Guide
===================

.. toctree::
:maxdepth: 1

appendices/2-2-migration-guide

2.1 Migration Guide
===================
Expand All @@ -23,13 +32,15 @@ introduced in 2.0, and the migration path from 1.3 to 2.0.
appendices/2-1-migration-guide
appendices/new-features-in-cakephp-2-1

2.2 Migration Guide
2.0 Migration Guide
===================

.. toctree::
:maxdepth: 1

appendices/2-2-migration-guide
appendices/2-0-migration-guide
appendices/new-features-in-cakephp-2-0
appendices/phpunit-migration-hints

Migration from 1.2 to 1.3
=========================
Expand Down
5 changes: 4 additions & 1 deletion en/appendices/2-2-migration-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ You will also need to modify ``app/Config/core.php``. Change the value of
When using ``Model::validateAssociated()`` or ``Model::saveAssociated()`` and
primary model validation fails, the validation errors of associated models are no longer wiped out.
``Model::$validationErrors`` will now always show all the errors.
You might need to update your testcases to reflect this change.
You might need to update your test cases to reflect this change.

Console
=======
Expand Down Expand Up @@ -318,6 +318,9 @@ Model Validation
compatible. It also exposes a rich API to add, modify and remove validation
rules. Check docs for this object in :doc:`/models/data-validation`.

- Custom validation functions in your models need to have "public" visibility
so that they are accessible by ``ModelValidator``.

- New validation rules added:

* :php:meth:`Validation::naturalNumber()`
Expand Down
211 changes: 211 additions & 0 deletions en/appendices/2-3-migration-guide.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
2.3 Migration Guide
###################

CakePHP 2.3 is a fully API compatible upgrade from 2.2. This page outlines
the changes and improvements made in 2.3.

Constants
---------

An application can now easily define :php:const:`CACHE` and :php:const:`LOGS`,
as they are conditionally defined by CakePHP now.

Caching
=======

- FileEngine is always the default cache engine. In the past a number of people
had difficulty setting up and deploying APC correctly both in cli + web.
Using files should make setting up CakePHP simpler for new developers.

Component
=========

AuthComponent
-------------

- A new authenticate adapter has been added to support blowfish/bcrypt hashed
passwords. You can now use ``Blowfish`` in your ``$authenticate`` array to
allow bcrypt passwords to be used.

PaginatorComponent
------------------

- PaginatorComponent now supports the ``findType`` option. This can be used to
specify what find method you want used for pagination. This is a bit easier
to manage and set than the 0'th index.

SecurityComponent
------------------

- SecurityComponent now supports the ``unlockedActions`` option. This can be used to
disable all security checks for any actions listed in this option.

RequestHandlerComponent
-----------------------

- :php:meth:`RequestHandlerComponent::viewClassMap()` has been added, which is used to map a type
to view classname. You can add ``$settings['viewClassMap']`` for automatically setting
the correct viewClass based on extension/content type.

CookieComponent
---------------

- :php:meth:`CookieComponent::check()` was added. This method works the same as
:php:meth:`CakeSession::check()` does.

Console
=======

- The ``server`` shell was added. You can use this to start the PHP5.4
webserver for your CakePHP application.
- Baking a new project now sets the application's cache prefix to the name of
the application.


Core
====

Configure
---------

- :php:meth:`Configure::check()` was added. This method works the same as
:php:meth:`CakeSession::check()` does.

Error
=====

Exceptions
----------

- CakeBaseException was added, which all core Exceptions now extend. The base exception
class also introduces the ``responseHeader()`` method which can be called on created Exception instances
to add headers for the response, as Exceptions don't reuse any response instance.

Model
=====

- Support for the biginteger type was added to all core datasources, and
fixtures.
- Support for ``FULLTEXT`` indexes was added for the MySQL driver.


Model
-----

- ``Model::find('list')`` now sets the ``recursive`` based on the max
containment depth or recursive value. When list is used with
ContainableBehavior.

Validation
----------

- Missing validation methods will **always** trigger errors now instead of
only in development mode.

Network
=======

SmtpTransport
-------------

- TLS/SSL support was added for SMTP connections.

CakeRequest
-----------

- :php:meth:`CakeRequest::onlyAllow()` was added.

CakeResponse
------------

- :php:meth:`CakeResponse::file()` was added.

CakeEmail
---------

- The ``contentDisposition`` option was added to
:php:meth:`CakeEmail::attachments()`. This allows you to disable the
Content-Disposition header added to attached files.

Routing
=======

Router
------

- Support for ``tel:``, ``sms:`` were added to :php:meth:`Router::url()`.

View
====

- MediaView is deprecated, and you can use new features in
:php:class:`CakeResponse` to achieve the same results.
- Serialization in Json and Xml views has been moved to ``_serialize()``
- beforeRender and afterRender callbacks are now being called in Json and Xml
views when using view templates.
- :php:meth:`View::fetch()` now has a ``$default`` argument. This argument can
be used to provide a default value should a block be empty.

Helpers
=======

FormHelper
----------

- :php:meth:`FormHelper::select()` now accepts a list of values in the disabled
attribute. Combined with ``'multiple' => 'checkbox'``, this allows you to
provide a list of values you want disabled.
- :php:meth:`FormHelper::postLink()` now accepts a ``method`` key. This allows
you to create link forms using HTTP methods other than POST.

TextHelper
----------

- :php:meth:`TextHelper::tail()` was added to truncate text starting from the end.
- `ending` in :php:meth:`TextHelper::truncate()` is deprecated in favor of `ellipsis`

Testing
=======

- A core fixture for the default ``cake_sessions`` table was added. You can use
it by adding ``core.cake_sessions`` to your fixture list.

Utility
=======

CakeNumber
----------

- :php:meth:`CakeNumber::fromReadableSize()` was added.

Folder
------

- :php:meth:`Folder::copy()` and :php:meth:`Folder::move()` now support the
ability to merge the target and source directories in addition to
skip/overwrite.


String
------

- :php:meth:`String::tail()` was added to truncate text starting from the end.
- `ending` in :php:meth:`String::truncate()` is deprecated in favor of `ellipsis`

Debugger
--------

- php:meth:`Debugger::exportVar()` now outputs private and protected properties
in PHP >= 5.3.0.

Security
--------

- Support for `bcrypt <http://codahale.com/how-to-safely-store-a-password/>`_
was added. See the :php:class:`Security::hash()` documentation for more
information on how to use bcrypt.

Validation
----------

- :php:meth:`Validation::fileSize()` was added.
5 changes: 3 additions & 2 deletions en/appendices/migrating-from-cakephp-1-2-to-1-3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,8 @@ new features in the FormHelper.
- ``HtmlHelper::meta()`` no longer has an ``$inline`` parameter.
It has been merged with the ``$options`` array.
- ``HtmlHelper::link()`` no longer has an ``$escapeTitle``
parameter. Use ``$options['escape']`` instead.
parameter. Use ``$options['escape']`` instead. The ``escape`` option
now controls the escaping of the title and attributes at the same time.
- ``HtmlHelper::para()`` no longer has an ``$escape`` parameter.
Use ``$options['escape']`` instead.
- ``HtmlHelper::div()`` no longer has an ``$escape`` parameter.
Expand Down Expand Up @@ -753,4 +754,4 @@ versions, it is recommend that the new path is used.

.. meta::
:title lang=en: Migrating from CakePHP 1.2 to 1.3
:keywords lang=en: inflections,bootstrap,unit tests,constants,cipher,php 5,replacements,pear,array,variables,models,cakephp,plugins
:keywords lang=en: inflections,bootstrap,unit tests,constants,cipher,php 5,replacements,pear,array,variables,models,cakephp,plugins
34 changes: 20 additions & 14 deletions en/console-and-shells.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Creating a shell
================

Let's create a shell for use in the Console. For this example,
we'll create a simple Hello world shell. In you applications
we'll create a simple Hello world shell. In your applications
``Console/Command`` directory create ``HelloShell.php``. Put the following
code inside it::

Expand Down Expand Up @@ -440,14 +440,18 @@ All of the methods that configure an option parser can be chained,
allowing you to define an entire option parser in one series of method calls::

<?php
$parser->addArgument('type', array(
'help' => 'Either a full path or type of class.'
))->addArgument('className', array(
'help' => 'A CakePHP core class name (e.g: Component, HtmlHelper).'
))->addOption('method', array(
'short' => 'm',
'help' => __('The specific method you want help on.')
))->description(__('Lookup doc block comments for classes in CakePHP.'));
function getOptionParser() {
$parser = parent::getOptionParser();
$parser->addArgument('type', array(
'help' => 'Either a full path or type of class.'
))->addArgument('className', array(
'help' => 'A CakePHP core class name (e.g: Component, HtmlHelper).'
))->addOption('method', array(
'short' => 'm',
'help' => __('The specific method you want help on.')
))->description(__('Lookup doc block comments for classes in CakePHP.'));
return $parser;
}

The methods that allow chaining are:

Expand Down Expand Up @@ -564,9 +568,9 @@ and creating boolean switches. Options are created with either

<?php
$parser->addOption('connection', array(
'short' => 'c'
'short' => 'c',
'help' => 'connection',
'default' => 'default'
'default' => 'default',
));

The above would allow you to use either ``cake myshell --connection=other``,
Expand Down Expand Up @@ -922,8 +926,10 @@ Shell API
Loads tasks defined in public :php:attr:`Shell::$tasks`

.. php:method:: nl($multiplier = 1)
Outputs a number of newlines.
:param int $multiplier Number of times the linefeed sequence should be repeated

Returns a number of linefeed sequences.

.. php:method:: out($message = null, $newlines = 1, $level = Shell::NORMAL)
Expand Down Expand Up @@ -1007,4 +1013,4 @@ More topics

.. meta::
:title lang=en: Console and Shells
:keywords lang=en: shell scripts,system shell,application classes,background tasks,line script,cron job,request response,system path,acl,new projects,shells,specifics,parameters,i18n,cakephp,directory,maintenance,ideal,applications,mvc
:keywords lang=en: shell scripts,system shell,application classes,background tasks,line script,cron job,request response,system path,acl,new projects,shells,specifics,parameters,i18n,cakephp,directory,maintenance,ideal,applications,mvc
Loading

0 comments on commit 2700e52

Please sign in to comment.