File tree Expand file tree Collapse file tree 3 files changed +50
-1
lines changed
src/Howtomakeaturn/PDFInfo Expand file tree Collapse file tree 3 files changed +50
-1
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ require_once ('../vendor/autoload.php ' );
3+
4+ use \Howtomakeaturn \PDFInfo \PDFInfo ;
5+
6+ $ whoops = new \Whoops \Run ;
7+ $ whoops ->pushHandler (new \Whoops \Handler \PrettyPageHandler );
8+ $ whoops ->register ();
9+
10+ $ pdf = new PDFInfo ('files/not-exist.pdf ' );
11+
12+ echo $ pdf ->title ;
13+ echo '<hr /> ' ;
14+ echo $ pdf ->author ;
15+ echo '<hr /> ' ;
16+ echo $ pdf ->creator ;
17+ echo '<hr /> ' ;
18+ echo $ pdf ->producer ;
19+ echo '<hr /> ' ;
20+ echo $ pdf ->creationDate ;
21+ echo '<hr /> ' ;
22+ echo $ pdf ->modDate ;
23+ echo '<hr /> ' ;
24+ echo $ pdf ->tagged ;
25+ echo '<hr /> ' ;
26+ echo $ pdf ->form ;
27+ echo '<hr /> ' ;
28+ echo $ pdf ->pages ;
29+ echo '<hr /> ' ;
30+ echo $ pdf ->encrypted ;
31+ echo '<hr /> ' ;
32+ echo $ pdf ->pageSize ;
33+ echo '<hr /> ' ;
34+ echo $ pdf ->fileSize ;
35+ echo '<hr /> ' ;
36+ echo $ pdf ->optimized ;
37+ echo '<hr /> ' ;
38+ echo $ pdf ->PDFVersion ;
39+ echo '<hr /> ' ;
Original file line number Diff line number Diff line change 1+ <?php
2+ namespace Howtomakeaturn \PDFInfo \Exceptions ;
3+
4+ use \Exception ;
5+
6+ class BaseException extends Exception{};
Original file line number Diff line number Diff line change @@ -42,7 +42,11 @@ private function loadOutput()
4242 $ file = escapeshellarg ($ this ->file );
4343 // Parse entire output
4444 // Surround with double quotes if file name has spaces
45- exec ("$ cmd $ file " , $ output );
45+ exec ("$ cmd $ file " , $ output , $ returnVar );
46+
47+ if ( $ returnVar !== 0 ){
48+ throw new Exceptions \BaseException ();
49+ }
4650
4751 $ this ->output = $ output ;
4852 }
You can’t perform that action at this time.
0 commit comments