#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    7
    Rep Power
    0

    Lightbulb Open source CMS Develop


    Hi
    I try to develop a cms ,
    i welcome any help or opinion

    root file : index.php , .htaccess
    folders :
    ==>core
    --> includes { bootstrap.inc.php , dbconnect.inc.php , patch.inc.php , ...)
    --> modules {user , content , menu , sys , box }
    --> style {css , img , template }
    ==>server
    --> default {config.php}
    --> example.com {config.php , modules , style , files}
    ==>main
    --> files
    --> library
    --> modules
    --> style
    ---->default {template , css , img }


    I will upload the files soon as possible ...
  2. #2
  3. For POny!
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Location
    Amsterdam
    Posts
    416
    Rep Power
    115
    Although I am certainly no expert i have a bad feeling with the global variables you use for your database connection. Aren't constants or static variables more suited for this?
    (love to hear it from the experts )
    Last edited by aeternus; February 16th, 2013 at 03:36 PM.
  4. #3
  5. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,911
    Rep Power
    1045
    Hi,

    I agree that you do overuse global variables. In the long run, this will make the code very obscure and error-prone, because you simply have no control over which variable has which value.

    Global variables are acceptable for small scripts that only generate a single page. But for a complex project like a CMS, you need to reduce global variables to an absolute minimum. I mean, you certainly don't want hundreds of strange variables floating around everywhere, each one carrying the risk of accidentally overwriting it.

    Also, please get rid of the old MySQL extension and use one of the modern replacements. The PHP manual has a big red warning on each page of the old extension, but obviously this zombie functionality just won't die -- thanks to hundreds of bad tutorials still promoting it.

    No offense, but I'm rather sceptical about your approach. Your code isn't particularly bad or something, but it's not exactly up to date. Do you really want to build your whole CMS from a bunch of loose functions and global variables like people did in the 90s? I mean, PHP has evolved since, it has object-oriented features, database abstraction layers, extensive frameworks etc.

    To put it bluntly: I think that if you go on like that, you might end up with a 100,000 lines long unmaintanable reinvention of the wheel.

    I'm not saying this to put you down! Your concept looks good, and I think it's great to start your own project. But I'd advise you to take some monthts (or even years) to plan and investigate current software and techniques before you actually start programming. Look into frameworks like Symfony or CodeIgniter, see how other CMS do it, inform yourself of security and current best practices, gather experience etc.

    You'll get a better result at the end.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    7
    Rep Power
    0
    Originally Posted by Jacques1
    Hi,

    I agree that you do overuse global variables. In the long run, this will make the code very obscure and error-prone, because you simply have no control over which variable has which value.
    ....
    tnx , i start it for learn php and complete a project that may help others to start sample site ,
    thank you to share me your experiences,
    i try to apply these ideas and make clean codes ,
    the project start on Feb 13 2013
  8. #5
  9. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,911
    Rep Power
    1045
    Well, if you stick to your original scheduling and continue to work on the code, that's pretty much the opposite of what I suggested.

    But that's up to you, of course.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    7
    Rep Power
    0
    Thanks guys ...

    I publish basic code ( that not clearly , result 1 week work only )
    I am newbie in php therefore get me you suggestions please ...

    https://github.com/wishcms/wishcms

IMN logo majestic logo threadwatch logo seochat tools logo