first commit
This commit is contained in:
38
TogglBase.inc
Normal file
38
TogglBase.inc
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
|
||||
class TogglBase
|
||||
{
|
||||
protected $folderKey;
|
||||
protected $lastErr;
|
||||
protected $file;
|
||||
|
||||
public function getFolderKey()
|
||||
{
|
||||
return $this->folderKey;
|
||||
}
|
||||
|
||||
public function getLastError()
|
||||
{
|
||||
return $this->lastErr;
|
||||
}
|
||||
|
||||
protected function open($filename)
|
||||
{
|
||||
mb_internal_encoding('UTF-8');
|
||||
$this->file = fopen($filename, "r");
|
||||
if (!fgetcsv($this->file)) {
|
||||
$this->lastErr = "Unable to read CSV file";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function close()
|
||||
{
|
||||
fclose($this->file);
|
||||
$this->file = null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user