Introduction
Phexecute is browser-based tool to quickly test/run PHP code. It comes with ability to easily check your code with PHP Code_Sniffer, run PHPUnit tests and more, all inside the browser. Phexecute can dramatically improve development time when something needs to be tested. Extending Phexecute to add your own packages/modules is also extremely easy., (*1)
Features
- PHP Code_Sniffer to easily identify and fix problematic parts of code (through PSR-2)
- Run PHPUnit tests and see results right inside browser
- Uses Symfony VarDumper component easy visualization of vars, arrays, objects
- Ability to save unlimited snippets
- Live PHP error highlighting
- Easy to extend
Screenshots
Main Screen, (*2)
, (*3)
PHP Code_Sniffer Results, (*4)
, (*5)
PHPUnit Results, (*6)
, (*7)
Requirements
Installation
You can download it directly OR install via composer:, (*8)
composer create-project -n -s dev sarfraznawaz2005/phexecute
, (*9)
Using Composer Packages inside Phexecute
Any packages that you install via composer are automatically available inside Phexecute. For example, dump
function comes from symfony/var-dumper
package specified in composer.json file and we can use it directly inside Phexecute like dump($var)
. So any packages specified in composer.json file are available for you to use them directly inside Phexecute code editor. This essentially means you can extend Phexecute to any level you want by adding your packages and use them in Phexecute code editor., (*10)
Adding Custom Packages
Adding your own packages is extremely simple so much so that you don't need to write single line of PHP code., (*11)
By default, Phexecute has three menu items System, Packages and Snippets. They come from pure text files that can be found in storage\data folder respectively. Should you need to add your own menu entry, simply create a text file in any of those three directories and it will auto-magically appear in Phexecute menu., (*12)
The format for a text file is:, (*13)
EntryName
(This name will appear in corresponding menu), (*14)
---
, (*15)
PHP Code
(The actual php code to run when menu entry is clicked), (*16)
---
, (*17)
true OR false
(whether or not to run code automatically), (*18)
For example here is how phpinfo
entry is defined (in storage/data/system/01-phpinfo.txt):, (*19)
phpinfo
, (*20)
---
, (*21)
phpinfo();
, (*22)
---
, (*23)
true
, (*24)
Note: Please notice that extensions of those files should be .txt although you can name these files anything., (*25)
You can extend Phexecute to any level you want. For example, you can use it to create automation commands, deploy scripts, run git commands, etc., (*26)
Please checkout text files in directories under storage\data to get an idea of how default menu entries are defined., (*27)
CAUTION
: Phexecute uses eval
to run the code. It is strongly recommended that you should use it for local testing only and not on production server due to security reasons. If you do, you use it on your own risk., (*28)
Contribute
Please feel free to fork and modify/extend Phexecute and send a pull request with your changes! To establish a consistent code quality, please check your code using PHP_CodeSniffer. If you find any bug, error or issue, please report it at issue tracker., (*29)
Donation?
In order to donate, please go to [this page][6] and proceed with your donation information. Thanks!, (*30)
License
The MIT License (MIT), (*31)
Copyright (c) 2015 Sarfraz Ahmed and [Contributors][7], (*32)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:, (*33)
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software., (*34)
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE., (*35)