public function setFile($file = null) { $return = false; if (!empty($file)) { if (!file_exists($file)) { if ($pathFile = Torpor::getFileInPath($file)) { trigger_error('Specified file "' . $file . '" not found, using "' . $pathFile . '" found in include path', E_USER_WARNING); $file = $pathFile; } else { trigger_error('Specified file "' . $file . '" does not exist; attempting to create an empty SQLite database', E_USER_WARNING); } } if ($file !== $this->getFile()) { if ($this->isConnected()) { $this->disconnect(); } $this->_file = $file; $return = true; } } else { if ($this->getFile()) { trigger_error('No file specified; maintaining prior connection.'); } else { $this->throwException('Cannot connect to or create empty SQLite database'); } } return $return; }