vendor record still hosed
[feisty_meow.git] / production / example_apps / zippy_maps / bin / cake
1 #!/usr/bin/env sh
2 ################################################################################
3 #
4 # Cake is a shell script for invoking CakePHP shell commands
5 #
6 # CakePHP(tm) :  Rapid Development Framework (http://cakephp.org)
7 # Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
8 #
9 # Licensed under The MIT License
10 # For full copyright and license information, please see the LICENSE.txt
11 # Redistributions of files must retain the above copyright notice.
12 #
13 # @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
14 # @link          http://cakephp.org CakePHP(tm) Project
15 # @since         1.2.0
16 # @license       http://www.opensource.org/licenses/mit-license.php MIT License
17 #
18 ################################################################################
19
20 # Canonicalize by following every symlink of the given name recursively
21 canonicalize() {
22         NAME="$1"
23         if [ -f "$NAME" ]
24         then
25                 DIR=$(dirname -- "$NAME")
26                 NAME=$(cd -P "$DIR" > /dev/null && pwd -P)/$(basename -- "$NAME")
27         fi
28         while [ -h "$NAME" ]; do
29                 DIR=$(dirname -- "$NAME")
30                 SYM=$(readlink "$NAME")
31                 NAME=$(cd "$DIR" > /dev/null && cd $(dirname -- "$SYM") > /dev/null && pwd)/$(basename -- "$SYM")
32         done
33         echo "$NAME"
34 }
35
36 CONSOLE=$(dirname -- "$(canonicalize "$0")")
37 APP=$(dirname "$CONSOLE")
38
39 if [ $(basename $0) != 'cake' ]
40 then
41     exec php "$CONSOLE"/cake.php $(basename $0) "$@"
42 else
43     exec php "$CONSOLE"/cake.php "$@"
44 fi
45
46 exit