Why is this in the core code?
Permalink
I was looking through some core source code and saw this...
That's inside /concrete/startup/config_check.php which is a file included into the index.php file.
Anyway that IF construct does nothing at all in that both of it's branches define the same exact thing which construct could just as well be eliminated entirely and left as...
Not a huge deal. Happens to the best of us with respect to leaving some superfluous code that should have been cleaned up.
But this leads me to another question.
I am commenting the source code as I go and understand it. Creating a separate file and just prepending the extension "COMMENTED" to the end of the file name.
I was thinking that I could contribute to C5 by making available these files as I create them. So that the core code (with virtually no comments) could at least end up with useful comments to other developers coming after me.
Is that something that you (i.e. the C5 team) might find useful?
If not...I'll just keep the commented files to myself for my own benefit but just wondered if anyone else might be interested in making these available to others somehow.
As for the superfluous code...that should be cleaned up as there is s no reason in this case to have the IF construct at all. There are probably a number of things like that. I can clean those up as I go too.
Carlos
That's inside /concrete/startup/config_check.php which is a file included into the index.php file.
Anyway that IF construct does nothing at all in that both of it's branches define the same exact thing which construct could just as well be eliminated entirely and left as...
define('CONFIG_FILE', DIR_CONFIG_SITE . '/site.php');
Not a huge deal. Happens to the best of us with respect to leaving some superfluous code that should have been cleaned up.
But this leads me to another question.
I am commenting the source code as I go and understand it. Creating a separate file and just prepending the extension "COMMENTED" to the end of the file name.
I was thinking that I could contribute to C5 by making available these files as I create them. So that the core code (with virtually no comments) could at least end up with useful comments to other developers coming after me.
Is that something that you (i.e. the C5 team) might find useful?
If not...I'll just keep the commented files to myself for my own benefit but just wondered if anyone else might be interested in making these available to others somehow.
As for the superfluous code...that should be cleaned up as there is s no reason in this case to have the IF construct at all. There are probably a number of things like that. I can clean those up as I go too.
Carlos
That's an excellent suggestion Jordan.
I don't know if I want to take the time to learn GIT just now mind you as I have a rather large project beginning today but in my spare time it might be worth doing as the best way to contribute commented code.
I'll look into that Jordan.
Thanks.
Carlos
I don't know if I want to take the time to learn GIT just now mind you as I have a rather large project beginning today but in my spare time it might be worth doing as the best way to contribute commented code.
I'll look into that Jordan.
Thanks.
Carlos
On a somewhat related topic...
Do you need a github account in order to submit pull requests for changes that you've made and would like to contribute? That's something I've not yet done with Git and am wondering if I can submit pull requests for changes made to a local repository; or do I need my own github account with a C5 branch?
-Steve
Do you need a github account in order to submit pull requests for changes that you've made and would like to contribute? That's something I've not yet done with Git and am wondering if I can submit pull requests for changes made to a local repository; or do I need my own github account with a C5 branch?
-Steve
to submit pull requests you do need a github account with a fork of the concrete5 branch
Forgive my ignorance about such matters but what exactly is a pull request?
Carlos
Carlos
If you make changes to your "copy" of C5 (your C5 Git repository) that you think are worthy of being incorporated into the "official" C5 code base, you can request that the core team "pull" your changes from your repository and merge them into the official C5 repository. The Git version control software makes the process of merging such changes fairly simple.
-Steve
-Steve
A valid point. Maybe it's there for future version incase they want to add in more functionality.
It's probably as case where they had a different config setup for the installation process and have since updated it.
I personally liked the closed method C5 use where the code, comments and instructions are all on one site without confusing matters with github.
Just my 2 cents ;)
It's probably as case where they had a different config setup for the installation process and have since updated it.
I personally liked the closed method C5 use where the code, comments and instructions are all on one site without confusing matters with github.
Just my 2 cents ;)
The code is still on concrete5.org -- github is just for the development process. Those files weren't available on concrete5.org previously (you had to access them via svn), so it's not changing anything unless you were previously involved in core development.
As for your project of commenting the system, I think that's great. If you don't mind learning yet another huge complicated topic, the best approach would be to fork Concrete5 on github which creates your own copy ("branch") of the codebase that you can modify to your heart's content. If you were able and willing to learn how to use git, doing it in this way would accomplish a few things:
1) You wouldn't have to change the names of files -- the whole point of version control systems such as git are to track changes for you, help you identify those changes, let you review them, or even go back to old versions if you make a mistake.
2) Github provides a really slick interface for viewing code directly on the website so it would server as a useful reference for people (they wouldn't have to download or install anything to look at it).
3) This is the easiest way to get your comments into the core code itself -- if you decide to offer back your commented files to the core system, Andrew and team could review your changes, make sure nothing got screwed up (happens to the best of us!), and roll it in very easily (assuming it's something they want to do of course -- I can't speak for them).
If you do decide that you want to go down yet another technical rabbit hole and try this out, I highly recommend this for learning git:
http://progit.org/book/
Cheers,
Jordan