예제 #1
0
파일: Refs.php 프로젝트: codexproject/core
 /**
  * Projects constructor.
  *
  * @param \Codex\Codex                $parent
  * @param \Laradic\Support\Filesystem $files
  */
 public function __construct(Project $parent)
 {
     parent::__construct();
     $this->setCodex($parent->getCodex());
     $this->setContainer($parent->getContainer());
     $this->setFiles($parent->getFiles());
     $this->project = $parent;
     $this->hookPoint('refs:construct', [$this]);
     $this->resolveRefs();
     $this->hookPoint('refs:constructed', [$this]);
 }
예제 #2
0
파일: Ref.php 프로젝트: codexproject/core
 /**
  * Ref constructor.
  *
  * @param \Codex\Codex            $codex
  * @param \Codex\Projects\Project $project
  * @param \Codex\Projects\Refs    $refs
  * @param           string        $name
  */
 public function __construct(Codex $codex, Project $project, Refs $refs, $name)
 {
     $this->setCodex($codex);
     $this->setFiles($project->getFiles());
     $this->name = $name;
     $this->project = $project;
     $this->refs = $refs;
     $this->path = $project->path($name);
     $this->hookPoint('refs:construct', [$this]);
     $this->resolve();
     $this->hookPoint('refs:constructed', [$this]);
 }
예제 #3
0
 /**
  * Document constructor.
  *
  * @param \Codex\Codex|\Codex\Contracts\Codex    $codex
  * @param \Codex\Projects\Project                $project
  * @param \Codex\Projects\Ref                    $ref
  * @param \Illuminate\Contracts\Cache\Repository $cache
  * @param                                        $path
  * @param                                        $pathName
  *
  * @throws \Codex\Exception\CodexException
  */
 public function __construct(Codex $codex, Project $project, Ref $ref, Repository $cache, $path, $pathName)
 {
     $this->setCodex($codex);
     $this->setFiles($project->getFiles());
     $this->ref = $ref;
     $this->project = $project;
     $this->path = $path;
     $this->pathName = $pathName;
     $this->cache = $cache;
     $this->extension = path_get_extension($path);
     $this->processed = new Collection();
     $this->hookPoint('document:construct', [$this]);
     #$this->codex->projects->hasActive() === false && $project->setActive();
     if (!$this->getFiles()->exists($this->getPath())) {
         throw CodexException::documentNotFound("{$this} in [{$project}]");
     }
     $this->attributes = $codex->config('default_document_attributes');
     $this->lastModified = $this->getFiles()->lastModified($this->getPath());
     $this->setCacheMode($this->getCodex()->config('document.cache.mode', self::CACHE_DISABLED));
     //$this->content = $this->getFiles()->get($this->getPath());
     $this->attr('view', null) === null && $this->setAttribute('view', $codex->view('document'));
     $this->hookPoint('document:constructed', [$this]);
 }