| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* @file This file is part of the PdfParser library. |
| 5 |
* |
| 6 |
* @author Konrad Abicht <k.abicht@gmail.com> |
| 7 |
* @date 2021-02-09 |
| 8 |
* |
| 9 |
* @license LGPLv3 |
| 10 |
* @url <https://github.com/smalot/pdfparser> |
| 11 |
* |
| 12 |
* PdfParser is a pdf library written in PHP, extraction oriented. |
| 13 |
* Copyright (C) 2017 - Sébastien MALOT <sebastien@malot.fr> |
| 14 |
* |
| 15 |
* This program is free software: you can redistribute it and/or modify |
| 16 |
* it under the terms of the GNU Lesser General Public License as published by |
| 17 |
* the Free Software Foundation, either version 3 of the License, or |
| 18 |
* (at your option) any later version. |
| 19 |
* |
| 20 |
* This program is distributed in the hope that it will be useful, |
| 21 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 23 |
* GNU Lesser General Public License for more details. |
| 24 |
* |
| 25 |
* You should have received a copy of the GNU Lesser General Public License |
| 26 |
* along with this program. |
| 27 |
* If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. |
| 28 |
* |
| 29 |
* -------------------------------------------------------------------------------------- |
| 30 |
* |
| 31 |
* About: |
| 32 |
* This file provides an alternative to the Composer-approach. |
| 33 |
* Include it into your project and all required files of PDFParser will be loaded automatically. |
| 34 |
* Please use it only, if Composer is not available. |
| 35 |
* |
| 36 |
* How to use: |
| 37 |
* 1. include this file as it is OR copy and rename it as you like (and then include it) |
| 38 |
* 2. afterwards you can use PDFParser classes |
| 39 |
* Done. |
| 40 |
*/ |
| 41 |
|
| 42 |
/** |
| 43 |
* Loads all files found in a given folder. |
| 44 |
* Calls itself recursively for all sub folders. |
| 45 |
* |
| 46 |
* @param string $dir |
| 47 |
*/ |
| 48 |
function requireFilesOfFolder($dir) |
| 49 |
{ |
| 50 |
foreach (new DirectoryIterator($dir) as $fileInfo) { |
| 51 |
if (!$fileInfo->isDot()) { |
| 52 |
if ($fileInfo->isDir()) { |
| 53 |
requireFilesOfFolder($fileInfo->getPathname()); |
| 54 |
} else { |
| 55 |
require_once $fileInfo->getPathname(); |
| 56 |
} |
| 57 |
} |
| 58 |
} |
| 59 |
} |
| 60 |
|
| 61 |
$rootFolder = __DIR__.'/src/Smalot/PdfParser'; |
| 62 |
|
| 63 |
// Manually require files, which can't be loaded automatically that easily. |
| 64 |
require_once $rootFolder.'/Element.php'; |
| 65 |
require_once $rootFolder.'/PDFObject.php'; |
| 66 |
require_once $rootFolder.'/Font.php'; |
| 67 |
require_once $rootFolder.'/Page.php'; |
| 68 |
require_once $rootFolder.'/Element/ElementString.php'; |
| 69 |
require_once $rootFolder.'/Encoding/AbstractEncoding.php'; |
| 70 |
|
| 71 |
/* |
| 72 |
* Load the rest of PDFParser files from /src/Smalot/PDFParser |
| 73 |
* Dont worry, it wont load files multiple times. |
| 74 |
*/ |
| 75 |
requireFilesOfFolder($rootFolder); |
| 76 |
|