function __construct() { $path = GFCOmmon::get_base_path() . '/includes/wizard/steps/'; require_once $path . 'class-gf-installation-wizard-step.php'; $classes = array(); foreach (glob($path . 'class-gf-installation-wizard-step-*.php') as $filename) { require_once $filename; $regex = '/class-gf-installation-wizard-step-(.*?).php/'; preg_match($regex, $filename, $matches); $class_name = 'GF_Installation_Wizard_Step_' . str_replace('-', '_', $matches[1]); $step = new $class_name(); $step_name = $step->get_name(); $classes[$step_name] = $class_name; } $sorted = array(); foreach ($this->get_sorted_step_names() as $sorted_step_name) { $sorted[$sorted_step_name] = $classes[$sorted_step_name]; } $this->_step_class_names = $sorted; }