Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gnugat/redaktilo
[maintained] An easy "line manipulation" PHP lib: jump, insert and do anything!
https://github.com/gnugat/redaktilo
Last synced: 1 day ago
JSON representation
[maintained] An easy "line manipulation" PHP lib: jump, insert and do anything!
- Host: GitHub
- URL: https://github.com/gnugat/redaktilo
- Owner: gnugat
- License: mit
- Created: 2014-04-28T06:13:12.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2024-08-12T20:20:04.000Z (3 months ago)
- Last Synced: 2024-11-07T18:54:24.676Z (8 days ago)
- Language: PHP
- Homepage: http://gnugat.github.io/redaktilo/
- Size: 1.09 MB
- Stars: 81
- Watchers: 7
- Forks: 11
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Redaktilo
Redaktilo allows you to find, insert, replace and remove lines using an
editor-like object.*Because your code too needs an editor to manipulate files*.
## Getting started
Use [Composer](http://getcomposer.org/) to install Redaktilo in your projects:
```console
$ composer require "gnugat/redaktilo:^2.0"
```Redaktilo provides an `Editor` class which can be instanciated using
`EditorFactory`:```php
editor = $editor;
$this->appKernelFilename = $appKernelFilename;
}public function addBundle($bundle)
{
$appKernel = $this->editor->open($this->appKernelFilename);
$newBundle = " new $bundle(),";
if ($this->editor->hasBelow($appKernel, $newBundle)) {
$message = sprintf('Bundle "%s" is already defined in "AppKernel::registerBundles()".', $bundle);throw new \RuntimeException($message);
}
$this->editor->jumpBelow($appKernel, ' );');
$this->editor->insertAbove($appKernel, $newBundle);
$this->editor->save($appKernel);return true;
}
}
```As you can see it's easier to read and to understand than
[the original PHP token parsing](https://github.com/sensiolabs/SensioGeneratorBundle/blob/8b7a33aa3d22388443b6de0b0cf184122e9f60d2/Manipulator/KernelManipulator.php).## Further documentation
You can see the current and past versions using one of the following:
* the `git tag` command
* the [releases page on Github](https://github.com/gnugat/redaktilo/releases)
* the file listing the [changes between versions](CHANGELOG.md)You can find more documentation at the following links:
* [copyright and MIT license](LICENSE)
* [versioning and branching models](VERSIONING.md)
* [contribution instructions](CONTRIBUTING.md)
* [migration to 2.0 instructions](UPGRADE-2.0.md)Next readings:
* [Tutorial](doc/01-tutorial.md)
* [Use cases](doc/02-use-cases.md)
* [Reference](doc/03-reference.md)
* [Vocabulary](doc/04-vocabulary.md)
* [Extending](doc/05-extending.md)
* [Exceptions](doc/06-exceptions.md)