fb

BLOGS

The lightweight of the PHP frameworks – CodeIgniter

The lightweight of the PHP frameworks – CodeIgniter

Fri, 09 Apr 2021

CodeIgniter serves as a framework for web applications for developers who prefer speed over an abundance of functions. According to the official project site, the main design objective of this open-source PHP framework is to combine maximum performance and flexibility with the slightest possible program framework.

What is CodeIgniter?

CodeIgniter is a web framework written in PHP that prides itself on using compact software design to make the development of web applications faster and more efficient. The U.S. software company EllisLab created CodeIgniter. The British Columbia Institute of Technology (BCIT) took over the project one year later.

The framework’s source code is under the MIT license and can be obtained through the GitHub online service. The most recent stable version of CodeIgniter 3.1.3 can be downloaded for free from the official website of the project.

An overview of application flow

  1. For incoming HTTP requests, CodeIgniter uses index.php as a front controller. All essential resources necessary for running the application are initialized here.
  2. CodeIgniter checks which action to execute as part of the routing. The application compares the URL in the request to the routing rules defined in routes.php to this effect.
  3. Caching follows to routing. If a response that matches a request is counted in the application’s cache it is delivered directly to the web browser requesting it. Otherwise, the controller is executed with a preceding filter function that is determined during routing.
  4. The framework for CodeIgniter contains an integrated filter, which intercepts harmful inquiries. Every HTTP request is subject to a security check before the application loads a controller which matches the request.
  5. If the request passes the filter then execute the controller. This selects a matching view and loads both the data model and all the libraries, help classes, plugins, and scripts needed to answer the query.
  6. It can be delivered to the web browser as soon as all the relevant data has been passed to view.
  7. When a caching is activated, CodeIgniter temporarily stops the outgoing data to be able to answer repetitive queries directly.

Benefits of the CodeIgniter framework

  • Minimal configuration effort
  • Small footprint
  • Excellent performance
  • Clean URLs
  • Free programming style
  • Extensive documentation
  • Community support

Drawbacks of the CodeIgniter framework

  • ORM only through third parties
  • No template engine
  • No namespacing
  • No PHP auto-loading
  • Fewer built-in libraries than other PHP frameworks