31 lines
885 B
Bash
31 lines
885 B
Bash
#!/usr/bin/env bash
|
|
# modules/yii.module.sh
|
|
#
|
|
# Shared Yii utilities for both yii2-basic and yii2-advanced.
|
|
# Anything specific to one variant lives in its respective framework module.
|
|
|
|
# ============================================
|
|
# Console runner
|
|
# ============================================
|
|
|
|
function yii::exec() {
|
|
runtime::exec php yii "$@"
|
|
}
|
|
|
|
# ============================================
|
|
# Environment resolution
|
|
# ============================================
|
|
|
|
# Maps shorthand env names (dev/qly/prd) to Yii's expected names.
|
|
# Used by both basic and advanced framework modules.
|
|
function yii::resolve_env() {
|
|
case "$(string::lowercase "$1")" in
|
|
dev|development) echo "Development" ;;
|
|
qly|qa|quality) echo "Quality" ;;
|
|
prd|prod|production) echo "Production" ;;
|
|
*)
|
|
log::error "Unknown Yii environment: '$1'"
|
|
return 1
|
|
;;
|
|
esac
|
|
}
|