diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b226417b..bbf98c07 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ Contributions are **welcome** and will be fully **credited**. -We accept contributions via Pull Requests on [Github](https://github.com/nyamsprod/Bakame.url). +We accept contributions via Pull Requests on [Github](https://github.com/theleague/csv). ## Pull Requests diff --git a/README.md b/README.md index 99de3624..d4f809c7 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ This package is compliant with [PSR-1], [PSR-2], and [PSR-4]. 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. +You need **PHP >= 5.4.0** and the `mbstring` extension to use `League\Csv` but the latest stable version of PHP is recommended. Install ------- @@ -54,8 +54,8 @@ Usage * If you have your LC_CTYPE set to a locale that's using UTF-8 and you try to parse a file that's not in UTF-8, PHP will cut your fields the moment it encounters a byte it can't understand (i.e. any outside of ASCII that doesn't happen to be part of a UTF-8 character which it likely isn't). [This gist will show you a possible solution](https://gist.github.com/pilif/9137146) to this problem by using [PHP stream filter](http://www.php.net/manual/en/stream.filters.php). This tip is from [Philip Hofstetter](https://github.com/pilif) * When merging multiples CSV documents don't forget to set the main CSV object - as a `Bakame\Csv\Writer` object with the `$open_mode = 'a+'` to preserve its content. - This setting is of course not required when your main `Bakame\Csv\Writer` object is + as a `League\Csv\Writer` object with the `$open_mode = 'a+'` to preserve its content. + This setting is of course not required when your main `League\Csv\Writer` object is created from String * **If you are on a Mac OS X Server**, add the following lines before using the library to help [PHP detect line ending in Mac OS X](http://php.net/manual/en/function.fgetcsv.php#refsect1-function.fgetcsv-returnvalues). @@ -69,7 +69,7 @@ if (! ini_get("auto_detect_line_endings")) { Documentation ------------- -Fractal has [full documentation](http://csv.thephpleague.com), powered by [Sculpin](https://sculpin.io). +Csv has [full documentation](http://csv.thephpleague.com), powered by [Sculpin](https://sculpin.io). Contribute to this documentation in the [sculpin branch](https://github.com/thephpleague/csv/tree/sculpin/source). diff --git a/composer.json b/composer.json index 8f7eb4c6..84a4b6dd 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "bakame/csv", + "name": "league/csv", "type": "library", "description" : "Csv data manipulation made easy in PHP 5.4+", "keywords": ["csv", "import", "export", "read", "write", "filter"], @@ -18,8 +18,11 @@ }, "autoload": { "psr-4": { - "Bakame\\Csv\\": "src", - "Bakame\\CSv\\": "test" + "League\\Csv\\": "src", + "League\\CSv\\": "test" } + }, + "replaces": { + "bakame/csv": "*" } } diff --git a/examples/download.php b/examples/download.php index 150827c5..1578b51e 100644 --- a/examples/download.php +++ b/examples/download.php @@ -1,6 +1,6 @@ - \Bakame\Csv\Reader simple usage + \League\Csv\Reader simple usage -

\Bakame\Csv\Reader simple usage

+

\League\Csv\Reader simple usage

diff --git a/examples/filtering.php b/examples/filtering.php index 61fcb4dc..d4789fb4 100644 --- a/examples/filtering.php +++ b/examples/filtering.php @@ -1,6 +1,6 @@ - \Bakame\Csv\Reader filtering method + \League\Csv\Reader filtering method -

Using the Bakame\Csv\Reader class filtering capabilities

+

Using the League\Csv\Reader class filtering capabilities

Part of the CSV from the 801th row with at most 25 rows
diff --git a/examples/json.php b/examples/json.php index a679fecc..2dcc5447 100644 --- a/examples/json.php +++ b/examples/json.php @@ -1,6 +1,6 @@ -

Using the Bakame\Csv\Writer class to merge two CSV documents

+

Using the League\Csv\Writer class to merge two CSV documents

The main Raw CSV

The delimiter is a ";"

@@ -74,7 +74,7 @@
 

Tips

When merging multiples CSV documents don't forget to set the main CSV object - as a Bakame\Csv\Writer object with the $open_mode = 'a+' + as a League\Csv\Writer object with the $open_mode = 'a+' to preserve its content. This setting is of course not required when your main CSV object is created from String

diff --git a/examples/switchmode.php b/examples/switchmode.php index df480ebc..97f23917 100644 --- a/examples/switchmode.php +++ b/examples/switchmode.php @@ -1,6 +1,6 @@ - Bakame\Csv\Writer and Bakame\Csv\Reader switching mode + League\Csv\Writer and League\Csv\Reader switching mode -

Using createFromString method and converting the Bakame\Csv\Writer into a Bakame\Csv\Reader

+

Using createFromString method and converting the League\Csv\Writer into a League\Csv\Reader

The table representation of the csv to be save

toHTML();?>

The Raw CSV as it will be saved

diff --git a/examples/table.php b/examples/table.php index 5c26ddbf..b81633da 100644 --- a/examples/table.php +++ b/examples/table.php @@ -1,6 +1,6 @@ - Using the \Bakame\Writer object + Using the \League\Writer object diff --git a/examples/xml.php b/examples/xml.php index 82052cb2..157081eb 100644 --- a/examples/xml.php +++ b/examples/xml.php @@ -3,7 +3,7 @@ error_reporting(-1); ini_set('display_errors', 1); -use Bakame\Csv\Reader; +use League\Csv\Reader; require '../vendor/autoload.php'; diff --git a/phpunit.xml b/phpunit.xml index 55cd7584..f610d386 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -12,7 +12,7 @@ stopOnFailure="false"> - + test diff --git a/src/AbstractCsv.php b/src/AbstractCsv.php index 4f1582e2..4d92418b 100644 --- a/src/AbstractCsv.php +++ b/src/AbstractCsv.php @@ -1,13 +1,13 @@ * @copyright 2014 Ignace Nyamagana Butera -* @link https://github.com/nyamsprod/Bakame.csv +* @link https://github.com/nyamsprod/League.csv * @license http://opensource.org/licenses/MIT -* @version 4.2.1 -* @package Bakame.csv +* @version 5.0.0 +* @package League.csv * * MIT LICENSE * @@ -30,7 +30,7 @@ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -namespace Bakame\Csv; +namespace League\Csv; use IteratorAggregate; use JsonSerializable; @@ -43,7 +43,7 @@ /** * A abstract class to enable basic CSV manipulation * - * @package Bakame.csv + * @package League.csv * @since 4.0.0 * */ diff --git a/src/ConverterTrait.php b/src/ConverterTrait.php index 67482492..d7d34cc9 100644 --- a/src/ConverterTrait.php +++ b/src/ConverterTrait.php @@ -1,13 +1,13 @@ * @copyright 2014 Ignace Nyamagana Butera -* @link https://github.com/nyamsprod/Bakame.csv +* @link https://github.com/nyamsprod/League.csv * @license http://opensource.org/licenses/MIT -* @version 4.2.1 -* @package Bakame.csv +* @version 5.0.0 +* @package League.csv * * MIT LICENSE * @@ -30,16 +30,16 @@ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -namespace Bakame\Csv; +namespace League\Csv; use DomDocument; use SplTempFileObject; -use Bakame\Csv\Iterator\MapIterator; +use League\Csv\Iterator\MapIterator; /** * A abstract class to enable basic CSV manipulation * - * @package Bakame.csv + * @package League.csv * @since 4.2.0 * */ diff --git a/src/Iterator/IteratorFilter.php b/src/Iterator/IteratorFilter.php index a7e96625..b313f399 100644 --- a/src/Iterator/IteratorFilter.php +++ b/src/Iterator/IteratorFilter.php @@ -1,13 +1,13 @@ * @copyright 2014 Ignace Nyamagana Butera -* @link https://github.com/nyamsprod/Bakame.csv +* @link https://github.com/nyamsprod/League.csv * @license http://opensource.org/licenses/MIT -* @version 4.2.1 -* @package Bakame.csv +* @version 5.0.0 +* @package League.csv * * MIT LICENSE * @@ -30,7 +30,7 @@ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -namespace Bakame\Csv\Iterator; +namespace League\Csv\Iterator; use CallbackFilterIterator; use Iterator; @@ -38,7 +38,7 @@ /** * A Trait to filter Iterators * - * @package Bakame.csv + * @package League.csv * @since 4.2.1 * */ diff --git a/src/Iterator/IteratorInterval.php b/src/Iterator/IteratorInterval.php index 180c4e33..620f7f0a 100644 --- a/src/Iterator/IteratorInterval.php +++ b/src/Iterator/IteratorInterval.php @@ -1,13 +1,13 @@ * @copyright 2014 Ignace Nyamagana Butera -* @link https://github.com/nyamsprod/Bakame.csv +* @link https://github.com/nyamsprod/League.csv * @license http://opensource.org/licenses/MIT -* @version 4.2.1 -* @package Bakame.csv +* @version 5.0.0 +* @package League.csv * * MIT LICENSE * @@ -30,7 +30,7 @@ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -namespace Bakame\Csv\Iterator; +namespace League\Csv\Iterator; use InvalidArgumentException; use Iterator; @@ -39,7 +39,7 @@ /** * A Trait to Set a LimitIterator object * - * @package Bakame.csv + * @package League.csv * @since 4.2.1 * */ diff --git a/src/Iterator/IteratorQuery.php b/src/Iterator/IteratorQuery.php index fbfc9d2c..9ea41f47 100644 --- a/src/Iterator/IteratorQuery.php +++ b/src/Iterator/IteratorQuery.php @@ -1,13 +1,13 @@ * @copyright 2014 Ignace Nyamagana Butera -* @link https://github.com/nyamsprod/Bakame.csv +* @link https://github.com/nyamsprod/League.csv * @license http://opensource.org/licenses/MIT -* @version 4.2.1 -* @package Bakame.csv +* @version 5.0.0 +* @package League.csv * * MIT LICENSE * @@ -30,14 +30,14 @@ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -namespace Bakame\Csv\Iterator; +namespace League\Csv\Iterator; use Iterator; /** * A Trait to Query in a SQL-like manner Iterators * - * @package Bakame.csv + * @package League.csv * @since 4.0.0 * */ diff --git a/src/Iterator/IteratorSortBy.php b/src/Iterator/IteratorSortBy.php index c26e85cc..0a0a604b 100644 --- a/src/Iterator/IteratorSortBy.php +++ b/src/Iterator/IteratorSortBy.php @@ -1,13 +1,13 @@ * @copyright 2014 Ignace Nyamagana Butera -* @link https://github.com/nyamsprod/Bakame.csv +* @link https://github.com/nyamsprod/League.csv * @license http://opensource.org/licenses/MIT -* @version 4.2.1 -* @package Bakame.csv +* @version 5.0.0 +* @package League.csv * * MIT LICENSE * @@ -30,7 +30,7 @@ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -namespace Bakame\Csv\Iterator; +namespace League\Csv\Iterator; use Iterator; use ArrayIterator; @@ -38,7 +38,7 @@ /** * A Trait to sort an Iterator * - * @package Bakame.csv + * @package League.csv * @since 4.2.1 * */ diff --git a/src/Iterator/MapIterator.php b/src/Iterator/MapIterator.php index 3b3c9a72..d3a34673 100644 --- a/src/Iterator/MapIterator.php +++ b/src/Iterator/MapIterator.php @@ -1,13 +1,13 @@ * @copyright 2014 Ignace Nyamagana Butera -* @link https://github.com/nyamsprod/Bakame.csv +* @link https://github.com/nyamsprod/League.csv * @license http://opensource.org/licenses/MIT -* @version 4.2.1 -* @package Bakame.csv +* @version 5.0.0 +* @package League.csv * * MIT LICENSE * @@ -30,7 +30,7 @@ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -namespace Bakame\Csv\Iterator; +namespace League\Csv\Iterator; use IteratorIterator; use Traversable; @@ -38,7 +38,7 @@ /** * A simple MapIterator * - * @package Bakame.csv + * @package League.csv * @since 3.3.0 * */ diff --git a/src/Reader.php b/src/Reader.php index a8d6432e..3b21e34b 100644 --- a/src/Reader.php +++ b/src/Reader.php @@ -1,13 +1,13 @@ * @copyright 2014 Ignace Nyamagana Butera -* @link https://github.com/nyamsprod/Bakame.csv +* @link https://github.com/nyamsprod/League.csv * @license http://opensource.org/licenses/MIT -* @version 4.2.1 -* @package Bakame.csv +* @version 5.0.0 +* @package League.csv * * MIT LICENSE * @@ -30,19 +30,19 @@ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -namespace Bakame\Csv; +namespace League\Csv; use SplFileObject; use SplTempFileObject; use InvalidArgumentException; use CallbackFilterIterator; -use Bakame\Csv\Iterator\MapIterator; -use Bakame\Csv\Iterator\IteratorQuery; +use League\Csv\Iterator\MapIterator; +use League\Csv\Iterator\IteratorQuery; /** * A class to manage extracting and filtering a CSV * - * @package Bakame.csv + * @package League.csv * @since 3.0.0 * */ @@ -192,7 +192,7 @@ public function fetchCol($columnIndex = 0, callable $callable = null) * * @param string $open_mode the file open mode flag * - * @return \Bakame\Csv\Writer + * @return \League\Csv\Writer */ public function getWriter($open_mode = 'w') { diff --git a/src/Writer.php b/src/Writer.php index c047953b..50784fc9 100644 --- a/src/Writer.php +++ b/src/Writer.php @@ -1,13 +1,13 @@ * @copyright 2014 Ignace Nyamagana Butera -* @link https://github.com/nyamsprod/Bakame.csv +* @link https://github.com/nyamsprod/League.csv * @license http://opensource.org/licenses/MIT -* @version 4.2.1 -* @package Bakame.csv +* @version 5.0.0 +* @package League.csv * * MIT LICENSE * @@ -30,7 +30,7 @@ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -namespace Bakame\Csv; +namespace League\Csv; use InvalidArgumentException; use Traversable; @@ -38,7 +38,7 @@ /** * A class to manage data insertion into a CSV * - * @package Bakame.csv + * @package League.csv * @since 4.0.0 * */ @@ -111,7 +111,7 @@ public function insertAll($rows) /** * Instantiate a {@link Reader} class from the current {@link Writer} * - * @return \Bakame\Csv\Reader + * @return \League\Csv\Reader */ public function getReader() { diff --git a/test/CsvTest.php b/test/CsvTest.php index 7a6defa2..e10ff76e 100644 --- a/test/CsvTest.php +++ b/test/CsvTest.php @@ -1,6 +1,6 @@ getObjectForTrait('\Bakame\Csv\Iterator\IteratorQuery'); + return $this->getObjectForTrait('\League\Csv\Iterator\IteratorQuery'); } public function setUp() diff --git a/test/ReaderTest.php b/test/ReaderTest.php index 8353593d..b72ddbdc 100644 --- a/test/ReaderTest.php +++ b/test/ReaderTest.php @@ -1,6 +1,6 @@ getWriter('a+'); - $this->assertInstanceOf('\Bakame\Csv\Writer', $csv); + $this->assertInstanceOf('\League\Csv\Writer', $csv); } } diff --git a/test/WriterTest.php b/test/WriterTest.php index 3b4a39db..e886d188 100644 --- a/test/WriterTest.php +++ b/test/WriterTest.php @@ -1,6 +1,6 @@
Statistics for the 20 least used female name in the year 2010