Skip to content

Commit

Permalink
Release v4.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jul 16, 2020
1 parent 18bf776 commit 1f2fa2a
Show file tree
Hide file tree
Showing 19 changed files with 125 additions and 128 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ phpunit
# Composer
#-------------------------
vendor/
composer.lock

#-------------------------
# IDE / Development Files
Expand Down Expand Up @@ -125,3 +124,4 @@ nb-configuration.xml
/results/
/phpunit*.xml
/.phpunit.*.cache

122 changes: 50 additions & 72 deletions app/Config/Autoload.php
Original file line number Diff line number Diff line change
@@ -1,88 +1,66 @@
<?php namespace Config;
<?php

require_once SYSTEMPATH . 'Config/AutoloadConfig.php';
namespace Config;

use CodeIgniter\Config\AutoloadConfig;

/**
* -------------------------------------------------------------------
* AUTO-LOADER
* -------------------------------------------------------------------
* This file defines the namespaces and class maps so the Autoloader
* can find the files as needed.
*
* NOTE: If you use an identical key in $psr4 or $classmap, then
* the values in this file will overwrite the framework's values.
*/
class Autoload extends \CodeIgniter\Config\AutoloadConfig
class Autoload extends AutoloadConfig
{
public $psr4 = [];

public $classmap = [];

//--------------------------------------------------------------------

/**
* Collects the application-specific autoload settings and merges
* them with the framework's required settings.
* -------------------------------------------------------------------
* Namespaces
* -------------------------------------------------------------------
* This maps the locations of any namespaces in your application to
* their location on the file system. These are used by the autoloader
* to locate files the first time they have been instantiated.
*
* The '/app' and '/system' directories are already mapped for you.
* you may change the name of the 'App' namespace if you wish,
* but this should be done prior to creating any namespaced classes,
* else you will need to modify all of those classes for this to work.
*
* NOTE: If you use an identical key in $psr4 or $classmap, then
* the values in this file will overwrite the framework's values.
* Prototype:
*
* $psr4 = [
* 'CodeIgniter' => SYSTEMPATH,
* 'App' => APPPATH
* ];
*
* @var array
*/
public function __construct()
{
parent::__construct();

/**
* -------------------------------------------------------------------
* Namespaces
* -------------------------------------------------------------------
* This maps the locations of any namespaces in your application
* to their location on the file system. These are used by the
* Autoloader to locate files the first time they have been instantiated.
*
* The '/app' and '/system' directories are already mapped for
* you. You may change the name of the 'App' namespace if you wish,
* but this should be done prior to creating any namespaced classes,
* else you will need to modify all of those classes for this to work.
*
* DO NOT change the name of the CodeIgniter namespace or your application
* WILL break. *
* Prototype:
*
* $Config['psr4'] = [
* 'CodeIgniter' => SYSPATH
* `];
*/
$psr4 = [
'App' => APPPATH, // To ensure filters, etc still found,
APP_NAMESPACE => APPPATH, // For custom namespace
'Config' => APPPATH . 'Config',
];

/**
* -------------------------------------------------------------------
* Class Map
* -------------------------------------------------------------------
* The class map provides a map of class names and their exact
* location on the drive. Classes loaded in this manner will have
* slightly faster performance because they will not have to be
* searched for within one or more directories as they would if they
* were being autoloaded through a namespace.
*
* Prototype:
*
* $Config['classmap'] = [
* 'MyClass' => '/path/to/class/file.php'
* ];
*/
$classmap = [];

//--------------------------------------------------------------------
// Do Not Edit Below This Line
//--------------------------------------------------------------------

$this->psr4 = array_merge($this->psr4, $psr4);
$this->classmap = array_merge($this->classmap, $classmap);

unset($psr4, $classmap);
}

//--------------------------------------------------------------------
public $psr4 = [
APP_NAMESPACE => APPPATH, // For custom app namespace
'Config' => APPPATH . 'Config',
];

/**
* -------------------------------------------------------------------
* Class Map
* -------------------------------------------------------------------
* The class map provides a map of class names and their exact
* location on the drive. Classes loaded in this manner will have
* slightly faster performance because they will not have to be
* searched for within one or more directories as they would if they
* were being autoloaded through a namespace.
*
* Prototype:
*
* $classmap = [
* 'MyClass' => '/path/to/class/file.php'
* ];
*
* @var array
*/
public $classmap = [];
}
2 changes: 1 addition & 1 deletion app/Config/Boot/development.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
| items. It can always be used within your own application too.
*/

defined('CI_DEBUG') || define('CI_DEBUG', 1);
defined('CI_DEBUG') || define('CI_DEBUG', true);
2 changes: 1 addition & 1 deletion app/Config/Boot/production.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
| release of the framework.
*/

defined('CI_DEBUG') || define('CI_DEBUG', 0);
defined('CI_DEBUG') || define('CI_DEBUG', false);
2 changes: 1 addition & 1 deletion app/Config/Boot/testing.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
| release of the framework.
*/

defined('CI_DEBUG') || define('CI_DEBUG', 1);
defined('CI_DEBUG') || define('CI_DEBUG', true);
12 changes: 9 additions & 3 deletions app/Config/Events.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php namespace Config;

