/** * Parst YaTDL-Datei und führt SQL-Statement aus * @param string $path * @return boolean * @since FPCM 3.2.0 */ public function execYaTdl($path) { if (substr($path, -4) !== '.yml') { $path .= '.yml'; } $yatdl = new \fpcm\model\system\yatdl($path); if ($yatdl->parse() !== true) { trigger_error('An YaTDL parser error occurred!'); return false; } $sql = str_replace('{{dbpref}}', $this->getDbprefix(), $yatdl->getSqlString()); $this->lastQueryString = $sql; if (defined('FPCM_DEBUG') && FPCM_DEBUG && defined('FPCM_DEBUG_SQL') && FPCM_DEBUG_SQL) { logs::sqllogWrite($sql); } try { $res = $this->connection->exec($sql); } catch (\PDOException $e) { logs::sqllogWrite($e); } if ($res === false) { $this->getError(); return false; } return true; }