Download the PHP package suzunone/code-runner without Composer
On this page you can find all versions of the php package suzunone/code-runner. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download suzunone/code-runner
More information about suzunone/code-runner
Files in suzunone/code-runner
Package code-runner
Short Description code-runner from piza.io.(piza.io API unofficial wrapper.)
License BSD-3-Clause
Informations about the package code-runner
CodeRunner
Introduction
paiza.io API unofficial wrapper. Using the Paiza API, compile and execute arbitrary code in a variety of programming languages.
Notice for using
This package use paiza.io API. So please read term of use (Japanese only).
Installation Instructions
Composer
Example
Example1
Source code
Results
API Reference
Suzunone\CodeRunner\CodeRunner
constants.
CodeRunner::LANG_C (string)
C Language constant
CodeRunner::LANG_CPP (string)
C++ Language constant
CodeRunner::LANG_OBJECTIVE_C (string)
Objective-C Language constant
CodeRunner::LANG_JAVA (string)
Java Language constant
CodeRunner::LANG_KOTLIN (string)
Kotlin Language constant
CodeRunner::LANG_SCALA (string)
Scala Language constant
CodeRunner::LANG_SWIFT (string)
Swift Language constant
CodeRunner::LANG_CSHARP (string)
C# Language constant
CodeRunner::LANG_GO (string)
GO Language constant
CodeRunner::LANG_HASKELL (string)
Haskell Language constant
CodeRunner::LANG_ERLANG (string)
Erlang Language constant
CodeRunner::LANG_PERL (string)
Perl Language constant
CodeRunner::LANG_PYTHON (string)
Python2 Language constant (string)
CodeRunner::LANG_PYTHON3 (string)
Python3 Language constant
CodeRunner::LANG_RUBY (string)
Ruby Language constant
CodeRunner::LANG_PHP (string)
PHP Language constant
CodeRunner::LANG_BASH (string)
Bash Language constant
CodeRunner::LANG_R (string)
R Language constant
CodeRunner::LANG_JAVASCRIPT (string)
JavaScript Language constant
CodeRunner::LANG_COFFEESCRIPT (string)
CoffeeScript Language constant
CodeRunner::LANG_VB (string)
VB Language constant
CodeRunner::LANG_COBOL (string)
Cobol Language constant
CodeRunner::LANG_FSHARP (string)
F# Language constant
CodeRunner::LANG_D (string)
D Language constant
CodeRunner::LANG_CLOJURE (string)
Clojure Language constant
CodeRunner::LANG_ELIXIR (string)
Elixir Language constant
CodeRunner::LANG_MYSQL (string)
MySQL Language constant
CodeRunner::LANG_RUST (string)
Rust Language constant
CodeRunner::LANG_SCHEME (string)
Scheme Language constant
CodeRunner::LANG_COMMON_LISP (string)
Common Lisp Language constant
CodeRunner::LANG_NADESIKO (string)
なでしこ Language constant
CodeRunner::LANG_TYPESCRIPT (string)
TypeScript Language constant
CodeRunner::LANG_PLAIN (string)
PlainText Language constant
CodeRunner::LANGS (array)
CodeRunner::EXTENSIONS (array)
CodeRunner::STATUS_RUNNING (string)
is status already running.
CodeRunner::STATUS_COMPLETED (string)
is status already completed.
CodeRunner::create()
Start compiling and executing the program code.
Parameters:
Parameter | Type | Description |
---|---|---|
$source_code |
string | program code |
$language |
string | language constant |
$input |
string | string passed in standard input |
$longpoll |
bool | Wait for compilation and execution to complete. |
$longpoll_timeout |
int | longpoll timeout time. |
Return:
CodeRunner::getTemplate()
Returns a template of the program code according to the language constants.
Parameters:
Parameter | Type | Description |
---|---|---|
$language |
string | language constant |
Return:
CodeRunner::getLanguageName()
Get the program name according to the language constant.
Parameters:
Parameter | Type | Description |
---|---|---|
$language |
string | language constant |
Return:
CodeRunner::getLangExtension()
Get the program file extension according to the language constant.
Parameters:
Parameter | Type | Description |
---|---|---|
$language |
string | language constant |
Return:
CodeRunner::getApiKey()
Get the API Key.
Parameters:
Return:
CodeRunner::setApiKey()
Set the API Key.
Parameters:
Parameter | Type | Description |
---|---|---|
$api_key |
string | API KEY |
Return:
\Suzunone\CodeRunner\Entities\OutputEntityInterface
Get the compilation and execution status of a program
OutputEntityInterface::status()
Parameters:
Return:
OutputEntityInterface::details()
Get the results of compiling and executing a program.
Parameters:
Return:
OutputEntityInterface::getResponse()
Get Response data.
Parameters:
Return:
\Suzunone\CodeRunner\Entities\Output\CreateEntity
properties
Properties | Type | Description |
---|---|---|
$id | string [readonly] | session id(This should be used in get_status/get_details API) |
$status | string [readonly] | running', 'completed' |
$error | string [readonly] | error message. |
$is_error | bool [readonly] | if error is true |
$is_completed | bool [readonly] | if completed is true |
$is_running | bool [readonly] | if running is true |
\Suzunone\CodeRunner\Entities\Output\StatusEntity
properties
Properties | Type | Description |
---|---|---|
$id | string [readonly] | session id(This should be used in get_status/get_details API) |
$status | string [readonly] | running', 'completed' |
$is_error | bool [readonly] | if error is true |
$is_completed | bool [readonly] | if completed is true |
$is_running | bool [readonly] | if running is true |
\Suzunone\CodeRunner\Entities\Output\DetailsEntity
properties
Properties | Type | Description |
---|---|---|
id | string | Session id |
language | string | language |
note | string | note |
status | string | status('running', 'completed') |
build_stdout | ?string | build output to stdout |
build_stderr | ?string | build output to stderr |
build_exit_code | int | build exit code |
build_time | ?int | build time(second) |
build_memory | ?int | build memory usage(bytes) |
build_result | ?int | build result('success', 'failure', 'error') |
stdout | ?string | code output to stdout |
stderr | ?string | code output to stderr |
exit_code | int | exit code |
time | int | time to run(seconds) |
memory | int | code memory usage(bytes) |
result | string | code result('success', 'failure', 'error') |
$is_completed | bool [readonly] | if completed is true |
$is_running | bool [readonly] | if running is true |