composer require box-project/processor
Processor simplifies the process of manipulating the contents of one or more files. With support for an event dispatcher, the process itself can also be modified or interrupted.
use Box\Component\Processor\Processor\Any\ReplaceProcessor;
$processor = new ReplaceProcessor();
$processor->setReplacement('/{{\s*name\s*}}/', 'world');
$processor->setExtensions(array('txt'));
// "Hello, world!"
echo $processor->processContents('example.txt', 'Hello, {{ name }}!');
It may be important to note that this library is primarily designed to work with PHP archive (phar) building processes. Incompatibilities with non-phar related processes are a secondary concern and may not be patched if in conflict.
You can find the documentation in Resources/docs
.
kherge/file
~1.3herrera-io/object-storage
~1.0psr/log
~1.0
monolog/monolog
~1.6symfony/dependency-injection
~2.5symfony/event-dispatcher
~2.5
This software is released under the MIT license.