The CakePHP core team is proud to announce the second beta release for CakePHP
3.0.0 <https://github.com/cakephp/cakephp/releases/3.0.0-beta2>.
It's been a month since our first beta release, and we are excited by the
big welcome the community has given to the new version. All the positive
feedback and help has been a great motivation for the core team to work
harder on improving the developer experience for 3.0.
This will be the last beta release for 3.0, this means that the API is
already stabilizing and we're mostly focusing on polishing the current
features, performance optimizations, documentation and quickly solving any
issues reported in Github.
We've had a very busy month implementing a few missing features we had in
our roadmap and upgrading some of the popular plugins for CakePHP.
Below the list of new features and changes that made it into 3.0.0-beta2:
DebugKit
Debugging CakePHP 3.0 applications is even better. The new DebugKit is
easier to install, faster and looks gorgeous.
DebugKit is a application toolbar that collects useful statistics about
your code such as time and memory, executed queries, log messages and view
variables. To install Debugkit just use
composer require cakephp/debug_kit "3.0.*-dev"
And add this line to your bootstrap.php file:
Plugin::load('DebugKit', ['bootstrap' => true]);
If you install a new application using the app skeleton
<https://github.com/cakephp/app>, DebugKit will be automatically installed
for you.
Database Migrations
Migrations <https://github.com/cakephp/collection> is now an official
CakePHP plugin. It wraps the excellent Phinx <http://phinx.org/> library
into a CakePHP shell to avoid repeating configuration strings and add some
of the cake experience. A database migration generated by this plugin would
look like:
<?phpuse Phinx\Migration\AbstractMigration;class CreateUsersTable extends
AbstractMigration {
/** * Change. */
public function change() {
// create the table
$table = $this->table('users');
$table->addColumn('id', 'integer')
->addColumn('username', 'string')
->addColumn('password', 'string')
->addColumn('created', 'datetime')
->create();
}
Migrations are reversible. This means that with the same code you can
create or rollback the changes done to the database schema.
To install the Migrations plugins run:
composer require cakephp/migrations "dev-master"
And add this line to your bootstrap.php file:
Plugin::load('Migrations');
New Logger interface
CakePHP has adopted the PSR-3 recommendation for loggers. Now all log
engines implement the Prs\Log\LoggerInterface interface. This means that
the entire logging system can easily be replaced by other implementations,
such as the popular Monolog library <https://github.com/Seldaek/monolog>.
Integration Tests and Data Integrity
Testing controllers has always been problematic. While ControllerTestCase
solved some of the problems, we identified this class as a source of
problems and confusion among our users. We decided to implement the new
IntegrationTestCase class as a way totest all aspects of an HTTP request in
your application without much mocking being involved. This should help you
improve code quality and ensure that your application and routes are
working as expected.
We also made the fixtures system better, allowing developers to define and
work with foreign key constraints in their database. The fixtures system
will now correctly load all data and enable constraints right before your
test code is executed.
New Bake templates
With the date for a stable release getting closer and closer we decided to
give a new look to default baked applications. Hopefully the new look will
feel fresher, more modern, and easier to work with.
Separate packages
We've seen an increasing interest in using the new ORM outside the
framework or within older CakePHP applications. One of our goals since the
start has been making this possible. We have already begun the work to
split the framework into various standalone components that can be reused
and installed with composer. While the ORM has not yet been extracted into
its own repository, most of the necessary pre-requisites are complete. As a
product of this work, we have already extracted several components out of
the main code base:
- Collections <https://github.com/cakephp/collection>: Provides a set of
tools to manipulate arrays or Traversable objects in an efficient and
elegant way.
- Validation <https://github.com/cakephp/validation>: The excellent and
flexible validation library can now be used in any project!
- Utility <https://github.com/cakephp/utility>: Provides the Hash,
Inflector, String and Xml classes.
- Event <https://github.com/cakephp/event>: Our Signal-Slot (or Observer
Pattern) implementation.
- Core <https://github.com/cakephp/core>: The CakePHP core, containing
the Configuration and Plugin management classes.
It is important to note that the these repositories are read-only,
development will continue in the main CakePHP repository and code will be
synchronized regularly to these splits. Please open any ticket or pull
request directly in the main github repository
<https://github.com/cakephp/cakephp>.
ORM Related Improvements
- Added Query::autoFields(). This controls whether the fields for the
main table are automatically selected.
- Ability to pass finder options to custom finders from the paginator by
using the finderOptions key.
- It is now possible to get the default column values out of the
database using the Schema\Table::defaultValue().
- Added accessibleFields as an option key for newEntity() and
patchEntity(). This will allow finer grain control for mass-assignment.
- TranslateBehavior automatically finds translations based on the
current application locale.
- Table::findOrCreate() was added.
- Ability to override the join type for an association using contain()
Plugin Shells
Shells in plugins can now be called without prefixing with the plugin name.
For example for a do_stuff shell living in the Tools plugin, you can
execute:
bin/cake do_stuff
Other improvements
- New uploadedFile validation rule.
- Made String::uuid() 3 times faster.
- Better exception reporting on fatal errors.
- Inflector was optimized for better performance.
- Several optimizations in the Hash class.
- Added Collection::buffered() to transform non-rewindable iterators in
rewindable ones.
Community Plugins
More plugins for version 3.0 are starting to pop. Here's a list of what we
found interesting:
- TwigView <https://github.com/WyriHaximus/TwigView> Use Twig as the
default templating engine.
- Imagine <https://github.com/burzum/cakephp-imagine-plugin/tree/3.0>
Image manipulation plugin
- Geo <https://github.com/dereuromark/cakephp-geo> Contains utility
libraries and behaviors for working with geo data.
- Blame <https://github.com/ceeram/blame> Records the user id who
modified a row in the database.
- CakePdf <https://github.com/FriendsOfCake/CakePdf/tree/3.0> Generates
PDF files using different engines
- Authenticate <https://github.com/FriendsOfCake/Authenticate/tree/cake3>
Authorization and Authentication adapters
- TinyAuth <https://github.com/dereuromark/cakephp-tinyauth> A
lightweight authorization system.
- TwitterBootstrap <https://github.com/gourmet/twitter_bootstrap> A
plugin to generate Boostraped interfaces
- Whoops <https://github.com/gourmet/whoops> Replaces the default
exception renderer with a nice debugging interface.
- Assetic <https://github.com/gourmet/assetic> Minifies and
pre-processes CSS and Javascript We'd like to thank again everyone who has
contributed thoughts, code, documentation or feedback to 3.0 so far.
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.