From aaf614b26c26e1d620175a5483812078aff262da Mon Sep 17 00:00:00 2001 From: "h.woltersdorf" Date: Thu, 9 Jul 2015 17:01:12 +0200 Subject: [PATCH] Added .gitignore Fixed usage of wrong member in ReflectionClass Replaced fixed /tmp directory with sys_get_temp_dir() --- .gitignore | 1 + PHPExport/ReflectionClass.php | 2 +- PHPExport/ReflectionExtension.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..62c8935 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/ \ No newline at end of file diff --git a/PHPExport/ReflectionClass.php b/PHPExport/ReflectionClass.php index 5860c32..c8fa1ca 100644 --- a/PHPExport/ReflectionClass.php +++ b/PHPExport/ReflectionClass.php @@ -128,7 +128,7 @@ public function exportFile( $file_path ) if ( empty($content) ) { - throw new \Exception( "Got no content from export for class {$this->_classname->getName()}" ); + throw new \Exception( "Got no content from export for class {$this->_reflection_class->getName()}" ); } $result = file_put_contents( $file_path, $content ); diff --git a/PHPExport/ReflectionExtension.php b/PHPExport/ReflectionExtension.php index d1b04cf..cac5012 100644 --- a/PHPExport/ReflectionExtension.php +++ b/PHPExport/ReflectionExtension.php @@ -113,7 +113,7 @@ public function exportFiles( $directory, $create_sub_directories = true ) public function exportPHAR( $phar_name, $output_dir = '.', $create_sub_directories = true ) { ini_set( 'phar.readonly', 0 ); - $temp_dir = '/tmp' . DIRECTORY_SEPARATOR . 'PHPExport_' . rand( 1, 9999 ); + $temp_dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'PHPExport_' . rand( 1, 9999 ); if ( !file_exists( $temp_dir ) && !@mkdir( $temp_dir ) ) {