atico/spreadsheet-translator-provider-localfile

This package is abandoned and no longer maintained. The author suggests using the samuelvi/spreadsheet-translator-provider-localfile package instead.

Spreadsheet Translator - Library that handles a local spreadsheet file

Installs: 51

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/atico/spreadsheet-translator-provider-localfile

v8.4.0 2025-11-08 10:50 UTC

This package is auto-updated.

Last update: 2025-11-08 10:52:32 UTC


README

This package provides a Spreadsheet Translator provider that reads spreadsheet documents from the local filesystem (local disks, mounted drives, or shared resources). It copies the configured source file to a temporary local path and returns a Resource object that the core library can consume.
The project now targets PHP 8.4 and includes a PHPUnit test suite and Makefile-powered workflows.

Features

  • Safely copies the source spreadsheet to a local temporary file before processing.
  • Keeps the provider’s output format configurable while defaulting to xlsx.
  • Fully compatible with PHP 8.4 and the samuelvi/spreadsheet-translator-core ^8.4 series.
  • Ships with PHPUnit coverage to prevent regressions in file handling.

Requirements

  • PHP >= 8.4
  • Composer 2
  • Filesystem access to both the source file and the configured temporary directory

Installation

composer require samuelvi/spreadsheet-translator-provider-localfile

Usage

<?php

use Atico\SpreadsheetTranslator\Core\Configuration\Configuration;
use Atico\SpreadsheetTranslator\Provider\LocalFile\LocalFileProvider;

$configuration = new Configuration([
    'providers' => [
        'local_file' => [
            'source_resource' => '/srv/shared/source.xlsx',
            'temp_local_source_file' => sys_get_temp_dir() . '/sheet-copy.xlsx',
            'format' => 'csv',
        ],
    ],
], 'local_file');

$provider = new LocalFileProvider($configuration);
$resource = $provider->handleSourceResource();

printf(
    'Copied "%s" with format "%s"%s',
    $resource->getValue(),
    $resource->getFormat(),
    PHP_EOL
);

Testing & Tooling

  • composer install – install dependencies (PHP 8.4 runtime required).
  • composer test / ./vendor/bin/phpunit – run the PHPUnit 11 suite.
  • make test – execute the same PHPUnit suite via the Makefile.
  • make check – install dependencies and run tests in one step.
  • make rector – apply Rector rules defined in rector.php.
  • make clean – remove local build caches such as .phpunit.cache.

Related

Contributing

We welcome contributions to this project, including pull requests and issues (and discussions on existing issues).

If you'd like to contribute code but aren't sure what, the issues list is a good place to start. If you're a first-time code contributor, you may find Github's guide to forking projects helpful.

All contributors (whether contributing code, involved in issue discussions, or involved in any other way) must abide by our code of conduct.

License

Spreadsheet Translator Symfony Bundle is licensed under the MIT License. See the LICENSE file for full details.