Somebody like to have one installation of cake core and many applications with it.

But  when you have many projects written in different time in diferent versions of cake this is impossible.

Appears problem how to easy use cake shells if you can’t add this util to path.

I propose next solution.

All we need is call modified script from app folder.

Example:

  cd /var/www/shop/app

  ./cake bake

Windows version cake.bat
@echo.
@echo off
@set path=%path%;C:\dev\_tools_\graphviz-2.16\bin\

SET app=%0
SET app1=%CD%
 
cd ..\cake\console
SET lib=%~dp0

php -q “%CD%\cake.php” -working “%app1%”  %*

echo.
cd %app1%
@echo on

Unix version: ./cake

#!/bin/bash
clear

APP=`pwd`
APP1=`pwd`
cd ../cake/console
LIB=${0/%cake/}

echo “Hello $USER,”

exec php -q ${LIB}cake.php -working “${APP1}” “$@”

cd ${APP1}
@echo on

echo ” “;

exit;

Advertisements