From a623291d0ecb6d6be6fae0a54b35ec8cba9ab48b Mon Sep 17 00:00:00 2001 From: "chuan-hao, you" Date: Sun, 22 Mar 2015 13:08:48 +0800 Subject: [PATCH] Add exceptions for the official exit codes. --- examples/example3.php | 39 +++++++++++++++++++ .../Exceptions/OpenOutputException.php | 6 +++ .../PDFInfo/Exceptions/OpenPDFException.php | 6 +++ .../{BaseException.php => OtherException.php} | 2 +- .../Exceptions/PDFPermissionException.php | 6 +++ src/Howtomakeaturn/PDFInfo/PDFInfo.php | 10 ++++- 6 files changed, 66 insertions(+), 3 deletions(-) create mode 100755 examples/example3.php create mode 100644 src/Howtomakeaturn/PDFInfo/Exceptions/OpenOutputException.php create mode 100644 src/Howtomakeaturn/PDFInfo/Exceptions/OpenPDFException.php rename src/Howtomakeaturn/PDFInfo/Exceptions/{BaseException.php => OtherException.php} (62%) create mode 100644 src/Howtomakeaturn/PDFInfo/Exceptions/PDFPermissionException.php diff --git a/examples/example3.php b/examples/example3.php new file mode 100755 index 0000000..07aceb9 --- /dev/null +++ b/examples/example3.php @@ -0,0 +1,39 @@ +pushHandler(new \Whoops\Handler\PrettyPageHandler); +$whoops->register(); + +$pdf = new PDFInfo('files/EEE.pdf'); + +echo $pdf->title; +echo '
'; +echo $pdf->author; +echo '
'; +echo $pdf->creator; +echo '
'; +echo $pdf->producer; +echo '
'; +echo $pdf->creationDate; +echo '
'; +echo $pdf->modDate; +echo '
'; +echo $pdf->tagged; +echo '
'; +echo $pdf->form; +echo '
'; +echo $pdf->pages; +echo '
'; +echo $pdf->encrypted; +echo '
'; +echo $pdf->pageSize; +echo '
'; +echo $pdf->fileSize; +echo '
'; +echo $pdf->optimized; +echo '
'; +echo $pdf->PDFVersion; +echo '
'; diff --git a/src/Howtomakeaturn/PDFInfo/Exceptions/OpenOutputException.php b/src/Howtomakeaturn/PDFInfo/Exceptions/OpenOutputException.php new file mode 100644 index 0000000..52c8844 --- /dev/null +++ b/src/Howtomakeaturn/PDFInfo/Exceptions/OpenOutputException.php @@ -0,0 +1,6 @@ +output = $output;