Initialize route
333726
public function init()
    {
        $this->setLangcode();

        $this->path = $this->url->path();
        $this->db = $this->config->getDb();
    }
824326
public function initializeRoutingTable()
    {
        $routes = $this->routeObjectBackend->loadObject();
        if (!is_array($routes)) {
            $routes = array();
        }
        
        $this->routes = $routes;
    }
1275052
def _init_routes_and_middlewares(self):
        """"""
        self._init_middlewares()
        self._init_endpoints()

        self.app = falcon.API(middleware=self.middleware)
        self.app.add_error_handler(Exception, self._error_handler)

        for version_path, endpoints in self.catalog:
            for route, resource in endpoints:
                self.app.add_route(version_path + route, resource)
1194780
def add_route(self, route):
        ''' '''
        self.routes.append(route)
        self.router.add(route.rule, route.method, route, name=route.name)
        if DEBUG: route.prepare()
218863
public function initialize()
    {
        $this->setSource($this->tableName);
        $this->keepSnapshots(true);

        $this->belongsTo('pid', __NAMESPACE__ . '\Route', 'id', array('alias' => 'Route'));
    }
818762
public static function init($path, $url = '/')
  {
    self::$path = rtrim(realpath($path), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
    self::$url = $url;
    self::$router = new Router();

    self::$page->onInit();
    self::$page->onPost();
    self::$page->beforeRender();
    print self::$page->render();
    self::$page->afterRender();
  }
295159
private function init()
    {
        // Set the layout from the Config file
        $this->layout = View::make(config('decoy.core.layout'));

        // Store the controller class for routing
        $this->controller = get_class($this);

        // Get the controller name
        $controller_name = $this->controllerName($this->controller);

        // Make a default title based on the controller name
        if (empty($this->title)) {
            $this->title = $this->title($controller_name);
        }

        // Figure out what the show view should be.  This is the path to the show
        // view file.  Such as 'admin.news.edit'
        if (empty($this->show_view)) {
            $this->show_view = $this->detailPath($this->controller);
        }

        // Try to suss out the model by singularizing the controller
        if (empty($this->model)) {
            $this->model = $this->model($this->controller);
            if (!class_exists($this->model)) {
                $this->model = null;
            }
        }

        // If the input contains info on the parent, immediately instantiate
        // the parent instance.  These are populated by some AJAX calls like
        // autocomplete on a many to many and the attach method.
        if (($parent_id = request('parent_id'))
            && ($parent_controller = request('parent_controller'))) {
            $parent_model_class = $this->model($parent_controller);
            $this->parent($parent_model_class::findOrFail($parent_id));
        }
    }
1370636
function initResource (ravelInstance, koaRouter) {
  // decorate methods with @mapping before handing off to Routes init
  buildRoute(ravelInstance, this, Routes.GET, 'getAll');
  buildRoute(ravelInstance, this, Routes.PUT, 'putAll');
  buildRoute(ravelInstance, this, Routes.DELETE, 'deleteAll');
  buildRoute(ravelInstance, this, Routes.GET, 'get');
  buildRoute(ravelInstance, this, Routes.POST, 'post');
  buildRoute(ravelInstance, this, Routes.PUT, 'put');
  buildRoute(ravelInstance, this, Routes.DELETE, 'delete');

  // hand off to routes init
  initRoutes.call(this, ravelInstance, koaRouter);
}
257681
def init_blueprint(self, blueprint):
        
        if self._route is not None:
            raise TypeError("route cannot be set when using blueprints!")

        blueprint.rak = self
        blueprint.add_url_rule("", view_func=getattr(self, self._view_name), methods=['POST'])
971511
function initRoutes (ravelInstance, koaRouter) {
  const proto = Object.getPrototypeOf(this);
  // handle class-level @mapping decorators
  const classMeta = Metadata.getClassMeta(proto, '@mapping', Object.create(null));
  for (const r of Object.keys(classMeta)) {
    buildRoute(ravelInstance, this, koaRouter, r, classMeta[r]);
  }

  // handle methods decorated with @mapping
  const meta = Metadata.getMeta(proto).method;
  const annotatedMethods = Object.keys(meta);
  for (const r of annotatedMethods) {
    const methodMeta = Metadata.getMethodMetaValue(proto, r, '@mapping', 'info');
    if (methodMeta) {
      buildRoute(ravelInstance, this, koaRouter, r, methodMeta);
    }
  }
}
866736
public function init()
    {
        parent::init();

        $routes = $this->findAvailableRoutes();
        $route = $this->getRequest()->getVar('endpoint') ?: $this->config()->default_route;

        // Legacy. Find the first route mapped to the controller.
        if (!$route && !empty($routes)) {
            $route = $routes[0];
        }

        if (!$route) {
            throw new \RuntimeException("There are no routes set up for a GraphQL server. You will need to add one to the SilverStripe\Control\Director.rules config setting.");
        }

        $route = trim($route, '/');
        $jsonRoutes = json_encode($routes);
        $securityID = Controller::config()->enable_csrf_protection
            ? "'" . SecurityToken::inst()->getValue() . "'"
            : 'null';
        Requirements::customScript(
            <<<JS
var GRAPHQL_ROUTE = '{$route}';
var GRAPHQL_ROUTES = $jsonRoutes;
var SECURITY_ID = $securityID;
JS
        );

        Requirements::javascript('silverstripe/graphql-devtools: client/dist/graphiql.js');
    }
908837
public function init()
    {
        parent::init();

        if ($this->connectorRoute === null) {
            throw new InvalidConfigException('Connector route must be specified.');
        }

        $this->settings['url'] = Url::toRoute($this->connectorRoute);

        if (!isset($this->settings['lang'])) {
            $this->settings['lang'] = Yii::$app->language;
        } elseif ($this->settings['lang'] === false) {
            unset($this->settings['lang']);
        }

        $this->settings['customData'] = [
            Yii::$app->request->csrfParam => Yii::$app->request->csrfToken,
        ];
    }
424353
public static function initialize()
    {
        switch($_SERVER['REQUEST_METHOD']) {
            case "POST":
                self::$_method = self::POST;
                break;
            case "GET":
                self::$_method = self::GET;
                break;
            case "PUT":
                self::$_method = self::PUT;
                break;
            case "DELETE":
                self::$_method = self::DELETE;
                break;
            default:
                self::$_method = self::HEAD;
        }
        self::$_data = array();
        self::_parseData($_GET);
        self::_parseData($_POST);
        
        if(
            isset($_SERVER['HTTPS']) &&
            $_SERVER['HTTPS'] !== null &&
            $_SERVER['HTTPS'] !== "off"
        ) {
            self::$_https = true;
        } else {
            self::$_https = false;
        }
        
        self::$_domain = (string) $_SERVER['HTTP_HOST'];
        self::$_file = (string) $_SERVER['SCRIPT_FILENAME'];
        if(isset($_SERVER['PATH_INFO'])) {
            self::$_pathInfo = (string) $_SERVER['PATH_INFO'];
        } else {
            self::$_pathInfo = "";
        }
    }
793017
protected function performInit()
    {
        $this->prepareTargetRoute()
             ->prepareParentParameter()
             ->checkForMorphToRelation();


        // Check permissions
        $permissions = $this->actionData->permissions();

        if (empty($permissions)) {
            $this->isPermitted = true;
        } else {
            $this->isPermitted = cms_auth()->can($permissions);
        }
    }
459299
function init(options = {}, handlebars) {
  const opts = deepExtend({}, defaults, options);
  normalizePaths(opts);
  opts.handlebars = handlebars || Handlebars.create();
  return Promise.resolve(opts);
}
181065
protected function init(){
		//time of construct...
		$starttime = explode(' ', microtime());
		self::$starttime = $starttime[1] + $starttime[0];
		//
		$this->router=array();
		}
1262545
private function initRouter(): App
    {
        $request = $this->container('request');
        $response = $this->container('response');
        $router = new Router($request, $response);
        $router->error(Error::class);

        $this->containers()->set('router', $router);
        return $this;
    }