Simple sandbox to quick evaluation php code.
Simple and usefull tool to execute custom php scripts. It allows to block specified function to increase security.
Clone that repository wherever you want (in my example
$ git clone email@example.com:plugowski/php_sandbox.git $ cd php_sandbox
and load all dependencies via composer:
$ composer install
The final step is to run docker using docker-compose commands (of course the first step is to install docker for your environment.
$ docker-compose build $ docker-compose up -d
Now you have working docker, go to your favourite browser and hit that addres:
Just type some code and push
Evaluate button or use keyboard shortcut on Mac
Ctrl+Enter on Windows.
More shortcuts you can find here.
Changed shortcuts by me:
|Alt-Shift-Up||Option-Shift-Up||Move lines up|
|Alt-Shift-Down||Option-Shift-Down||Move lines down|
|Ctrl-Shift-P||Command-Shift-P||Add Library / Package|
- docker! Now you can use Sandbox with containers and don't be afraid about lost data from computer while use dangerous functions
- multi php now uses fastcgi to evaluate php scripts, no shel_exec anymore :)
- small refactoring
- new Kint for debugging
- added library manager, now you are able to add external libraries from packagist, and use it in sandbox directly
- fixed counting of memory used by script (now it is counting only for evaluated script without extra stuff from bootstrap)
- added new PhpStorm shortcut
- changed routing from FatFree to my own (FatFree fired couple ini_sets which might conflict with security settings, where ini_set() function will be disabled)
- added snippets, which you can save and load in any time
- added possibility to switch between couple of php versions
- added Kint debug tool for dumping varialbles
- refactored Config class
- Initial release
- visual editor based on ace
- simple benchmarking (count memory usage, memory peak and execution time)
- "last load" option
That code is licenced under New BSD License.
To build that tool I used: