Beispiel #1
0
 /**
  * Redirect to the default project and version.
  *
  * @return Redirect
  */
 public function index()
 {
     $this->hookPoint('controller:index');
     #codex()->addons->getManifest()->load()->set('asdf.a', 'asdf')->save();
     codex('addons');
     return redirect(route('codex.document', ['projectSlug' => $this->codex->config('default_project')]));
 }
Beispiel #2
0
 public function handle()
 {
     $gen = codex('projects')->createGenerator();
     $gen->setName($this->ask('Enter name'));
     $gen->set('displayName', $this->ask('Enter display name'));
     $gen->generate();
     $this->comment('done');
 }
 /**
  * @{inheritDoc}
  */
 public function collect()
 {
     $this->codex = $codex = codex();
     $project = $codex->projects->getActive();
     return ['version' => $codex->getVersion(), 'project' => $project ? $project->getName() : '', 'ref' => $project ? $project->getRef() : '', 'document' => $this->document ? $this->document->getPath() : '', 'data' => $this->data->transform(function ($item) {
         if (!is_string($item)) {
             $item = $this->getDataFormatter()->formatVar($item);
         }
         return $item;
     })->toArray()];
 }
Beispiel #4
0
 public function project(Action $action)
 {
     if (false === codex('projects')->has($action->param(0))) {
         return;
     }
     $project = codex('projects')->get($action->param(0));
     if ($action->hasParameter(1) && false === $project->hasRef($action->param(1))) {
         return;
     }
     $url = codex()->url($project, $action->param(1), $action->param(2));
     $action->getElement()->setAttribute('href', $url);
 }
Beispiel #5
0
    protected function listFilters()
    {
        foreach (codex('addons')->processors->all() as $filter) {
            if ($this->more) {
                $replace = $filter['replace'] ? "\nReplaces: {$filter['replace']}\n" : '';
                $this->output->write(<<<FILTER
<comment>{$filter['name']}</comment>
Priority: {$filter['priority']}{$replace}


FILTER
);
            } else {
                $this->line(" - {$filter['name']}");
            }
        }
    }
Beispiel #6
0
<?php

/**
 * Part of the Codex Project packages.
 *
 * License and copyright information bundled with this package in the LICENSE file.
 *
 * @author Robin Radic
 * @copyright Copyright 2016 (c) Codex Project
 * @license http://codex-project.ninja/license The MIT License
 */
if (codex()->isDev()) {
    Route::get('logs', ['as' => 'logs', 'uses' => 'CodexDevController@getLogs']);
}