summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2009-11-06 15:26:38 +0100
committerSarven Capadisli <csarven@status.net>2009-11-06 15:26:38 +0100
commit63a07ede62cc814c5aac0de9e15768afcc81eb4b (patch)
treea31cf82f701ac4af8741546f38bdb144557e7927 /scripts
parent87543292d18409e7b4f3c4876172d414d39183fd (diff)
parent972dc020f4690161f8be2599399e73a040ebebb6 (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/console.php19
1 files changed, 14 insertions, 5 deletions
diff --git a/scripts/console.php b/scripts/console.php
index e65529a8d..41dd43f28 100755
--- a/scripts/console.php
+++ b/scripts/console.php
@@ -110,12 +110,21 @@ function readline_emulation($prompt)
function console_help()
{
print "Welcome to StatusNet's interactive PHP console!\n";
- print "Type some PHP code and it'll run!\n";
+ print "Type some PHP code and it'll execute...\n";
print "\n";
- print "Note that PHP is cranky and you can easily kill your session.\n";
+ print "Hint: return a value of any type to output it via var_export():\n";
+ print " \$profile = new Profile();\n";
+ print " \$profile->find();\n";
+ print " \$profile->fetch();\n";
+ print " return \$profile;\n";
+ print "\n";
+ print "Note that PHP is cranky and you can easily kill your session by mistyping.\n";
+ print "\n";
+ print "Type ctrl+D or enter 'exit' to exit.\n";
}
+print "StatusNet interactive PHP console... type ctrl+D or enter 'exit' to exit.\n";
$prompt = common_config('site', 'name') . '> ';
while (!feof(STDIN)) {
$line = read_input_line($prompt);
@@ -124,14 +133,14 @@ while (!feof(STDIN)) {
break;
} elseif ($line !== '') {
try {
- if ($line == 'exit') {
+ if (trim($line) == 'exit') {
break;
- } elseif ($line == 'help') {
+ } elseif (trim($line) == 'help') {
console_help();
continue;
}
- // Let's do this
+ // Let's do this!
$result = eval($line);
if ($result === false) {
// parse error