/** * Проверка существования спрайта */ public function exists() { return $this->cssDi->isFile(); }
/** * Выполняет команды в переданном файле в shell интерпретаторе */ public function execureShell(DirItem $sql) { check_condition($sql->isFile(), 'Файл с sql инструкциями не существут: ' . $sql->getAbsPath()); $LOGGER = PsLogger::inst(__CLASS__); $command = 'mysql' . ' --default-character-set=utf8' . ' --host=' . $this->host() . ' --user='******' --password='******' --database=' . $this->database() : '') . ' < ' . $sql->getAbsPath(); $LOGGER->info('Executing sql shell script: {}', $command); $output = shell_exec($command); $LOGGER->info($output ? 'Output: ' . $output : 'No output'); }