Friday, January 2, 2015

CakePHP 3.0.0-RC1 Released

The CakePHP core team is proud to announce the first release candidate for CakePHP 3.0.0.
It's been an intense time since our last beta release. We have been busy polishing most of the rough edges that we could find with the help of the community.

This polishing sprint meant a few breaking API breaking changes from beta3, specifically around the validation subsystem, due to many shortcomings found in the previous implementation.

Below the list of new features and changes that made it into 3.0.0-rc1:

Revamped Validation

The validation process was split into two stages. The first stage is a user-facing type of validation and has not changed since the last release except for where and when it is performed.

In previous versions you would do

$article = $this->Articles->newEntity($this->request->data);  $this->Articles->save($article, ['validate' => 'myCustomValidatorName']);

But now, user-facing validation is performed when creating the entity and not when saving it. This requires you to pass the validation option to either newEntity or patchEntity methods:

$article = $this->Articles->newEntity($this->request->data, [      'validate' => 'myCustomValidatorName'  ]);  $this->Articles->save($article);

It is important to notice that fields that fail validation will not be copied into the resulting entity.

The second validation step, that we have called "application rules", is done when saving or deleting an entity. The rules checking step is meant to check application integrity, such as uniqueness of a column, arity or foreignKey constraints:

// In UsersTable.php    public function buildRules(RulesChecker $rules) {      $rules->add($rules->isUnique('email'));      return $rules;  }

Application rules can also be used to enforce business logic constraints such as state machines, and workflow states.

The validate() and validateMany() methods have been removed from the Table class.

You can read more about the application rules system in the rules checker documentation.

New Error Pages

The error pages containing the exception stack traces have been redesigned to be easier to read and spot what caused the error originally. The new look was inspired by the Rails' better errors plugin

New Bake Plugin

The cake bake command is now a plugin. This will help us evolve its code at a higher pace and introduce new code generators and configuration options.

One important change concerning bake is that it now uses CakePHP's View system to render the templates. This means that it is possible to attach listeners to the Bake.beforeRender andBake.afterRender events to modify bake's output.

Additionally, the templating syntax has changed to make them more readable. If you had your own bake templates in the past, they will need to be updated to use the new syntax which uses erb style tags. To get the Bake plugin run:

composer require cakephp/bake=dev-master --dev  

And load it in your application bootstrap_cli.php file:

Plugin::load('Bake');

Table-less Forms

Due to popular request, there is now a Form object that is capable of defining a schema and validating form data without the use of ORM tables or entities:

public function add()  {          $contact = new ContactForm();          if ($this->request->is('post')) {              if ($contact->execute($this->request->data)) {                  $this->Flash->success('We will get back to you soon.');                  return $this->redirect(['action' => 'add']);              }              $this->Flash->error('There was a problem submitting your form.');          }          $this->set('contact', $contact);  }

You can read more about them here http://book.cakephp.org/3.0/en/core-libraries/form.html

Adopted PSR-2

We have recently adopted the PSR-2 coding style standard for CakePHP and all the official plugins. You can read more about the reasoning in this blog post

ORM Related Improvements

  • Added Query::firstOrFail()
  • Allowing to change the joinType in TranslateBehavior
  • Implemented Table::addAssociations() to add multiple associations at once
  • Support for IS NOT operator
  • It is now possible to call matching() and contain() for the same association alias.

We'd like to thank again everyone who has contributed thoughts, code, documentation or feedback to 3.0 so far. Please help us find any issues or rough edges in the code by opening tickets in Github.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Thursday, January 1, 2015

Re: CakePHP 3.0.0-beta3 released

Hello Anthony !

Thank you !!!!     I had enabled the intl php extension but neglected to recycle my apache server.  That has now been done and I get the default home page.

Regards

Lorne

On Friday, January 2, 2015 12:19:33 AM UTC-5, Anthony GRASSIOT wrote:

you must enable intl php extension.

