setSystemDiagnostic( true ); echo "Diagnostic mode is now enabled.\n"; } else if ( in_array( '--disable', $argv ) ) { $sd_obj = TTnew( 'SystemDiagnostic' ); /** @var SystemDiagnostic $sd_obj */ $sd_obj->setSystemDiagnostic( false ); echo "Diagnostic mode is now disabled.\n"; } else if ( in_array( '--upload', $argv ) ) { if ( isset( $config_vars['other']['primary_company_id'] ) ) { $company_id = $config_vars['other']['primary_company_id']; $clf = TTnew( 'CompanyListFactory' ); /** @var CompanyListFactory $clf */ $current_company = $clf->getByID( $company_id )->getCurrent(); $sd_obj = TTnew( 'SystemDiagnostic' ); /** @var SystemDiagnostic $sd_obj */ $sd_obj->uploadSystemDiagnostic( $current_company, true ); echo "Done!\n"; } else { echo "ERROR: Unable to determine primary company!\n"; } } else { echo "ERROR: Unknown command!\n"; } } //Debug::Display(); Debug::writeToLog(); ?>