v2.0.0 2019-11-11 17:20 UTC

This package is auto-updated.

Last update: 2024-11-04 09:24:41 UTC


README

Install

composer require mocking-magician/organic
<?

use \MockingMagician\Organic\Facade\FileSystem;

/** @var \MockingMagician\Organic\Inode\File $file */
$file = FileSystem::getFile('path/to/file.ext');

$file->getDirectoryContainerPath();
$file->getObjectPath();
$file->getRealPath();
$file->getName();
$file->getExtension();
$file->getPermissions();
$file->getAccessTime();
$file->getModificationTime();
$file->getChangeTime();
$file->getSize();

/** @var MockingMagician\Organic\IO\IOFile $io */
$io = $file->getIO();

$io->write('something');
$io->tell();
$io->truncate(25);
$io->passThrough();
$io->read(250);
$io->getContent();
$io->getChar();
$io->getCurrentLine();
$io->addContent('some data to append');
$io->seek(13);
$io->flush();
$io->eof();
$io->lock(LOCK_EX, $wouldBlock);
$io->putContent('that new content');
$io->scanFormat('FS');


//TODO Continue documentation