PHPackages                             christophehurpeau/php-importer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. christophehurpeau/php-importer

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

christophehurpeau/php-importer
==============================

Interfaces and CSV Importer in PHP

1.0.0(11y ago)929.2k[1 PRs](https://github.com/christophehurpeau/php-importer/pulls)MITPHP

Since Mar 6Pushed 7y ago1 watchersCompare

[ Source](https://github.com/christophehurpeau/php-importer)[ Packagist](https://packagist.org/packages/christophehurpeau/php-importer)[ RSS](/packages/christophehurpeau-php-importer/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (3)Versions (7)Used By (0)

[![Build Status](https://camo.githubusercontent.com/4d877c0059ae28bc8a4fcbfa399b8453b5ba8a0d213c79ab80cc655a608d8b7a/68747470733a2f2f7472617669732d63692e6f72672f6368726973746f706865687572706561752f7068702d696d706f727465722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/christophehurpeau/php-importer)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/8e1c54ffc215d5c453b53ce0a20519db815da98f995e26e9db7fe25aa1e992d9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6368726973746f706865687572706561752f7068702d696d706f727465722f6261646765732f7175616c6974792d73636f72652e706e673f733d61333239303961653962306232316463623861633863363563326561346335643765383565353230)](https://scrutinizer-ci.com/g/christophehurpeau/php-importer/)[![Code Climate](https://camo.githubusercontent.com/f1718b0233130a4dbde2ea3b62c962811559461cee864344b6bf2017cd0d7057/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6368726973746f706865687572706561752f7068702d696d706f727465722f6261646765732f6770612e737667)](https://codeclimate.com/github/christophehurpeau/php-importer)[![Test Coverage](https://camo.githubusercontent.com/d21a2ce3e3d14ee9e3290fe886c305ec9319a11ef47e82d70e1eace3521176f7/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6368726973746f706865687572706561752f7068702d696d706f727465722f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/christophehurpeau/php-importer)

php-importer
============

[](#php-importer)

Import and process files

Example:
--------

[](#example)

```
namespace CountriesExample;

class CountriesCsvProcessor implements \Importer\HeaderValidator, \Importer\LineProcessor
{
  const HEADER_COUNTRY_NAME = 'country_name';

  /**
   * @return array|true
   */
  public function processFile($file) {

      $engine = new \Importer\Csv\Engine;
      $parser = new \Importer\Csv\Parser($file);
      return $engine->process($parser, $this, $this);
  }

  /**
     * @return array
     */
    public function getRequiredHeaders()
    {
        return array( self::HEADER_COUNTRY_NAME );
    }

    /**
     * @param array $line
     */
    public function processLine(array $line)
    {
        $countryName = $line[self::HEADER_COUNTRY];
        if (empty($countryName)) {
            return 'Country name  for country' . $countryName . 'is empty for line '.print_r($line, true);
        }
        echo $countryName . "\n";//do something
        return true; // everything went well
    }
}
```

### How to use

[](#how-to-use)

```
ini_set('auto_detect_line_endings', true);
$countriesCsvProcessor = new CountriesCsvProcessor();
$result = $dataCountriesCsvProcessor->processFile(__DIR__ . '/../data/countries.csv');
if ($result !== true) {
    throw new \Exception('Failed lines: '. print_r($result, true));
}
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~108 days

Total

5

Last Release

4018d ago

Major Versions

0.3.1 → 1.0.02015-05-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/12703a49897013cd2e337b1a6d3c79249aa678f158573e1e9598ad708a2b9368?d=identicon)[christophe-hurpeau](/maintainers/christophe-hurpeau)

---

Top Contributors

[![christophehurpeau](https://avatars.githubusercontent.com/u/302891?v=4)](https://github.com/christophehurpeau "christophehurpeau (9 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/christophehurpeau-php-importer/health.svg)

```
[![Health](https://phpackages.com/badges/christophehurpeau-php-importer/health.svg)](https://phpackages.com/packages/christophehurpeau-php-importer)
```

###  Alternatives

[weblagence/laravel-facebook-pixel

Facebook Pixel integration for Laravel

35109.2k](/packages/weblagence-laravel-facebook-pixel)[fof/masquerade

User profile builder extension for your Flarum forum.

2123.1k4](/packages/fof-masquerade)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
