mfg
This commit is contained in:
11
.ddev/.global_commands/web/artisan
Executable file
11
.ddev/.global_commands/web/artisan
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
#ddev-generated
|
||||
## Description: Run artisan CLI inside the web container
|
||||
## Usage: artisan [flags] [args]
|
||||
## Example: "ddev artisan list" or "ddev artisan cache:clear"
|
||||
## ProjectTypes: laravel
|
||||
## ExecRaw: true
|
||||
|
||||
php ./artisan "$@"
|
||||
|
||||
65
.ddev/.global_commands/web/blackfire
Executable file
65
.ddev/.global_commands/web/blackfire
Executable file
@@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
|
||||
#ddev-generated: Remove this line to take over this script
|
||||
## Description: Enable or disable blackfire.io profiling
|
||||
## Usage: blackfire start|stop|on|off|enable|disable|true|false|status
|
||||
## Example: "ddev blackfire" (default is "on"), "ddev blackfire off", "ddev blackfire on", "ddev blackfire status"
|
||||
## ExecRaw: false
|
||||
## Flags: []
|
||||
|
||||
function enable {
|
||||
if [ -z ${BLACKFIRE_SERVER_ID} ] || [ -z ${BLACKFIRE_SERVER_TOKEN} ]; then
|
||||
echo "BLACKFIRE_SERVER_ID and BLACKFIRE_SERVER_TOKEN environment variables must be set" >&2
|
||||
echo "See docs for how to set in global or project config" >&2
|
||||
echo "For example, ddev config global --web-environment-add=BLACKFIRE_SERVER_ID=<id>,BLACKFIRE_SERVER_TOKEN=<token>"
|
||||
exit 1
|
||||
fi
|
||||
phpdismod xhprof xdebug
|
||||
phpenmod blackfire
|
||||
killall -USR2 php-fpm && killall -HUP nginx
|
||||
# Can't use killall here because it kills this process!
|
||||
pid=$(ps -ef | awk '$8~/^blackfire.*/ { print $2 }' 2>/dev/null)
|
||||
if [ "${pid}" != "" ]; then kill $pid; fi
|
||||
nohup blackfire agent:start --log-level=4 >/tmp/blackfire_nohup.out 2>&1 &
|
||||
sleep 1
|
||||
echo "Enabled blackfire PHP extension and started blackfire agent"
|
||||
exit
|
||||
}
|
||||
function disable {
|
||||
phpdismod blackfire
|
||||
killall -USR2 php-fpm
|
||||
# Can't use killall here because it kills this process!
|
||||
pid=$(ps -ef | awk '$8~/^blackfire.*/ { print $2 }' 2>/dev/null)
|
||||
if [ "${pid}" != "" ]; then kill ${pid}; fi
|
||||
echo "Disabled blackfire PHP extension and stopped blackfire agent"
|
||||
exit
|
||||
}
|
||||
|
||||
|
||||
if [ $# -eq 0 ] ; then
|
||||
enable
|
||||
fi
|
||||
|
||||
case $1 in
|
||||
on|true|enable|start)
|
||||
disable_xdebug
|
||||
enable
|
||||
;;
|
||||
off|false|disable|stop)
|
||||
disable
|
||||
;;
|
||||
status)
|
||||
php --version | grep "with blackfire" >/dev/null 2>&1
|
||||
phpstatus=$?
|
||||
# Can't use killall here because it kills this process!
|
||||
agentstatus=$(ps -ef | awk '$8~/^blackfire.*/ { print $2 }' 2>/dev/null)
|
||||
if [ ${phpstatus} -eq 0 ]; then echo "blackfire PHP extension enabled"; else echo "blackfire PHP extension disabled"; fi
|
||||
if [ "${agentstatus}" != "" ]; then echo "blackfire agent running"; else echo "blackfire agent not running"; fi
|
||||
if [ ${phpstatus} -eq 0 ]; then printf "probe version %s\n" "$(php -v | awk -F '[ ,\~]+' '/blackfire/{ print $4; }')"; fi
|
||||
printf "blackfire version %s\n" "$(blackfire version | awk '{print $3;}')"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Invalid argument: $1"
|
||||
;;
|
||||
esac
|
||||
17
.ddev/.global_commands/web/craft
Executable file
17
.ddev/.global_commands/web/craft
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
#ddev-generated
|
||||
## Description: Run Craft CMS command inside the web container
|
||||
## Usage: craft [flags] [args]
|
||||
## Example: "ddev craft db/backup" or "ddev craft db/backup ./my-backups" (see https://craftcms.com/docs/4.x/console-commands.html)
|
||||
## ProjectTypes: craftcms,php
|
||||
## ExecRaw: true
|
||||
|
||||
if [ "${DDEV_PROJECT_TYPE}" != "craftcms" ]; then
|
||||
echo "The craft command is only available in the craftcms project type. You can update this in your project's config file, followed by restarting the DDEV project."
|
||||
else
|
||||
CRAFT_CMD_ROOT=${CRAFT_CMD_ROOT:="./"}
|
||||
|
||||
cd "${CRAFT_CMD_ROOT}"
|
||||
php craft "$@"
|
||||
fi
|
||||
14
.ddev/.global_commands/web/drush
Executable file
14
.ddev/.global_commands/web/drush
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
#ddev-generated
|
||||
## Description: Run drush CLI inside the web container
|
||||
## Usage: drush [flags] [args]
|
||||
## Example: "ddev drush uli" or "ddev drush sql-cli" or "ddev drush --version"
|
||||
## ProjectTypes: drupal7,drupal8,drupal9,drupal10,backdrop
|
||||
## ExecRaw: true
|
||||
|
||||
if ! command -v drush >/dev/null; then
|
||||
echo "drush is not available. You may need to 'ddev composer require drush/drush'"
|
||||
exit 1
|
||||
fi
|
||||
drush "$@"
|
||||
16
.ddev/.global_commands/web/magento
Executable file
16
.ddev/.global_commands/web/magento
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
#ddev-generated
|
||||
## Description: Run magento CLI inside the web container
|
||||
## Usage: magento [flags] [args]
|
||||
## Example: "ddev magento list" or "ddev magento maintenance:enable" or "ddev magento sampledata:reset"
|
||||
## ProjectTypes: magento2
|
||||
## ExecRaw: true
|
||||
|
||||
if [ ! -f bin/magento ]; then
|
||||
echo 'bin/magento does not exist in your project root directory.'
|
||||
echo 'Please verify that you installed the shop in your project directory.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
php bin/magento "$@"
|
||||
9
.ddev/.global_commands/web/npm
Executable file
9
.ddev/.global_commands/web/npm
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
#ddev-generated
|
||||
## Description: Run npm inside the web container
|
||||
## Usage: npm [flags] [args]
|
||||
## Example: "ddev npm install" or "ddev npm update"
|
||||
## ExecRaw: true
|
||||
## HostWorkingDir: true
|
||||
|
||||
npm "$@"
|
||||
9
.ddev/.global_commands/web/nvm
Executable file
9
.ddev/.global_commands/web/nvm
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash -i
|
||||
|
||||
#ddev-generated
|
||||
## Description: Run nvm inside the web container
|
||||
## Usage: nvm [flags] [args]
|
||||
## Example: "ddev nvm install 6"
|
||||
## ExecRaw: true
|
||||
|
||||
nvm "$@"
|
||||
9
.ddev/.global_commands/web/php
Executable file
9
.ddev/.global_commands/web/php
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
#ddev-generated
|
||||
## Description: Run php inside the web container
|
||||
## Usage: php [flags] [args]
|
||||
## Example: "ddev php --version"
|
||||
## ExecRaw: true
|
||||
|
||||
php "$@"
|
||||
11
.ddev/.global_commands/web/python
Executable file
11
.ddev/.global_commands/web/python
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
#ddev-generated
|
||||
## Description: Run python inside the web container, in the same relative directory as on host
|
||||
## Usage: python [flags] [args]
|
||||
## Example: "ddev python --version"
|
||||
## ExecRaw: true
|
||||
## HostWorkingDir: true
|
||||
## ProjectTypes: django4,python
|
||||
|
||||
python "$@"
|
||||
11
.ddev/.global_commands/web/sake
Executable file
11
.ddev/.global_commands/web/sake
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
#ddev-generated
|
||||
## Description: Run Silverstripe sake CLI inside the web container
|
||||
## Usage: sake [flags] [args]
|
||||
## Example: "ddev sake dev/build" or "ddev sake dev/tasks"
|
||||
## ProjectTypes: silverstripe
|
||||
## ExecRaw: true
|
||||
|
||||
sake "$@"
|
||||
|
||||
12
.ddev/.global_commands/web/typo3
Executable file
12
.ddev/.global_commands/web/typo3
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
#ddev-generated
|
||||
# This assumes that the typo3 command will be in the $PATH; if in vendor/bin/ it will be
|
||||
|
||||
## Description: Run TYPO3 CLI (typo3) command inside the web container
|
||||
## Usage: typo3 [args]
|
||||
## Example: "ddev typo3 site:list" or "ddev typo3 list" or "ddev typo3 extension:list"
|
||||
## ProjectTypes: typo3
|
||||
## ExecRaw: true
|
||||
|
||||
typo3 "$@"
|
||||
12
.ddev/.global_commands/web/typo3cms
Executable file
12
.ddev/.global_commands/web/typo3cms
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
#ddev-generated
|
||||
# This assumes that the typo3cms command will be in the $PATH; if in vendor/bin/ it will be
|
||||
|
||||
## Description: Run TYPO3 Console (typo3cms) command inside the web container
|
||||
## Usage: typo3cms [args]
|
||||
## Example: "ddev typo3cms cache:flush" or "ddev typo3cms database:export"
|
||||
## ProjectTypes: typo3
|
||||
## ExecRaw: true
|
||||
|
||||
typo3cms "$@"
|
||||
9
.ddev/.global_commands/web/wp
Executable file
9
.ddev/.global_commands/web/wp
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
#ddev-generated
|
||||
## Description: Run WordPress CLI inside the web container
|
||||
## Usage: wp [flags] [args]
|
||||
## Example: "ddev wp core version" or "ddev wp plugin install user-switching --activate"
|
||||
## ProjectTypes: wordpress
|
||||
## ExecRaw: true
|
||||
|
||||
wp "$@"
|
||||
75
.ddev/.global_commands/web/xdebug
Executable file
75
.ddev/.global_commands/web/xdebug
Executable file
@@ -0,0 +1,75 @@
|
||||
#!/bin/bash
|
||||
|
||||
## #ddev-generated
|
||||
## Description: Enable or disable xdebug
|
||||
## Usage: xdebug on|off|enable|disable|true|false|toggle|status
|
||||
## Example: "ddev xdebug" (default is "on"), "ddev xdebug off", "ddev xdebug on", "ddev xdebug toggle", "ddev xdebug status"
|
||||
## Execraw: false
|
||||
## Flags: []
|
||||
|
||||
if [ $# -eq 0 ] ; then
|
||||
enable_xdebug
|
||||
exit
|
||||
fi
|
||||
|
||||
xdebug_version=$(php --version | awk '/Xdebug v/ {print $3}')
|
||||
|
||||
case $1 in
|
||||
on|true|enable)
|
||||
enable_xdebug
|
||||
;;
|
||||
off|false|disable)
|
||||
disable_xdebug
|
||||
;;
|
||||
toggle)
|
||||
case ${xdebug_version} in
|
||||
v3*)
|
||||
status=$(php -r 'echo ini_get("xdebug.mode");' 2>/dev/null)
|
||||
if [[ "${status}" =~ .*"debug".* ]]; then
|
||||
disable_xdebug
|
||||
else
|
||||
enable_xdebug
|
||||
fi
|
||||
;;
|
||||
v2*)
|
||||
status=$(php -r 'echo ini_get("xdebug.remote_enable");')
|
||||
if [ "${status}" = "1" ]; then
|
||||
disable_xdebug
|
||||
else
|
||||
enable_xdebug
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
enable_xdebug
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
status)
|
||||
case ${xdebug_version} in
|
||||
v3*)
|
||||
status=$(php -r 'echo ini_get("xdebug.mode");' 2>/dev/null)
|
||||
if [[ "${status}" =~ .*"debug".* ]]; then
|
||||
result="xdebug enabled"
|
||||
else
|
||||
result="xdebug disabled"
|
||||
fi
|
||||
;;
|
||||
v2*)
|
||||
status=$(php -r 'echo ini_get("xdebug.remote_enable");')
|
||||
if [ "${status}" = "1" ]; then
|
||||
result="xdebug enabled"
|
||||
else
|
||||
result="xdebug disabled"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
result="xdebug disabled"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo $result
|
||||
;;
|
||||
*)
|
||||
echo "Invalid argument: $1"
|
||||
;;
|
||||
esac
|
||||
34
.ddev/.global_commands/web/xhprof
Executable file
34
.ddev/.global_commands/web/xhprof
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
## #ddev-generated
|
||||
## Description: Enable or disable xhprof
|
||||
## Usage: xhprof on|off|enable|disable|true|false|status
|
||||
## Example: "ddev xhprof" (default is "on"), "ddev xhprof off", "ddev xhprof on", "ddev xhprof status"
|
||||
## ExecRaw: false
|
||||
## Flags: []
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
enable_xhprof
|
||||
exit
|
||||
fi
|
||||
|
||||
case $1 in
|
||||
on | true | enable)
|
||||
enable_xhprof
|
||||
;;
|
||||
off | false | disable)
|
||||
disable_xhprof
|
||||
;;
|
||||
status)
|
||||
status=$(php -m | grep 'xhprof')
|
||||
if [ "${status}" = "xhprof" ]; then
|
||||
result="xhprof is enabled"
|
||||
else
|
||||
result="xhprof is disabled"
|
||||
fi
|
||||
echo $result
|
||||
;;
|
||||
*)
|
||||
echo "Invalid argument: $1"
|
||||
;;
|
||||
esac
|
||||
10
.ddev/.global_commands/web/yarn
Executable file
10
.ddev/.global_commands/web/yarn
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
#ddev-generated
|
||||
## Description: Run yarn inside the web container in the root of the project (Use --cwd for another directory)
|
||||
## Usage: yarn [flags] [args]
|
||||
## Example: "ddev yarn install" or "ddev yarn add learna" or "ddev yarn --cwd web/core add learna"
|
||||
## ExecRaw: true
|
||||
## HostWorkingDir: true
|
||||
|
||||
yarn "$@"
|
||||
Reference in New Issue
Block a user