Git Product home page Git Product logo

flysystem-concatenate's Introduction

keven/flysystem-concatenate

Concatenate files and append content to existing files in league/flysystem.

This plugin is compatible with any adapter.

It relies on streams so manipulating big files does not fill the memory.

Install

composer require keven/flysystem-concatenate

Usage

Concatenate files into a new one:

<?php

use Keven\Flysystem\Concatenate\Concatenate;

$filesystem->addPlugin(new Concatenate);
$filesystem->write('/file1', 'file1');
$filesystem->write('/file2', 'file2');
$filesystem->concatenate('/file3', '/file1', '/file2');

echo $this->filesystem->read('/file3'); // file1file2

Append content to an existing file:

<?php

use Keven\Flysystem\Concatenate\Append;

$filesystem->addPlugin(new Append);
$this->filesystem->write('/file1', 'file1');
$this->filesystem->append('/file1', 'more');

echo $this->filesystem->read('/file1'); // file1more

flysystem-concatenate's People

Contributors

kevengodet avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

imrantune

flysystem-concatenate's Issues

Append thrown exception about backup file, backup file not exist

Some problem with append, when I try to append file I faced with that

File not found at path: download_files/adrecord/baby_bjorn/20200909111536.csv.backup

DO message

Error executing "CopyObject" on "https://minimoj-consumer.ams3.digitaloceanspaces.com/minimoj-consumer/minimoj/download_files/adrecord/baby_bjorn/20200909113824.csv.backup"; AWS HTTP error: Client error: `PUT https://minimoj-consumer.ams3.digitaloceanspaces.com/minimoj-consumer/minimoj/download_files/adrecord/baby_bjorn/20200909113824.csv.backup` resulted in a `404 Not Found` response:
<?xml version="1.0" encoding="UTF-8"?><Error><Code>NoSuchKey</Code><BucketName>minimoj-consumer</BucketName><RequestId>t (truncated...)
 NoSuchKey (client):  - <?xml version="1.0" encoding="UTF-8"?><Error><Code>NoSuchKey</Code><BucketName>minimoj-consumer</BucketName><RequestId>tx0000000000000832ab176-005f58bf08-ab90b1-ams3b</RequestId><HostId>ab90b1-ams3b-ams3-zg02</HostId></Error>

this is data for CopyObject command

data = {array} [6]
 Bucket = "minimoj-consumer"
 Key = "minimoj/download_files/adrecord/baby_bjorn/20200909113824.csv.backup"
 CopySource = "minimoj-consumer/minimoj/download_files/adrecord/baby_bjorn/20200909113824.csv"
 ACL = "private"
 @http = {array} [0]
 @context = {array} [0]

what could be wrong, how to fix it ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.