$ composer global require psy/psysh
If asked what version constraint to use just type *
If asked to type in your GitHub credentials please do as Composer grabs from the Github repo
Update your PATH for global CLI use
Add the following to the .bashrc file
$ vi ~/.bashrc
- Hit
Shift+g[takes you to bottom of page] - Hit
o[opens new line] - Hit
Enter[add new line] - Add the following line:
export PATH=~/.composer/vendor/bin:$PATH - After modifying the file hit
Escand type:wqthenenter - Exit SSH from Vagrant box with
exit - Now log back into your vagrant box with
$ vagrant ssh
$ psysh
require('/Users/richardjortega/.composer/vendor/autoload.php');
# find path with `which psysh`
\Psy\Shell::debug(get_defined_vars());
# code stops line before with interactive shell!!!- Load up Sublime Text
Tools>New Snippet
Copy and paste the following code:
<snippet>
<content><![CDATA[
require('/home/vagrant/.composer/vendor/autoload.php');
\Psy\Shell::debug(get_defined_vars());
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>debugger</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>CMD + S,Sublime Text 2 or 3 > Packages > User[Sublime will open the correct folder to save for you] and save aspsysh_debugger.sublime-snippet- Now you can just type
debuggerthen hitTABand it will add the necessary lines for your breakpoint. - You can add multiple breakpoints in your page.
- To remove a breakpoint simply remove/delete the two inserted lines.
- Copy the following code https://gist.github.com/richardjortega/9624537 to your
code.dev/publicfolder
Thanks for sharing this with our CodeUp cohort today, Richard! Sharing new tools and enthusiasm is much obliged!