/** * Sets up requires directories * @param DatabaseUpdater $updater Provided by MediaWikis update.php * @return boolean Always true to keep the hook running */ public static function getSchemaUpdates($updater) { //TODO: Create abstraction in Core/Adapter $sTmpDir = BSDATADIR . DS . 'UEModulePDF'; if (!file_exists($sTmpDir)) { echo 'Directory "' . $sTmpDir . '" not found. Creating.' . "\n"; wfMkdirParents($sTmpDir); } else { echo 'Directory "' . $sTmpDir . '" found.' . "\n"; } $sDefaultTemplateDir = BSDATADIR . DS . 'PDFTemplates'; if (!file_exists($sDefaultTemplateDir)) { echo 'Default template directory "' . $sDefaultTemplateDir . '" not found. Copying.' . "\n"; BsFileSystemHelper::copyRecursive(__DIR__ . DS . 'data' . DS . 'PDFTemplates', $sDefaultTemplateDir); } return true; }