Permalink
Browse files

Start removing all the <?php from the english docs.

  • Loading branch information...
1 parent 52fe03d commit 60ba09d712258cf6719229d3ee9d7715d688f1d0 @markstory markstory committed Nov 20, 2012
Showing with 40 additions and 449 deletions.
  1. +0 −26 en/appendices/2-0-migration-guide.rst
  2. +0 −2 en/appendices/2-1-migration-guide.rst
  3. +0 −3 en/appendices/2-2-migration-guide.rst
  4. +0 −2 en/appendices/glossary.rst
  5. +5 −26 en/appendices/migrating-from-cakephp-1-2-to-1-3.rst
  6. +15 −60 en/appendices/new-features-in-cakephp-1-3.rst
  7. +6 −24 en/appendices/new-features-in-cakephp-2-0.rst
  8. +5 −12 en/appendices/new-features-in-cakephp-2-1.rst
  9. +1 −2 en/appendices/phpunit-migration-hints.rst
  10. +0 −30 en/console-and-shells.rst
  11. +0 −2 en/console-and-shells/schema-management-and-migrations.rst
  12. +0 −18 en/contributing/cakephp-coding-conventions.rst
  13. +0 −30 en/controllers.rst
  14. +0 −10 en/controllers/components.rst
  15. +3 −32 en/controllers/request-response.rst
  16. +1 −6 en/controllers/scaffolding.rst
  17. +1 −10 en/core-libraries/behaviors/acl.rst
  18. +1 −15 en/core-libraries/behaviors/containable.rst
  19. +0 −11 en/core-libraries/behaviors/translate.rst
  20. +0 −19 en/core-libraries/behaviors/tree.rst
  21. +0 −9 en/core-libraries/caching.rst
  22. +0 −12 en/core-libraries/collections.rst
  23. +0 −9 en/core-libraries/components/access-control-lists.rst
  24. +0 −25 en/core-libraries/components/authentication.rst
  25. +0 −8 en/core-libraries/components/cookie.rst
  26. +0 −20 en/core-libraries/components/pagination.rst
  27. +0 −7 en/core-libraries/components/request-handling.rst
  28. +1 −8 en/core-libraries/components/security-component.rst
  29. +1 −11 en/core-libraries/components/sessions.rst
