The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> PHP Development
|
Open source CMS Develop
Discuss Open source CMS Develop in the PHP Development forum on Dev Shed. Open source CMS Develop PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

February 16th, 2013, 05:03 AM
|
|
Registered User
|
|
Join Date: Feb 2013
Posts: 7
Time spent in forums: 2 h 22 m 12 sec
Reputation Power: 0
|
|
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 ...
|

February 16th, 2013, 03:34 PM
|
 |
For POny!
|
|
Join Date: Apr 2012
Location: Amsterdam
|
|
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.
|

February 16th, 2013, 06:01 PM
|
 |
pollyanna
|
|
Join Date: Jul 2012
Location: Germany
|
|
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. 
|

February 17th, 2013, 12:50 AM
|
|
Registered User
|
|
Join Date: Feb 2013
Posts: 7
Time spent in forums: 2 h 22 m 12 sec
Reputation Power: 0
|
|
Quote: | 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
|

February 17th, 2013, 05:36 AM
|
 |
pollyanna
|
|
Join Date: Jul 2012
Location: Germany
|
|
|
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.
|

February 20th, 2013, 09:13 AM
|
|
Registered User
|
|
Join Date: Feb 2013
Posts: 7
Time spent in forums: 2 h 22 m 12 sec
Reputation 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
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|