Lines Matching +full:- +full:- +full:strip +full:- +full:components

10  * @author     Andreas Wagner <andreas.wagner@em.uni-frankfurt.de>
42 if ($INPUT->post->has('pref') && checkSecurityToken()) {
43 $this->savePreferences($INPUT->post->arr('pref'));
56 if ($INPUT->post->bool('backup')) {
57 $this->removeMediaAtticBackups();
58 $this->runBackup();
60 echo '<h1>' . $this->getLang('menu') . '</h1>';
62 if ($this->isRunningWindows()) {
63 msg($this->getLang('windows-msg'), 2);
66 if ($this->isRunningWindows()) {
67 echo '<div class="bt-warning" style="display: block;">';
68 echo $this->locale_xhtml('windows');
72 echo '<div class="bt-content" style="display: none;">';
77 echo $this->locale_xhtml('intro');
79 echo $this->getForm();
81 $this->listBackups();
83 echo $this->locale_xhtml('donate');
96 $ns = $this->getConf('backupnamespace');
105 echo '<h2>' . $this->getLang('recent') . '</h2>';
120 echo '<p>' . sprintf($this->getLang('medians'), $ns, $link) . '</p>';
129 $self = fullpath(dirname(mediaFN($this->getConf('backupnamespace') . ':foo')));
130 …$targetdir = $conf['mediaolddir'] . '/' . $this->stripPrefix($self, fullpath(dirname(mediaFN($conf…
132 $this->btRemoveFiles($targetdir, 'dw-backup-');
142 echo '<h1>' . $this->getLang('menu') . '</h1>';
143 echo '<p class="bt-running">';
144 echo hsc($this->getLang('running'));
149 $id = $this->createBackupID();
154 $this->createBackup($fn, $this->loadPreferences(), [$this, 'logXHTML']);
156 msg(sprintf($this->getLang('success'), ml($id), $id), 1);
159 msg('Backup failed. ' . $e->getMessage(), -1);
163 …echo '<script>document.getElementsByClassName(\'bt-running\')[0].style.display=\'none\';</script>';
176 if ($level === -1 || $level === 1) {
197 $form->addFieldsetOpen($this->getLang('components'));
199 $prefs = $this->loadPreferences();
201 $label = $this->getLang('bt_' . $pref);
206 $form->setHiddenField("pref[$pref]", '0');
207 $cb = $form->addCheckbox("pref[$pref]", $label)->useInput(false)->addClass('block');
209 $cb->attr('checked', 'checked');
213 $form->addButton('backup', $this->getLang('bt_create_backup'));
214 return $form->toHTML();
236 if (file_exists($this->prefFile)) {
237 $more = json_decode(io_readFile($this->prefFile, false), true);
252 io_saveFile($this->prefFile, json_encode($prefs, JSON_PRETTY_PRINT));
262 $tarfilename = 'dw-backup-' . date('Ymd-His') . '.tar';
268 return cleanID($this->getConf('backupnamespace') . ':' . $tarfilename);
284 $tar->create($fn);
295 $logger('Can\'t call ' . $cmd[1], -1);
299 $tar->close();
320 $file = $this->stripPrefix($path, $dir);
327 if (!$this->defaultFilter($file)) {
334 $tar->addFile($path, $file);
348 if ($this->filters === null) {
349 $this->filters = explode("\n", $this->getConf('filterdirs'));
350 $this->filters = array_map('trim', $this->filters);
351 $this->filters = array_filter($this->filters);
358 foreach ($this->filters as $filter) {
368 * Strip the given prefix from the directory
382 // region backup components
394 $this->addDirectoryToTar($tar, DOKU_CONF, 'conf', $logger, function ($path) {
399 $tar->addFile(DOKU_INC . 'inc/preload.php', 'inc/preload.php');
414 $this->addDirectoryToTar($tar, $conf['datadir'], 'data/pages', $logger);
428 $this->addDirectoryToTar($tar, $conf['olddir'], 'data/attic', $logger);
442 $this->addDirectoryToTar($tar, $conf['metadir'], 'data/meta', $logger);
459 $self = fullpath(dirname(mediaFN($this->getConf('backupnamespace') . ':foo')));
460 $relself = 'data/media/' . $this->stripPrefix($self, $media);
462 …$this->addDirectoryToTar($tar, $conf['mediadir'], 'data/media', $logger, function ($path) use ($re…
482 $self = fullpath(dirname(mediaFN($this->getConf('backupnamespace') . ':foo')));
483 $relself = 'data/media_attic/' . $this->stripPrefix($self, $media);
485 …$this->addDirectoryToTar($tar, $conf['mediaolddir'], 'data/media_attic', $logger, function ($path)…
505 $self = fullpath(dirname(mediaFN($this->getConf('backupnamespace') . ':foo')));
506 $relself = 'data/media_meta/' . $this->stripPrefix($self, $media);
508 …$this->addDirectoryToTar($tar, $conf['mediametadir'], 'data/media_meta', $logger, function ($path)…
525 $this->addDirectoryToTar($tar, DOKU_INC . 'lib/tpl', 'lib/tpl', $logger);
539 $this->addDirectoryToTar($tar, DOKU_INC . 'lib/plugins', 'lib/plugins', $logger);