Exemplo n.º 1
0
 /**
  * @since 2.0
  */
 public function execute()
 {
     // TODO It would be good if this script would work with SMW not being enable (yet).
     // Then one could setup the store without first enabling SMW (which will break the wiki until the store is setup).
     if (!defined('SMW_VERSION')) {
         $this->output("You need to have SMW enabled in order to use this maintenance script!\n\n");
         exit;
     }
     $this->loadGlobalFunctions();
     $store = $this->getStore();
     if ($this->hasOption('delete')) {
         $this->dropStore($store);
     } else {
         Store::setupStore(!$this->isQuiet());
     }
 }
Exemplo n.º 2
0
 private function performFullDelete()
 {
     $this->reportMessage("Deleting all stored data completely and rebuilding it again later!\n---\n" . " Semantic data in the wiki might be incomplete for some time while this operation runs.\n\n" . " NOTE: It is usually necessary to run this script ONE MORE TIME after this operation,\n" . " since some properties' types are not stored yet in the first run.\n---\n");
     if ($this->options->has('s') || $this->options->has('e')) {
         $this->reportMessage(" WARNING: -s or -e are used, so some pages will not be refreshed at all!\n" . " Data for those pages will only be available again when they have been\n" . " refreshed as well!\n\n");
     }
     $obLevel = ob_get_level();
     $this->reportMessage(' Abort with control-c in the next five seconds ...  ');
     wfCountDown(6);
     $this->store->drop($this->verbose);
     $this->store->setupStore($this->verbose);
     // Be sure to have some buffer, otherwise some PHPs complain
     while (ob_get_level() > $obLevel) {
         ob_end_flush();
     }
     $this->reportMessage("\nAll storage structures have been deleted and recreated.\n\n");
     return true;
 }