Skip to content

Commit cc850a4

Browse files
committed
Initial push
0 parents  commit cc850a4

File tree

11 files changed

+534
-0
lines changed

11 files changed

+534
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
vendor
2+
composer.lock
3+
.idea

.travis.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
language: php
2+
3+
php:
4+
- hhvm
5+
- 7.0
6+
- 5.6
7+
- 5.5
8+
9+
matrix:
10+
fast_finish: true
11+
allow_failures:
12+
- php: hhvm
13+
14+
sudo: false
15+
16+
install: composer install --no-interaction
17+
18+
script:
19+
- mkdir -p build/logs
20+
- vendor/bin/phpunit --coverage-clover build/logs/clover.xml
21+
22+
after_success:
23+
- sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php vendor/bin/coveralls -v; fi;'
24+
25+
notifications:
26+
email:
27+
on_success: always
28+
on_failure: always
29+

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Changelog
2+
3+
All notable changes to `webklex/laravel-pdfmerger` will be documented in this file.
4+
5+
Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
6+
7+
## [UNRELEASED]
8+
9+
### Added
10+
- new laravel-pdfmerger package

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2016 Webklex
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# The MIT License (MIT)
2+
3+
Copyright (c) 2016 Malte Goldenbaum <[email protected]>
4+
5+
> Permission is hereby granted, free of charge, to any person obtaining a copy
6+
> of this software and associated documentation files (the "Software"), to deal
7+
> in the Software without restriction, including without limitation the rights
8+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
> copies of the Software, and to permit persons to whom the Software is
10+
> furnished to do so, subject to the following conditions:
11+
>
12+
> The above copyright notice and this permission notice shall be included in
13+
> all copies or substantial portions of the Software.
14+
>
15+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
> THE SOFTWARE.

README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Laravel PDFMerger
2+
3+
[![Latest Version on Packagist][ico-version]][link-packagist]
4+
[![Software License][ico-license]](LICENSE.md)
5+
[![Build Status][ico-travis]][link-travis]
6+
[![Total Downloads][ico-downloads]][link-downloads]
7+
8+
9+
## Install
10+
11+
Via Composer
12+
13+
``` bash
14+
$ composer require webklex/laravel-pdfmerger
15+
```
16+
17+
## Setup
18+
19+
Add the service provider to the providers array in `config/app.php`.
20+
21+
``` php
22+
'providers' => [
23+
...
24+
Webklex\PDFMerger\Providers\PDFMergerServiceProvider::class
25+
],
26+
27+
'aliases' => [
28+
...
29+
'PDFMerger' => Webklex\PDFMerger\Facades\PDFMergerFacade::class
30+
]
31+
```
32+
33+
## Usage
34+
35+
``` php
36+
use Webklex\PDFMerger\Facades\PDFMergerFacade as PDFMerger;
37+
38+
$oPDF = PDFMerger::init();
39+
40+
$oPDF->setFileName('example.pdf');
41+
$oPDF->addPDF('first_pdf.pdf', '1');
42+
$oPDF->addPDF('second_pdf.pdf', 'all');
43+
$oPDF->merge();
44+
$oPDF->save('/somewhere/merged_result.pdf');
45+
46+
```
47+
48+
## Change log
49+
50+
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
51+
52+
## Testing
53+
54+
``` bash
55+
$ composer test
56+
```
57+
58+
## Security
59+
60+
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
61+
62+
## Credits
63+
64+
- [Webklex][link-author]
65+
- All Contributors
66+
67+
## License
68+
69+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
70+
71+
[ico-version]: https://img.shields.io/packagist/v/Webklex/PDFMerger.svg?style=flat-square
72+
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
73+
[ico-travis]: https://img.shields.io/travis/Webklex/translator/master.svg?style=flat-square
74+
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/Webklex/PDFMerger.svg?style=flat-square
75+
[ico-code-quality]: https://img.shields.io/scrutinizer/g/Webklex/PDFMerger.svg?style=flat-square
76+
[ico-downloads]: https://img.shields.io/packagist/dt/Webklex/PDFMerger.svg?style=flat-square
77+
78+
[link-packagist]: https://packagist.org/packages/Webklex/PDFMerger
79+
[link-travis]: https://travis-ci.org/Webklex/PDFMerger
80+
[link-scrutinizer]: https://scrutinizer-ci.com/g/Webklex/PDFMerger/code-structure
81+
[link-code-quality]: https://scrutinizer-ci.com/g/Webklex/PDFMerger
82+
[link-downloads]: https://packagist.org/packages/Webklex/PDFMerger
83+
[link-author]: https://github.com/webklex

composer.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "webklex/laravel-pdfmerger",
3+
"type": "library",
4+
"description": "Generic PDF merger for Laravel",
5+
"keywords": [
6+
"webklex",
7+
"laravel",
8+
"pdf",
9+
"merger",
10+
"pdfmerger"
11+
],
12+
"homepage": "https://github.com/webklex/pdfmerger",
13+
"license": "MIT",
14+
"authors": [
15+
{
16+
"name": "Malte Goldenbaum",
17+
"email": "[email protected]",
18+
"role": "Developer"
19+
}
20+
],
21+
"require": {
22+
"php": ">=5.5.9",
23+
"illuminate/support": "~5.2",
24+
"itbz/fpdi": "^1.6"
25+
},
26+
"require-dev": {
27+
"phpunit/phpunit": "4.*",
28+
"scrutinizer/ocular": "~1.1",
29+
"squizlabs/php_codesniffer": "~2.3"
30+
},
31+
"autoload": {
32+
"psr-4": {
33+
"Webklex\\PDFMerger\\": "src/PDFMerger"
34+
}
35+
},
36+
"autoload-dev": {
37+
"psr-4": {
38+
"Webklex\\PDFMerger\\Test\\": "tests"
39+
}
40+
},
41+
"scripts": {
42+
"test": "phpunit"
43+
},
44+
"extra": {
45+
"branch-alias": {
46+
"dev-master": "1.0-dev"
47+
}
48+
}
49+
}

phpunit.xml.dist

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="vendor/autoload.php"
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
verbose="true"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="false"
11+
stopOnFailure="false">
12+
<testsuites>
13+
<testsuite name="Helpers Test Suite">
14+
<directory>tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
<filter>
18+
<whitelist>
19+
<directory suffix=".php">src/</directory>
20+
</whitelist>
21+
</filter>
22+
<logging>
23+
<log type="tap" target="build/report.tap"/>
24+
<log type="junit" target="build/report.junit.xml"/>
25+
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
26+
<log type="coverage-text" target="build/coverage.txt"/>
27+
<log type="coverage-clover" target="build/logs/clover.xml"/>
28+
</logging>
29+
</phpunit>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
/*
3+
* File: PDFMergerFacade.php
4+
* Category: Facade
5+
* Author: M. Goldenbaum
6+
* Created: 01.12.16 21:06
7+
* Updated: -
8+
*
9+
* Description:
10+
* -
11+
*/
12+
13+
namespace Webklex\PDFMerger\Facades;
14+
15+
use \Illuminate\Support\Facades\Facade;
16+
17+
/**
18+
* @see \Illuminate\Translation\Translator
19+
*/
20+
class PDFMergerFacade extends Facade {
21+
22+
/**
23+
* Get the registered name of the component.
24+
*
25+
* @return string
26+
*/
27+
protected static function getFacadeAccessor() {
28+
return 'PDFMerger';
29+
}
30+
}

0 commit comments

Comments
 (0)