@@ -19,7 +19,7 @@ class Csv
19
19
protected $ handle ;
20
20
protected $ pathDir ;
21
21
protected $ filename ;
22
- protected $ currentFile ;
22
+ protected $ currentPathname ;
23
23
protected $ header ;
24
24
protected $ maxLines ;
25
25
protected $ delimiter ;
@@ -91,8 +91,8 @@ protected function open()
91
91
if ($ this ->fileNumber > 1 ) {
92
92
$ filename .= '- ' . $ this ->fileNumber ;
93
93
}
94
- $ this ->currentFile = $ this ->pathDir . '/ ' . $ filename . '.csv ' ;
95
- $ this ->handle = \fopen ($ this ->currentFile , 'wb ' ); //Binary is forced. EOL = "\n"
94
+ $ this ->currentPathname = $ this ->pathDir . '/ ' . $ filename . '.csv ' ;
95
+ $ this ->handle = \fopen ($ this ->currentPathname , 'wb ' ); //Binary is forced. EOL = "\n"
96
96
if (false === $ this ->handle ) {
97
97
throw new \Exception (sprintf ('Error during the opening of the %s file ' , $ this ->filename ));
98
98
}
@@ -118,12 +118,12 @@ public function close()
118
118
$ this ->handle = null ;
119
119
120
120
if ($ this ->unixToDos ) {
121
- passthru (sprintf ('%s %s ' , $ this ->unixToDosPath , $ this ->currentFile ), $ returnVar );
121
+ passthru (sprintf ('%s %s ' , $ this ->unixToDosPath , $ this ->currentPathname ), $ returnVar );
122
122
if (0 !== $ returnVar ) {
123
123
throw new \Exception (sprintf ('Unix2dos error (%s file) ' , $ this ->filename ));
124
124
}
125
125
}
126
- $ this ->currentFile = null ;
126
+ $ this ->currentPathname = null ;
127
127
}
128
128
}
129
129
@@ -167,4 +167,13 @@ public function getTotalLines()
167
167
{
168
168
return $ this ->totalLines ;
169
169
}
170
+
171
+ /**
172
+ * Gets the path to the current file
173
+ * @return string
174
+ */
175
+ public function getCurrentPathname ()
176
+ {
177
+ return $ this ->currentPathname ;
178
+ }
170
179
}
0 commit comments