Le 2 janv. 2015 05:53, "Lorne Dudley" <dud...@queensu.ca> a écrit :
Hello Mark !

I have made a number of attempts at getting different cakephp 3.0.0-beta3 applications to run without success.   In all cases I get to this message.
Fatal error: Class 'Locale' not found in C:\Users\RedFox\Documents\web\app-master-cake3\vendor\cakephp\cakephp\src\I18n\I18n.php on line 235
Can you advise this novice user how to get past this point ?

Regards

Lorne Dudley

On Sunday, November 16, 2014 9:49:13 PM UTC-5, mark_story wrote:
The CakePHP core team is excited to announce the release of CakePHP 3.0.0-beta3. While we had originally planned on only doing 2 beta releases, we're not entirely satisfied with the current ORM validation workflow, and want to do some additional work there. The new plan is to have at least two RC releases after beta3. The RC releases will be API frozen and no new features or breaking changes will be added.

Since 3.0.0-beta2, we've been hard at work incorporating community feedback, and completing the remaining changes that will break compatibility in a significant way.

# Breaking Changes since 3.0.0-beta2

* Bake templates now use a templating mechanism that involves a pre-parsing steps of the templates. This was done to improve the readability and ease of creating new bake templates. This also means that any custom templates that you may have will need to be updated.
* The default replacement for `Inflector::slug()` is now `-` instead of `_`.
* `LOG_ERROR` and `TESTS` constants were unused and have been removed.
* `Controller::$actions` was removed and replaced with `Controller::isAction()`. The new method makes it easier to customize which methods your controllers consider to be routable actions.
* `Component::initialize()` is now a post-constructor hook like all other initialize methods.
* Component has a new `beforeFilter()` event listener that is fired *before* a controllers' `beforeFilter` method is.
* `CakeSession::read()` returns null in all failure scenarios now.
* Controller actions invoked with `requestAction()` must return a Response object now. All other return values will trigger an error.
* Database configuration no longer accepts the `'login'` key. You *must* use `'username'`. This was changed to resolve inconsistencies across the framework.
* Checkbox and radio inputs are now nested inside their attached label elements. This was done to improve compatibility with a few popular CSS libraries. If you have customized the templates FormHelper uses, you may need to update your templates.
* `Cake\View\Error\MissingViewException` is now `Cake\View\Error\MissingTemplateException` in order to allow `MissingView` to be used for missing view classes.
* Authentication objects that had implemented `logout()` need to be updated to use the new `Auth.logout` event.
* The `App.www_root` configuration value has been renamed to `App.wwwRoot` for consistency reasons.


# New features since 3.0.0-beta2

* `Cake\Cache\EngineFileEngine` now generates directories when debug is off.
* There are several new standalone libraries extracted from CakePHP. The `Cache`, `Log`, `Utility` packages are now installable separately with composer.
* The `pj()` (print json) helper method has been added as a convenience when working in the interactive console or test cases.
* The `Model.initialize` event has been added. This event is fired right after a table's initialize hook has completed, allowing plugins or other listeners to interact with table objects.
* Database connections, cache engines, loggers and email transports can now be configured with a Datasource Name (DSN) using the `url` key. This makes it easier to define configuration in environment variables which is a recommended approach by many Platform as a service providers.
* `Component::initialize()` and `View::initialize()` were added.
* Arbitrary meta tags can be created with `HtmlHelper::meta()`.
* Exceptions are now raised when custom view class cannot be found.
* Request data marshaled into entities is not forcibly cast now. This makes validating entity data a bit easier as entity data more closely represents the original request data.
* The query expression builder now has a `between()` method for generating `BETWEEN` clauses.
* `Cake\ORM\Behavior::initialize()` was added.
* Stack traces are now displayed on fatal errors if xdebug is installed.
* `Request::is()` now caches results in memory.
* AuthComponent has two new events. `Auth.afterIdentify` is fired after a user is identified or logged in. `Auth.logout` is fired when `AuthComponent::logout()` is called.
* SessionComponent is deprecated. Instead you should be using `$this->request->session()` instead.
* Each hasher in the `FallbackHasher` class can have separate options now.

