Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeIgniter 3 Compatibility #2515

Merged
merged 8 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ TEST_WEB_70 := \
test_metrics \
test_web_cakephp_28 \
test_web_codeigniter_22 \
test_web_codeigniter_31 \
test_web_laravel_42 \
test_web_lumen_52 \
test_web_nette_24 \
Expand Down Expand Up @@ -572,6 +573,7 @@ TEST_WEB_71 := \
test_metrics \
test_web_cakephp_28 \
test_web_codeigniter_22 \
test_web_codeigniter_31 \
test_web_laravel_42 \
test_web_laravel_57 \
test_web_laravel_58 \
Expand Down Expand Up @@ -624,6 +626,7 @@ TEST_INTEGRATIONS_72 := \
TEST_WEB_72 := \
test_metrics \
test_web_codeigniter_22 \
test_web_codeigniter_31 \
test_web_drupal_89 \
test_web_laravel_42 \
test_web_laravel_57 \
Expand Down Expand Up @@ -682,6 +685,7 @@ TEST_INTEGRATIONS_73 :=\
TEST_WEB_73 := \
test_metrics \
test_web_codeigniter_22 \
test_web_codeigniter_31 \
test_web_drupal_89 \
test_web_laminas_14 \
test_web_laravel_57 \
Expand Down Expand Up @@ -742,6 +746,7 @@ TEST_INTEGRATIONS_74 := \
TEST_WEB_74 := \
test_metrics \
test_web_codeigniter_22 \
test_web_codeigniter_31 \
test_web_drupal_89 \
test_web_drupal_95 \
test_web_laminas_14 \
Expand Down Expand Up @@ -803,6 +808,7 @@ TEST_INTEGRATIONS_80 := \
TEST_WEB_80 := \
test_metrics \
test_web_codeigniter_22 \
test_web_codeigniter_31 \
test_web_drupal_95 \
test_web_laminas_rest_19 \
test_web_laminas_14 \
Expand Down Expand Up @@ -850,6 +856,7 @@ TEST_INTEGRATIONS_81 := \
TEST_WEB_81 := \
test_metrics \
test_web_codeigniter_22 \
test_web_codeigniter_31 \
test_web_drupal_95 \
test_web_drupal_101 \
test_web_laminas_rest_19 \
Expand Down Expand Up @@ -900,6 +907,7 @@ TEST_INTEGRATIONS_82 := \
TEST_WEB_82 := \
test_metrics \
test_web_codeigniter_22 \
test_web_codeigniter_31 \
test_web_drupal_95 \
test_web_drupal_101 \
test_web_laminas_rest_19 \
Expand Down Expand Up @@ -953,6 +961,7 @@ TEST_INTEGRATIONS_83 := \
TEST_WEB_83 := \
test_metrics \
test_web_codeigniter_22 \
test_web_codeigniter_31 \
test_web_drupal_95 \
test_web_laravel_8x \
test_web_laravel_9x \
Expand Down Expand Up @@ -1236,6 +1245,9 @@ test_web_cakephp_28: global_test_run_dependencies
$(call run_tests_debug,--testsuite=cakephp-28-test)
test_web_codeigniter_22: global_test_run_dependencies
$(call run_tests_debug,--testsuite=codeigniter-22-test)
test_web_codeigniter_31: global_test_run_dependencies
$(COMPOSER) --working-dir=tests/Frameworks/CodeIgniter/Version_3_1 update
$(call run_tests_debug,--testsuite=codeigniter-31-test)
test_web_drupal_89: global_test_run_dependencies
$(call run_composer_with_retry,tests/Frameworks/Drupal/Version_8_9/core,--ignore-platform-reqs)
$(call run_composer_with_retry,tests/Frameworks/Drupal/Version_8_9,--ignore-platform-reqs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function init(\CI_Router $router = null)
return Integration::NOT_LOADED;
}
$majorVersion = \substr(\CI_VERSION, 0, 2);
if ('2.' === $majorVersion) {
if ('2.' === $majorVersion || '3.' === $majorVersion) {
/* After _set_routing has been called the class and method
* are known, so now we can set up tracing on CodeIgniter.
*/
Expand Down Expand Up @@ -70,7 +70,7 @@ function (SpanData $span) use ($rootSpan, $method, $service) {

// We took the assumption that all controllers will extend CI_Controller.
// But we've at least seen one healthcheck controller not extending it.
if ($this->load && \method_exists($this->load, 'helper')) {
if (property_exists($this, 'load') && $this->load && \method_exists($this->load, 'helper')) {
$this->load->helper('url');

if (!array_key_exists(Tag::HTTP_URL, $rootSpan->meta)) {
Expand Down
15 changes: 15 additions & 0 deletions tests/Frameworks/CodeIgniter/Version_3_1/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Matches multiple files with brace expansion notation
# Set default charset
[*]
charset = utf-8

# Tab indentation (no size specified)
indent_style = tab
32 changes: 32 additions & 0 deletions tests/Frameworks/CodeIgniter/Version_3_1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.DS_Store

application/cache/*
!application/cache/index.html

application/logs/*
!application/logs/index.html

!application/*/.htaccess

composer.lock
tests/mocks/database/ci_test.sqlite

user_guide_src/build/*
user_guide_src/cilexer/build/*
user_guide_src/cilexer/dist/*
user_guide_src/cilexer/pycilexer.egg-info/*
/vendor/

# IDE Files
#-------------------------
/nbproject/
.idea/*

## Sublime Text cache files
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.sublime-workspace
*.sublime-project
/tests/tests/
/tests/results/
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<IfModule authz_core_module>
Require all denied
</IfModule>
<IfModule !authz_core_module>
Deny from all
</IfModule>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>

<p>Directory access is forbidden.</p>

</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

/*
| -------------------------------------------------------------------
| AUTO-LOADER
| -------------------------------------------------------------------
| This file specifies which systems should be loaded by default.
|
| In order to keep the framework as light-weight as possible only the
| absolute minimal resources are loaded by default. For example,
| the database is not connected to automatically since no assumption
| is made regarding whether you intend to use it. This file lets
| you globally define which systems you would like loaded with every
| request.
|
| -------------------------------------------------------------------
| Instructions
| -------------------------------------------------------------------
|
| These are the things you can load automatically:
|
| 1. Packages
| 2. Libraries
| 3. Drivers
| 4. Helper files
| 5. Custom config files
| 6. Language files
| 7. Models
|
*/

/*
| -------------------------------------------------------------------
| Auto-load Packages
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
|
*/
$autoload['packages'] = array();

/*
| -------------------------------------------------------------------
| Auto-load Libraries
| -------------------------------------------------------------------
| These are the classes located in system/libraries/ or your
| application/libraries/ directory, with the addition of the
| 'database' library, which is somewhat of a special case.
|
| Prototype:
|
| $autoload['libraries'] = array('database', 'email', 'session');
|
| You can also supply an alternative library name to be assigned
| in the controller:
|
| $autoload['libraries'] = array('user_agent' => 'ua');
*/
$autoload['libraries'] = array();

/*
| -------------------------------------------------------------------
| Auto-load Drivers
| -------------------------------------------------------------------
| These classes are located in system/libraries/ or in your
| application/libraries/ directory, but are also placed inside their
| own subdirectory and they extend the CI_Driver_Library class. They
| offer multiple interchangeable driver options.
|
| Prototype:
|
| $autoload['drivers'] = array('cache');
|
| You can also supply an alternative property name to be assigned in
| the controller:
|
| $autoload['drivers'] = array('cache' => 'cch');
|
*/
$autoload['drivers'] = array();

/*
| -------------------------------------------------------------------
| Auto-load Helper Files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array();

/*
| -------------------------------------------------------------------
| Auto-load Config files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['config'] = array('config1', 'config2');
|
| NOTE: This item is intended for use ONLY if you have created custom
| config files. Otherwise, leave it blank.
|
*/
$autoload['config'] = array();

/*
| -------------------------------------------------------------------
| Auto-load Language files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['language'] = array('lang1', 'lang2');
|
| NOTE: Do not include the "_lang" part of your file. For example
| "codeigniter_lang.php" would be referenced as array('codeigniter');
|
*/
$autoload['language'] = array();

/*
| -------------------------------------------------------------------
| Auto-load Models
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['model'] = array('first_model', 'second_model');
|
| You can also supply an alternative model name to be assigned
| in the controller:
|
| $autoload['model'] = array('first_model' => 'first');
*/
$autoload['model'] = array();
Loading
Loading