private function saveFullCode() { if (!_root::getRequest()->isPost()) { return null; } $sContent = $_POST['content']; $oFile = new _file(_root::getParam('file')); //backup $oBackupFile = new _file(_root::getParam('file') . '.bak'); $oBackupFile->setContent($oFile->getContent()); $oBackupFile->save(); $tLine = $oFile->getTab(); $oFile->setContent($sContent); $oFile->save(); _root::redirect('code::editcode', array('project' => _root::getParam('project'), 'file' => _root::getParam('file'))); }
public function getTabFromTable($sTable) { $oFile = new _file($this->_tConfig[$this->_sConfig . '.database'] . $sTable . '.csv'); $tFile = $oFile->getTab(); return $tFile; }
private function updateLibPathInConf($sProject, $sLib) { //replace link library $oIniFile = new _file($sProject . '/conf/site.ini.php'); $tIni = $oIniFile->getTab(); $tNewIni = array(); $bSection = 0; foreach ($tIni as $line) { if (preg_match('/\\[path\\]/', $line)) { $bSection = 1; } else { if ($bSection && substr($line, 0, 3) == 'lib') { $line = 'lib=' . $sLib; } } $tNewIni[] = $line; } $oIniFile->setContent(implode($tNewIni, "")); $oIniFile->save(); }