A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/fork-php/runkit7 below:

fork-php/runkit7: Runkit that (mostly) works in PHP7! (method and function manipulation)

Runkit7: Independent fork of runkit for PHP 7.2+

For all those things you.... probably shouldn't have been doing anyway.... but surely do! Supports PHP7.2-8.1! (function/method manipulation is recommended only for unit testing, but all other functionality works.)

Building and installing runkit7 in unix

Building and installing runkit7 in Windows

This extension's documentation is available at https://www.php.net/runkit7.

Compatibility: PHP7.2 to PHP 8.1

See runkit-api.php for the implemented functionality and method signatures. New functionality was added to support usage with PHP7.

Superglobals work reliably when tested on web servers and tests. Class and function manipulation is recommended only for unit tests.

The following contributions are welcome:

Other methods and corresponding tests are disabled/skipped because changes to php internals in php7 made them impractical.

This is runkit7 4.x. Use runkit7 2.x for PHP 7.1 support, or 1.x for PHP 7.0 support.

The following mocking libraries work with runkit7.

Implemented APIs for PHP7

NOTE: Most runkit7_*() functions have aliases of runkit_*().

Unsupported APIs for PHP7:

(These functions will be missing. Some of these should be possible to implement.)

Reasons for disabling property manipulation

See PROPERTY_MANIPULATION.md

See https://github.com/runkit7/runkit7/issues

Tasks for the near future:

See CONTRIBUTING.md for guidelines on issues and pull requests, as well as links to resources that are useful for php7 module and runkit7 development.

(runkit7 is a fork of https://github.com/zenovich/runkit, implementing php7.2+ support)

Runkit has two groups of features outlined below (Sandboxing was removed in runkit7):

A new .ini entry runkit.superglobal is defined which may be specified as a simple variable, or list of simple variables to be registered as superglobals. runkit.superglobal is defined as PHP_INI_SYSTEM and must be set in the system-wide php.ini.

Example:

php.ini:

runkit.superglobal=foo,bar

test.php:

function testme() {
  echo "Foo is $foo\n";
  echo "Bar is $bar\n";
  echo "Baz is $baz\n";
}
$foo = 1;
$bar = 2;
$baz = 3;

testme();

Outputs:

USER DEFINED FUNCTION AND CLASS MANIPULATION

NOTE: Only a subset of the APIs have been ported to PHP7. Some of these APIs have segmentation faults in corner cases (when runkit.internal_override=On)

User defined functions and user defined methods may now be renamed, delete, and redefined using the API described at http://www.php.net/runkit

Examples for these functions may also be found in the tests folder.

runkit_lint was disabled with the rest of the sandbox code due to issues porting it to PHP 7 (Issue #114). As a replacement for runkit_lint/runkit_lint_file try any of the following:

BUILDING AND INSTALLING RUNKIT7 IN UNIX

pecl install runkit7 can be used to install runkit7 releases published on PECL.

Tarballs can be downloaded from PECL or GitHub.

An example of how to build the latest master branch from source is below:

git clone https://github.com/runkit7/runkit7.git
cd runkit7
phpize
# The sandbox related code and flags have been removed, no need to disable them.
# (--enable-runkit7-modify (on by default) controls function, method, class, manipulation, and will control property manipulation)
# (--enable-runkit7-super (on by default) allows you to add custom superglobals)
# ./configure --help lists available configuration options.
./configure
make
make test
sudo make install
BUILDING AND INSTALLING RUNKIT7 IN WINDOWS Setting up php build environment

Read https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2 and https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2#building_pecl_extensions first. This is just a special case of these instructions.

For PHP7.2+, you need to install "Visual Studio 2017 Community Edition" (or other 2017 edition). For PHP8.0+, you need to install "Visual Studio 2019 Community Edition" (or other 2019 edition). Make sure that C++ is installed with Visual Studio. The command prompt to use is "VS2017 x86 Native Tools Command Prompt" on 32-bit, "VS2017 x64 Native Tools Command Prompt" on 64-bit.

For 64-bit installations of php7, use "x64" instead of "x86" for the below commands/folders.

After completing setup steps mentioned, including for C:\php-sdk\phpdev\vc14

extract download of php-7.4.11-src (or any version of php 7) to C:\php-sdk\phpdev\vc15\x86\php-7.4.11-src

Installing runkit7 on windows

There are currently no sources providing DLLs of this fork. Runkit7 and other extensions used must be built from source.

Create subdirectory C:\php-sdk\phpdev\vc14\x86\pecl, adjacent to php source directory)

extract download of runkit7 to C:\php-sdk\phpdev\vc14\x86\pecl\runkit7 (all of the c files and h files should be within runkit7)

Then, execute the following (Add --enable-runkit7 to the configure flags you were already using)

cd C:\php-sdk
C:\php-sdk\bin\phpsdk_setvars.bat
cd phpdev\vc15\x86\php-7.4.11\src
buildconf
configure --enable-runkit7
nmake

Then, optionally test it (Most of the tests should pass, be skipped, or be known failures.):

nmake test TESTS="C:\php-sdk\vc14\x86\pecl\runkit7\tests

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4