hrupin/yii2-file

File

Installs: 36

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

0.1.2 2016-01-09 17:51 UTC

This package is not auto-updated.

Last update: 2024-04-17 17:07:43 UTC


README

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());