Welcome Guest, Not a member yet? Register   Sign In
GoIgniter, Extending CodeIgniter 3.
#1
Rainbow 

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:
  • HMVC with namespace
  • run_module_controller() which is better than Wiredesignz HMVC's Module::run
  • static file management with asset_url()
  • The way of initiating helper, model, or library is very similar to CodeIgniter4 (creating a new class instead of $this->load->... )
  • Still compatible with PHP 5.4 (Contrast to CodeIgniter4 that will only support PHP7)
  • Extended routes (including option to disable autoroute)
  • Extended config
  • Better Unit Test Library
  • ORM
  • Twig
https://github.com/goFrendiAsgard/GoIgniter
Please let me know what you think.
Thanks Smile
Reply
#2

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).
Reply
#3

You can integrate Twig as Composer package for convenient upgrading. Other future components could be installed in the same way too.
Reply
#4

Code:
{
    "config": {
        "preferred-install": "dist"
    },
    "require": {
        "roave/security-advisories": "dev-master",
        "paragonie/random_compat": "^2.0.2",
        "twig/twig": "~1.0",
        "twig/extensions": "~1.3"
    }
}
Reply
#5

@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.
Reply
#6

@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.
Reply
#7

(01-04-2017, 06:52 PM)ivantcholakov Wrote: @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.

@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.
Reply
#8

@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.
Reply
#9

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
Reply




Theme © iAndrew 2016 - Forum software by © MyBB