Download the PHP package phine/phar-replace without Composer
On this page you can find all versions of the php package phine/phar-replace. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phine/phar-replace
More information about phine/phar-replace
Files in phine/phar-replace
Package phar-replace
Short Description Adds search and replace support for the phar library.
License MIT
Homepage https://github.com/phine/lib-phar-replace
Informations about the package phar-replace
Phar Replace
Adds search and replace support for the phar library.
Requirement
- PHP >= 5.3.3
- Phine Exception >= 1.0.0
- Phine Observer >= 2.0
- Phine Phar >= 1.0.0
Installation
Via Composer:
$ composer require "phine/phar-replace=~1.0"
Usage
The library provides a single subject observer for lib-phar. This observer can be registered to the following subjects in order to perform a global search and replace of one or more search strings:
Builder::ADD_FILE
Builder::ADD_STRING
To create an observer, you will need a new instance of ReplaceObserver
.
With the observer registered, any file or string added will all of its
search
, @search@
, {{ search }}
string occurrences replaced with the
value replace
.
It may be important to note that only scalar values are supported.
You may also set search strings and replacement values after the observer
has been created by calling either setSearchValue()
or setSearchValues()
:
By using setSearchValues()
, you will be removing all previous search strings
and their replacement values. Only the new search strings and replacement values
provided will be used.
Documentation
You can find the API documentation here.
License
This library is available under the MIT license.
All versions of phar-replace with dependencies
phine/exception Version ~1.0
phine/observer Version ~2.0
phine/phar Version ~1.0