Skip to content
This repository was archived by the owner on Aug 14, 2022. It is now read-only.
/ php-file Public archive

PHP library for file and directory management.

License

Notifications You must be signed in to change notification settings

josantonius/php-file

Repository files navigation

PHP File library

Latest Stable Version Total Downloads Latest Unstable Version License

Spanish version

PHP library for file management.



Installation

The preferred way to install this extension is through composer.

To install PHP File library, simply:

$ composer require Josantonius/File

Requirements

This library is supported by PHP versions 7.0 or higher and is compatible with HHVM versions 3.0 or higher.

To use this library in HHVM (HipHop Virtual Machine) you will have to activate the scalar types. Add the following line "hhvm.php7.scalar_types = true" in your "/etc/hhvm/php.ini".

Quick Start and Examples

To use this class, simply:

require __DIR__ . '/vendor/autoload.php';

use Josantonius\File\File;

Available Methods

Available methods in this library:

File::searchString();

Usage

Example of use for this library:

<?php
require __DIR__ . '/vendor/autoload.php';

use Josantonius\File\File;

$search = 'Morbi';

$filepath = getcwd() . '/' . 'resources/file.txt';

File::searchString($search, $filepath); /* bool(true) */

Tests

To use the test class, simply:

<?php
$loader = require __DIR__ . '/vendor/autoload.php';

$loader->addPsr4('Josantonius\\File\\Tests\\', __DIR__ . '/vendor/josantonius/file/tests');

use Josantonius\File\Tests\FileTest;

Available test methods in this library:

FileTest::testSearchString();

Exception Handler

This library uses exception handler that you can customize.

Contribute

  1. Check for open issues or open a new issue to start a discussion around a bug or feature.
  2. Fork the repository on GitHub to start making your changes.
  3. Write one or more tests for the new feature or that expose the bug.
  4. Make code changes to implement the feature or fix the bug.
  5. Send a pull request to get your changes merged and published.

This is intended for large and long-lived objects.

Repository

All files in this repository were created and uploaded automatically with Reposgit Creator.

Author

Maintained by Josantonius.

Licensing

This project is licensed under MIT license. See the LICENSE file for more info.