GoIgniter, Extending CodeIgniter 3. |
Hi, I've just make a project based on CodeIgniter 3.
While it is good to try CodeIgniter 4 and involved in it's development, I want a framework that still works on older server and allow legacy code to run. The framework should also support modern approach such as namespaces and ORM. GoIgniter has several features:
Please let me know what you think. Thanks
I always have an interest in looking at other peoples solutions in there core folder. So I took a look at your MY_Config.php file and noticed you are setting the base_url dynamically with values from $_SERVER['SERVER_NAME'] or $_SERVER['SERVER_ADDR']. I understand why this is handy (I used it myself in the past), but it makes you vulnerable for 'host header injection' attacks.
Nowadays I use an installer which sets the base_url config value to the live domainname and dynamically overrule this if $_SERVER['SERVER_NAME'] is on my development tld (I use http://customerX.dev etc).
You can integrate Twig as Composer package for convenient upgrading. Other future components could be installed in the same way too.
Code: {
@Diederik : Excellent insight !!! GoIgniter has some kind of multisite capability. Thus, I should "whitelist" allowed hostname before autoguessing based on $_SERVER['SERVER_NAME']
@ivantcholakov : The reason I put "twig" in core directory is because I want to let people use twig without installing composer. Probably the best way is firstly check whether composer's autoloader is exists. If it exists, then I should use composer's autoloader, otherwise, I can fallback to this old way. Thanks for your insight.
@gofrendi
Once installed by you, the composer autoloader always exists (within the vendor folder). If you change your mind, commit composer.json, composer.lock and the whole directory vendor/ into the git repository. Thus, when the product is downloaded, it will simply run, without the need of using the composer manager from the command line. (01-04-2017, 06:52 PM)ivantcholakov Wrote: @gofrendi @invantcholakov This also means that I should include "vendor" folder to the github repository. Is it a good practice? I see a lot of github project (including CodeIgniter and laravel) doesn't include "vendor" directory in their repository.
@gofrendi
I've also read about "don't commit the vendor directory" several times, but for my projects I ignore this advice. I want the whole source of my application to be downloaded from one place, and with Composer this is achievable. The only problem I faced was with a package without a release tag, it was initially committed as an empty directory (a git submodule). Example https://github.com/XaminProject/handleba...issues/165 Introducing the setting "preferred-install": "dist" and reinstalling the packages from scratch fixed this rare problem.
A lot of update, but here is the summary:
1. ORM getting better by using cache mechanism. 2. Core foundation of CMS module has been partially complete 3. You can now add twig via composer, and GoIgniter will load it automatically. The one in core folder will be used in case of composer not available. 4. Host header injection will never work as long as you define $config['hostname'] See instructions on https://github.com/goFrendiAsgard/GoIgniter The test is located at /modules/cms/controllers/Test.php, and can be accessed by using this url: http://localhost:8080/cms/test |
Welcome Guest, Not a member yet? Register Sign In |