antoineaugusti/pdfarchiver
Composer 安装命令:
composer require antoineaugusti/pdfarchiver
包简介
Archive locally generated PDFs to a remote host
README 文档
README
What's the goal?
The goal is to easily archive generated PDF documents from one location (the "local" location) to another location (the "remote" one).
Let's say we have a local architecture like this:
company/
├── first-folder
│ ├── makefile
│ ├── document.tex
│ ├── pdf
│ │ └── document.pdf
│ └── report
│ ├── makefile
│ ├── report.tex
│ └── pdf
│ └── report.pdf
├── second-folder
│ ├── makefile
│ ├── reporting.tex
│ └── pdf
│ └── reporting.pdf
└── dummy
We will transfer PDF files to the remote filesystem with this architecture:
company/
├── first-folder
│ ├── document.pdf
│ └── report
│ ├── report.pdf
├── second-folder
│ ├── reporting.pdf
You don't need to create sub directories on the remote filesytem, they will automatically be created when copying PDF files to the remote filesystem.
Installation
PHP 5.4+ or HHVM 3.2+, and Composer are required.
To get the latest version of PdfArchiver, just run the following command from your Terminal:
$ composer require antoineaugusti/pdfarchiver
And then pull the dependencies with the following command:
$ composer install
Filesystem adapters
PdfArchiver relies on the awesome Flysystem package from The PHP League. A lot of adapters are available in the documentation. Determine which adapters you'll need for your local and remote filesystems and then let the Antoineaugusti\PdfArchiver\Console\MoverCommand class do the work for you.
Example: local filesystem to SFTP server
For example, let's say you want to move generated PDFs from your local machine to a SFTP server. An example is given here.
Steal the example file and place it at the root of this directory. Replace configuration values with your needs and you're good to go.
Don't forget to add dependencies for your adapters in your composer.json file and then run composer update.
How to run
commands is the file placed at the root of this directory where you have previously wired your adapters to the MoverCommand class.
Once you've chosen the right adapters (don't forget to pull dependencies with composer update) and you've set your configuration values, it will be very easy. The Antoineaugusti\PdfArchiver\Console\MoverCommand class will search recursively from the root folder you have defined in your local adapter with the following command:
$ php commands archive
Starting from a subfolder
If you don't want to start at the defined root folder, but somewhere else, just give the relative path as the first argument:
$ php commands archive example/subfolder
Generating PDF files
Since we are relying on the existence of a makefile and pdf folder, you may want to generate your PDF files before moving them to a remote location. Just pass the option --make when calling the script:
$ php commands archive example/subfolder --make
Contributing
Contributions are very welcome. This package is pretty simple right now and it only suits my needs. Feel free to open a PR to add some options or additional behavior!
antoineaugusti/pdfarchiver 适用场景与选型建议
antoineaugusti/pdfarchiver 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 48 次下载、GitHub Stars 达 1, 最近一次更新时间为 2015 年 01 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「filesystem」 「documents」 「Flysystem」 「archiver」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 antoineaugusti/pdfarchiver 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 antoineaugusti/pdfarchiver 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 antoineaugusti/pdfarchiver 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A SDK for working with B2 cloud storage.
A PHP class providing static methods for reading, writing, copying, moving, and deleting files and directories, MIME type detection, image size detection, and file permission management
Backblaze B2 Cloud Storage for Laravel 5. Original by Paul Olthof (@hpolthof) continued by @bringyourownideas
Virtual Filesystem Storage Adapter for Laravel
The flysystem adapter for yandex disk rest api.
A sleek PHP wrapper around rclone with Laravel-style fluent API syntax
统计信息
- 总下载量: 48
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 33
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-01-24