underscored(); $class = '\\App\\Controller\\' . $name; $ref = new ReflectionClass($class); $methods = $ref->getMethods(ReflectionMethod::IS_STATIC); try { foreach ($methods as $method) { $data = [ 'controller' => $controller, 'action' => $method->name ]; $location = Model::factory(\Incoviba\common\Location::class)->where('controller', $controller)->where('action', $method->name)->findOne(); if ($location !== false) { continue; } $location = Model::factory(\Incoviba\common\Location::class)->create($data); $location->save(); $cnt ++; } } catch (Exception $e) { d($e); $errors ++; } } if ($errors == 0) { header('Location: next_step.php?step=log_locations'); } ?>