Giter VIP home page Giter VIP logo

devkit's Introduction

CodeIgniter 4 Development

PHPUnit PHPStan Psalm Coverage Status Downloads GitHub release (latest by date) GitHub stars GitHub license contributions welcome

What is CodeIgniter?

CodeIgniter is a PHP full-stack web framework that is light, fast, flexible and secure. More information can be found at the official site.

This repository holds the source code for CodeIgniter 4 only. Version 4 is a complete rewrite to bring the quality and the code into a more modern version, while still keeping as many of the things intact that has made people love the framework over the years.

More information about the plans for version 4 can be found in CodeIgniter 4 on the forums.

Documentation

The User Guide is the primary documentation for CodeIgniter 4.

You will also find the current in-progress User Guide. As with the rest of the framework, it is a work in progress, and will see changes over time to structure, explanations, etc.

You might also be interested in the API documentation for the framework components.

Important Change with index.php

index.php is no longer in the root of the project! It has been moved inside the public folder, for better security and separation of components.

This means that you should configure your web server to "point" to your project's public folder, and not to the project root. A better practice would be to configure a virtual host to point there. A poor practice would be to point your web server to the project root and expect to enter public/..., as the rest of your logic and the framework are exposed.

Please read the user guide for a better explanation of how CI4 works!

Repository Management

CodeIgniter is developed completely on a volunteer basis. As such, please give up to 7 days for your issues to be reviewed. If you haven't heard from one of the team in that time period, feel free to leave a comment on the issue so that it gets brought back to our attention.

Important

We use GitHub issues to track BUGS and to track approved DEVELOPMENT work packages. We use our forum to provide SUPPORT and to discuss FEATURE REQUESTS.

If you raise an issue here that pertains to support or a feature request, it will be closed! If you are not sure if you have found a bug, raise a thread on the forum first - someone else may have encountered the same thing.

Before raising a new GitHub issue, please check that your bug hasn't already been reported or fixed.

We use pull requests (PRs) for CONTRIBUTIONS to the repository. We are looking for contributions that address one of the reported bugs or approved work packages.

Do not use a PR as a form of feature request. Unsolicited contributions will only be considered if they fit nicely into the framework roadmap. Remember that some components that were part of CodeIgniter 3 are being moved to optional packages, with their own repository.

Contributing

We are accepting contributions from the community! It doesn't matter whether you can code, write documentation, or help find bugs, all contributions are welcome.

Please read the Contributing to CodeIgniter.

CodeIgniter has had thousands on contributions from people since its creation. This project would not be what it is without them.

Made with contrib.rocks.

Server Requirements

PHP version 8.1 or higher is required, with the following extensions installed:

Warning

  • The end of life date for PHP 7.4 was November 28, 2022.
  • The end of life date for PHP 8.0 was November 26, 2023.
  • If you are still using PHP 7.4 or 8.0, you should upgrade immediately.
  • The end of life date for PHP 8.1 will be December 31, 2025.

Additionally, make sure that the following extensions are enabled in your PHP:

  • json (enabled by default - don't turn it off)
  • mysqlnd if you plan to use MySQL
  • libcurl if you plan to use the HTTP\CURLRequest library

Running CodeIgniter Tests

Information on running the CodeIgniter test suite can be found in the README.md file in the tests directory.

devkit's People

Contributors

ddevsr avatar dependabot[bot] avatar kenjis avatar mgatner avatar paulbalandan avatar samsonasik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

devkit's Issues

Install Fail

I try to install bu error
i try require codeigniter4/devkit i have :
Problem 1
- codeigniter4/devkit[v1.1.0, ..., v1.1.1] require roave/security-advisories dev-latest -> found roave/security-advisories[dev-latest] but it does not match your minimum-stability.
- Root composer.json requires codeigniter4/devkit ^1.1 -> satisfiable by codeigniter4/devkit[v1.1.0, v1.1.1].

You can also try re-running composer require with an explicit version constraint, e.g. "composer require codeigniter4/devkit:*" to figure out if any version is installable, or "composer require codeigniter4/devkit:^2.1" if you know which you need.

so i try composer require codeigniter4/devkit:1.1.1 and i have :
Problem 1
- Root composer.json requires codeigniter4/devkit 1.1.1 -> satisfiable by codeigniter4/devkit[v1.1.1].
- codeigniter4/devkit v1.1.1 requires roave/security-advisories dev-latest -> found roave/security-advisories[dev-latest] but it does not match your minimum-stability.

TypedPropertyFromAssignsRector is trying to update App/Config files and ruin the app

If we copy rector.php from Templates to new project, and run rector process it's trying to update App/Config files like:

./vendor/bin/rector process
 11/11 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
11 files with changes
=====================

1) tests/_support/Models/ExampleModel.php:5

    ---------- begin diff ----------
