Example #1
0
function relative2absolute ($string, $directory) {
	if (path_is_relative($string)) {
		return simplify_path(addslash($directory) . $string);
	} else {
		return simplify_path($string);
	}
}
Example #2
0
 /**
  * Codex constructor.
  *
  * @param \Illuminate\Contracts\Container\Container $container The container instance
  * @param \Illuminate\Filesystem\Filesystem         $files     The filesystem instance
  * @param \Illuminate\Contracts\Cache\Repository    $cache     The cache instance
  * @param \Codex\Contracts\Log\Log                  $log       The log instance
  *
  * @hook constructed After Codex has been constructed
  * @example
  * <?php
  * codex()->projects->get('codex')->documents->get('index')->render();
  */
 public function __construct(Container $container, Filesystem $files, Cache $cache, Contracts\Log\Log $log)
 {
     $this->setContainer($container);
     $this->setFiles($files);
     $this->cache = $cache;
     $this->log = $log;
     $this->docsPath = config('codex.paths.docs');
     if (path_is_relative($this->docsPath)) {
         $this->docsPath = base_path($this->docsPath);
     }
     // 'factory:done' called after all factory operations have completed.
     $this->hookPoint('constructed', [$this]);
 }