@ -74,6 +74,14 @@ class Pico
*/
*/
protected $rootDir;
protected $rootDir;
/**
* Vendor directory of this Pico instance
*
* @see Pico::getVendorDir()
* @var string
*/
protected $vendorDir;
/**
/**
* Config directory of this Pico instance
* Config directory of this Pico instance
*
*
@ -262,6 +270,7 @@ class Pico
public function __construct($rootDir, $configDir, $pluginsDir, $themesDir)
public function __construct($rootDir, $configDir, $pluginsDir, $themesDir)
{
{
$this->rootDir = rtrim($rootDir, '/\\') . '/';
$this->rootDir = rtrim($rootDir, '/\\') . '/';
$this->vendorDir = dirname(__DIR__) . '/';
$this->configDir = $this->getAbsolutePath($configDir);
$this->configDir = $this->getAbsolutePath($configDir);
$this->pluginsDir = $this->getAbsolutePath($pluginsDir);
$this->pluginsDir = $this->getAbsolutePath($pluginsDir);
$this->themesDir = $this->getAbsolutePath($themesDir);
$this->themesDir = $this->getAbsolutePath($themesDir);
@ -277,6 +286,16 @@ class Pico
return $this->rootDir;
return $this->rootDir;
}
}
/**
* Returns the vendor directory of this Pico instance
*
* @return string vendor directory path
*/
public function getVendorDir()
{
return $this->vendorDir;
}
/**
/**
* Returns the config directory of this Pico instance
* Returns the config directory of this Pico instance
*
*
@ -744,8 +763,10 @@ class Pico
// try to guess the content directory
// try to guess the content directory
if (is_dir($this->getRootDir() . 'content')) {
if (is_dir($this->getRootDir() . 'content')) {
$this->config['content_dir'] = $this->getRootDir() . 'content/';
$this->config['content_dir'] = $this->getRootDir() . 'content/';
} else {
} elseif (is_dir($this->getRootDir() . 'content-sample')) {
$this->config['content_dir'] = $this->getRootDir() . 'content-sample/';
$this->config['content_dir'] = $this->getRootDir() . 'content-sample/';
} else {
$this->config['content_dir'] = $this->getVendorDir() . 'content-sample/';
}
}
} else {
} else {
$this->config['content_dir'] = $this->getAbsolutePath($this->config['content_dir']);
$this->config['content_dir'] = $this->getAbsolutePath($this->config['content_dir']);