38 lines
736 B
PHP
38 lines
736 B
PHP
<?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;
|
|
}
|
|
} |