2017 © Pedro Peláez
 

library php_sandbox

Simple sandbox to quick evaluation php code.

image

plugowski/php_sandbox

Simple sandbox to quick evaluation php code.

  • Thursday, June 8, 2017
  • by plugowski
  • Repository
  • 4 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

PHP Sandbox

Simple and usefull tool to execute custom php scripts. It allows to block specified function to increase security., (*1)

Screenshot

PHP Sandbox, (*2)

Installation

Clone that repository wherever you want (in my example /www/php_sandbox), (*3)

$ git clone git@github.com:plugowski/php_sandbox.git
$ cd php_sandbox

and load all dependencies via composer:, (*4)

$ 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., (*5)

$ docker-compose build
$ docker-compose up -d

Now you have working docker, go to your favourite browser and hit that addres:, (*6)

localhost:8080

Voila!, (*7)

Usage

Just type some code and push Evaluate button or use keyboard shortcut on Mac Command+Enter or Ctrl+Enter on Windows. More shortcuts you can find here., (*8)

Changed shortcuts by me:, (*9)

Windows Mac Action
Ctrl-Enter Commantd-Enter Execute code
Ctrl-S Command-S Execute code
Alt-Shift-Up Option-Shift-Up Move lines up
Alt-Shift-Down Option-Shift-Down Move lines down
Ctrl-D Command-D Copy line
Ctrl-Shift-L Command-Shift-L Show sidebar
Ctrl-Shift-S Command-Shift-S Save Snippet
Ctrl-Shift-P Command-Shift-P Add Library / Package

Changelog

  • 1.4
    • 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
  • 1.3
    • added library manager, now you are able to add external libraries from packagist, and use it in sandbox directly
  • 1.2
    • 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
  • 1.1
    • added Kint debug tool for dumping varialbles
    • refactored Config class
  • 1.0
    • Initial release
    • visual editor based on ace
    • simple benchmarking (count memory usage, memory peak and execution time)
    • "last load" option

Licence

That code is licenced under New BSD License., (*10)

Credits

To build that tool I used:, (*11)

  • Kint - http://raveren.github.io/kint/
  • Ace Editor - https://ace.c9.io/
  • Bootstrap - https://getbootstrap.com/
  • FontAwesome - http://fortawesome.github.io/Font-Awesome/
  • jQuery - https://jquery.com/

The Versions

14/02 2016

1.1

1.1.0.0

Simple sandbox to quick evaluation php code.

  Sources   Download

The Requires

 

The Development Requires

by Paweł Ługowski

14/02 2016

1.0

1.0.0.0

Simple sandbox to quick evaluation php code.

  Sources   Download

The Requires

 

The Development Requires

by Paweł Ługowski