@@ -36,9 +36,9 @@ abstract class PHPWord_Reader_Abstract implements PHPWord_Reader_IReader
36
36
*
37
37
* @var boolean
38
38
*/
39
- protected $ _readDataOnly = FALSE ;
39
+ protected $ readDataOnly = TRUE ;
40
40
41
- protected $ _fileHandle = NULL ;
41
+ protected $ fileHandle = NULL ;
42
42
43
43
44
44
/**
@@ -47,7 +47,8 @@ abstract class PHPWord_Reader_Abstract implements PHPWord_Reader_IReader
47
47
* @return boolean
48
48
*/
49
49
public function getReadDataOnly () {
50
- return $ this ->_readDataOnly ;
50
+ // return $this->readDataOnly;
51
+ return TRUE ;
51
52
}
52
53
53
54
/**
@@ -56,29 +57,29 @@ public function getReadDataOnly() {
56
57
* @param boolean $pValue
57
58
* @return PHPWord_Reader_IReader
58
59
*/
59
- public function setReadDataOnly ($ pValue = FALSE ) {
60
- $ this ->_readDataOnly = $ pValue ;
60
+ public function setReadDataOnly ($ pValue = TRUE ) {
61
+ $ this ->readDataOnly = $ pValue ;
61
62
return $ this ;
62
63
}
63
64
64
65
/**
65
66
* Open file for reading
66
67
*
67
68
* @param string $pFilename
68
- * @throws PHPWord_Reader_Exception
69
+ * @throws PHPWord_Exception
69
70
* @return resource
70
71
*/
71
- protected function _openFile ($ pFilename )
72
+ protected function openFile ($ pFilename )
72
73
{
73
74
// Check if file exists
74
75
if (!file_exists ($ pFilename ) || !is_readable ($ pFilename )) {
75
- throw new PHPWord_Reader_Exception ("Could not open " . $ pFilename . " for reading! File does not exist. " );
76
+ throw new PHPWord_Exception ("Could not open " . $ pFilename . " for reading! File does not exist. " );
76
77
}
77
78
78
79
// Open file
79
- $ this ->_fileHandle = fopen ($ pFilename , 'r ' );
80
- if ($ this ->_fileHandle === FALSE ) {
81
- throw new PHPWord_Reader_Exception ("Could not open file " . $ pFilename . " for reading. " );
80
+ $ this ->fileHandle = fopen ($ pFilename , 'r ' );
81
+ if ($ this ->fileHandle === FALSE ) {
82
+ throw new PHPWord_Exception ("Could not open file " . $ pFilename . " for reading. " );
82
83
}
83
84
}
84
85
@@ -87,19 +88,17 @@ protected function _openFile($pFilename)
87
88
*
88
89
* @param string $pFilename
89
90
* @return boolean
90
- * @throws PHPWord_Reader_Exception
91
+ * @throws PHPWord_Exception
91
92
*/
92
93
public function canRead ($ pFilename )
93
94
{
94
95
// Check if file exists
95
96
try {
96
- $ this ->_openFile ($ pFilename );
97
+ $ this ->openFile ($ pFilename );
97
98
} catch (Exception $ e ) {
98
99
return FALSE ;
99
100
}
100
-
101
- $ readable = $ this ->_isValidFormat ();
102
- fclose ($ this ->_fileHandle );
101
+ fclose ($ this ->fileHandle );
103
102
return $ readable ;
104
103
}
105
104
0 commit comments