https://github.com/technodelight/php-cli-editor-input
Small and simple intermediate layer between console editors (like vim) and your PHP console application
https://github.com/technodelight/php-cli-editor-input
cli php vim
Last synced: about 1 month ago
JSON representation
Small and simple intermediate layer between console editors (like vim) and your PHP console application
- Host: GitHub
- URL: https://github.com/technodelight/php-cli-editor-input
- Owner: technodelight
- License: mit
- Created: 2019-07-03T11:45:34.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-03T11:58:49.000Z (almost 7 years ago)
- Last Synced: 2025-01-08T10:08:38.439Z (over 1 year ago)
- Topics: cli, php, vim
- Language: PHP
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php-cli-editor-input
Small and simple intermediate layer between console editors (like vim) and your PHP console application
## Usage
```
use Technodelight\CliEditorInput\AdaptableFactoryWithPreference;
$editor = AdaptableFactoryWithPreference::build('vim');
$title = 'Title will be a commented out section as first line in the editor';
$content = 'Initial content, which can be edited';
$content = $editor->edit($title, $content, $stripComments = true);
// $content will contain all lines read back from the editor, excluding commented out lines
// each line starting with # is considered as comment (regex '/^#/')
```