@@ -111,7 +111,6 @@ Internationalization / Localization
If you want to echo the result of the translation, use::
- <?php
echo __('My Message');
This change includes all shortcut translation methods::
@@ -128,7 +127,6 @@ Alongside this, if you pass additional parameters, the translation will call
`sprintf <http://php.net/manual/en/function.sprintf.php>`_ with these
parameters before returning. For example::
- <?php
// Will return something like "Called: MyClass:myMethod"
echo __('Called: %s:%s', $className, $methodName);
@@ -215,7 +213,6 @@ Components
Component is now the required base class for all components. You should update
your components and their constructors, as both have changed::
- <?php
class PrgComponent extends Component {
function __construct(ComponentCollection $collection, $settings = array()) {
parent::__construct($collection, $settings);
@@ -245,7 +242,6 @@ All the deprecated callbacks in Component have not been transferred to
ComponentCollection. Instead you should use the `trigger()` method to interact
with callbacks. If you need to trigger a callback you could do so by calling::
- <?php
$this->Components->trigger('someCallback', array(&$this));
Changes in disabling components
@@ -429,7 +425,6 @@ Although there has been a huge refactoring in how the classes are loaded, in ver
few occasions you will need to change your application code to respect the way you were
used to doing it. The biggest change is the introduction of a new method::
- <?php
App::uses('AuthComponent', 'Controller/Component');
We decided the function name should emulate PHP 5.3's ``use`` keyword, just as a way
@@ -443,7 +438,6 @@ is used for the first time it will be located.
Some examples on using :php:meth:`App::uses()` when migrating from
:php:meth:`App::import()`::
- <?php
App::import('Controller', 'Pages');
// becomes
App::uses('PagesController', 'Controller');
@@ -468,7 +462,6 @@ All classes that were loaded in the past using ``App::import('Core', $class);``
will need to be loaded using ``App::uses()`` referring to the correct package.
See the api to locate the classes in their new folders. Some examples::
- <?php
App::import('Core', 'CakeRoute');
// becomes
App::uses('CakeRoute', 'Routing/Route');
@@ -494,7 +487,6 @@ App::build() and core paths
Examples::
- <?php
App::build(array('controllers' => array('/full/path/to/controllers')));
//becomes
App::build(array('Controller' => array('/full/path/to/Controller')));
@@ -526,7 +518,6 @@ Cache
::
- <?php
Cache::config('something');
Cache::write('key', $value);
@@ -557,14 +548,12 @@ Router
``index`` action is given a short route. If you wish to continue using short
routes, you can add a route like::
- <?php
Router::connect('/users/:action', array('controller' => 'users', 'plugin' => 'users'));
To your routes file for each plugin you need short routes on.
Your app/Config/routes.php file needs to be updated adding this line at the bottom of the file::
- <?php
require CAKE . 'Config' . DS . 'routes.php';
This is needed in order to generate the default routes for your application. If you do not wish to have such routes,
@@ -663,7 +652,6 @@ In order to accommodate View being removed from the ClassRegistry, the signature
of Helper::__construct() was changed. You should update any subclasses to use
the following::
- <?php
function __construct(View $View, $settings = array())
When overriding the constructor you should always call `parent::__construct` as
@@ -803,13 +791,11 @@ this, just change ``$_minimizedAttributeFormat`` in your AppHelper to ``%s``.
To use with Html/Form helpers and others, you can write::
- <?php
$this->Form->checkbox('field', array('checked' => true, 'value' => 'some_value'));
Other facility is that minimized attributes can be passed as item and not as
key. For example::
- <?php
$this->Form->checkbox('field', array('checked', 'value' => 'some_value'));
Note that ``checked`` have a numeric key.
@@ -938,7 +924,6 @@ afterRender it is the view file being rendered. For beforeLayout and afterLayout
it is the layout file being rendered. Your helpers function signatures should
look like::
- <?php
function beforeRender($viewFile) {
}
@@ -1030,20 +1015,17 @@ Models
Model relationships are now lazy loaded. You can run into a situation where
assigning a value to a nonexistent model property will throw errors::
- <?php
$Post->inexistentProperty[] = 'value';
will throw the error "Notice: Indirect modification of overloaded property
$inexistentProperty has no effect". Assigning an initial value to the property
solves the issue::
- <?php
$Post->nonexistentProperty = array();
$Post->nonexistentProperty[] = 'value';
Or just declare the property in the model class::
- <?php
class Post {
public $nonexistentProperty = array();
}
@@ -1087,12 +1069,10 @@ List of Changes
* API for DboSource::execute has changed, it will now take an array of query
values as second parameter::
- <?php
public function execute($sql, $params = array(), $options = array())
became::
- <?php
public function execute($sql, $options = array(), $params = array())
third parameter is meant to receive options for logging, currently it only
@@ -1102,7 +1082,6 @@ List of Changes
* DboSource::fetchAll() now accepts an array as second parameter, to pass values
to be bound to the query, third parameter was dropped. Example::
- <?php
$db->fetchAll('SELECT * from users where username = ? AND password = ?', array('jhon', '12345'));
$db->fetchAll('SELECT * from users where username = :username AND password = :password', array('username' => 'jhon', 'password' => '12345'));
@@ -1145,15 +1124,13 @@ AclBehavior and TreeBehavior
- No longer supports strings as configuration. Example::
- <?php
public $actsAs = array(
'Acl' => 'Controlled',
'Tree' => 'nested'
);
became::
- <?php
public $actsAs = array(
'Acl' => array('type' => 'Controlled'),
'Tree' => array('type' => 'nested')
@@ -1167,14 +1144,12 @@ Plugins no longer magically append their plugin prefix to components, helpers
and models used within them. You must be explicit with the components, models,
and helpers you wish to use. In the past::
- <?php
public $components = array('Session', 'Comments');
Would look in the controller's plugin before checking app/core components. It
will now only look in the app/core components. If you wish to use objects from a
plugin you must put the plugin name::
- <?php
public $components = array('Session', 'Comment.Comments');
This was done to reduce hard to debug issues caused by magic misfiring. It also
@@ -1272,7 +1247,6 @@ the key "driver" is not accepted anymore, only "datasource", in order to make it
more consistent. Also, as the datasources have been moved to packages you will
need to pass the package they are located in. Example::
- <?php
public $default = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
@@ -12,7 +12,6 @@ removed from the CakePHP core. If you do not already have these classes, you
can use the following while upgrading::
// app/View/Helper/AppHelper.php
- <?php
App::uses('Helper', 'View');
class AppHelper extends Helper {
}
@@ -262,7 +261,6 @@ View
instead.
- ``$scripts_for_layout`` is deprecated. Use the following instead::
- <?php
echo $this->fetch('meta');
echo $this->fetch('css');
echo $this->fetch('script');
@@ -13,7 +13,6 @@ When upgrading to CakePHP 2.2 its important to add a few new configuration
values to ``app/Config/bootstrap.php``. Adding these will ensure consistent
behavior with 2.1.x::
- <?php
// Enable the Dispatcher filters for plugin assets, and
// CacheHelper.
Configure::write('Dispatcher.filters', array(
@@ -36,7 +35,6 @@ behavior with 2.1.x::
You will also need to modify ``app/Config/core.php``. Change the value of
:php:const:`LOG_ERROR` to :php:const:`LOG_ERR`::
- <?php
define('LOG_ERROR', LOG_ERR);
When using ``Model::validateAssociated()`` or ``Model::saveAssociated()`` and
@@ -274,7 +272,6 @@ It is now possible to tag or label cache keys under groups. This makes it
simpler to mass-delete cache entries associated to the same label. Groups are
declared at configuration time when creating the cache engine::
- <?php
Cache::config(array(
'engine' => 'Redis',
...
@@ -12,7 +12,6 @@ Glossary
html attributes
An array of key => values that are composed into html attributes. For example::
- <?php
// Given
array('class' => 'my-class', '_target' => 'blank')
@@ -22,7 +21,6 @@ Glossary
If an option can be minimized or accepts it's name as the value, then ``true``
can be used::
- <?php
// Given
array('checked' => true)
@@ -46,7 +46,6 @@ There is a new way to add those paths. As of 1.3 RC1 the
::
- <?php
App::build(array(
'plugins' => array('/full/path/to/plugins/', '/next/full/path/to/plugins/'),
'models' => array('/full/path/to/models/', '/next/full/path/to/models/'),
@@ -74,11 +73,8 @@ configs are created **before** bootstrap.php is loaded.
``inflections.php`` has been removed, it was an unnecessary file
hit, and the related features have been refactored into a method to
increase their flexibility. You now use ``Inflector::rules()`` to
-load custom inflections.
+load custom inflections::
-::
-
- <?php
Inflector::rules('singular', array(
'rules' => array('/^(bil)er$/i' => '\1', '/^(inflec|contribu)tors$/i' => '\1ta'),
'uninflected' => array('singulars'),
@@ -223,11 +219,8 @@ automatically included without you asking for them. SessionHelper
and SessionComponent now act like every other component and must be
declared like any other helper/component. You should update
``AppController::$components`` and ``AppController::$helpers`` to
-include these classes to retain existing behavior.
-
-::
+include these classes to retain existing behavior::
- <?php
var $components = array('Session', 'Auth', ...);
var $helpers = array('Session', 'Html', 'Form' ...);
@@ -281,11 +274,8 @@ behavior with other prefix style routes in that it was treated
differently. Instead you should use ``Routing.prefixes``. Prefix
routes in 1.3 do not require additional routes to be declared
manually. All prefix routes will be generated automatically. To
-update simply change your core.php.
-
-::
+update simply change your core.php::
- <?php
//from:
Configure::write('Routing.admin', 'admin');
@@ -295,11 +285,8 @@ update simply change your core.php.
See the New features guide for more information on using prefix
routes. A small change has also been done to routing params. Routed
params should now only consist of alphanumeric chars, - and \_ or
-``/[A-Z0-9-_+]+/``.
+``/[A-Z0-9-_+]+/``::
-::
-
- <?php
Router::connect('/:$%@#param/:action/*', array(...)); // BAD
Router::connect('/:can/:anybody/:see/:m-3/*', array(...)); //Acceptable
@@ -308,11 +295,8 @@ increase performance and reduce code clutter. The side effect of
this is two seldom used features were removed, as they were
problematic and buggy even with the existing code base. First path
segments using full regular expressions was removed. You can no
-longer create routes like
-
-::
+longer create routes like::
- <?php
Router::connect('/([0-9]+)-p-(.*)/', array('controller' => 'products', 'action' => 'show'));
These routes complicated route compilation and impossible to
@@ -321,9 +305,6 @@ you use route parameters with capture patterns. Next mid-route
greedy star support has been removed. It was previously possible to
use a greedy star in the middle of a route.
-::
-
- <?php
Router::connect(
'/pages/*/:event',
array('controller' => 'pages', 'action' => 'display'),
@@ -343,7 +324,6 @@ $this->redirect() calls to reflect this change.
::
- <?php
// old format:
$url = array('controller' => 'posts', 'action' => 'view', 'id' => $id);
// use cases:
@@ -500,7 +480,6 @@ automatically outputs SQL logs. If you want to output SQL logs in
::
- <?php
echo $this->element('sql_dump');
You can place this element anywhere in your layout or view. The
Oops, something went wrong.

0 comments on commit 60ba09d

Please sign in to comment.