PHPackages                             shama/oven - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. shama/oven

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

shama/oven
==========

A CakePHP 2 Re-Baker and CMS Plugin

94PHP

Since Jul 12Pushed 13y ago1 watchersCompare

[ Source](https://github.com/shama/oven)[ Packagist](https://packagist.org/packages/shama/oven)[ RSS](/packages/shama-oven/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Oven
====

[](#oven)

A CakePHP 2 Re-Baker and CMS Plugin

BETA / WARNING
--------------

[](#beta--warning)

Oven is currently in **beta**. I would like to get the community's opinion and input on this project. Open an issue, find me on [twitter](http://twitter.com/shamakry) or on irc #cakephp as `shama`.

This means functionality will change and this plugin may *destroy your code*. You have been warned.

WHAT IS THIS?
-------------

[](#what-is-this)

Oven is a CakePHP plugin that enables you to bake an entire app from a single [json recipe](https://github.com/shama/oven/blob/master/Config/config.json) file. It allows you to then edit your app as you would normally and later re-bake as needed without overwriting your code. It also includes an easily override-able scaffolding/CMS controlled by your recipe file.

One Line Install (requires git)
-------------------------------

[](#one-line-install-requires-git)

```
curl https://raw.github.com/shama/oven/master/Console/install.sh | bash -s NewCakeApp

```

Uses git to download the latest CakePHP &amp; Oven. Replace `NewCakeApp` with whatever folder name you want to install into or remove to install into your current working folder.

### Manual Install

[](#manual-install)

If that doesn't work or if you prefer manual labor then just download or...

```
git clone git://github.com/shama/oven.git Plugin/Oven && cd Plugin/Oven && git submodule update --init

```

in a CakePHP 2.x app. Enable the plugin in `app/Config/bootstrap.php` and run the command `./Console/cake oven.init`.

Usage
-----

[](#usage)

### Initialize

[](#initialize)

The `oven.init` command will setup your `Config/core.php` and `Config/database.php` files (if they haven't already been customized). It is recommended that after you've installed Oven to run this command to init your app:

```
./Console/cake oven.init

```

### Recipe Bake

[](#recipe-bake)

Oven uses `Config/oven.json` as a recipe to build your app. After making edits to your recipe, run the command:

```
./Console/cake oven.bake

```

If you want Oven to continously watch for changes to your recipe then run the command:

```
./Console/cake oven.watch

```

### Merge Classes

[](#merge-classes)

At the core of Oven is a nice little PhpBaker lib. It will turn any PHP class into an array. Once a class is represented as an array the fun begins as we can now manipulate the file just like an array. With this we easily can merge two classes with the command:

```
./Console/cake oven.merge Controller/CommentsController Controller/NewCommentsController

```

Will merge properties and methods from CommentsController into NewCommentsController. Any conflicts will use the second stated class.

CMS
---

[](#cms)

### Controllers

[](#controllers)

Oven includes an unobtrusive CMS. Use it when you want or override when you only want to use it partially. To use the CMS, your controllers should extend the `Oven.BasesController`. This will automatically setup the CRUD based on your recipe.

Your controller can be as simple as:

```
