Created
August 19, 2016 10:41
-
-
Save Dan-Q/6a86d73d468076b815be534c9b0e925f to your computer and use it in GitHub Desktop.
Concrete5 Console. Bash script (with embedded/self-referencing PHP script) to provide an interactive PHP console onto your Concrete5 installation. Place in Concrete5 directory, mark executable, and run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Concrete5 Console<?php /* | |
cd `dirname $0` | |
php -dauto_prepend_file=`basename "$0"` -a | |
cd - | |
exit | |
*/ | |
define('DIR_BASE','.'); | |
define('C5_ENVIRONMENT_ONLY',true); | |
include('index.php'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This file is a polyglot. The first part of script (up to and including
exit
command) is Bash: switches to the directory of the script (which should be the Concrete5 installation directory) and then opens a PHP interactive session, first running itself. A PHP/*...*/
comment block limits as much as possible of the Bash code from being displayed as PHP output. The PHP code loads the Concrete5 environment.