Skip to content

hrupin/yii2-file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

File

File

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist hrupin/yii2-file "*"

or add

"hrupin/yii2-file": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

use hrupin\file\File;

$dir = '/some/your/dir';

$file = new File($dir, 'file.txt');
$file->readAllFile();
$file->readStrFile(10);
$file->closeFile();

$file->createFile($dir, 'anotherFile.txt');
$file->writeFile('You some text or data ...');
$file->writeFile('Add you some text or data ...');
$file->readAllFile();
$file->closeFile();

var_dump($file->getErrors());

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages