This is the documentation for PortPHP, an awesome data import/export pipeline:


use Port\Csv\CsvReader;
use Port\Doctrine\DoctrineWriter;

$reader = new CsvReader('input.csv');
$writer = new DoctrineWriter($entityManager, 'YourApp:Person');


// Iterate over the reader and write each row to the database
foreach ($reader as $row) {



Broadly speaking, you can use PortPHP in two ways:

  1. organize your import/export pipeline around a workflow; or
  2. use one or more of the components on their own, such as readers, writers or converters.


Open a command console, enter your project directory and execute the following command to download the latest stable version of this package:

$ composer require portphp/steps:1.0.x-dev

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.


Port consists of several components to aid you in processing data:

  1. Readers read data of different kinds from different sources.
  2. Writers write data to a database, Excel or CSV file.
  3. Value converters transform your input data and clean it up.
  4. Each of these components can be used standalone. However, you can structure the components around a Workflow for better re-usability.