Files
old-toggl-uploader/TogglBase.inc

38 lines
736 B
PHP
Raw Normal View History

2017-10-19 11:38:33 +02:00
<?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;
}
}