Open ghostwriter opened 3 years ago
$workspace->open('README.md');
, $workspace->open('test.php');
, $workspace->open('phpunit.xml');
return a MarkdownDocument
, PhpDocument
, XmlDocument
and define additional methods in the respective document classes.
public function open(string $file): ?Document
{
$extension = pathinfo($file, PATHINFO_EXTENSION);
switch ($extension) {
case 'md':
return new MarkdownDocument($file);
case 'php':
return new PhpDocument($file);
case 'xml':
return new XmlDocument($file);
default:
return new TextDocument($file);
}
}
resource
handler (internally)create functionality (LSP-like) protocol.
nikic/php-parser
or microsoft/tolerant-php-parser
)Directory
is separated out because i want to use it to build an api to use both real directories that exist, and virtual directories that only exist in-memory.
for virtual storage, we can use array
,sqlite(:memory:)
or sqlite:file
with a custom table)
I would like to build a tool that would allow me to use
PHP
code to create/update/delete any files and folders and execute commands in a specific directory.Then add custom