lapaz / plain-php
Support for plain PHP script file
Installs: 192
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
pkg:composer/lapaz/plain-php
Requires
- php: ^5.6||^7.0
Requires (Dev)
- phpunit/phpunit: ^5.7.20||^6.0
This package is auto-updated.
Last update: 2025-10-05 21:03:59 UTC
README
Plain PHP script file runner that safer than extract()
and require
way.
Quick Start
To load these config-file.php
script:
<?php /* @var $this SomeObject */ return [ // your config 'some-element' => $parameter, 'another-element' => $anotherParameter, 'element-by-method-call' => $this->getConfigElement(), ];
Use ScriptRunner below instead of raw require
statement.
$config = ScriptRunner::which()->requires('path/to/config-file.php')->with([ 'parameter' => '...', 'anotherParameter' => '...', ])->binding($someObject)->run();
Features
- Closed and safer evaluation than raw
require
orinclude
- Binding any object as
$this
variable in target file - Immutable and branchable variable bound context