diff --git a/README.md b/README.md index dbcf1de7..d8036288 100644 --- a/README.md +++ b/README.md @@ -5,21 +5,22 @@ Bakame.csv A simple library to easily load, manipulate and save CSV files in PHP 5.4+ -This package is compliant with [PSR-0][], [PSR-1][], and [PSR-2][]. +This package is compliant with [PSR-1][], [PSR-2][], and [PSR-4][]. -[PSR-0]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md [PSR-1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md [PSR-2]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md +[PSR-4]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md + System Requirements ------- You need **PHP >= 5.4.0** and the `mbstring` extension to use `Bakame\Csv` but the latest stable version of PHP is recommended. -Installation +Install ------- -You may install the Bakame.csv package with Composer (recommended) or manually. +Install the Bakame.csv package with Composer. ```json { @@ -29,10 +30,6 @@ You may install the Bakame.csv package with Composer (recommended) or manually. } ``` -**Manual Install:** - -Download and extract the library in a specific directory, then add `'/path/to/Bakame/Csv/src'` to your PSR-0 compliant autoloader. - Usage ------- @@ -197,7 +194,7 @@ $data = $reader->fetchAssoc(['firstname', 'lastname', 'email']); // ] // ``` -> + > * If the number of values in a CSV row is lesser than the number of named keys, the method will add `null` values to compensate for the missing values. > * If the number of values in a CSV row is greater that the number of named keys the exceeding values will be drop from the result set. @@ -403,3 +400,5 @@ Credits - [ignace nyamagana butera](https://github.com/nyamsprod) - [All Contributors](graphs/contributors) + +[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/nyamsprod/bakame.csv/trend.png)](https://bitdeli.com/free "Bitdeli Badge") \ No newline at end of file diff --git a/composer.json b/composer.json index d84e9c2c..8f7eb4c6 100644 --- a/composer.json +++ b/composer.json @@ -17,8 +17,9 @@ "ext-mbstring" : "*" }, "autoload": { - "psr-0": { - "Bakame": ["src", "test"] + "psr-4": { + "Bakame\\Csv\\": "src", + "Bakame\\CSv\\": "test" } } -} \ No newline at end of file +} diff --git a/phpunit.xml b/phpunit.xml index a6e7dd58..55cd7584 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -13,13 +13,13 @@ - test/Bakame + test - src/Bakame + src/ diff --git a/src/Bakame/Csv/AbstractCsv.php b/src/AbstractCsv.php similarity index 100% rename from src/Bakame/Csv/AbstractCsv.php rename to src/AbstractCsv.php diff --git a/src/Bakame/Csv/Iterator/IteratorQuery.php b/src/Iterator/IteratorQuery.php similarity index 100% rename from src/Bakame/Csv/Iterator/IteratorQuery.php rename to src/Iterator/IteratorQuery.php diff --git a/src/Bakame/Csv/Iterator/MapIterator.php b/src/Iterator/MapIterator.php similarity index 100% rename from src/Bakame/Csv/Iterator/MapIterator.php rename to src/Iterator/MapIterator.php diff --git a/src/Bakame/Csv/Reader.php b/src/Reader.php similarity index 100% rename from src/Bakame/Csv/Reader.php rename to src/Reader.php diff --git a/src/Bakame/Csv/Writer.php b/src/Writer.php similarity index 100% rename from src/Bakame/Csv/Writer.php rename to src/Writer.php diff --git a/test/Bakame/Csv/CsvTest.php b/test/CsvTest.php similarity index 100% rename from test/Bakame/Csv/CsvTest.php rename to test/CsvTest.php diff --git a/test/Bakame/Csv/Iterator/IteratorQueryTest.php b/test/Iterator/IteratorQueryTest.php similarity index 100% rename from test/Bakame/Csv/Iterator/IteratorQueryTest.php rename to test/Iterator/IteratorQueryTest.php diff --git a/test/Bakame/Csv/ReaderTest.php b/test/ReaderTest.php similarity index 100% rename from test/Bakame/Csv/ReaderTest.php rename to test/ReaderTest.php diff --git a/test/Bakame/Csv/WriterTest.php b/test/WriterTest.php similarity index 100% rename from test/Bakame/Csv/WriterTest.php rename to test/WriterTest.php diff --git a/test/Bakame/Csv/data/prenoms.csv b/test/data/prenoms.csv similarity index 100% rename from test/Bakame/Csv/data/prenoms.csv rename to test/data/prenoms.csv diff --git a/test/Bakame/Csv/foo.csv b/test/foo.csv similarity index 100% rename from test/Bakame/Csv/foo.csv rename to test/foo.csv