/** * @todo document */ public function getInfo($property = NULL) { if (!isset($this->info)) { $this->info = array(); if (file_exists("{$this->path}/composer.json")) { $this->info = drush_json_decode(file_get_contents("{$this->path}/composer.json")); if (!$this->info) { $this->info = array(); } } } $this->info['generation_date'] = date('c'); if (isset($property)) { return isset($this->info[$property]) ? $this->info[$property] : FALSE; } return $this->info; }
function readFile($filename) { $item = file_get_contents($filename); return $item ? (object) drush_json_decode($item) : FALSE; }