controllers/EditorController.php
/**
     * Write source code in file and saves on server file
     * 
     * @param string $fileDir
     * @param string $fileName
     * @param string $contents
     * @return boolean
     */
Write source code in file and saves on server file

@param string $fileDir
@param string $fileName
@param string $contents
@return boolean
Write source code in file and saves on server file @param string $fileDir @param string $fileName @param string $contents @return boolean
public function saveFileOnDisk($fileDir, $fileName, $contents) {
        if (!is_dir($fileDir)) {
            try {
                mkdir($fileDir, 0777, true);
            } catch (Exception $e) {
                Logger::getLogger()->LogFatal('Exception: ' . $e->getMessage());
            }
        }
        if (is_writable($fileDir)) {
            $filePath = $fileDir."/".$fileName;
            return Utils::createNewFile($filePath, $contents);
        } else {
            Logger::getLogger()->LogFatal("Folder $fileDir is not writable");
            return false;
        }
    }
public function saveFileOnDisk ( $ fileDir , $ fileName , $ contents ) { if ( ! is_dir ( $ fileDir ) ) { try { mkdir ( $ fileDir , 0777 , true ) ; } catch ( Exception $ e ) { Logger :: getLogger ( ) -> LogFatal ( 'Exception: ' . $ e -> getMessage ( ) ) ; } } if ( is_writable ( $ fileDir ) ) { $ filePath = $ fileDir . " / " . $ fileName ; return Utils :: createNewFile ( $ filePath , $ contents ) ; } else { Logger :: getLogger ( ) -> LogFatal ( " Folder  $ fileDir  is not writable " ) ; return false ; } }
Write source code in file and saves on server file
Write source code in file and saves on server file