Welcome Guest, Not a member yet? Register   Sign In
Using CodeIgniter as git submodule . . .


Have you ever tried using CodeIgniter as git submodule?

I use CodeIgniter as main framework for more projects/webs/apps. It's very easy to update CI to higher version. Just overwrite system folder and make some minor changes. Great flow. But I use some libraries and helpers made by me (micro ORM, debug helpers). It si very annoying to copy every changes, which I make to all these libraries, across all pages. 

This is leading me to an idea. I'm going to reorder folder structure like this:

- application/
-- config/
-- controllers/
-- core
-- errors
-- helpers
-- hooks/
-- language/
-- libraries/
-- models/
-- third_party/
-- views/
- user_guide/
- submodule/
-- application/
--- config/
--- controllers/
--- core
--- errors
--- helpers
--- hooks/
--- language/
--- libraries/
--- models/
--- third_party/
--- views/
-- index.php
-- license.txt
-- system/
--- cache/
--- core/
--- database/
--- fonts/
--- helpers/
--- language/
--- libraries/
--- logs/
-- user_guide/
- index.php

As you can see, whole CI is isolated in submodule/. Now I can handle all content as a separate project and distribute as a git submodule. But .... I'm not sure if it si possible to correctly set the paths without differing with "submodule". I'm going to try.

Have you anybody tried something similar? Have any previous experience?

Thanks for your answers.

(This post was last modified: 03-17-2016, 06:12 AM by josepostiga.)

I'm not understanding your problem... If you have system libraries that need modifications, why don't you extend them? https://codeigniter.com/user_guide/gener...asses.html

That way, you're not required to keep manually changing the core classes everytime you update CI.
Best regards,
José Postiga
Senior Backend Developer

You don't need to do this ... index.php configures the path to the "system directory" to use, so you're fine with having a "static" copy of it wherever you deploy, with your separate git projects only tracking the "application" directory.

You didn't understood what I want.

It is not about modifying system classes. Let's explain once again.

Now I have application/ folder with all subdirectories.
Let's show an example. In library, helper, ... folder, I have these like classes:
All classes are reusable in more projects and have almost nothing to do with system classes. Typical way is to copy those classes to another application/ folder in another project. But ... If I make even a little change in those classes, I will have to copy them to all projects which uses them.

As you can see, it wil not help me to untrack CI except application in git or extending system classes. I need to keep my "advanced" codeigniter in one "repository" and use it in all webs as described (sorry about "advanced". I'm not arrogant. I just didn't find better word. :-D)

Have you tried to use composer?
Best regards,
José Postiga
Senior Backend Developer

Composer smells to me. I love CI because it doesn't need composer. Once I start using composer or other dependency manager, everything what offers CI will go to  Lar..v.l  hell. I hate situation when I must run composer update every few month to check, if there in not another pack of new updates ready Dodgy .

I just want to keep my small pack of my code in one piece and use it every where I work.


It works now. 

I got isolated submodule/ folder where are: untouched CI system and my classes in application folders where they belong. Now it is just about git.
I have to set this to the repository and set like submodule.

Theme © iAndrew 2016 - Forum software by © MyBB