Register user agent parser.

@author Morten Rugaard <moru@nodes.dk>

@return void
513855
protected function registerUserAgentParser()
    {
        $this->app->bind('nodes.useragent', function ($app) {
            return new NodesUserAgentParser($app['request']);
        });

        $this->app->singleton(NodesUserAgentParser::class, function ($app) {
            return $app['nodes.useragent'];
        });
    }
251372
public function registerClasses()
    {
        // Register user defined libraries in the DI container
        $aLibraries = $this->getOptionNames('dialogs.classes');
        foreach($aLibraries as $sShortName => $sFullName)
        {
            $this->registerLibrary($sShortName, $this->getOption($sFullName));
        }
    }
466659
public function register()
    {
        $this->app->singleton(Parser::class, function ($app) {
            return new Parser(new ParsedownDriver(config('markdown') ?? []));
        });

        $this->app->bind('markdown', Parser::class);
    }
499961
protected function register()
    {
        // Make comment model for the factory.
        $this->setModel($this->makeUserModel());

        // Build comment with model.
        $this->setSingularity($this->makeUserInstance());

        // Set columns to the users, after admin init.
        if ($this->methodExist('columns')) {
            $this->registerColumns();
        }
    }
955511
public function registerCommands()
    {
        $this->app['command.cpanel.install'] = $this->app->share(function()
        {
            return new InstallCommand();
        });

        $this->app['command.cpanel.user'] = $this->app->share(function()
        {
            return new UserSeedCommand();
        });

        $this->commands('command.cpanel.install','command.cpanel.user');
    }
1186403
protected function registerRegisterUserCommand()
    {
        $this->app->singleton('command.authentication.user.register', function ($app) {
            return $app->make(RegisterUser::class);
        });
        $this->commands('command.authentication.user.register');
    }
467245
public function setupParser() {
		$this->parser = xml_parser_create('UTF-8');
		xml_parser_set_option($this->parser, XML_OPTION_SKIP_WHITE, 1);
		xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, 'UTF-8');
		xml_set_object($this->parser, $this);
		xml_set_element_handler($this->parser, 'startXML', 'endXML');
		xml_set_character_data_handler($this->parser, 'charXML');
	}
459207
public function register()
    {
        $tokens    = array();
        $translate = array();
        foreach ($this->newKeywords as $token => $versions) {
            if (\defined($token)) {
                $tokens[] = constant($token);
            }
            if (isset($versions['content'])) {
                $translate[strtolower($versions['content'])] = $token;
            }
        }

        /*
         * Deal with tokens not recognized by the PHP version the sniffer is run
         * under and (not correctly) compensated for by PHPCS.
         */
        if (empty($translate) === false) {
            $this->translateContentToToken = $translate;
            $tokens[] = \T_STRING;
        }

        return $tokens;
    }
697555
protected function _loadRequestUserAgent()
    {
        if($this->_requestUserAgent !== NULL) return;

        if(! key_exists('HTTP_USER_AGENT', $_SERVER))
            throw new Exception("No HTTP User Agent was found");

        $this->_requestUserAgent = $_SERVER['HTTP_USER_AGENT'];
    }
1097389
public function register()
    {
        $this->app['validation'] = $this->app->share(function () {
            return new Factory(new Parser());
        });

        $this->app->alias('validation', 'Ionix\Validation\Factory');
    }
212778
protected function registerCommands()
    {
        $this->add(new \Daedalus\Command\DumpContainerCommand($this->kernel->getContainer()));
        $this->add(new \Daedalus\Command\HelpCommand($this->kernel->getContainer()));
    }
