* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-# Abort if called from a web server
+// Abort if called from a web server
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
if (CONSOLE_INTERACTIVE) {
if (CONSOLE_READLINE) {
$line = readline($prompt);
- readline_add_history($line);
- if (defined('CONSOLE_HISTORY')) {
- // Save often; it's easy to hit fatal errors.
- readline_write_history(CONSOLE_HISTORY);
+ if (trim($line) != '') {
+ readline_add_history($line);
+ if (defined('CONSOLE_HISTORY')) {
+ // Save often; it's easy to hit fatal errors.
+ readline_write_history(CONSOLE_HISTORY);
+ }
}
return $line;
} else {
function console_help()
{
- print "Welcome to StatusNet's interactive PHP console!\n";
+ print "Welcome to GNU social's interactive PHP console!\n";
print "Type some PHP code and it'll execute...\n";
print "\n";
print "Hint: return a value of any type to output it via var_export():\n";
}
if (CONSOLE_INTERACTIVE) {
- print "StatusNet interactive PHP console... type ctrl+D or enter 'exit' to exit.\n";
- $prompt = common_config('site', 'name') . '> ';
+ print "GNU social interactive PHP console... type ctrl+D or enter 'exit' to exit.\n";
+ $prompt = common_slugify(common_config('site', 'name')) . '> ';
} else {
$prompt = '';
}