technodelight/php-cli-editor-input

Small and simple intermediate layer between console editors (like vim) and your PHP console application

1.0 2019-07-03 11:58 UTC

This package is auto-updated.

Last update: 2024-09-29 05:42:19 UTC


README

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 '/^#/')