168454
public function register() {
		if (!$this->is_registered) {
			// Automatically use Sentry if detected
			if ($this->detected_sentry() and Config::$sentry_dsn !== null) {
				$this->add_handler(new Handler\Sentry());
			}

			// If we configured mail, send mail too
			if (Config::$mail_errors_to !== null) {
				$this->add_handler(new Handler\Mail());
			}

			// Always add the application handler
			$this->add_handler(new Handler\Application());

			if (Config::$debug === true) {
				// If we detect Whoops, use that instead of our basic handler
				if ($this->detected_whoops()) {
					$this->add_handler(new Handler\Whoops());
				} else {
					$this->add_handler(new Handler\BasicCLI());
					$this->add_handler(new Handler\Basic());
				}
			} else {
				// If we are not in debug, and we end up as the last handler,
				// send some crude error message to the user's browser.
				$this->add_handler(new Handler\BasicOutput());
			}

			set_error_handler([$this, 'handle_error']);
			set_exception_handler([$this, 'handle_exception']);
			register_shutdown_function([$this, 'handle_shutdown']);

			$this->is_registered = true;
		}
	}
535129
public static function register() {
		foreach ( [ 'post', 'user' ] as $type ) {
			\register_rest_field(
				'post' === $type ? get_post_types() : $type ,
				self::FIELD_NAME,
				[ 'get_callback' => [ __CLASS__, 'get_' . $type . '_fields' ] ]
			);
		}
	}
86662
public function initParser()
    {
        $parserType = CheckoutApi_Client_Constant::PARSER_CLASS_GROUP.$this->getRespondType(); 

        $parserObj =  CheckoutApi_Lib_Factory::getSingletonInstance($parserType) ;
        $this->setParser($parserObj);       
    }
994884
function register()
    {
        // Ensure the default options have been set.
        $customizedOptions = $this->model->getConfiguration() + array(
            'labels'              => array(),
            'supports'            => array('title', 'editor'),
            'hierarchical'        => false,
            'public'              => true,
            'show_ui'             => true,
            'show_in_menu'        => true,
            'show_in_nav_menus'   => false,
            'show_in_admin_bar'   => true,
            'menu_position'       => 5,
            'can_export'          => false,
            'has_archive'         => false,
            'exclude_from_search' => true,
            'publicly_queryable'  => true,
            'rewrite'             => array(),
            'capability_type'     => 'post',
        );

        $customizedOptions['rewrite'] += array(
            'with_front' => false,
        );


        $labelParser = new LabelParser($this->model);
        $labelParser->parse();
        $singular   = $labelParser->singular();
        $plural     = $labelParser->plural();

        $customizedOptions['labels'] += array(
            'name'                => _x($plural, 'Post Type General Name', 'strata'),
            'singular_name'       => _x($singular, 'Post Type Singular Name', 'strata'),
            'menu_name'           => __($plural, 'strata'),
            'parent_item_colon'   => __($singular. ' Item:', 'strata'),
            'all_items'           => __('All ' . $plural, 'strata'),
            'view_item'           => __('View ' . $singular. ' Item', 'strata'),
            'add_new_item'        => __('Add New', 'strata'),
            'add_new'             => __('Add New', 'strata'),
            'edit_item'           => __('Edit ' . $singular, 'strata'),
            'update_item'         => __('Update ' . $singular, 'strata'),
            'search_items'        => __('Search ' . $plural, 'strata'),
            'not_found'           => __('Not found', 'strata'),
            'not_found_in_trash'  => __('Not found in Trash', 'strata'),
        );

        return register_post_type($this->model->getWordpressKey(), $customizedOptions);
    }
140618
public function registerHamlCompiler() {

		// Add resolver
		$this->app['view.engine.resolver']->register('haml', function() {
			return new CompilerEngine($this->app['Bkwld\LaravelHaml\HamlCompiler']);
		});

		// Add extensions
		$this->app['view']->addExtension('haml', 'haml');
		$this->app['view']->addExtension('haml.php', 'haml');
	}
1335515
public static function registerParser(string $parserName)
    {
        $parser = new $parserName();

        if ($parser instanceof ContentTypeParser) {
            self::$registeredParsers[] = $parser;
        } else {
            throw new \Exception("$parserName is not a valid parser");
        }
    }