diff options
Diffstat (limited to 'fai_gestion/bin')
-rwxr-xr-x | fai_gestion/bin/cake | 68 | ||||
-rw-r--r-- | fai_gestion/bin/cake.bat | 27 | ||||
-rw-r--r-- | fai_gestion/bin/cake.php | 12 |
3 files changed, 107 insertions, 0 deletions
diff --git a/fai_gestion/bin/cake b/fai_gestion/bin/cake new file mode 100755 index 0000000..c5c7000 --- /dev/null +++ b/fai_gestion/bin/cake @@ -0,0 +1,68 @@ +#!/usr/bin/env sh +################################################################################ +# +# Cake is a shell script for invoking CakePHP shell commands +# +# CakePHP(tm) : Rapid Development Framework (https://cakephp.org) +# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) +# +# Licensed under The MIT License +# For full copyright and license information, please see the LICENSE.txt +# Redistributions of files must retain the above copyright notice. +# +# @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) +# @link https://cakephp.org CakePHP(tm) Project +# @since 1.2.0 +# @license https://opensource.org/licenses/mit-license.php MIT License +# +################################################################################ + +# Canonicalize by following every symlink of the given name recursively +canonicalize() { + NAME="$1" + if [ -f "$NAME" ] + then + DIR=$(dirname -- "$NAME") + NAME=$(cd -P "$DIR" > /dev/null && pwd -P)/$(basename -- "$NAME") + fi + while [ -h "$NAME" ]; do + DIR=$(dirname -- "$NAME") + SYM=$(readlink "$NAME") + NAME=$(cd "$DIR" > /dev/null && cd $(dirname -- "$SYM") > /dev/null && pwd)/$(basename -- "$SYM") + done + echo "$NAME" +} + +# Find a CLI version of PHP +findCliPhp() { + for TESTEXEC in php php-cli /usr/local/bin/php + do + SAPI=`echo "<?= PHP_SAPI ?>" | $TESTEXEC 2>/dev/null` + if [ "$SAPI" = "cli" ] + then + echo $TESTEXEC + return + fi + done + echo "Failed to find a CLI version of PHP; falling back to system standard php executable" >&2 + echo "php"; +} + +CONSOLE=$(dirname -- "$(canonicalize "$0")") +APP=$(dirname "$CONSOLE") + +# If your CLI PHP is somewhere that this doesn't find, you can define a PHP environment +# variable with the correct path in it. +if [ -z "$PHP" ] +then + PHP=$(findCliPhp) +fi + +if [ $(basename $0) != 'cake' ] +then + exec $PHP "$CONSOLE"/cake.php $(basename $0) "$@" +else + exec $PHP "$CONSOLE"/cake.php "$@" +fi + +exit diff --git a/fai_gestion/bin/cake.bat b/fai_gestion/bin/cake.bat new file mode 100644 index 0000000..ad13782 --- /dev/null +++ b/fai_gestion/bin/cake.bat @@ -0,0 +1,27 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: +:: Cake is a Windows batch script for invoking CakePHP shell commands +:: +:: CakePHP(tm) : Rapid Development Framework (https://cakephp.org) +:: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) +:: +:: Licensed under The MIT License +:: Redistributions of files must retain the above copyright notice. +:: +:: @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) +:: @link https://cakephp.org CakePHP(tm) Project +:: @since 2.0.0 +:: @license https://opensource.org/licenses/mit-license.php MIT License +:: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +@echo off + +SET app=%0 +SET lib=%~dp0 + +php "%lib%cake.php" %* + +echo. + +exit /B %ERRORLEVEL% diff --git a/fai_gestion/bin/cake.php b/fai_gestion/bin/cake.php new file mode 100644 index 0000000..320ee36 --- /dev/null +++ b/fai_gestion/bin/cake.php @@ -0,0 +1,12 @@ +#!/usr/bin/php -q +<?php +// Check platform requirements +require dirname(__DIR__) . '/config/requirements.php'; +require dirname(__DIR__) . '/vendor/autoload.php'; + +use App\Application; +use Cake\Console\CommandRunner; + +// Build the runner with an application and root executable name. +$runner = new CommandRunner(new Application(dirname(__DIR__) . '/config'), 'cake'); +exit($runner->run($argv)); |