public function __construct(Codex $codex, Project $project, Filesystem $files, Container $container, Cache $cache)
 {
     ini_set('memory_limit', '2G');
     $path = $project->path($project->config('hooks.sassdoc.path'));
     $pathName = 'sassdoc';
     parent::__construct($codex, $project, $files, $container, $path, $pathName);
     $this->mergeAttributes($project->config('hooks.sassdoc'));
     $this->setPath($path);
     $this->cache = $cache;
 }
 public function extendProject()
 {
     Project::extend('getSassdocDocument', function () {
         /** @var Project $this */
         return app()->make('codex.hooks.sassdoc.document', ['project' => $this, 'codex' => $this->getCodex()]);
     });
 }
Esempio n. 3
0
 /**
  * handle
  *
  * @param \Codex\Core\Project $project
  */
 public function handle(Project $project)
 {
     $that = $this;
     // Add a method on the project class that creates a new GitSync for that specific project
     Project::macro('gitSyncer', function () {
         /** @var Project $this */
         return app('codex.hooks.git')->gitSyncer($this);
     });
 }
 /**
  * {@inheritdoc}
  */
 public function register()
 {
     $app = parent::register();
     $this->codexRouteExclusion('git-hook-webhook');
     // Add the hook which merges the codex config.
     $this->codexHook('factory:ready', FactoryHook::class);
     Project::extend('gitSyncer', function () {
         /** @var Project $this */
         return app('codex.hooks.git')->gitSyncer($this);
     });
 }
 /**
  * handle
  *
  * @param \Codex\Core\Project $project
  */
 public function handle(Project $project, Menu $menu)
 {
     if (!$project->hasEnabledHook('sassdoc')) {
         return;
     }
     $node = $menu->add('sassdoc', $project->config('hooks.sassdoc.menu_name'));
     $node->setMeta('icon', $project->config('hooks.sassdoc.menu_icon'));
     $node->setAttribute('href', route('codex.hooks.sassdoc', ['projectName' => $project->getName(), 'ref' => $project->getRef()]));
 }
Esempio n. 6
0
 protected function setting($key, $default = null)
 {
     return array_get($this->project->config('hooks.git'), $key, $default);
 }
Esempio n. 7
0
 /**
  * Returns an array of parent menu items
  *
  * @return array
  */
 public function getBreadcrumb()
 {
     return $this->project->getSidebarMenu()->getBreadcrumbToHref($this->url());
 }