use CodeIgniter\Events\Events;
use CodeIgniter\Exceptions\FrameworkException;

/*
* --------------------------------------------------------------------
Expand All @@ -22,12 +23,17 @@
Events::on('pre_system', function () {
if (ENVIRONMENT !== 'testing')
{
while (\ob_get_level() > 0)
if (ini_get('zlib.output_compression'))
{
\ob_end_flush();
throw FrameworkException::forEnabledZlibOutputCompression();
}

\ob_start(function ($buffer) {
while (ob_get_level() > 0)
{
ob_end_flush();
}

ob_start(function ($buffer) {
return $buffer;
});
}
Expand Down
5 changes: 3 additions & 2 deletions app/Config/Exceptions.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php namespace Config;

use CodeIgniter\Config\BaseConfig;

/**
* Setup how the exception handler works.
*
* @package Config
*/

class Exceptions
class Exceptions extends BaseConfig
{
/*
|--------------------------------------------------------------------------
Expand Down
16 changes: 15 additions & 1 deletion app/Config/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,21 @@ class Format extends BaseConfig
'application/xml' => \CodeIgniter\Format\XMLFormatter::class,
'text/xml' => \CodeIgniter\Format\XMLFormatter::class,
];


/*
|--------------------------------------------------------------------------
| Formatters Options
|--------------------------------------------------------------------------
|
| Additional Options to adjust default formatters behaviour.
| For each mime type, list the additional options that should be used.
|
*/
public $formatterOptions = [
'application/json' => JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES,
'application/xml' => 0,
'text/xml' => 0,
];
//--------------------------------------------------------------------

/**
Expand Down
8 changes: 8 additions & 0 deletions app/Config/Honeypot.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Honeypot extends BaseConfig
* @var boolean
*/
public $hidden = true;

/**
* Honeypot Label Content
*
Expand All @@ -31,4 +32,11 @@ class Honeypot extends BaseConfig
* @var string
*/
public $template = '<label>{label}</label><input type="text" name="{name}" value=""/>';

/**
* Honeypot container
*
* @var string
*/
public $container = '<div style="display:none">{template}</div>';
}
2 changes: 1 addition & 1 deletion app/Config/Images.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Images extends BaseConfig
/**
* The available handler classes.
*
* @var array
* @var \CodeIgniter\Images\Handlers\BaseHandler[]
*/
public $handlers = [
'gd' => \CodeIgniter\Images\Handlers\GDHandler::class,
Expand Down
42 changes: 10 additions & 32 deletions app/Config/Modules.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php namespace Config;
<?php

// Cannot extend BaseConfig or looping resources occurs.
class Modules
namespace Config;

use CodeIgniter\Modules\Modules as CoreModules;

class Modules extends CoreModules
{
/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -29,39 +32,14 @@ class Modules
| Auto-discover Rules
|--------------------------------------------------------------------------
|
| Lists the aliases of all discovery classes that will be active
| and used during the current application request. If it is not
| listed here, only the base application elements will be used.
| Aliases list of all discovery classes that will be active and used during
| the current application request.
| If it is not listed, only the base application elements will be used.
*/
public $activeExplorers = [
public $aliases = [
'events',
'registrars',
'routes',
'services',
];

/**
* Should the application auto-discover the requested resources.
*
* Valid values are:
* - events
* - registrars
* - routes
* - services
*
* @param string $alias
*
* @return boolean
*/
public function shouldDiscover(string $alias)
{
if (! $this->enabled)
{
return false;
}

$alias = strtolower($alias);

return in_array($alias, $this->activeExplorers);
}
}
2 changes: 1 addition & 1 deletion app/Config/Routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* --------------------------------------------------------------------
*
* There will often be times that you need additional routing and you
* need to it be able to override any defaults in this file. Environment
* need it to be able to override any defaults in this file. Environment
* based routes is one such time. require() additional route files here
* to make that happen.
*
Expand Down
2 changes: 0 additions & 2 deletions app/Config/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

use CodeIgniter\Config\Services as CoreServices;

require_once SYSTEMPATH . 'Config/Services.php';

/**
* Services Configuration file.
*
Expand Down
4 changes: 4 additions & 0 deletions app/Language/en/Validation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php

// override core en language system validation or define your own en language validation message
return [];
1 change: 1 addition & 0 deletions app/Views/errors/html/debug.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ p.lead {
border-radius: 5px;
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
margin: 0;
overflow-x: scroll;
}
.source span.line {
line-height: 1.4;
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@
"codeigniter4/framework": "^4"
},
"require-dev": {
"fzaninotto/faker": "^1.9@dev",
"mikey179/vfsstream": "1.6.*",
"phpunit/phpunit": "8.5.*"
"phpunit/phpunit": "^8.5"
},
"autoload-dev": {
"psr-4": {
"Tests\\Support\\": "tests/_support"
}
},
"scripts": {
"test": "phpunit",
"post-update-cmd": [
"@composer dump-autoload"
]
],
"test": "phpunit"
},
"support": {
"forum": "http://forum.codeigniter.com/",
Expand Down
Loading

0 comments on commit 1f2fa2a

Please sign in to comment.