Skip to content

Commit

Permalink
Initial push
Browse files Browse the repository at this point in the history
  • Loading branch information
Webklex committed Feb 17, 2017
0 parents commit cc850a4
Show file tree
Hide file tree
Showing 11 changed files with 534 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vendor
composer.lock
.idea
29 changes: 29 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
language: php

php:
- hhvm
- 7.0
- 5.6
- 5.5

matrix:
fast_finish: true
allow_failures:
- php: hhvm

sudo: false

install: composer install --no-interaction

script:
- mkdir -p build/logs
- vendor/bin/phpunit --coverage-clover build/logs/clover.xml

after_success:
- sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php vendor/bin/coveralls -v; fi;'

notifications:
email:
on_success: always
on_failure: always

10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

All notable changes to `webklex/laravel-pdfmerger` will be documented in this file.

Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## [UNRELEASED]

### Added
- new laravel-pdfmerger package
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016 Webklex

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# The MIT License (MIT)

Copyright (c) 2016 Malte Goldenbaum <[email protected]>

> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in
> all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> THE SOFTWARE.
83 changes: 83 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Laravel PDFMerger

[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE.md)
[![Build Status][ico-travis]][link-travis]
[![Total Downloads][ico-downloads]][link-downloads]


## Install

Via Composer

``` bash
$ composer require webklex/laravel-pdfmerger
```

## Setup

Add the service provider to the providers array in `config/app.php`.

``` php
'providers' => [
...
Webklex\PDFMerger\Providers\PDFMergerServiceProvider::class
],

'aliases' => [
...
'PDFMerger' => Webklex\PDFMerger\Facades\PDFMergerFacade::class
]
```

## Usage

``` php
use Webklex\PDFMerger\Facades\PDFMergerFacade as PDFMerger;

$oPDF = PDFMerger::init();

$oPDF->setFileName('example.pdf');
$oPDF->addPDF('first_pdf.pdf', '1');
$oPDF->addPDF('second_pdf.pdf', 'all');
$oPDF->merge();
$oPDF->save('/somewhere/merged_result.pdf');

```

## Change log

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Testing

``` bash
$ composer test
```

## Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

## Credits

- [Webklex][link-author]
- All Contributors

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

[ico-version]: https://img.shields.io/packagist/v/Webklex/PDFMerger.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/Webklex/translator/master.svg?style=flat-square
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/Webklex/PDFMerger.svg?style=flat-square
[ico-code-quality]: https://img.shields.io/scrutinizer/g/Webklex/PDFMerger.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/Webklex/PDFMerger.svg?style=flat-square

[link-packagist]: https://packagist.org/packages/Webklex/PDFMerger
[link-travis]: https://travis-ci.org/Webklex/PDFMerger
[link-scrutinizer]: https://scrutinizer-ci.com/g/Webklex/PDFMerger/code-structure
[link-code-quality]: https://scrutinizer-ci.com/g/Webklex/PDFMerger
[link-downloads]: https://packagist.org/packages/Webklex/PDFMerger
[link-author]: https://github.com/webklex
49 changes: 49 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "webklex/laravel-pdfmerger",
"type": "library",
"description": "Generic PDF merger for Laravel",
"keywords": [
"webklex",
"laravel",
"pdf",
"merger",
"pdfmerger"
],
"homepage": "https://github.com/webklex/pdfmerger",
"license": "MIT",
"authors": [
{
"name": "Malte Goldenbaum",
"email": "[email protected]",
"role": "Developer"
}
],
"require": {
"php": ">=5.5.9",
"illuminate/support": "~5.2",
"itbz/fpdi": "^1.6"
},
"require-dev": {
"phpunit/phpunit": "4.*",
"scrutinizer/ocular": "~1.1",
"squizlabs/php_codesniffer": "~2.3"
},
"autoload": {
"psr-4": {
"Webklex\\PDFMerger\\": "src/PDFMerger"
}
},
"autoload-dev": {
"psr-4": {
"Webklex\\PDFMerger\\Test\\": "tests"
}
},
"scripts": {
"test": "phpunit"
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
}
}
29 changes: 29 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Helpers Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit>
30 changes: 30 additions & 0 deletions src/PDFMerger/Facades/PDFMergerFacade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/*
* File: PDFMergerFacade.php
* Category: Facade
* Author: M. Goldenbaum
* Created: 01.12.16 21:06
* Updated: -
*
* Description:
* -
*/

namespace Webklex\PDFMerger\Facades;

use \Illuminate\Support\Facades\Facade;

/**
* @see \Illuminate\Translation\Translator
*/
class PDFMergerFacade extends Facade {

/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor() {
return 'PDFMerger';
}
}
Loading

0 comments on commit cc850a4

Please sign in to comment.