Download the PHP package meebio/php-eval-console without Composer

On this page you can find all versions of the php package meebio/php-eval-console. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-eval-console

PHP Eval Console

In-browser, standalone console that executes your PHP code and returns the produced output. This package is based on package darsain/laravel-console.

Screenshot

Table of contents

Installation

Get package through composer:

Copy vendor/meebio/php-eval-console/assets to assets in project root directory.

Create index.php in project root directory with following content:

Open index.php page in browser.

Configuration

Key Type Description Default
assets_dir string Relative path to assets directory. 'assets'
views_path string Absolute path to views directory. Modify only if you want to use custom views. '<...>/Views'
console_view_path string Absolute path to main view. Modify only if you want to use custom views. '<...>/Views/console.php'
execute_url string|null URL to application execute route. If null set it is guessed. null
evaluator EvaluatorInterface Instance of EvaluatorInterface implementation that will be used for running code. EvalEvaluator
authorizer null|AuthorizerInterface Instance of AuthorizerInterface implementation that will be used for running code. This option also accepts null or array of authorizers. IpAuthorizer
queries_callback null|closure Callback that will return database queries to display after running code. null
post_execute_callback null|closure Post execute callback. Can be used to perform some actions after code evaluation, but before returning result. null

Evaluators

EvalEvaluator

Basic evaluator that uses eval command. This is entirely not secure.

PhpSandboxEvaluator

More advanced php evaluator that make use of fieryprophet/php-sandbox package. This sandbox class utilizes PHP-Parser to prevent sandboxed code from running unsafe code. If configured properly this evaluator could probably allow application to be exposed to public users. To use this evaluator require fieryprophet/php-sandbox package in composer.

Authorizers

IpAuthorizer

This authorizer ensures that only access from provided ips is possible. Authorizer constructor takes to arguments first is array of allowed ips (null if this check should be disabled) and second is array of disallowed ips (null if this check should be disabled).

Queries callback

Closure that will provide array of queries after code evaluation. Returned data should be in following format:

Laravel support

You should install the package through Composer:

You must add service provider to app config:

You can publish package assets through artisan command:

or just copy directory vendor/meebio/php-eval-console/assets to public/vendor/php-eval-console.

Last thing that should be done is to make sure CSRF Protection is not blocking console post requests. To do that in Laravel 5.1 you should add console URI to be excluded in VerifyCsrfToken class. So it looks something like this:

For lower versions of Laravel, that can be done as well, but some manual method overriding is needed.

When everything is done you should see Console at /console uri.

TODO


All versions of php-eval-console with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package meebio/php-eval-console contains the following files

Loading the files please wait ....