For more details on all the changes in 3.0.0, you can consult the [migration guide](http://book.cakephp.org/3.0/en/appendices/3-0-migration-guide.html). In closing, we'd like to thank all of the people that have helped so far with the 3.0 release. We've made great progress and without your help we wouldn't be here today.

Download a [packaged release](https://github.com/cakephp/cakephp/releases/3.0.0-beta3).

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+u...@googlegroups.com.
To post to this group, send email to cake...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: CakePHP 3.0.0-beta3 released

you must enable intl php extension.

Le 2 janv. 2015 05:53, "Lorne Dudley" <dudleyl@queensu.ca> a écrit :
Hello Mark !

I have made a number of attempts at getting different cakephp 3.0.0-beta3 applications to run without success.   In all cases I get to this message.
Fatal error: Class 'Locale' not found in C:\Users\RedFox\Documents\web\app-master-cake3\vendor\cakephp\cakephp\src\I18n\I18n.php on line 235
Can you advise this novice user how to get past this point ?

Regards

Lorne Dudley

On Sunday, November 16, 2014 9:49:13 PM UTC-5, mark_story wrote:
The CakePHP core team is excited to announce the release of CakePHP 3.0.0-beta3. While we had originally planned on only doing 2 beta releases, we're not entirely satisfied with the current ORM validation workflow, and want to do some additional work there. The new plan is to have at least two RC releases after beta3. The RC releases will be API frozen and no new features or breaking changes will be added.

Since 3.0.0-beta2, we've been hard at work incorporating community feedback, and completing the remaining changes that will break compatibility in a significant way.

# Breaking Changes since 3.0.0-beta2

* Bake templates now use a templating mechanism that involves a pre-parsing steps of the templates. This was done to improve the readability and ease of creating new bake templates. This also means that any custom templates that you may have will need to be updated.
* The default replacement for `Inflector::slug()` is now `-` instead of `_`.
* `LOG_ERROR` and `TESTS` constants were unused and have been removed.
* `Controller::$actions` was removed and replaced with `Controller::isAction()`. The new method makes it easier to customize which methods your controllers consider to be routable actions.
* `Component::initialize()` is now a post-constructor hook like all other initialize methods.
* Component has a new `beforeFilter()` event listener that is fired *before* a controllers' `beforeFilter` method is.
* `CakeSession::read()` returns null in all failure scenarios now.
* Controller actions invoked with `requestAction()` must return a Response object now. All other return values will trigger an error.
* Database configuration no longer accepts the `'login'` key. You *must* use `'username'`. This was changed to resolve inconsistencies across the framework.
* Checkbox and radio inputs are now nested inside their attached label elements. This was done to improve compatibility with a few popular CSS libraries. If you have customized the templates FormHelper uses, you may need to update your templates.
* `Cake\View\Error\MissingViewException` is now `Cake\View\Error\MissingTemplateException` in order to allow `MissingView` to be used for missing view classes.
* Authentication objects that had implemented `logout()` need to be updated to use the new `Auth.logout` event.
* The `App.www_root` configuration value has been renamed to `App.wwwRoot` for consistency reasons.


# New features since 3.0.0-beta2

* `Cake\Cache\EngineFileEngine` now generates directories when debug is off.
* There are several new standalone libraries extracted from CakePHP. The `Cache`, `Log`, `Utility` packages are now installable separately with composer.
* The `pj()` (print json) helper method has been added as a convenience when working in the interactive console or test cases.
* The `Model.initialize` event has been added. This event is fired right after a table's initialize hook has completed, allowing plugins or other listeners to interact with table objects.
* Database connections, cache engines, loggers and email transports can now be configured with a Datasource Name (DSN) using the `url` key. This makes it easier to define configuration in environment variables which is a recommended approach by many Platform as a service providers.
* `Component::initialize()` and `View::initialize()` were added.
* Arbitrary meta tags can be created with `HtmlHelper::meta()`.
* Exceptions are now raised when custom view class cannot be found.
* Request data marshaled into entities is not forcibly cast now. This makes validating entity data a bit easier as entity data more closely represents the original request data.
* The query expression builder now has a `between()` method for generating `BETWEEN` clauses.
* `Cake\ORM\Behavior::initialize()` was added.
* Stack traces are now displayed on fatal errors if xdebug is installed.
* `Request::is()` now caches results in memory.
* AuthComponent has two new events. `Auth.afterIdentify` is fired after a user is identified or logged in. `Auth.logout` is fired when `AuthComponent::logout()` is called.
* SessionComponent is deprecated. Instead you should be using `$this->request->session()` instead.
* Each hasher in the `FallbackHasher` class can have separate options now.

For more details on all the changes in 3.0.0, you can consult the [migration guide](http://book.cakephp.org/3.0/en/appendices/3-0-migration-guide.html). In closing, we'd like to thank all of the people that have helped so far with the 3.0 release. We've made great progress and without your help we wouldn't be here today.

Download a [packaged release](https://github.com/cakephp/cakephp/releases/3.0.0-beta3).

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: CakePHP 3.0.0-beta3 released

Hello Mark !

I have made a number of attempts at getting different cakephp 3.0.0-beta3 applications to run without success.   In all cases I get to this message.
Fatal error: Class 'Locale' not found in C:\Users\RedFox\Documents\web\app-master-cake3\vendor\cakephp\cakephp\src\I18n\I18n.php on line 235
Can you advise this novice user how to get past this point ?

Regards

Lorne Dudley

On Sunday, November 16, 2014 9:49:13 PM UTC-5, mark_story wrote:
The CakePHP core team is excited to announce the release of CakePHP 3.0.0-beta3. While we had originally planned on only doing 2 beta releases, we're not entirely satisfied with the current ORM validation workflow, and want to do some additional work there. The new plan is to have at least two RC releases after beta3. The RC releases will be API frozen and no new features or breaking changes will be added.

Since 3.0.0-beta2, we've been hard at work incorporating community feedback, and completing the remaining changes that will break compatibility in a significant way.

# Breaking Changes since 3.0.0-beta2

* Bake templates now use a templating mechanism that involves a pre-parsing steps of the templates. This was done to improve the readability and ease of creating new bake templates. This also means that any custom templates that you may have will need to be updated.
* The default replacement for `Inflector::slug()` is now `-` instead of `_`.
* `LOG_ERROR` and `TESTS` constants were unused and have been removed.
* `Controller::$actions` was removed and replaced with `Controller::isAction()`. The new method makes it easier to customize which methods your controllers consider to be routable actions.
* `Component::initialize()` is now a post-constructor hook like all other initialize methods.
* Component has a new `beforeFilter()` event listener that is fired *before* a controllers' `beforeFilter` method is.
* `CakeSession::read()` returns null in all failure scenarios now.
* Controller actions invoked with `requestAction()` must return a Response object now. All other return values will trigger an error.
* Database configuration no longer accepts the `'login'` key. You *must* use `'username'`. This was changed to resolve inconsistencies across the framework.
* Checkbox and radio inputs are now nested inside their attached label elements. This was done to improve compatibility with a few popular CSS libraries. If you have customized the templates FormHelper uses, you may need to update your templates.
* `Cake\View\Error\MissingViewException` is now `Cake\View\Error\MissingTemplateException` in order to allow `MissingView` to be used for missing view classes.
* Authentication objects that had implemented `logout()` need to be updated to use the new `Auth.logout` event.
* The `App.www_root` configuration value has been renamed to `App.wwwRoot` for consistency reasons.


# New features since 3.0.0-beta2

* `Cake\Cache\EngineFileEngine` now generates directories when debug is off.
* There are several new standalone libraries extracted from CakePHP. The `Cache`, `Log`, `Utility` packages are now installable separately with composer.
* The `pj()` (print json) helper method has been added as a convenience when working in the interactive console or test cases.
* The `Model.initialize` event has been added. This event is fired right after a table's initialize hook has completed, allowing plugins or other listeners to interact with table objects.
* Database connections, cache engines, loggers and email transports can now be configured with a Datasource Name (DSN) using the `url` key. This makes it easier to define configuration in environment variables which is a recommended approach by many Platform as a service providers.
* `Component::initialize()` and `View::initialize()` were added.
* Arbitrary meta tags can be created with `HtmlHelper::meta()`.
* Exceptions are now raised when custom view class cannot be found.
* Request data marshaled into entities is not forcibly cast now. This makes validating entity data a bit easier as entity data more closely represents the original request data.
* The query expression builder now has a `between()` method for generating `BETWEEN` clauses.
* `Cake\ORM\Behavior::initialize()` was added.
* Stack traces are now displayed on fatal errors if xdebug is installed.
* `Request::is()` now caches results in memory.
* AuthComponent has two new events. `Auth.afterIdentify` is fired after a user is identified or logged in. `Auth.logout` is fired when `AuthComponent::logout()` is called.
* SessionComponent is deprecated. Instead you should be using `$this->request->session()` instead.
* Each hasher in the `FallbackHasher` class can have separate options now.

For more details on all the changes in 3.0.0, you can consult the [migration guide](http://book.cakephp.org/3.0/en/appendices/3-0-migration-guide.html). In closing, we'd like to thank all of the people that have helped so far with the 3.0 release. We've made great progress and without your help we wouldn't be here today.

Download a [packaged release](https://github.com/cakephp/cakephp/releases/3.0.0-beta3).

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

cakephp-3.0.0-beta3 Fatal error: Class 'Locale' not found in \cakephp-3.0.0-beta3\vendor\cakephp\cakephp\src\I18n\I18n.php on line 229

I am a novice cakephp user who just downloaded the 3.0.0-beta3 version. 
 I get "Fatal error: Class 'Locale' not found in \cakephp-3.0.0-beta3\vendor\cakephp\cakephp\src\I18n\I18n.php on line 229
when I attempt to access http://localhost/cakephp-3.0.0-beta3

Can anyone give me some simple instructions as to how to resolve this ?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

cakePHP 3.0 "out of the box" working example for the novice user ???

I am a cakePHP novice and am attempting to learn by examination of a working model.
So far I have downloaded two cakePHP 3 examples. Both were missing a \vendor\autoload.php component.
Can anyone point me to a cakePHP 3 example that works "out of the box" without any
additional setup required for the novice user ?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: mailchimp cakephp api

Those are all pretty common-knowledge things regarding basic CakePHP stuff, if you used it for a while.
It might be best to first get a  grasp on CakePHP and a few easy things, and go from there.
Don't try to understand all at once.

Using composer is explained on their page. You could just drag and drop it, but the composer approach is usually the cleaner one
You can look at existing projects on how they leverage composer.

The configs file, if not existent can easily be created and loaded in your bootstrap as documented.

mark


Am Donnerstag, 1. Januar 2015 04:52:48 UTC+1 schrieb ajt:
Hi, I want to be able to view emails in a cakephp page sent via mailchimp.

The API is here but
Here are the instructions https://github.com/dereuromark/cakephp-mailchimp


1)Install the plugin into the APP/Plugin folder, ideally via composer. //how? I just copied the extracted zip folder instead, is this OK?



2)Make sure it is loaded - using CakePlugin::loadAll(), for example.
Use the Configure class to set the API data (via APP/Config/configs.php etc):  //there is NO SUCH FILE configs.php


//This goes where?

$config['Mailchimp'] = array(
    'apiKey' => 'YOUR_API_KEY',
    'defaultListId' => 'YOUR_LIST_ID',
    'defaultCampaignId => 'YOUR_CAMPAIGN_ID'
);

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.