Per default Babel doesn’t use Sessions, so this is only needed for advanced operations…
- boris - PHP Read Eval Print Loop (REPL)
https://github.com/d11wtq/Boris
I wasted many hours trying to get the lousy PHP shell to work here (php -a). Then I discovered that it wasn’t even the real shell, but “interactive mode”. I have no idea why as =readline= was available.
I also had to comment this in
php.ini
for Boris to work:; disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
- php-boris - an Emacs extension for Boris
From MELPA, install via
M-x package-install
Currently only sessions with output work
(with-temp-buffer
(url-insert-file-contents "https://raw.github.com/steckerhalter/ob-php/master/ob-php.el")
(eval-buffer))
(require 'ob-php)
(add-to-list 'org-babel-load-languages '(php . t))
(org-babel-do-load-languages 'org-babel-load-languages org-babel-load-languages)
That’s it, you should be good to go!
(:name ob-php
:type http
:url "https://raw.github.com/steckerhalter/ob-php/master/ob-php.el"
:prepare (progn
(add-to-list 'org-babel-load-languages '(php . t))
(org-babel-do-load-languages 'org-babel-load-languages org-babel-load-languages)))
))
4 + 4;
print "dude\n";
print $x;
return $y;
4 + 4;
print "dude\n";
print $x;
return $y;
$dude = new stdClass();
$dude->man = "green";
$dude->pleora = new stdClass();
return $dude;
$test = array(
array('forest', 'green'),
array('sea', $sea),
);
foreach ($test as $row) {
foreach($row as $cell) { print '|' . $cell; };
print "\n";
}
- Note taken on [2013-08-06 Tue 01:43]
This is wrong and should be fixed. The result is not really output!
$x = array("mond" => "schein", array("sonate", "betthofen"));
print $x;
var_dump($x);
body { margin: 20px !important; }