Download the PHP package kaloa/filesystem without Composer

On this page you can find all versions of the php package kaloa/filesystem. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filesystem

kaloa/filesystem

Install

Via Composer:

$ composer require kaloa/filesystem

Requirements

The following PHP versions are supported:

Documentation

CsvReader

Goals

Usage

Read all CSV rows from a stream into a numeric array. This is also a general usage example.

use Kaloa\Filesystem\CsvReader;

$stream = fopen(__DIR__ . '/file.csv', 'rb');

$csvReader = new CsvReader($stream);
$data = $csvReader->fetchAll();

fclose($stream);

Read all CSV rows from a stream into an associative array. The first row from the input will be used as keys.

$data = $csvReader->fetchAllAssoc();

If the file doesn't contain a row with keys, keys can be provided manually. The first row will be seen as regular data.

$data = $csvReader->fetchAllAssoc(array('id', 'title', 'date_added'));

There’s also a streaming mode available.

while ($row = $csvReader->fetch()) {
    // ...
}

Streaming works with associative arrays, too. Here, the first call to fetchAssoc will transparently read the first two rows from the input to read both the keys and the first data row.

while ($row = $csvReader->fetchAssoc()) {
    // ...
}

Respectively:

while ($row = $csvReader->fetchAssoc(array('id', 'title', 'date_added'))) {
    // ...
}

The reader class is intended to always return UTF-8 data. Differing CSV input encodings will be converted automatically if the input encoding is specified in the constructor.

$csvReader = new CsvReader($iso88591Stream, 'ISO-8859-1');

There’s also support for non-standard delimiter, enclosure and escape characters.

$csvReader = new CsvReader($stream, 'UTF-8', ':', '|', '%');

Further notes

Recipes

For usage with the reader, PHP strings can be converted to streams using the data protocol.

$csvString = <<<'CSV'
"Col a","Col b"
"value 1a","value 1b"
"value 2a","value 2b"
CSV;

$dataUri = 'data://text/plain;base64,' . base64_encode($csvString);

$stream = fopen($dataUri, 'rb');

$reader = new CsvReader($stream);

PathHelper

Goals

Usage

use Kaloa\Filesystem\PathHelper;

$pathHelper = new PathHelper();

$pathHelper->normalize('./dir1/dir2/dir3/dir4/../../../'); // "dir1"

Testing

(Tools are not included in this package.)

$ phpunit

Further quality assurance:

$ phpcs --standard=PSR2 ./src
$ phpmd ./src text codesize,design,naming

Credits

License

The package is published under the MIT License. See LICENSE for full license info.


All versions of filesystem with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kaloa/filesystem contains the following files

Loading the files please wait ....