mirror of
https://github.com/janunger/rheinwerk-video-training.git
synced 2025-02-11 05:43:48 +01:00
Initiale Version
This commit is contained in:
commit
88cf71d772
12
Kapitel_10/Lektion_2/composer.json
Normal file
12
Kapitel_10/Lektion_2/composer.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "janunger/htdocs",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"MeineApp\\": "src/MeineApp/"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"setasign/fpdf": "^1.8",
|
||||
"swiftmailer/swiftmailer": "^5.4"
|
||||
}
|
||||
}
|
111
Kapitel_10/Lektion_2/composer.lock
generated
Normal file
111
Kapitel_10/Lektion_2/composer.lock
generated
Normal file
@ -0,0 +1,111 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "cf0c46c105d5112892731a0d6e94acd1",
|
||||
"content-hash": "2567b247fee072367eb7e7924242d83d",
|
||||
"packages": [
|
||||
{
|
||||
"name": "setasign/fpdf",
|
||||
"version": "1.8.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Setasign/FPDF.git",
|
||||
"reference": "2c68c9e6c034ac3187d25968790139a73184cdb1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Setasign/FPDF/zipball/2c68c9e6c034ac3187d25968790139a73184cdb1",
|
||||
"reference": "2c68c9e6c034ac3187d25968790139a73184cdb1",
|
||||
"shasum": ""
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"fpdf.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"no usage restriction"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Olivier Plathey",
|
||||
"email": "oliver@fpdf.org",
|
||||
"homepage": "http://fpdf.org/"
|
||||
}
|
||||
],
|
||||
"description": "FPDF is a PHP class which allows to generate PDF files with pure PHP. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.",
|
||||
"homepage": "http://www.fpdf.org",
|
||||
"keywords": [
|
||||
"fpdf",
|
||||
"pdf"
|
||||
],
|
||||
"time": "2016-01-01 17:47:15"
|
||||
},
|
||||
{
|
||||
"name": "swiftmailer/swiftmailer",
|
||||
"version": "v5.4.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/swiftmailer/swiftmailer.git",
|
||||
"reference": "4cc92842069c2bbc1f28daaaf1d2576ec4dfe153"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/4cc92842069c2bbc1f28daaaf1d2576ec4dfe153",
|
||||
"reference": "4cc92842069c2bbc1f28daaaf1d2576ec4dfe153",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "~0.9.1"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "5.4-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"lib/swift_required.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Chris Corbyn"
|
||||
},
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
}
|
||||
],
|
||||
"description": "Swiftmailer, free feature-rich PHP mailer",
|
||||
"homepage": "http://swiftmailer.org",
|
||||
"keywords": [
|
||||
"email",
|
||||
"mail",
|
||||
"mailer"
|
||||
],
|
||||
"time": "2016-07-08 11:51:25"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": [],
|
||||
"platform-dev": []
|
||||
}
|
17
Kapitel_10/Lektion_2/src/MeineApp/PdfGenerator.php
Normal file
17
Kapitel_10/Lektion_2/src/MeineApp/PdfGenerator.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace MeineApp;
|
||||
|
||||
class PdfGenerator
|
||||
{
|
||||
public function sendePdf()
|
||||
{
|
||||
$pdf = new \FPDF();
|
||||
|
||||
$pdf->AddPage();
|
||||
$pdf->SetFont('Arial', 'B', 16);
|
||||
$pdf->Cell(40, 10, 'Hallo Welt!');
|
||||
|
||||
$pdf->Output();
|
||||
}
|
||||
}
|
7
Kapitel_10/Lektion_2/vendor/autoload.php
vendored
Normal file
7
Kapitel_10/Lektion_2/vendor/autoload.php
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
require_once __DIR__ . '/composer' . '/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit7413ea639ec8fc7f7139894a55ed7e15::getLoader();
|
413
Kapitel_10/Lektion_2/vendor/composer/ClassLoader.php
vendored
Normal file
413
Kapitel_10/Lektion_2/vendor/composer/ClassLoader.php
vendored
Normal file
@ -0,0 +1,413 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
/**
|
||||
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
||||
*
|
||||
* $loader = new \Composer\Autoload\ClassLoader();
|
||||
*
|
||||
* // register classes with namespaces
|
||||
* $loader->add('Symfony\Component', __DIR__.'/component');
|
||||
* $loader->add('Symfony', __DIR__.'/framework');
|
||||
*
|
||||
* // activate the autoloader
|
||||
* $loader->register();
|
||||
*
|
||||
* // to enable searching the include path (eg. for PEAR packages)
|
||||
* $loader->setUseIncludePath(true);
|
||||
*
|
||||
* In this example, if you try to use a class in the Symfony\Component
|
||||
* namespace or one of its children (Symfony\Component\Console for instance),
|
||||
* the autoloader will first look for the class under the component/
|
||||
* directory, and it will then fallback to the framework/ directory if not
|
||||
* found before giving up.
|
||||
*
|
||||
* This class is loosely based on the Symfony UniversalClassLoader.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
* @see http://www.php-fig.org/psr/psr-0/
|
||||
* @see http://www.php-fig.org/psr/psr-4/
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
// PSR-4
|
||||
private $prefixLengthsPsr4 = array();
|
||||
private $prefixDirsPsr4 = array();
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
private $prefixesPsr0 = array();
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
private $useIncludePath = false;
|
||||
private $classMap = array();
|
||||
|
||||
private $classMapAuthoritative = false;
|
||||
|
||||
public function getPrefixes()
|
||||
{
|
||||
if (!empty($this->prefixesPsr0)) {
|
||||
return call_user_func_array('array_merge', $this->prefixesPsr0);
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
return $this->prefixDirsPsr4;
|
||||
}
|
||||
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
return $this->fallbackDirsPsr0;
|
||||
}
|
||||
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
return $this->fallbackDirsPsr4;
|
||||
}
|
||||
|
||||
public function getClassMap()
|
||||
{
|
||||
return $this->classMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $classMap Class to filename map
|
||||
*/
|
||||
public function addClassMap(array $classMap)
|
||||
{
|
||||
if ($this->classMap) {
|
||||
$this->classMap = array_merge($this->classMap, $classMap);
|
||||
} else {
|
||||
$this->classMap = $classMap;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix, either
|
||||
* appending or prepending to the ones previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace, either
|
||||
* appending or prepending to the ones previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||
// Register directories for a new namespace.
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix,
|
||||
* replacing any others previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 base directories
|
||||
*/
|
||||
public function set($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr0 = (array) $paths;
|
||||
} else {
|
||||
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace,
|
||||
* replacing any others previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function setPsr4($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr4 = (array) $paths;
|
||||
} else {
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns on searching the include path for class files.
|
||||
*
|
||||
* @param bool $useIncludePath
|
||||
*/
|
||||
public function setUseIncludePath($useIncludePath)
|
||||
{
|
||||
$this->useIncludePath = $useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be used to check if the autoloader uses the include path to check
|
||||
* for classes.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getUseIncludePath()
|
||||
{
|
||||
return $this->useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns off searching the prefix and fallback directories for classes
|
||||
* that have not been registered with the class map.
|
||||
*
|
||||
* @param bool $classMapAuthoritative
|
||||
*/
|
||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||
{
|
||||
$this->classMapAuthoritative = $classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should class lookup fail if not found in the current class map?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isClassMapAuthoritative()
|
||||
{
|
||||
return $this->classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers this instance as an autoloader.
|
||||
*
|
||||
* @param bool $prepend Whether to prepend the autoloader or not
|
||||
*/
|
||||
public function register($prepend = false)
|
||||
{
|
||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters this instance as an autoloader.
|
||||
*/
|
||||
public function unregister()
|
||||
{
|
||||
spl_autoload_unregister(array($this, 'loadClass'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the given class or interface.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
* @return bool|null True if loaded, null otherwise
|
||||
*/
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
includeFile($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the path to the file where the class is defined.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
*
|
||||
* @return string|false The path if found, false otherwise
|
||||
*/
|
||||
public function findFile($class)
|
||||
{
|
||||
// work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
|
||||
if ('\\' == $class[0]) {
|
||||
$class = substr($class, 1);
|
||||
}
|
||||
|
||||
// class map lookup
|
||||
if (isset($this->classMap[$class])) {
|
||||
return $this->classMap[$class];
|
||||
}
|
||||
if ($this->classMapAuthoritative) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$file = $this->findFileWithExtension($class, '.php');
|
||||
|
||||
// Search for Hack files if we are running on HHVM
|
||||
if ($file === null && defined('HHVM_VERSION')) {
|
||||
$file = $this->findFileWithExtension($class, '.hh');
|
||||
}
|
||||
|
||||
if ($file === null) {
|
||||
// Remember that this class does not exist.
|
||||
return $this->classMap[$class] = false;
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
private function findFileWithExtension($class, $ext)
|
||||
{
|
||||
// PSR-4 lookup
|
||||
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
||||
|
||||
$first = $class[0];
|
||||
if (isset($this->prefixLengthsPsr4[$first])) {
|
||||
foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-4 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr4 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 lookup
|
||||
if (false !== $pos = strrpos($class, '\\')) {
|
||||
// namespaced class name
|
||||
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
||||
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
||||
} else {
|
||||
// PEAR-like class name
|
||||
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
||||
}
|
||||
|
||||
if (isset($this->prefixesPsr0[$first])) {
|
||||
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
foreach ($dirs as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr0 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 include paths.
|
||||
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*/
|
||||
function includeFile($file)
|
||||
{
|
||||
include $file;
|
||||
}
|
21
Kapitel_10/Lektion_2/vendor/composer/LICENSE
vendored
Normal file
21
Kapitel_10/Lektion_2/vendor/composer/LICENSE
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
|
||||
Copyright (c) 2016 Nils Adermann, Jordi Boggiano
|
||||
|
||||
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.
|
||||
|
10
Kapitel_10/Lektion_2/vendor/composer/autoload_classmap.php
vendored
Normal file
10
Kapitel_10/Lektion_2/vendor/composer/autoload_classmap.php
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'FPDF' => $vendorDir . '/setasign/fpdf/fpdf.php',
|
||||
);
|
10
Kapitel_10/Lektion_2/vendor/composer/autoload_files.php
vendored
Normal file
10
Kapitel_10/Lektion_2/vendor/composer/autoload_files.php
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
// autoload_files.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'2c102faa651ef8ea5874edb585946bce' => $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php',
|
||||
);
|
9
Kapitel_10/Lektion_2/vendor/composer/autoload_namespaces.php
vendored
Normal file
9
Kapitel_10/Lektion_2/vendor/composer/autoload_namespaces.php
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
);
|
10
Kapitel_10/Lektion_2/vendor/composer/autoload_psr4.php
vendored
Normal file
10
Kapitel_10/Lektion_2/vendor/composer/autoload_psr4.php
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
// autoload_psr4.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'MeineApp\\' => array($baseDir . '/src/MeineApp'),
|
||||
);
|
70
Kapitel_10/Lektion_2/vendor/composer/autoload_real.php
vendored
Normal file
70
Kapitel_10/Lektion_2/vendor/composer/autoload_real.php
vendored
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit7413ea639ec8fc7f7139894a55ed7e15
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
public static function loadClassLoader($class)
|
||||
{
|
||||
if ('Composer\Autoload\ClassLoader' === $class) {
|
||||
require __DIR__ . '/ClassLoader.php';
|
||||
}
|
||||
}
|
||||
|
||||
public static function getLoader()
|
||||
{
|
||||
if (null !== self::$loader) {
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit7413ea639ec8fc7f7139894a55ed7e15', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit7413ea639ec8fc7f7139894a55ed7e15', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
|
||||
if ($useStaticLoader) {
|
||||
require_once __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit7413ea639ec8fc7f7139894a55ed7e15::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->set($namespace, $path);
|
||||
}
|
||||
|
||||
$map = require __DIR__ . '/autoload_psr4.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->setPsr4($namespace, $path);
|
||||
}
|
||||
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
$loader->addClassMap($classMap);
|
||||
}
|
||||
}
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit7413ea639ec8fc7f7139894a55ed7e15::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire7413ea639ec8fc7f7139894a55ed7e15($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequire7413ea639ec8fc7f7139894a55ed7e15($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
}
|
||||
}
|
40
Kapitel_10/Lektion_2/vendor/composer/autoload_static.php
vendored
Normal file
40
Kapitel_10/Lektion_2/vendor/composer/autoload_static.php
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
// autoload_static.php @generated by Composer
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit7413ea639ec8fc7f7139894a55ed7e15
|
||||
{
|
||||
public static $files = array (
|
||||
'2c102faa651ef8ea5874edb585946bce' => __DIR__ . '/..' . '/swiftmailer/swiftmailer/lib/swift_required.php',
|
||||
);
|
||||
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
'M' =>
|
||||
array (
|
||||
'MeineApp\\' => 9,
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixDirsPsr4 = array (
|
||||
'MeineApp\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/src/MeineApp',
|
||||
),
|
||||
);
|
||||
|
||||
public static $classMap = array (
|
||||
'FPDF' => __DIR__ . '/..' . '/setasign/fpdf/fpdf.php',
|
||||
);
|
||||
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit7413ea639ec8fc7f7139894a55ed7e15::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit7413ea639ec8fc7f7139894a55ed7e15::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit7413ea639ec8fc7f7139894a55ed7e15::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
}
|
98
Kapitel_10/Lektion_2/vendor/composer/installed.json
vendored
Normal file
98
Kapitel_10/Lektion_2/vendor/composer/installed.json
vendored
Normal file
@ -0,0 +1,98 @@
|
||||
[
|
||||
{
|
||||
"name": "setasign/fpdf",
|
||||
"version": "1.8.1",
|
||||
"version_normalized": "1.8.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Setasign/FPDF.git",
|
||||
"reference": "2c68c9e6c034ac3187d25968790139a73184cdb1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Setasign/FPDF/zipball/2c68c9e6c034ac3187d25968790139a73184cdb1",
|
||||
"reference": "2c68c9e6c034ac3187d25968790139a73184cdb1",
|
||||
"shasum": ""
|
||||
},
|
||||
"time": "2016-01-01 17:47:15",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"fpdf.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"no usage restriction"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Olivier Plathey",
|
||||
"email": "oliver@fpdf.org",
|
||||
"homepage": "http://fpdf.org/"
|
||||
}
|
||||
],
|
||||
"description": "FPDF is a PHP class which allows to generate PDF files with pure PHP. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.",
|
||||
"homepage": "http://www.fpdf.org",
|
||||
"keywords": [
|
||||
"fpdf",
|
||||
"pdf"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "swiftmailer/swiftmailer",
|
||||
"version": "v5.4.3",
|
||||
"version_normalized": "5.4.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/swiftmailer/swiftmailer.git",
|
||||
"reference": "4cc92842069c2bbc1f28daaaf1d2576ec4dfe153"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/4cc92842069c2bbc1f28daaaf1d2576ec4dfe153",
|
||||
"reference": "4cc92842069c2bbc1f28daaaf1d2576ec4dfe153",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "~0.9.1"
|
||||
},
|
||||
"time": "2016-07-08 11:51:25",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "5.4-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"lib/swift_required.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Chris Corbyn"
|
||||
},
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
}
|
||||
],
|
||||
"description": "Swiftmailer, free feature-rich PHP mailer",
|
||||
"homepage": "http://swiftmailer.org",
|
||||
"keywords": [
|
||||
"email",
|
||||
"mail",
|
||||
"mailer"
|
||||
]
|
||||
}
|
||||
]
|
272
Kapitel_10/Lektion_2/vendor/setasign/fpdf/FAQ.htm
vendored
Normal file
272
Kapitel_10/Lektion_2/vendor/setasign/fpdf/FAQ.htm
vendored
Normal file
@ -0,0 +1,272 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>FAQ</title>
|
||||
<link type="text/css" rel="stylesheet" href="fpdf.css">
|
||||
<style type="text/css">
|
||||
ul {list-style-type:none; margin:0; padding:0}
|
||||
ul#answers li {margin-top:1.8em}
|
||||
.question {font-weight:bold; color:#900000}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>FAQ</h1>
|
||||
<ul>
|
||||
<li><b>1.</b> <a href='#q1'>What's exactly the license of FPDF? Are there any usage restrictions?</a></li>
|
||||
<li><b>2.</b> <a href='#q2'>I get the following error when I try to generate a PDF: Some data has already been output, can't send PDF file</a></li>
|
||||
<li><b>3.</b> <a href='#q3'>Accented letters are replaced with some strange characters like é.</a></li>
|
||||
<li><b>4.</b> <a href='#q4'>I try to display the Euro symbol but it doesn't work.</a></li>
|
||||
<li><b>5.</b> <a href='#q5'>I try to display a variable in the Header method but nothing prints.</a></li>
|
||||
<li><b>6.</b> <a href='#q6'>I have defined the Header and Footer methods in my PDF class but nothing shows.</a></li>
|
||||
<li><b>7.</b> <a href='#q7'>I can't make line breaks work. I put \n in the string printed by MultiCell but it doesn't work.</a></li>
|
||||
<li><b>8.</b> <a href='#q8'>I use jQuery to generate the PDF but it doesn't show.</a></li>
|
||||
<li><b>9.</b> <a href='#q9'>I draw a frame with very precise dimensions, but when printed I notice some differences.</a></li>
|
||||
<li><b>10.</b> <a href='#q10'>I'd like to use the whole surface of the page, but when printed I always have some margins. How can I get rid of them?</a></li>
|
||||
<li><b>11.</b> <a href='#q11'>How can I put a background in my PDF?</a></li>
|
||||
<li><b>12.</b> <a href='#q12'>How can I set a specific header or footer on the first page?</a></li>
|
||||
<li><b>13.</b> <a href='#q13'>I'd like to use extensions provided by different scripts. How can I combine them?</a></li>
|
||||
<li><b>14.</b> <a href='#q14'>How can I open the PDF in a new tab?</a></li>
|
||||
<li><b>15.</b> <a href='#q15'>How can I send the PDF by email?</a></li>
|
||||
<li><b>16.</b> <a href='#q16'>What's the limit of the file sizes I can generate with FPDF?</a></li>
|
||||
<li><b>17.</b> <a href='#q17'>Can I modify a PDF with FPDF?</a></li>
|
||||
<li><b>18.</b> <a href='#q18'>I'd like to make a search engine in PHP and index PDF files. Can I do it with FPDF?</a></li>
|
||||
<li><b>19.</b> <a href='#q19'>Can I convert an HTML page to PDF with FPDF?</a></li>
|
||||
<li><b>20.</b> <a href='#q20'>Can I concatenate PDF files with FPDF?</a></li>
|
||||
</ul>
|
||||
|
||||
<ul id='answers'>
|
||||
<li id='q1'>
|
||||
<p><b>1.</b> <span class='question'>What's exactly the license of FPDF? Are there any usage restrictions?</span></p>
|
||||
FPDF is released under a permissive license: there is no usage restriction. You may embed it
|
||||
freely in your application (commercial or not), with or without modifications.
|
||||
</li>
|
||||
|
||||
<li id='q2'>
|
||||
<p><b>2.</b> <span class='question'>I get the following error when I try to generate a PDF: Some data has already been output, can't send PDF file</span></p>
|
||||
You must send nothing to the browser except the PDF itself: no HTML, no space, no carriage return. A common
|
||||
case is having extra blank at the end of an included script file.<br>
|
||||
If you can't figure out where the problem comes from, this other message appearing just before can help you:<br>
|
||||
<br>
|
||||
<b>Warning:</b> Cannot modify header information - headers already sent by (output started at script.php:X)<br>
|
||||
<br>
|
||||
It means that script.php outputs something at line X. Go to this line and fix it.
|
||||
In case the message doesn't show, first check that you didn't disable warnings, then add this at the very
|
||||
beginning of your script:
|
||||
<div class="doc-source">
|
||||
<pre><code>ob_end_clean();</code></pre>
|
||||
</div>
|
||||
If you still don't see it, disable zlib.output_compression in your php.ini and it should appear.
|
||||
</li>
|
||||
|
||||
<li id='q3'>
|
||||
<p><b>3.</b> <span class='question'>Accented letters are replaced with some strange characters like é.</span></p>
|
||||
Don't use UTF-8 with the standard fonts; they expect text encoded in ISO-8859-1 or windows-1252.
|
||||
You can use utf8_decode() to perform a conversion to ISO-8859-1:
|
||||
<div class="doc-source">
|
||||
<pre><code>$str = utf8_decode($str);</code></pre>
|
||||
</div>
|
||||
But some characters such as Euro won't be translated correctly. If the iconv extension is available, the
|
||||
right way to do it is the following:
|
||||
<div class="doc-source">
|
||||
<pre><code>$str = iconv('UTF-8', 'windows-1252', $str);</code></pre>
|
||||
</div>
|
||||
In case you need characters outside windows-1252, take a look at tutorial #7 or
|
||||
<a href="http://www.fpdf.org/?go=script&id=92" target="_blank">tFPDF</a>.
|
||||
</li>
|
||||
|
||||
<li id='q4'>
|
||||
<p><b>4.</b> <span class='question'>I try to display the Euro symbol but it doesn't work.</span></p>
|
||||
The standard fonts have the Euro character at position 128. You can define a constant like this
|
||||
for convenience:
|
||||
<div class="doc-source">
|
||||
<pre><code>define('EURO', chr(128));</code></pre>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li id='q5'>
|
||||
<p><b>5.</b> <span class='question'>I try to display a variable in the Header method but nothing prints.</span></p>
|
||||
You have to use the <code>global</code> keyword to access global variables, for example:
|
||||
<div class="doc-source">
|
||||
<pre><code>function Header()
|
||||
{
|
||||
global $title;
|
||||
|
||||
$this->SetFont('Arial', 'B', 15);
|
||||
$this->Cell(0, 10, $title, 1, 1, 'C');
|
||||
}
|
||||
|
||||
$title = 'My title';</code></pre>
|
||||
</div>
|
||||
Alternatively, you can use an object property:
|
||||
<div class="doc-source">
|
||||
<pre><code>function Header()
|
||||
{
|
||||
$this->SetFont('Arial', 'B', 15);
|
||||
$this->Cell(0, 10, $this->title, 1, 1, 'C');
|
||||
}
|
||||
|
||||
$pdf->title = 'My title';</code></pre>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li id='q6'>
|
||||
<p><b>6.</b> <span class='question'>I have defined the Header and Footer methods in my PDF class but nothing shows.</span></p>
|
||||
You have to create an object from the PDF class, not FPDF:
|
||||
<div class="doc-source">
|
||||
<pre><code>$pdf = new PDF();</code></pre>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li id='q7'>
|
||||
<p><b>7.</b> <span class='question'>I can't make line breaks work. I put \n in the string printed by MultiCell but it doesn't work.</span></p>
|
||||
You have to enclose your string with double quotes, not single ones.
|
||||
</li>
|
||||
|
||||
<li id='q8'>
|
||||
<p><b>8.</b> <span class='question'>I use jQuery to generate the PDF but it doesn't show.</span></p>
|
||||
Don't use an AJAX request to retrieve the PDF.
|
||||
</li>
|
||||
|
||||
<li id='q9'>
|
||||
<p><b>9.</b> <span class='question'>I draw a frame with very precise dimensions, but when printed I notice some differences.</span></p>
|
||||
To respect dimensions, select "None" for the Page Scaling setting instead of "Shrink to Printable Area" in the print dialog box.
|
||||
</li>
|
||||
|
||||
<li id='q10'>
|
||||
<p><b>10.</b> <span class='question'>I'd like to use the whole surface of the page, but when printed I always have some margins. How can I get rid of them?</span></p>
|
||||
Printers have physical margins (different depending on the models); it is therefore impossible to remove
|
||||
them and print on the whole surface of the paper.
|
||||
</li>
|
||||
|
||||
<li id='q11'>
|
||||
<p><b>11.</b> <span class='question'>How can I put a background in my PDF?</span></p>
|
||||
For a picture, call Image() in the Header() method, before any other output. To set a background color, use Rect().
|
||||
</li>
|
||||
|
||||
<li id='q12'>
|
||||
<p><b>12.</b> <span class='question'>How can I set a specific header or footer on the first page?</span></p>
|
||||
Just test the page number:
|
||||
<div class="doc-source">
|
||||
<pre><code>function Header()
|
||||
{
|
||||
if($this->PageNo()==1)
|
||||
{
|
||||
//First page
|
||||
...
|
||||
}
|
||||
else
|
||||
{
|
||||
//Other pages
|
||||
...
|
||||
}
|
||||
}</code></pre>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li id='q13'>
|
||||
<p><b>13.</b> <span class='question'>I'd like to use extensions provided by different scripts. How can I combine them?</span></p>
|
||||
Use an inheritance chain. If you have two classes, say A in a.php:
|
||||
<div class="doc-source">
|
||||
<pre><code>require('fpdf.php');
|
||||
|
||||
class A extends FPDF
|
||||
{
|
||||
...
|
||||
}</code></pre>
|
||||
</div>
|
||||
and B in b.php:
|
||||
<div class="doc-source">
|
||||
<pre><code>require('fpdf.php');
|
||||
|
||||
class B extends FPDF
|
||||
{
|
||||
...
|
||||
}</code></pre>
|
||||
</div>
|
||||
then make B extend A:
|
||||
<div class="doc-source">
|
||||
<pre><code>require('a.php');
|
||||
|
||||
class B extends A
|
||||
{
|
||||
...
|
||||
}</code></pre>
|
||||
</div>
|
||||
and make your own class extend B:
|
||||
<div class="doc-source">
|
||||
<pre><code>require('b.php');
|
||||
|
||||
class PDF extends B
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
$pdf = new PDF();</code></pre>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li id='q14'>
|
||||
<p><b>14.</b> <span class='question'>How can I open the PDF in a new tab?</span></p>
|
||||
Just do the same as you would for an HTML page or anything else: add a target="_blank" to your link or form.
|
||||
</li>
|
||||
|
||||
<li id='q15'>
|
||||
<p><b>15.</b> <span class='question'>How can I send the PDF by email?</span></p>
|
||||
As for any other file, but an easy way is to use <a href="http://phpmailer.codeworxtech.com" target="_blank">PHPMailer</a> and
|
||||
its in-memory attachment:
|
||||
<div class="doc-source">
|
||||
<pre><code>$mail = new PHPMailer();
|
||||
...
|
||||
$doc = $pdf->Output('S');
|
||||
$mail->AddStringAttachment($doc, 'doc.pdf', 'base64', 'application/pdf');
|
||||
$mail->Send();</code></pre>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li id='q16'>
|
||||
<p><b>16.</b> <span class='question'>What's the limit of the file sizes I can generate with FPDF?</span></p>
|
||||
There is no particular limit. There are some constraints, however:
|
||||
<br>
|
||||
<br>
|
||||
- There is usually a maximum memory size allocated to PHP scripts. For very big documents,
|
||||
especially with images, the limit may be reached (the file being built in memory). The
|
||||
parameter is configured in the php.ini file.
|
||||
<br>
|
||||
<br>
|
||||
- The maximum execution time allocated to scripts defaults to 30 seconds. This limit can of course
|
||||
be easily reached. It is configured in php.ini and may be altered dynamically with set_time_limit().
|
||||
<br>
|
||||
<br>
|
||||
You can work around the memory limit with <a href="http://www.fpdf.org/?go=script&id=76" target="_blank">this script</a>.
|
||||
</li>
|
||||
|
||||
<li id='q17'>
|
||||
<p><b>17.</b> <span class='question'>Can I modify a PDF with FPDF?</span></p>
|
||||
It's possible to import pages from an existing PDF document thanks to the
|
||||
<a href="https://www.setasign.com/products/fpdi/about/" target="_blank">FPDI</a> extension.
|
||||
Then you can add some content to them.
|
||||
</li>
|
||||
|
||||
<li id='q18'>
|
||||
<p><b>18.</b> <span class='question'>I'd like to make a search engine in PHP and index PDF files. Can I do it with FPDF?</span></p>
|
||||
No. But a GPL C utility does exist, pdftotext, which is able to extract the textual content from a PDF.
|
||||
It's provided with the <a href="http://www.foolabs.com/xpdf/" target="_blank">Xpdf</a> package.
|
||||
</li>
|
||||
|
||||
<li id='q19'>
|
||||
<p><b>19.</b> <span class='question'>Can I convert an HTML page to PDF with FPDF?</span></p>
|
||||
Not real-world pages. But a GPL C utility does exist, <a href="https://www.msweet.org/projects.php?Z1" target="_blank">HTMLDOC</a>,
|
||||
which allows to do it and gives good results.
|
||||
</li>
|
||||
|
||||
<li id='q20'>
|
||||
<p><b>20.</b> <span class='question'>Can I concatenate PDF files with FPDF?</span></p>
|
||||
Not directly, but it's possible to use <a href="https://www.setasign.com/products/fpdi/demos/concatenate-fake/" target="_blank">FPDI</a>
|
||||
to perform that task. Some free command-line tools also exist:
|
||||
<a href="https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/" target="_blank">pdftk</a> and
|
||||
<a href="http://thierry.schmit.free.fr/spip/spip.php?article15" target="_blank">mbtPdfAsm</a>.
|
||||
</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
21
Kapitel_10/Lektion_2/vendor/setasign/fpdf/README.md
vendored
Normal file
21
Kapitel_10/Lektion_2/vendor/setasign/fpdf/README.md
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
# FPDF
|
||||
**This repository is only made for cloning official FPDF releases which are available at: http://www.fpdf.org**
|
||||
**THERE WILL BE NO DEVELOPMENT IN THIS REPOSITORY!**
|
||||
|
||||
FPDF is a PHP class which allows to generate PDF files with pure PHP. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.
|
||||
|
||||
## Installation with [Composer](https://packagist.org/packages/setasign/fpdf)
|
||||
|
||||
If you're using Composer to manage dependencies, you can use
|
||||
|
||||
$ composer require setasign/fpdf:1.8.1
|
||||
|
||||
or you can include the following in your composer.json file:
|
||||
|
||||
```json
|
||||
{
|
||||
"require": {
|
||||
"setasign/fpdf": "1.8.1"
|
||||
}
|
||||
}
|
||||
```
|
163
Kapitel_10/Lektion_2/vendor/setasign/fpdf/changelog.htm
vendored
Normal file
163
Kapitel_10/Lektion_2/vendor/setasign/fpdf/changelog.htm
vendored
Normal file
@ -0,0 +1,163 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Changelog</title>
|
||||
<link type="text/css" rel="stylesheet" href="fpdf.css">
|
||||
<style type="text/css">
|
||||
dd {margin:1em 0 1em 1em}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Changelog</h1>
|
||||
<dl>
|
||||
<dt><strong>v1.81</strong> (2015-12-20)</dt>
|
||||
<dd>
|
||||
- Added GetPageWidth() and GetPageHeight().<br>
|
||||
- Fixed a bug in SetXY().<br>
|
||||
</dd>
|
||||
<dt><strong>v1.8</strong> (2015-11-29)</dt>
|
||||
<dd>
|
||||
- PHP 5.1.0 or higher is now required.<br>
|
||||
- The MakeFont utility now subsets fonts, which can greatly reduce font sizes.<br>
|
||||
- Added ToUnicode CMaps to improve text extraction.<br>
|
||||
- Added a parameter to AddPage() to rotate the page.<br>
|
||||
- Added a parameter to SetY() to indicate whether the x position should be reset or not.<br>
|
||||
- Added a parameter to Output() to specify the encoding of the name, and special characters are now properly encoded. Additionally the order of the first two parameters was reversed to be more logical (however the old order is still supported for compatibility).<br>
|
||||
- The Error() method now throws an exception.<br>
|
||||
- Adding contents before the first AddPage() or after Close() now raises an error.<br>
|
||||
- Outputting text with no font selected now raises an error.<br>
|
||||
</dd>
|
||||
<dt><strong>v1.7</strong> (2011-06-18)</dt>
|
||||
<dd>
|
||||
- The MakeFont utility has been completely rewritten and doesn't depend on ttf2pt1 anymore.<br>
|
||||
- Alpha channel is now supported for PNGs.<br>
|
||||
- When inserting an image, it's now possible to specify its resolution.<br>
|
||||
- Default resolution for images was increased from 72 to 96 dpi.<br>
|
||||
- When inserting a GIF image, no temporary file is used anymore if the PHP version is 5.1 or higher.<br>
|
||||
- When output buffering is enabled and the PDF is about to be sent, the buffer is now cleared if it contains only a UTF-8 BOM and/or whitespace (instead of throwing an error).<br>
|
||||
- Symbol and ZapfDingbats fonts now support underline style.<br>
|
||||
- Custom page sizes are now checked to ensure that width is smaller than height.<br>
|
||||
- Standard font files were changed to use the same format as user fonts.<br>
|
||||
- A bug in the embedding of Type1 fonts was fixed.<br>
|
||||
- A bug related to SetDisplayMode() and the current locale was fixed.<br>
|
||||
- A display issue occurring with the Adobe Reader X plug-in was fixed.<br>
|
||||
- An issue related to transparency with some versions of Adobe Reader was fixed.<br>
|
||||
- The Content-Length header was removed because it caused an issue when the HTTP server applies compression.<br>
|
||||
</dd>
|
||||
<dt><strong>v1.6</strong> (2008-08-03)</dt>
|
||||
<dd>
|
||||
- PHP 4.3.10 or higher is now required.<br>
|
||||
- GIF image support.<br>
|
||||
- Images can now trigger page breaks.<br>
|
||||
- Possibility to have different page formats in a single document.<br>
|
||||
- Document properties (author, creator, keywords, subject and title) can now be specified in UTF-8.<br>
|
||||
- Fixed a bug: when a PNG was inserted through a URL, an error sometimes occurred.<br>
|
||||
- An automatic page break in Header() doesn't cause an infinite loop any more.<br>
|
||||
- Removed some warning messages appearing with recent PHP versions.<br>
|
||||
- Added HTTP headers to reduce problems with IE.<br>
|
||||
</dd>
|
||||
<dt><strong>v1.53</strong> (2004-12-31)</dt>
|
||||
<dd>
|
||||
- When the font subdirectory is in the same directory as fpdf.php, it's no longer necessary to define the FPDF_FONTPATH constant.<br>
|
||||
- The array $HTTP_SERVER_VARS is no longer used. It could cause trouble on PHP5-based configurations with the register_long_arrays option disabled.<br>
|
||||
- Fixed a problem related to Type1 font embedding which caused trouble to some PDF processors.<br>
|
||||
- The file name sent to the browser could not contain a space character.<br>
|
||||
- The Cell() method could not print the number 0 (you had to pass the string '0').<br>
|
||||
</dd>
|
||||
<dt><strong>v1.52</strong> (2003-12-30)</dt>
|
||||
<dd>
|
||||
- Image() now displays the image at 72 dpi if no dimension is given.<br>
|
||||
- Output() takes a string as second parameter to indicate destination.<br>
|
||||
- Open() is now called automatically by AddPage().<br>
|
||||
- Inserting remote JPEG images doesn't generate an error any longer.<br>
|
||||
- Decimal separator is forced to dot in the constructor.<br>
|
||||
- Added several encodings (Turkish, Thai, Hebrew, Ukrainian and Vietnamese).<br>
|
||||
- The last line of a right-aligned MultiCell() was not correctly aligned if it was terminated by a carriage return.<br>
|
||||
- No more error message about already sent headers when outputting the PDF to the standard output from the command line.<br>
|
||||
- The underlining was going too far for text containing characters \, ( or ).<br>
|
||||
- $HTTP_ENV_VARS has been replaced by $HTTP_SERVER_VARS.<br>
|
||||
</dd>
|
||||
<dt><strong>v1.51</strong> (2002-08-03)</dt>
|
||||
<dd>
|
||||
- Type1 font support.<br>
|
||||
- Added Baltic encoding.<br>
|
||||
- The class now works internally in points with the origin at the bottom in order to avoid two bugs occurring with Acrobat 5:<br> * The line thickness was too large when printed under Windows 98 SE and ME.<br> * TrueType fonts didn't appear immediately inside the plug-in (a substitution font was used), one had to cause a window refresh to make them show up.<br>
|
||||
- It's no longer necessary to set the decimal separator as dot to produce valid documents.<br>
|
||||
- The clickable area in a cell was always on the left independently from the text alignment.<br>
|
||||
- JPEG images in CMYK mode appeared in inverted colors.<br>
|
||||
- Transparent PNG images in grayscale or true color mode were incorrectly handled.<br>
|
||||
- Adding new fonts now works correctly even with the magic_quotes_runtime option set to on.<br>
|
||||
</dd>
|
||||
<dt><strong>v1.5</strong> (2002-05-28)</dt>
|
||||
<dd>
|
||||
- TrueType font (AddFont()) and encoding support (Western and Eastern Europe, Cyrillic and Greek).<br>
|
||||
- Added Write() method.<br>
|
||||
- Added underlined style.<br>
|
||||
- Internal and external link support (AddLink(), SetLink(), Link()).<br>
|
||||
- Added right margin management and methods SetRightMargin(), SetTopMargin().<br>
|
||||
- Modification of SetDisplayMode() to select page layout.<br>
|
||||
- The border parameter of MultiCell() now lets choose borders to draw as Cell().<br>
|
||||
- When a document contains no page, Close() now calls AddPage() instead of causing a fatal error.<br>
|
||||
</dd>
|
||||
<dt><strong>v1.41</strong> (2002-03-13)</dt>
|
||||
<dd>
|
||||
- Fixed SetDisplayMode() which no longer worked (the PDF viewer used its default display).<br>
|
||||
</dd>
|
||||
<dt><strong>v1.4</strong> (2002-03-02)</dt>
|
||||
<dd>
|
||||
- PHP3 is no longer supported.<br>
|
||||
- Page compression (SetCompression()).<br>
|
||||
- Choice of page format and possibility to change orientation inside document.<br>
|
||||
- Added AcceptPageBreak() method.<br>
|
||||
- Ability to print the total number of pages (AliasNbPages()).<br>
|
||||
- Choice of cell borders to draw.<br>
|
||||
- New mode for Cell(): the current position can now move under the cell.<br>
|
||||
- Ability to include an image by specifying height only (width is calculated automatically).<br>
|
||||
- Fixed a bug: when a justified line triggered a page break, the footer inherited the corresponding word spacing.<br>
|
||||
</dd>
|
||||
<dt><strong>v1.31</strong> (2002-01-12)</dt>
|
||||
<dd>
|
||||
- Fixed a bug in drawing frame with MultiCell(): the last line always started from the left margin.<br>
|
||||
- Removed Expires HTTP header (gives trouble in some situations).<br>
|
||||
- Added Content-disposition HTTP header (seems to help in some situations).<br>
|
||||
</dd>
|
||||
<dt><strong>v1.3</strong> (2001-12-03)</dt>
|
||||
<dd>
|
||||
- Line break and text justification support (MultiCell()).<br>
|
||||
- Color support (SetDrawColor(), SetFillColor(), SetTextColor()). Possibility to draw filled rectangles and paint cell background.<br>
|
||||
- A cell whose width is declared null extends up to the right margin of the page.<br>
|
||||
- Line width is now retained from page to page and defaults to 0.2 mm.<br>
|
||||
- Added SetXY() method.<br>
|
||||
- Fixed a passing by reference done in a deprecated manner for PHP4.<br>
|
||||
</dd>
|
||||
<dt><strong>v1.2</strong> (2001-11-11)</dt>
|
||||
<dd>
|
||||
- Added font metric files and GetStringWidth() method.<br>
|
||||
- Centering and right-aligning text in cells.<br>
|
||||
- Display mode control (SetDisplayMode()).<br>
|
||||
- Added methods to set document properties (SetAuthor(), SetCreator(), SetKeywords(), SetSubject(), SetTitle()).<br>
|
||||
- Possibility to force PDF download by browser.<br>
|
||||
- Added SetX() and GetX() methods.<br>
|
||||
- During automatic page break, current abscissa is now retained.<br>
|
||||
</dd>
|
||||
<dt><strong>v1.11</strong> (2001-10-20)</dt>
|
||||
<dd>
|
||||
- PNG support doesn't require PHP4/zlib any more. Data are now put directly into PDF without any decompression/recompression stage.<br>
|
||||
- Image insertion now works correctly even with magic_quotes_runtime option set to on.<br>
|
||||
</dd>
|
||||
<dt><strong>v1.1</strong> (2001-10-07)</dt>
|
||||
<dd>
|
||||
- JPEG and PNG image support.<br>
|
||||
</dd>
|
||||
<dt><strong>v1.01</strong> (2001-10-03)</dt>
|
||||
<dd>
|
||||
- Fixed a bug involving page break: in case when Header() doesn't specify a font, the one from previous page was not restored and produced an incorrect document.<br>
|
||||
</dd>
|
||||
<dt><strong>v1.0</strong> (2001-09-17)</dt>
|
||||
<dd>
|
||||
- First version.<br>
|
||||
</dd>
|
||||
</dl>
|
||||
</body>
|
||||
</html>
|
21
Kapitel_10/Lektion_2/vendor/setasign/fpdf/composer.json
vendored
Normal file
21
Kapitel_10/Lektion_2/vendor/setasign/fpdf/composer.json
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "setasign/fpdf",
|
||||
"version": "1.8.1",
|
||||
"homepage": "http://www.fpdf.org",
|
||||
"description": "FPDF is a PHP class which allows to generate PDF files with pure PHP. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.",
|
||||
"type": "library",
|
||||
"keywords": ["pdf", "fpdf"],
|
||||
"license": "no usage restriction",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Olivier Plathey",
|
||||
"email": "oliver@fpdf.org",
|
||||
"homepage": "http://fpdf.org/"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"fpdf.php"
|
||||
]
|
||||
}
|
||||
}
|
63
Kapitel_10/Lektion_2/vendor/setasign/fpdf/doc/__construct.htm
vendored
Normal file
63
Kapitel_10/Lektion_2/vendor/setasign/fpdf/doc/__construct.htm
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>__construct</title>
|
||||
<link type="text/css" rel="stylesheet" href="../fpdf.css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>__construct</h1>
|
||||
<code>__construct([<b>string</b> orientation [, <b>string</b> unit [, <b>mixed</b> size]]])</code>
|
||||
<h2>Description</h2>
|
||||
This is the class constructor. It allows to set up the page size, the orientation and the
|
||||
unit of measure used in all methods (except for font sizes).
|
||||
<h2>Parameters</h2>
|
||||
<dl class="param">
|
||||
<dt><code>orientation</code></dt>
|
||||
<dd>
|
||||
Default page orientation. Possible values are (case insensitive):
|
||||
<ul>
|
||||
<li><code>P</code> or <code>Portrait</code></li>
|
||||
<li><code>L</code> or <code>Landscape</code></li>
|
||||
</ul>
|
||||
Default value is <code>P</code>.
|
||||
</dd>
|
||||
<dt><code>unit</code></dt>
|
||||
<dd>
|
||||
User unit. Possible values are:
|
||||
<ul>
|
||||
<li><code>pt</code>: point</li>
|
||||
<li><code>mm</code>: millimeter</li>
|
||||
<li><code>cm</code>: centimeter</li>
|
||||
<li><code>in</code>: inch</li>
|
||||
</ul>
|
||||
A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This
|
||||
is a very common unit in typography; font sizes are expressed in that unit.
|
||||
<br>
|
||||
<br>
|
||||
Default value is <code>mm</code>.
|
||||
</dd>
|
||||
<dt><code>size</code></dt>
|
||||
<dd>
|
||||
The size used for pages. It can be either one of the following values (case insensitive):
|
||||
<ul>
|
||||
<li><code>A3</code></li>
|
||||
<li><code>A4</code></li>
|
||||
<li><code>A5</code></li>
|
||||
<li><code>Letter</code></li>
|
||||
<li><code>Legal</code></li>
|
||||
</ul>
|
||||
or an array containing the width and the height (expressed in the unit given by <code>unit</code>).<br>
|
||||
<br>
|
||||
Default value is <code>A4</code>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h2>Example</h2>
|
||||
Example with a custom 100x150 mm page size:
|
||||
<div class="doc-source">
|
||||
<pre><code>$pdf = new FPDF('P','mm',array(100,150));</code></pre>
|
||||
</div>
|
||||
<hr style="margin-top:1.5em">
|
||||
<div style="text-align:center"><a href="index.htm">Index</a></div>
|
||||
</body>
|
||||
</html>
|
63
Kapitel_10/Lektion_2/vendor/setasign/fpdf/doc/acceptpagebreak.htm
vendored
Normal file
63
Kapitel_10/Lektion_2/vendor/setasign/fpdf/doc/acceptpagebreak.htm
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>AcceptPageBreak</title>
|
||||
<link type="text/css" rel="stylesheet" href="../fpdf.css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>AcceptPageBreak</h1>
|
||||
<code><b>boolean</b> AcceptPageBreak()</code>
|
||||
<h2>Description</h2>
|
||||
Whenever a page break condition is met, the method is called, and the break is issued or not
|
||||
depending on the returned value. The default implementation returns a value according to the
|
||||
mode selected by SetAutoPageBreak().
|
||||
<br>
|
||||
This method is called automatically and should not be called directly by the application.
|
||||
<h2>Example</h2>
|
||||
The method is overriden in an inherited class in order to obtain a 3 column layout:
|
||||
<div class="doc-source">
|
||||
<pre><code>class PDF extends FPDF
|
||||
{
|
||||
var $col = 0;
|
||||
|
||||
function SetCol($col)
|
||||
{
|
||||
// Move position to a column
|
||||
$this->col = $col;
|
||||
$x = 10+$col*65;
|
||||
$this->SetLeftMargin($x);
|
||||
$this->SetX($x);
|
||||
}
|
||||
|
||||
function AcceptPageBreak()
|
||||
{
|
||||
if($this->col<2)
|
||||
{
|
||||
// Go to next column
|
||||
$this->SetCol($this->col+1);
|
||||
$this->SetY(10);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Go back to first column and issue page break
|
||||
$this->SetCol(0);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$pdf = new PDF();
|
||||
$pdf->AddPage();
|
||||
$pdf->SetFont('Arial','',12);
|
||||
for($i=1;$i<=300;$i++)
|
||||
$pdf->Cell(0,5,"Line $i",0,1);
|
||||