Welcome Guest, Not a member yet? Register   Sign In
Better update routine?
#1

I find updating Codeigniter a bit clumsy at best; manually copying files and folders ... now, in these days of git; is there some way one can integrate it into a project for easy updating?
Reply
#2

Git is a bad idea for this; use Composer.
Reply
#3

(09-19-2017, 12:39 AM)Narf Wrote: Git is a bad idea for this; use Composer.

But how would I do that? I seem to be changin' a lot of lib files and what have you that is dropped all over the place into application folder, lib folder, third party folder etc.. How do I make sure I can update CI wihout overriding the changes I've made to any file. I thought Composer was just simply a package manager ... !?
Reply
#4

(09-19-2017, 10:19 AM)blaasvaer Wrote:
(09-19-2017, 12:39 AM)Narf Wrote: Git is a bad idea for this; use Composer.

But how would I do that? I seem to be changin' a lot of lib files and what have you that is dropped all over the place into application folder, lib folder, third party folder etc.. How do I make sure I can update CI wihout overriding the changes I've made to any file. I thought Composer was just simply a package manager ... !?

https://github.com/kenjis/codeigniter-co...odeigniter
Reply
#5

(09-19-2017, 11:10 AM)Paradinight Wrote:
(09-19-2017, 10:19 AM)blaasvaer Wrote:
(09-19-2017, 12:39 AM)Narf Wrote: Git is a bad idea for this; use Composer.

But how would I do that? I seem to be changin' a lot of lib files and what have you that is dropped all over the place into application folder, lib folder, third party folder etc.. How do I make sure I can update CI wihout overriding the changes I've made to any file. I thought Composer was just simply a package manager ... !?

https://github.com/kenjis/codeigniter-co...odeigniter

Thank you for that. But as it also states in the installation description, you have to manually update codeigniter application files ... so, not much of a change from a manual update.

How could this be rethought architecturally? It does seem a little odd that we haven't come any longer than this in updating these frameworks ... hmm. But thanks anyway. : )
Reply
#6

(09-19-2017, 10:19 AM)blaasvaer Wrote:
(09-19-2017, 12:39 AM)Narf Wrote: Git is a bad idea for this; use Composer.

But how would I do that? I seem to be changin' a lot of lib files and what have you that is dropped all over the place into application folder, lib folder, third party folder etc.. How do I make sure I can update CI wihout overriding the changes I've made to any file. I thought Composer was just simply a package manager ... !?

I don't quite get what the problem is ...

Are you modifying framework files? You should never do that.

Anything you do under application/, third_party/, etc. is your own business. system/ is the only dir you need to change during an update.
Reply
#7

(09-19-2017, 01:54 PM)Narf Wrote:
(09-19-2017, 10:19 AM)blaasvaer Wrote:
(09-19-2017, 12:39 AM)Narf Wrote: Git is a bad idea for this; use Composer.

But how would I do that? I seem to be changin' a lot of lib files and what have you that is dropped all over the place into application folder, lib folder, third party folder etc.. How do I make sure I can update CI wihout overriding the changes I've made to any file. I thought Composer was just simply a package manager ... !?

I don't quite get what the problem is ...

Are you modifying framework files? You should never do that.

Anything you do under application/, third_party/, etc. is your own business. system/ is the only dir you need to change during an update.


But that's exactly my point. In application you have all the config, routing etc. that you usually modify. You add modules and stuff to that application folder, and then when any of those (config files, libraries etc) gets updated you manually have to copy/paste lines of code from your modified files back into the updated ones.

I know that you shouldn't touch the system folder for that same reason, BUT the reality is, that the same actually goes for the larger part of the application folder ... and that's to be honest a little misleading. Now image, that the »system« somehow checked for - let's say - a config.php file in some directory, let's call it user_app, for the lack of creativity. The system could then somehow merge that config with its own ... and when stuff gets updated, you simply dump a clean application folder into the root leaving your user_app (which is TOTALLY your own code) untouched.

Am I really the only person who think it's weird that system shouldn't be touched but changing stuff in application is ok. To me they look much the same in the sense that they contain stuff that potentially gets updated by the CodeIgniter team ...
Reply
#8

One possible project structure:
- application ... for all *your* logic
- ci3 ... the CodeIgniter3 download/composer/whatever
- public ... your public facing document root

With a new app, copy public & application from "ci3" to your project root, as a starting point for your app,

*index.php* from CI would go inside "public", and would have to be modified so that system="../ci3/system" and application="../application"

Configure your web server or virtual host to use your project's "public" folder as document root.

Whenever a new version of CI comes out, replace your "ci3" folder (clone/download/composer/whatever).
You then need to check "ci3/index.php" to see if any changes need to made to your "public/index.php".
You also need to check your "application/..." files to see if there are changes in "ci3/application/..." - those are likely to be mostly (or even only) in the "config" subfolder.

No constant merging, just checking on new release.
Your application is intact & not clobbered by an update, nor is your public folder.

Works for me.
Reply
#9

(09-19-2017, 03:21 PM)ciadmin Wrote: One possible project structure:
- application ... for all *your* logic
- ci3 ... the CodeIgniter3 download/composer/whatever
- public ... your public facing document root

With a new app, copy public & application from "ci3" to your project root, as a starting point for your app,

*index.php* from CI would go inside "public", and would have to be modified so that system="../ci3/system" and application="../application"

Configure your web server or virtual host to use your project's "public" folder as document root.

Whenever a new version of CI comes out, replace your "ci3" folder (clone/download/composer/whatever).
You then need to check "ci3/index.php" to see if any changes need to made to your "public/index.php".
You also need to check your "application/..." files to see if there are changes in "ci3/application/..." - those are likely to be mostly (or even only) in the "config" subfolder.

No constant merging, just checking on new release.
Your application is intact & not clobbered by an update, nor is your public folder.

Works for me.

Thanks for the input. But this still does not eliminate the manual comparison of config files in the application folder when updating. I think I'll see if I can find an application that can automatically check two directories against each other (just like git does) and then let me decide what to do when files are different ... wonder whether this will do: www.sublimerge.com (or something the like).
Reply
#10

(09-19-2017, 02:05 PM)blaasvaer Wrote: But that's exactly my point. In application you have all the config, routing etc. that you usually modify. You add modules and stuff to that application folder, and then when any of those (config files, libraries etc) gets updated you manually have to copy/paste lines of code from your modified files back into the updated ones.

No, you don't have to compare changes to, or modify anything under application/.

Even if something in there changes, it is mostly comments (irrelevant). In the rare event that a new config option is introduced, or a default value has changed, we do that in a BC-preserving way, it is explicitly mentioned in the upgrade instructions AND it never happens on a patch (i.e. the Z in x.y.z) release if it requires your attention.

(09-19-2017, 02:05 PM)blaasvaer Wrote: I know that you shouldn't touch the system folder for that same reason, BUT the reality is, that the same actually goes for the larger part of the application folder ... and that's to be honest a little misleading.

That is some alternative reality you're talking about. You don't even have to use application/; it's just a sample skeleton to get you up and running fast.

(09-19-2017, 02:05 PM)blaasvaer Wrote: Am I really the only person who think it's weird that system shouldn't be touched but changing stuff in application is ok. To me they look much the same in the sense that they contain stuff that potentially gets updated by the CodeIgniter team ...

Yes, you are the only person to think that. Literally every piece of software that uses configuration files is shipped with those configuration files, and you are expected to change them.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB