params->shift(); $import = new Import(ImportSource::load($id, $this->db())); if ($runId = $import->run()) { echo "Triggered new import\n"; } else { echo "Nothing changed\n"; } } protected function db() { if ($this->db === null) { $this->app->setupZendAutoloader(); $resourceName = $this->Config()->get('db', 'resource'); if ($resourceName) { $this->db = Db::fromResourceName($resourceName); } else { $this->fail('Director is not configured correctly'); } } return $this->db; } }