/** * List Sites in Cache * * ## OPTIONS * * [--rebuild] * @subcommand cache */ public function cache($args, $assoc_args) { $sites_cache = new Terminus\SitesCache(); if (isset($assoc_args['rebuild'])) { $sites_cache->rebuild(); } $sites = $sites_cache->all(); $data = array(); foreach ($sites as $name => $id) { $data[] = array('name' => $name, 'id' => $id); } $this->handleDisplay($data, $args); }
/** * Clears sites cache * * @return void */ public function rebuildCache() { $this->sites_cache->rebuild(); }