Add project
This commit is contained in:
47
bin/bash_completion.sh
Normal file
47
bin/bash_completion.sh
Normal file
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# Bash completion file for CakePHP console.
|
||||
# Copy this file to a file named `cake` under `/etc/bash_completion.d/`.
|
||||
# For more info check https://book.cakephp.org/5/en/console-commands/completion.html#how-to-enable-bash-autocompletion-for-the-cakephp-console
|
||||
#
|
||||
|
||||
_cake()
|
||||
{
|
||||
local cur prev opts cake
|
||||
COMPREPLY=()
|
||||
cake="${COMP_WORDS[0]}"
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
if [[ "$cur" == -* ]] ; then
|
||||
if [[ ${COMP_CWORD} = 1 ]] ; then
|
||||
opts=$(${cake} completion options)
|
||||
elif [[ ${COMP_CWORD} = 2 ]] ; then
|
||||
opts=$(${cake} completion options "${COMP_WORDS[1]}")
|
||||
else
|
||||
opts=$(${cake} completion options "${COMP_WORDS[1]}" "${COMP_WORDS[2]}")
|
||||
fi
|
||||
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ ${COMP_CWORD} = 1 ]] ; then
|
||||
opts=$(${cake} completion commands)
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ ${COMP_CWORD} = 2 ]] ; then
|
||||
opts=$(${cake} completion subcommands $prev)
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
if [[ $COMPREPLY = "" ]] ; then
|
||||
_filedir
|
||||
return 0
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
complete -F _cake cake bin/cake
|
||||
75
bin/cake
Normal file
75
bin/cake
Normal file
@@ -0,0 +1,75 @@
|
||||
#!/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";
|
||||
}
|
||||
|
||||
# If current path is a symlink, resolve to real path
|
||||
realname="$0"
|
||||
if [ -L "$realname" ]
|
||||
then
|
||||
realname=$(readlink -f "$0")
|
||||
fi
|
||||
|
||||
CONSOLE=$(dirname -- "$(canonicalize "$realname")")
|
||||
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 "$realname")" != 'cake' ]
|
||||
then
|
||||
exec "$PHP" "$CONSOLE"/cake.php "$(basename "$realname")" "$@"
|
||||
else
|
||||
exec "$PHP" "$CONSOLE"/cake.php "$@"
|
||||
fi
|
||||
|
||||
exit
|
||||
27
bin/cake.bat
Normal file
27
bin/cake.bat
Normal file
@@ -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%
|
||||
10
bin/cake.php
Normal file
10
bin/cake.php
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/php -q
|
||||
<?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));
|
||||
Reference in New Issue
Block a user