formatInstance = $options["formatInstance"]; } else { throw new \Exception("Missing parameter formatInstance"); } // Attempts to retrieve directoryInstance if (isset($options["directoryInstance"]) && ! is_null($options["directoryInstance"])) { $this->directoryInstance = $options["directoryInstance"]; } else { throw new \Exception("Missing parameter directoryInstance"); } // Attempts to retrieve version if (isset($options["version"]) && ! is_null($options["version"])) { $this->version = $options["version"]; } else { throw new \Exception("Missing parameter version"); } } /** * Controls the diagnostics creation * * @param Console_CommandLine_Result $options * @throws \Exception */ function create(Console_CommandLine_Result $options){ $args = $options->args; $options = $options->options; $diagnosticData = new Alternc_Diagnostic_Data(Alternc_Diagnostic_Data::TYPE_ROOT); $serviceList = explode(',',$options["services"]); foreach ($serviceList as $service) { $class_name = "Alternc_Diagnostic_Service_".trim(ucfirst($service)); if(!class_exists($class_name)){ throw new \Exception("Invalid service $service"); } /** @var Alternc_Diagnostic_Service_Interface */ $serviceAgent = new $class_name( array("service" => $this) ); // Runs the service agent and store the results $diagnosticData->addData($serviceAgent->name, $serviceAgent->run()); } $this->formatInstance->setData($diagnosticData)->write(); } function compare( $options ){} function index( $options ){} function show( $options ){} function delete( $options ){} }