/** * Include config file, unique only. * @param string|array $path * @return bool true if the path was unique and loaded */ public function includeConfig($path, $force = false) { $file = File::create($path); $path = $file->getPath(); if (!isset($this->_included[$path]) || $force) { $this->_included[$path] = $path; $this->mergeItems($file->load()); return true; } return false; }
public function needsComposerInstall() { if (file_exists('vendor')) { return false; } if (!file_exists('composer.json')) { return false; } $data = File::create('composer.json')->load(); foreach (['require', 'require-dev'] as $key) { if (isset($data[$key])) { foreach ($data[$key] as $package => $version) { list(, $name) = explode('/', $package); if (strncmp($name, 'hidev-', 6) === 0) { return true; } } } } return false; }