---
title: 'CakePHP: Calling bake from every dev-app install folder'
url: 'https://maxwesten.nl/blog/articles/cakephp-calling-bake-from-every-dev-app-install-folder'
markdown: 'https://maxwesten.nl/blog/articles/cakephp-calling-bake-from-every-dev-app-install-folder.md'
date: '2007-05-08'
description: 'If you use a setup like I explained in my previous post calling the bake script involves a lot of typing with the core and app parameter paths. If I want to call the bake script from the /Users/mwesten/Sites/dev/myapp cake app folder, it has to be done like this: php /Users/mwesten/Sites/cake1.2.x.x/cake/scripts/bake.php -core /Users/mwesten/Sites/cake1.2.x.x/cake -app /Users/mwesten/Sites/dev/myapp To make things easier on myself I use the following alias'
taxonomy:
  category:
    - OSX
    - PHP
  tag:
    - CakePHP
    - OSX
    - PHP
    - Terminal
  archives_month:
    - may_2007
  archives_year:
    - '2007'
---

# CakePHP: Calling bake from every dev-app install folder

[Home](https://maxwesten.nl/)  [Blog](https://maxwesten.nl/blog)  [Articles](https://maxwesten.nl/blog/articles)  CakePHP: Calling bake from every dev-app install folder 

## [ CakePHP: Calling bake from every dev-app install folder](https://maxwesten.nl/blog/articles/cakephp-calling-bake-from-every-dev-app-install-folder)

    8th May 2007   [CakePHP](https://maxwesten.nl/tag:CakePHP#body-wrapper) [OSX](https://maxwesten.nl/tag:OSX#body-wrapper) [PHP](https://maxwesten.nl/tag:PHP#body-wrapper) [Terminal](https://maxwesten.nl/tag:Terminal#body-wrapper)  

If you use a setup like I explained in my [previous post](http://blog.dlmax.org/blog/cakephp-central-cake-core-install-with-multiple-apps) calling the bake script involves a lot of typing with the core and app parameter paths.

If I want to call the bake script from the */Users/mwesten/Sites/dev/myapp* cake app folder, it has to be done like this:

```php
php /Users/mwesten/Sites/cake1.2.x.x/cake/scripts/bake.php -core /Users/mwesten/Sites/cake1.2.x.x/cake  -app /Users/mwesten/Sites/dev/myapp
```

To make things easier on myself I use the following alias and shell script. First I edit /etc/profile (or ~/.bash\_profile)

```
sudo mate -w /etc/profile

```

and add the following line:

```
alias bake="/Users/mwesten/cake12bake.sh"

```

After this I create the shell script:

```
mate /Users/mwesten/cake12bake.sh

```

add the following 2 lines:

```
#!/bin/sh
php /Users/mwesten/Sites/cake1.2.x.x/cake/scripts/bake.php -core /Users/mwesten/Sites/cake1.2.x.x/cake -app $PWD

```

Now you can execute the bake script from the app folders.

UPDATE: If you are using the latest version (bleeding edge dev install of CakePHP 1.2) you can do the following instead: edit /etc/profile or ~/.bash\_profile and add the following folder to the path statement: `/Users/mwesten/Sites/cake1.2.x.x/cake/console`

After this you can call the bake script like this:

```
cake bake

```

or just "cake" for all possible options....

Hmmm..... For some reason it now still calls the wrong app folder, but I think it will be fixed in no-time ;)

 [ Previous Article](https://maxwesten.nl/blog/articles/automatic-updating-select-boxes-with-ajax) [Next Article ](https://maxwesten.nl/blog/articles/cakephp-central-cake-core-install-with-multiple-apps)

#### Related Posts

- 100 

     [Easiest local development environment on OSX](https://maxwesten.nl/blog/articles/easiest-local-development-environment-on-osx "Easiest local development environment on OSX")
- 100 

     [Setting up MockSMTP on OSX 10.7(Lion) for local PHP development](https://maxwesten.nl/blog/articles/setting-up-mocksmtp-on-osx-10-7lion-for-local-php-development "Setting up MockSMTP on OSX 10.7(Lion) for local PHP development")
- 100 

     [Mod\_security settings for Wordpress 3.x](https://maxwesten.nl/blog/articles/mod_security-settings-for-wordpress-3-x "Mod_security settings for Wordpress 3.x")
- 100 

     [Developing in PHP with NetBeans 6.8](https://maxwesten.nl/blog/articles/developing-in-php-with-netbeans "Developing in PHP with NetBeans 6.8")
- 100 

     [Installing xDebug 2.0.4 or 2.1 on OSX](https://maxwesten.nl/blog/articles/installing-xdebug-204-or-21-on-osx "Installing xDebug 2.0.4 or 2.1 on OSX")

[←](https://xn--sr8hvo.ws/%F0%9F%92%95%F0%9F%8E%89%E2%A4%B5%EF%B8%8F/previous)An IndieWeb Webring 🕸💍 [→](https://xn--sr8hvo.ws/%F0%9F%92%95%F0%9F%8E%89%E2%A4%B5%EF%B8%8F/next)

---

## Navigation

- Parent: [Articles](https://maxwesten.nl/blog/articles.md)
- Previous: [CakePHP: Central cake core install with multiple apps](https://maxwesten.nl/blog/articles/cakephp-central-cake-core-install-with-multiple-apps.md)
- Next: [Automatic updating Select boxes with Ajax](https://maxwesten.nl/blog/articles/automatic-updating-select-boxes-with-ajax.md)
