Open Source PHP Framework (originally from EllisLab)

Related tags

Frameworks php
Overview

What is CodeIgniter

CodeIgniter is an Application Development Framework - a toolkit - for people who build web sites using PHP. Its goal is to enable you to develop projects much faster than you could if you were writing code from scratch, by providing a rich set of libraries for commonly needed tasks, as well as a simple interface and logical structure to access these libraries. CodeIgniter lets you creatively focus on your project by minimizing the amount of code needed for a given task.

Release Information

This repo contains in-development code for future releases. To download the latest stable release please visit the CodeIgniter Downloads page.

Changelog and New Features

You can find a list of all changes for each release in the user guide change log.

Server Requirements

PHP version 5.6 or newer is recommended.

It should work on 5.4.8 as well, but we strongly advise you NOT to run such old versions of PHP, because of potential security and performance issues, as well as missing features.

Installation

Please see the installation section of the CodeIgniter User Guide.

License

Please see the license agreement.

Resources

Report security issues to our Security Panel or via our page on HackerOne, thank you.

Acknowledgement

The CodeIgniter team would like to thank EllisLab, all the contributors to the CodeIgniter project and you, the CodeIgniter user.

Comments
  • New Session library

    New Session library

    It can be found in the feature/session branch and is the last thing I want finished before the 3.0 release. To everybody reading this: please test it and give some (useful) feedback. :) Tests with non-mysql DBs in particular would be really useful.

    Implemented features:

    • Locking (this is mandatory, no drivers without locking will be implemented; locking for non-MySQL/Postgre DBs though is done through sysvsem, which means there's no locking on Windows)
    • Lazy writes (only write data to storage if it was changed)
    • 'files' & 'database' drivers

    Planned/todo features & other stuff that might get implemented:

    • Redis & Memcache(d) drivers
    • Not sure if extending the library works at this time, but this certainly needs more work
    • Optional session data encryption
    • Other drivers?
    • Tests? (we've had issues with PHPUnit burping with "headers already sent" messages when we send cookies)
    • PHP should validate incoming session IDs (they need to be all alphanumeric chars), but still - double check that to avoid SQL injections
    • Automatic regeneration of IDs
    • session.use_strict_mode functionality

    BC breaks:

    • Flash/temp/user-data can collide & are all actual $_SESSION vars
    • Changed table structure for database storage
    • No cookie storage (no, it will not happen, you must use server-side storage)
    • No user-agent matching - it's user input and therefore ineffective and pointless
    • Database storage can't be used with a persistent connection (to avoid deadlock and to allow concurrency)

    Issues/PRs that this resolves/supersedes:

    • #1344
    • #1375
    • #1780
    • #1940
    • #2476
    • #2702
    • #2923
    Feature Request 
    opened by narfbg 155
  • HMVC with Core Unit Tests

    HMVC with Core Unit Tests

    This is the HMVC solution from #357, further refined and with thorough unit tests added.

    The former incarnation was recommended by @philsturgeon, who suggested several features and refinements along the way. All of the substantive changes - especially the CodeIgniter class and modifications to Config, Router, and Loader - have been stable and working in a production environment for over a year and a half now.

    Almost all core classes have unit test coverage, and specifically those with new features or significant changes are all covered, with strong isolation and virtually every code path tested. Convenience functions for vfsStream have also been added to CI_TestCase.

    A new README in the system directory enumerates the entire application lifecycle in detail to aid in comparison with the existing bootstrap process.

    This implementation aims to be fully backward compatible with version 2.1. Great care has been taken to ensure that upgrading users can continue to use the framework in the same way they used to, even if they don't take advantage of the HMVC feature.

    P.S. - Don't be frightened by the number of new lines of code in this request - 2/3 of that is new unit test code.

    Feature Request 
    opened by dchill42 113
  • Added Session driver with native PHP sessions and original-flavor CI cookie sessions

    Added Session driver with native PHP sessions and original-flavor CI cookie sessions

    This is a refactoring of the original CodeIgniter Session library as a driver library. It adds a native PHP session driver for those who prefer that route, while keeping all the neat features of original CI sessions and a couple new features suggested on UserVoice. This code has been thoroughly tested and running stable on St. Petersburg College servers for many, many moons.

    Bon Appetit!

    opened by dchill42 107
  • CodeIgniter Bypass

    CodeIgniter Bypass

    Hi Guys!

    I had a chance to test CodeIgniter against XSS attack. I have found few things that might be interested for you guys:

    I have created a test-bed here: http://xssplayground.net23.net/clean10.html

    The area is protected by CodeIgniter but for testing purpose OUTPUT reflects in Standard HTML, Script, Attribute and URL context. In the following manner, in my test-bed output reflects in different context.

    Output reflects here (Standard HTML Context): <?php echo cleanCode($_POST['name']); ?> <br><br>

    Output reflects in attribute context <div class='<?php echo cleanCode($_POST['name']);?>'>I am an attribute context</div> <br><br>

    Output reflects in URL context <a href='<?php echo cleanCode($_POST['name']);?>'>I am URL context</a> <br><br>

    Output reflects in script context <script> var a = '<?php echo cleanCode($_POST['name']);?>'; </script>

    The following injection will BYPASS CodeIgniter in "attribute" and "URL" context:

    '; onmouseover=confirm(location);//

    OR

    '; onmouseover=confirm(cookie);//

    In CodeIgniter's black-list you guys are checking against "document.cookie" and "window.location". The same purpose can be achieved by using cookie and location word! In above cases, if I inject

    '; onmouseover=alert(window.location);//

    I got the following output which stops XSS:

    Attribute context: <div class='\'; onmouseover=alert&#40;[removed]&#41;;//'> URL context: <a href='\'; onmouseover=alert&#40;[removed]&#41;;//'>

    Also in Chrome, the following injection bypassed URL context only:

    j a vas cript:confirm(1);

    If I simply inject javascript:alert(1) then CodeIgniter works perfectly and removed javascript but in the above manner, injection works.

    Let me know, if I missed something :)

    Regards

    @soaj1664ashar

    opened by soaj1664 87
  • Application vs. System Testing

    Application vs. System Testing

    This isn't so much of an issue but more of an open question as to where unit testing support is heading for CI3.0.

    It's awesome that unit tests are now a part of CI core, and it's great that the branch has been merged in and everything's starting to look good and official. I'm excited.

    As you'll all know, currently the tests are in /tests. While this is fine, that folder seems to only facilitate system tests. What about application tests? It would make sense to move the /tests directory into /system/tests and have an /application/tests directory with a sample test inside it.

    Is there a framework in place for application tests? There'll need to be mocks setup, methods to override core bits of CI functionality etc.

    Is there anything in there that I'm missing to allow for this yet? If not, want me to look into it?

    Feature Request 
    opened by jamierumbelow 76
  • Bump docs to suggest 5.3 is used

    Bump docs to suggest 5.3 is used

    A while back when I was on the team I suggested we moved from 5.1 to 5.2. This made sense two or three years ago when this branch was meant to be "out soon" but time has moved on a little bit.

    When people first started grumping about 5.2 being used I explained that I didn't think it was so bad for various reasons. I know that people use CodeIgniter on versions of PHP that are WAY out of date, and I know that even 3 years ago moving from 5.1 to 5.2 pissed people off.

    What has made me spin on a dime here is that the .travis.yml does not actually test against 5.2 at all, and of course it can't because vfStream has a 5.3 dependency.

    On top of that, PHPUnit probably needs 5.3 too depending on the version travis is supplying you with.

    SO!

    If you aren't testing against 5.2, you really really cannot release with docs saying that you support 5.2. CodeIgniter was always a cowboy framework with zero tests and that is turning around. In the past were dangerous untested releases done without warning. It was a bit of a nightmare, and I had to run back from the pub one day to patch and retag a version that somebody at EllisLabs had released without warning which had some bugs on one version of PHP. Without 5.2 in the .travis.yml version matrix once again I'd say you absolutely cannot say you support 5.2.

    Instead of trying to find a way to test on 5.2, I'd urge you just to pop up the requirements to 5.3.

    This may well still work on 5.2 and the only place it will fail is if a developer tries to run composer update, but that is only for testing, and the tests wont work anyway.

    I'm not going crazy here. I think PHP 5.4 would be nice, but I know that these things need to be done slowly. If you lot want to go further than carry on, but everyone else should try and avoid complaining that the level of progress is not enough.

    opened by philsturgeon 68
  • Processed routes

    Processed routes

    This patch allows back references of routes with a "php:" prefix to be processed with php, original style routes are unaffected by these changes. You can use original style routes and "php:" prefixed routes in the same route config file.

    Feature Request 
    opened by jdfm 65
  • Proposal: encrypt->decode should verify integrity

    Proposal: encrypt->decode should verify integrity

    The encryption library has some remaining issues. It bluntly shoves data thru mcrypt_decrypt without checking data integrity. This can result in loss of data, even wrong variables, or worse.

    i propose, next to prepending the $init_vect to the data, to also prepend a hash_hmac() from the data. This way the integrity of the to decode data can also be validated.

    in this new setup encrypt->decode() can return false if the hash_hmac does not compute (e.g. the data was tampered with).

    edit: this would probably cause problems with backwards compatibility with older/existing data. http://www.cryptofails.com/post/70059597528/codeigniter-encryption-is-not-authentication

    opened by GDmac 64
  • Visibility of reset functions in Active Record class

    Visibility of reset functions in Active Record class

    As of 2.0.3, visibility is set to protected on the active record reset functions (_reset_select(), _reset_write()). I realize this conforms cleanly with the previously-unenforced private status of these functions -- but do we actually need/want protected visibility now that we're enforcing visibility in PHP5?

    Seems to me that there should be a way to uniformly clear query-related active record bits from controllers/models/libraries and opening up these functions is an easy way to do that.

    Reference: system/database/DB_active_rec.php - Lines 1995 and 2027

    opened by cs-rhett 56
  • Fixed Database PDO driver

    Fixed Database PDO driver

    Throughout testing over the PDO drivers, was used on this build process : http://goo.gl/VR1a8

    By now, on SQLite, MySQL and Postgre, all function was verified and work as expected.

    opened by toopay 53
  • About CI3 maintenance

    About CI3 maintenance

    @narfbg @lonnieezell @michalsn @MGatner @paulbalandan @samsonasik

    Thank you for maintaining CI!

    Recently, CI3 repository has less activities, but many users wish CI3 is maintained and support php8+, if it is possible. There are many candidates to help maintaining CI3 in forum, but no one has been selected yet. I also would like to help maintaining CI3 repository.

    Anyway, I would like to talk about the future of CI3. (add maintainers, switch to 3.2.0+ or continue 3.1.12+, php8+ support, and so on)

    opened by sapics 46
  • bootloader in CI_VERSION = '3.1.11' is going into a loop

    bootloader in CI_VERSION = '3.1.11' is going into a loop

    Out of nowhere (on 12/1/22) , my app running on AWS decided to go into a hard loop while trying to load the bootstrap in Codeigniter.php in the above version under php 7.4.27. The UI is never loading due to this. There were no significant changes in the app.

    It gets to require_once BASEPATH.'core/CodeIgniter.php at the bottom of index.php and keeps going back to this line. Thus the app never gets to run.

    Any idea how to fix this?

    opened by richb201 1
  • Error in codeigniter's Output.php file (system/core/Output.php)

    Error in codeigniter's Output.php file (system/core/Output.php)

    Error: Message: str_replace(): Passing null to parameter #3 ($output) of type array|string is deprecated

    You need to replace at line no. 457 in system/core/Output.php

    $output = str_replace(array('{elapsed_time}', '{memory_usage}'), array($elapsed, $memory), $output);

    with this $output = $output ? str_replace(array('{elapsed_time}', '{memory_usage}'), array($elapsed, $memory), $output): "";

    opened by spicer1 2
  • $this->uri->ruri_string() generates error message in PHP 8.1

    $this->uri->ruri_string() generates error message in PHP 8.1

    The following code

    public function ruri() {
        echo $this->uri->ruri_string();
    }
    

    generates this error message in php 8.1:

    A PHP Error was encountered
    Severity: 8192
    
    Message: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated
    
    Filename: core/URI.php
    
    Line Number: 641
    
    Backtrace:
    
    File: C:\project\path\application\controllers\Test.php
    Line: 91
    Function: ruri_string
    
    File: C:\project\path\index.php
    Line: 320
    Function: require_once
    

    This also affects other functions that use ruri_string, like $this->form_validation->run()

    opened by Kenqr 2
  • Keep the test suite on the tags ?

    Keep the test suite on the tags ?

    I noticed that although the test suite (tests/ directory) is present on the git branches, they are not kept on the tags. So when checking out a tag, we actually don't have the test suite

    $ git log 3.1.13

    commit bcb17eb8ba53a85de154439d0ab8ff1bed047bc9 (tag: 3.1.13)
    Author: Andrey Andreev <[email protected]>
    Date:   Thu Mar 3 15:21:49 2022 +0200
    
       [ci skip] 3.1.13 release
    
    commit 2042929bab8ffc14faf6193de0107b7f95abbdaf (upstream/master)
    Author: Andrey Andreev <[email protected]>
    Date:   Thu Mar 3 15:09:04 2022 +0200
    
       [ci skip] Doc updates for 3.1.13 start and changelog entry for #6107
    
    
    

    And in the bcb17eb8ba53a85de154439d0ab8ff1bed047bc9, all test suite is removed

    Would it be possible to keep the test suite also on the tags?

    opened by tenzap 2
Owner
B.C. Institute of Technology
CodeIgniter Project
B.C. Institute of Technology
Coole is a PHP framework built on open source components

Coole is a PHP framework built on open source components. - Coole 是一个基于开源组件包构建的 PHP 框架。

guanguans 20 Jan 7, 2023
Elgg is an open source rapid development framework for socially aware web applications.

Elgg Elgg is an open source rapid development framework for socially aware web applications. Features Well-documented core API that allows developers

Elgg 1.6k Dec 27, 2022
An issue tracking tool based on hyperf+reactjs for small and medium-sized enterprises, open-source and free, similar to Jira.

介绍 本项目以 actionview 为蓝本,使用 Hyperf 框架进行重写。 本项目为 Hyperf 框架的 DEMO 项目 原 ActionView 介绍 English | 中文 一个类Jira的问题需求跟踪工具,前端基于reactjs+redux、后端基于php laravel-frame

Gemini-D 14 Nov 15, 2022
Source code of Ice framework

Ice framework Simple and fast PHP framework delivered as C-extension. Stage How to contribute? Fork the ice/framework repository. Create a new branch

ice framework 340 Nov 15, 2022
CleverStyle Framework is simple, scalable, fast and secure full-stack PHP framework

CleverStyle Framework is simple, scalable, fast and secure full-stack PHP framework. It is free, Open Source and is distributed under Free Public Lice

Nazar Mokrynskyi 150 Apr 12, 2022
I made my own simple php framework inspired from laravel framework.

Simple MVC About Since 2019, I started learning the php programming language and have worked on many projects using the php framework. Laravel is one

null 14 Aug 14, 2022
PHPR or PHP Array Framework is a framework highly dependent to an array structure.

this is new repository for php-framework Introduction PHPR or PHP Array Framework is a framework highly dependent to an array structure. PHPR Framewor

Agung Zon Blade 2 Feb 12, 2022
I made my own simple php framework inspired from laravel framework.

Simple MVC About Since 2019, I started learning the php programming language and have worked on many projects using the php framework. Laravel is one

Rizky Alamsyah 14 Aug 14, 2022
Framework X is a simple and fast micro framework based on PHP

Framework X is a simple and fast micro framework based on PHP. I've created a simple CRUD application to understand how it works. I used twig and I created a custom middleware to handle PUT, DELETE methods.

Mahmut Bayri 6 Oct 14, 2022
Spiral Framework is a High-Performance PHP/Go Full-Stack framework and group of over sixty PSR-compatible components

Spiral HTTP Application Skeleton Spiral Framework is a High-Performance PHP/Go Full-Stack framework and group of over sixty PSR-compatible components.

Spiral Scout 152 Dec 18, 2022
Sunhill Framework is a simple, fast, and powerful PHP App Development Framework

Sunhill Framework is a simple, fast, and powerful PHP App Development Framework that enables you to develop more modern applications by using MVC (Model - View - Controller) pattern.

Mehmet Selcuk Batal 3 Dec 29, 2022
Framework X – the simple and fast micro framework for building reactive web applications that run anywhere.

Framework X Framework X – the simple and fast micro framework for building reactive web applications that run anywhere. Quickstart Documentation Tests

Christian Lück 620 Jan 7, 2023
Source Code for 'Pro PHP 8 MVC' by Christopher Pitt

Apress Source Code This repository accompanies Pro PHP 8 MVC by Christopher Pitt (Apress, 2021). Download the files as a zip using the green button, o

Apress 27 Dec 25, 2022
Library for Open Swoole extension

Open Swoole Library This library works with Open Swoole since release version v4.7.1. WIP Table of Contents How to Contribute Code Requirements Develo

Open Swoole 3 Dec 22, 2022
FuelPHP v1.x is a simple, flexible, community driven PHP 5.3+ framework, based on the best ideas of other frameworks, with a fresh start! FuelPHP is fully PHP 7 compatible.

FuelPHP Version: 1.8.2 Website Release Documentation Release API browser Development branch Documentation Development branch API browser Support Forum

Fuel 1.5k Dec 28, 2022
An asynchronous event driven PHP socket framework. Supports HTTP, Websocket, SSL and other custom protocols. PHP>=5.3.

Workerman What is it Workerman is an asynchronous event-driven PHP framework with high performance to build fast and scalable network applications. Wo

walkor 10.2k Dec 31, 2022
Fast php framework written in c, built in php extension

Yaf - Yet Another Framework PHP framework written in c and built as a PHP extension. Requirement PHP 7.0+ (master branch)) PHP 5.2+ (php5 branch) Inst

Xinchen Hui 4.5k Dec 28, 2022
💫 Vega is a CLI mode HTTP web framework written in PHP support Swoole, WorkerMan / Vega 是一个用 PHP 编写的 CLI 模式 HTTP 网络框架,支持 Swoole、WorkerMan

Mix Vega 中文 | English Vega is a CLI mode HTTP web framework written in PHP support Swoole, WorkerMan Vega 是一个用 PHP 编写的 CLI 模式 HTTP 网络框架,支持 Swoole、Work

Mix PHP 46 Apr 28, 2022
A PHP framework for web artisans.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

The Laravel Framework 72k Jan 7, 2023