Esempio n. 1
0
 /**
  * Your main program
  *
  * Arguments and options have been parsed when this is run
  *
  * @param DokuCLI_Options $options
  * @return void
  */
 protected function main(DokuCLI_Options $options)
 {
     $this->clear = $options->getOpt('clear');
     $this->quiet = $options->getOpt('quiet');
     if ($this->clear) {
         $this->clearindex();
     }
     $this->update();
 }
Esempio n. 2
0
 /**
  * Your main program
  *
  * Arguments and options have been parsed when this is run
  *
  * @param DokuCLI_Options $options
  * @throws DokuCLI_Exception
  * @return void
  */
 protected function main(DokuCLI_Options $options)
 {
     $renderer = $options->getOpt('renderer', 'xhtml');
     // do the action
     $source = stream_get_contents(STDIN);
     $info = array();
     $result = p_render($renderer, p_get_instructions($source), $info);
     if (is_null($result)) {
         throw new DokuCLI_Exception("No such renderer {$renderer}");
     }
     echo $result;
 }
Esempio n. 3
0
 /**
  * Your main program
  *
  * Arguments and options have been parsed when this is run
  *
  * @param DokuCLI_Options $options
  * @return void
  */
 protected function main(DokuCLI_Options $options)
 {
     $this->force = $options->getOpt('force', false);
     $this->username = $options->getOpt('user', $this->getUser());
     $command = $options->getCmd();
     switch ($command) {
         case 'checkout':
             $wiki_id = array_shift($options->args);
             $localfile = array_shift($options->args);
             $this->commandCheckout($wiki_id, $localfile);
             break;
         case 'commit':
             $localfile = array_shift($options->args);
             $wiki_id = array_shift($options->args);
             $this->commandCommit($localfile, $wiki_id, $options->getOpt('message', ''), $options->getOpt('trivial', false));
             break;
         case 'lock':
             $wiki_id = array_shift($options->args);
             $this->obtainLock($wiki_id);
             $this->success("{$wiki_id} locked");
             break;
         case 'unlock':
             $wiki_id = array_shift($options->args);
             $this->clearLock($wiki_id);
             $this->success("{$wiki_id} unlocked");
             break;
         default:
             echo $options->help();
     }
 }
Esempio n. 4
0
 /**
  * Your main program
  *
  * Arguments and options have been parsed when this is run
  *
  * @param DokuCLI_Options $options
  * @return void
  */
 protected function main(DokuCLI_Options $options)
 {
     if ($options->getOpt('keep')) {
         $keep = explode(',', $options->getOpt('keep'));
         if (!in_array('en', $keep)) {
             $keep[] = 'en';
         }
     } elseif ($options->getOpt('english-only')) {
         $keep = array('en');
     } else {
         echo $options->help();
         exit(0);
     }
     // Kill all language directories in /inc/lang and /lib/plugins besides those in $langs array
     $this->stripDirLangs(realpath(dirname(__FILE__) . '/../inc/lang'), $keep);
     $this->processExtensions(realpath(dirname(__FILE__) . '/../lib/plugins'), $keep);
     $this->processExtensions(realpath(dirname(__FILE__) . '/../lib/tpl'), $keep);
 }
Esempio n. 5
0
 /**
  * Your main program
  *
  * Arguments and options have been parsed when this is run
  *
  * @param DokuCLI_Options $options
  * @return void
  */
 protected function main(DokuCLI_Options $options)
 {
     $command = $options->getCmd();
     if (!$command) {
         $command = array_shift($options->args);
     }
     switch ($command) {
         case '':
             echo $options->help();
             break;
         case 'clone':
             $this->cmd_clone($options->args);
             break;
         case 'install':
             $this->cmd_install($options->args);
             break;
         case 'repo':
         case 'repos':
             $this->cmd_repos();
             break;
         default:
             $this->cmd_git($command, $options->args);
     }
 }
 /**
  * Your main program
  *
  * Arguments and options have been parsed when this is run
  *
  * @param DokuCLI_Options $options
  * @return void
  */
 protected function main(DokuCLI_Options $options)
 {
     $this->clear = $options->getOpt('clear');
     $this->quiet = $options->getOpt('quiet');
     $this->force = $options->getOpt('force');
     $this->namespace = $options->getOpt('namespace', '');
     $this->removeLocks = $options->getOpt('remove-locks', '');
     $this->maxRuns = $options->getOpt('max-runs', 0);
     $this->startOffset = $options->getOpt('start', 0);
     $id = $options->getOpt('id');
     if ($this->removeLocks) {
         $this->removeLocks();
     }
     if ($id) {
         $this->index($id);
         $this->quietecho("done.\n");
     } else {
         if ($this->clear) {
             $this->clearindex();
         }
         $this->update();
     }
 }
Esempio n. 7
0
    /**
     * Your main program
     *
     * Arguments and options have been parsed when this is run
     *
     * @param DokuCLI_Options $options
     * @return void
     */
    protected function main(DokuCLI_Options $options) {
        $this->clear = $options->getOpt('clear');
        $this->quiet = $options->getOpt('quiet');
        $this->force = $options->getOpt('force');
        $this->namespace = $options->getOpt('namespace', '');
        
        $id = $options->getOpt('id');
        
        if($id) {
            $this->index($id);
            $this->quietecho("done.\n");
            return;
        }

        if($this->clear) {
            $this->clearindex();
        }

        $this->update();
    }
Esempio n. 8
0
 /**
  * Your main program
  *
  * Arguments and options have been parsed when this is run
  *
  * @param DokuCLI_Options $options
  * @return void
  */
 protected function main(DokuCLI_Options $options)
 {
     $cron = $options->getOpt('cron');
     $this->sendAll($this->findFreshEdits($cron));
 }
Esempio n. 9
0
 /**
  * Register options and arguments on the given $options object
  *
  * @param DokuCLI_Options $options
  * @return void
  */
 protected function setup(DokuCLI_Options $options)
 {
     $options->setHelp('Outputs a list of wanted pages (pages which have internal links but do not yet exist).');
     $options->registerArgument('namespace', 'The namespace to lookup. Defaults to root namespace', false);
 }
 /**
  * Your main program
  *
  * Arguments and options have been parsed when this is run
  *
  * @param DokuCLI_Options $options
  * @return void
  */
 protected function main(DokuCLI_Options $options)
 {
     $this->clear = $options->getOpt('clear');
     $this->quiet = $options->getOpt('quiet');
     $this->force = $options->getOpt('force');
     $this->namespace = $options->getOpt('namespace', '');
     $this->removeLocks = $options->getOpt('remove-locks', '');
     $this->maxRuns = $options->getOpt('max-runs', 0);
     $this->startOffset = $options->getOpt('start', 0);
     self::$tempFileName = $options->getOpt('temp-file', '');
     self::$totalPagesToIndex = $options->getOpt('end', 0);
     $id = $options->getOpt('id');
     if ($this->removeLocks) {
         $this->removeLocks();
     }
     if ($id) {
         $this->index($id, 1, 1);
         $this->quietecho("done\n");
     } else {
         if ($this->clear) {
             $this->clearindex();
         }
         $this->update();
     }
 }