@@ @@

 class ExampleModel extends Model
 {
-    protected $table          = 'factories';
-    protected $primaryKey     = 'id';
-    protected $returnType     = 'object';
-    protected $useSoftDeletes = false;
-    protected $allowedFields  = [
+    protected string $table          = 'factories';
+    protected string $primaryKey     = 'id';
+    protected string $returnType     = 'object';
+    protected bool $useSoftDeletes = false;
+    protected array $allowedFields  = [
         'name',
         'uid',
         'class',
@@ @@
         'icon',
         'summary',
     ];
-    protected $useTimestamps      = true;
-    protected $validationRules    = [];
-    protected $validationMessages = [];
-    protected $skipValidation     = false;
+    protected bool $useTimestamps      = true;
+    protected array $validationRules    = [];
+    protected array $validationMessages = [];
+    protected bool $skipValidation     = false;
 }
    ----------- end diff -----------

Applied rules:
 * TypedPropertyFromAssignsRector


2) tests/_support/Libraries/ConfigReader.php:1

    ---------- begin diff ----------
@@ @@

 namespace Tests\Support\Libraries;

+use Config\App;
 /**
  * Class ConfigReader
  *
@@ @@
  * loading external values. Used to read actual local values from
  * a config file.
  */
-class ConfigReader extends \Config\App
+class ConfigReader extends App
 {
     public function __construct()
     {
    ----------- end diff -----------

3) tests/_support/Database/Migrations/2020-02-22-222222_example_migration.php:5

    ---------- begin diff ----------
@@ @@

 class ExampleMigration extends Migration
 {
-    protected $DBGroup = 'tests';
+    protected string $DBGroup = 'tests';

     public function up()
     {
    ----------- end diff -----------

Applied rules:
 * TypedPropertyFromAssignsRector


4) app/Controllers/BaseController.php:31

    ---------- begin diff ----------
@@ @@
      * An array of helpers to be loaded automatically upon
      * class instantiation. These helpers will be available
      * to all other controllers that extend BaseController.
-     *
-     * @var array
      */
-    protected $helpers = [];
+    protected array $helpers = [];

     /**
      * Be sure to declare properties for any property fetch you initialized.
    ----------- end diff -----------

Applied rules:
 * RemoveUselessVarTagRector
 * TypedPropertyFromAssignsRector


5) app/Config/View.php:13

    ---------- begin diff ----------
@@ @@
      * to each view. You might prefer to have the data stick around between
      * calls so that it is available to all views. If that is the case,
      * set $saveData to true.
-     *
-     * @var bool
      */
-    public $saveData = true;
+    public bool $saveData = true;

     /**
      * Parser Filters map a filter name with any PHP callable. When the
@@ @@
      * Examples:
      *  { title|esc(js) }
      *  { created_on|date(Y-m-d)|esc(attr) }
-     *
-     * @var array
      */
-    public $filters = [];
+    public array $filters = [];

     /**
      * Parser Plugins provide a way to extend the functionality provided
      * by the core Parser by creating aliases that will be replaced with
      * any callable. Can be single or tag pair.
-     *
-     * @var array
      */
-    public $plugins = [];
+    public array $plugins = [];

     /**
      * View Decorators are class methods that will be run in sequence to
    ----------- end diff -----------

Applied rules:
 * RemoveUselessVarTagRector
 * TypedPropertyFromAssignsRector


6) app/Config/Publisher.php:20

    ---------- begin diff ----------
@@ @@
      *
      * @var array<string,string>
      */
-    public $restrictions = [
+    public array $restrictions = [
         ROOTPATH => '*',
         FCPATH   => '#\.(s?css|js|map|html?|xml|json|webmanifest|ttf|eot|woff2?|gif|jpe?g|tiff?|png|webp|bmp|ico|svg)$#i',
     ];
    ----------- end diff -----------

Applied rules:
 * TypedPropertyFromAssignsRector


7) app/Config/Modules.php:13

    ---------- begin diff ----------
@@ @@
      * If true, then auto-discovery will happen across all elements listed in
      * $aliases below. If false, no auto-discovery will happen at all,
      * giving a slight performance boost.
-     *
-     * @var bool
      */
-    public $enabled = true;
+    public bool $enabled = true;

     /**
      * --------------------------------------------------------------------------
@@ @@
      *
      * If true, then auto-discovery will happen across all namespaces loaded
      * by Composer, as well as the namespaces configured locally.
-     *
-     * @var bool
      */
-    public $discoverInComposer = true;
+    public bool $discoverInComposer = true;

     /**
      * The Composer package list for Auto-Discovery
@@ @@
      *           'pestphp/pest',
      *       ],
      *   ]
-     *
-     * @var array
      */
-    public $composerPackages = [];
+    public array $composerPackages = [];

     /**
      * --------------------------------------------------------------------------
@@ @@
      *
      * @var string[]
      */
-    public $aliases = [
+    public array $aliases = [
         'events',
         'filters',
         'registrars',
    ----------- end diff -----------

Applied rules:
 * RemoveUselessVarTagRector
 * TypedPropertyFromAssignsRector


8) app/Config/Cookie.php:26

    ---------- begin diff ----------
@@ @@
      *
      * @var DateTimeInterface|int|string
      */
-    public $expires = 0;
+    public int $expires = 0;

     /**
      * --------------------------------------------------------------------------
    ----------- end diff -----------

Applied rules:
 * TypedPropertyFromAssignsRector


9) app/Config/ContentSecurityPolicy.php:53

    ---------- begin diff ----------
@@ @@
      *
      * @var string|string[]
      */
-    public $scriptSrc = 'self';
+    public string $scriptSrc = 'self';

     /**
      * Lists allowed stylesheets' URLs.
@@ @@
      *
      * @var string|string[]
      */
-    public $styleSrc = 'self';
+    public string $styleSrc = 'self';

     /**
      * Defines the origins from which images can be loaded.
@@ @@
      *
      * @var string|string[]
      */
-    public $imageSrc = 'self';
+    public string $imageSrc = 'self';

     /**
      * Restricts the URLs that can appear in a page's `<base>` element.
@@ @@
      *
      * @var string|string[]
      */
-    public $childSrc = 'self';
+    public string $childSrc = 'self';

     /**
      * Limits the origins that you can connect to (via XHR,
@@ @@
      *
      * @var string|string[]
      */
-    public $connectSrc = 'self';
+    public string $connectSrc = 'self';

     /**
      * Specifies the origins that can serve web fonts.
@@ @@
      *
      * @var string|string[]
      */
-    public $formAction = 'self';
+    public string $formAction = 'self';

     /**
      * Specifies the sources that can embed the current page.
@@ @@
      *
      * @var string|string[]
      */
-    public $objectSrc = 'self';
+    public string $objectSrc = 'self';

     /**
      * @var string|string[]|null
    ----------- end diff -----------

Applied rules:
 * TypedPropertyFromAssignsRector


10) app/Config/Cache.php:61

    ---------- begin diff ----------
@@ @@
      *
      * @var bool|string[]
      */
-    public $cacheQueryString = false;
+    public bool $cacheQueryString = false;

     /**
      * --------------------------------------------------------------------------
    ----------- end diff -----------

Applied rules:
 * TypedPropertyFromAssignsRector


11) app/Config/Autoload.php:60

    ---------- begin diff ----------
@@ @@
      *
      * @var array<string, string>
      */
-    public $classmap = [];
+    public array $classmap = [];

     /**
      * -------------------------------------------------------------------
@@ @@
      * @var string[]
      * @phpstan-var list<string>
      */
-    public $files = [];
+    public array $files = [];

     /**
      * -------------------------------------------------------------------
@@ @@
      * @var string[]
      * @phpstan-var list<string>
      */
-    public $helpers = [];
+    public array $helpers = [];
 }
    ----------- end diff -----------

Applied rules:
 * TypedPropertyFromAssignsRector


                                                                                                                        
 [OK] 11 files have been changed by Rector                                                                              
                                                                                                                        

and after that php spark serve is not wokring:

hp spark serve            
PHP Fatal error:  Type of Config\Autoload::$classmap must not be defined (as in class CodeIgniter\Config\AutoloadConfig) in /Users/jrebjak/CodeIgniter4/crm/app/Config/Autoload.php on line 18

Fatal error: Type of Config\Autoload::$classmap must not be defined (as in class CodeIgniter\Config\AutoloadConfig) in /Users/jrebjak/CodeIgniter4/crm/app/Config/Autoload.php on line 18

I believe devkit should fix this mainly because of newcomers.

Easy fix is to set false in line:

TypedPropertyFromAssignsRector::INLINE_PUBLIC => false

Infection fails when merging

Dev: Remove `master` branch

The master branch only complicates the work and has no benefit.

Currently, the master branch is diverged, v1.2.0 is not included in master or develop:
Screenshot 2024-03-16 9 16 27

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.