This is a discussion on Choosing PHP for large projects within the PHP Language forums, part of the PHP Programming Forums category; >From the points listed, the only thing that would > make a difference, with regards to the size of ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
>From the points listed, the only thing that would
> make a difference, with regards to the size of the project, is the lack > of namespace. If the project is written from scratch (i.e. not just > gathering up a bunch of prototypes or separate projects), you plan > ahead, and you are strict with your naming conventions (proper > prefixing), then it is less of a problem, if at all. > > If you include more than one namespace, then you can still get name > collisions. I think the namecase issue can be overcome in PHP by using classes. This is what I do, not specifically for the namespace issue, but to sort of organize and encapsulate my code. If I have something that is an "entity", such as a "project activity" or such, I make a class, and put all functions that have to do with project activities (assessing the database, arranging things to create output HTML tables, or parts of tables, etc.) in that class. Then the function is called by instantiating an object $myobject = new myobjectclass $myobject->myfunction() or a variable directly $myobject->name or if instantiation is not needed (to just access a function) myobjectclass::myfunction() In effect, one could create a class just to create a namespace for a group of functions. // SI |
|
|||
|
coolsti wrote:
>>From the points listed, the only thing that would > >>make a difference, with regards to the size of the project, is the lack >>of namespace. If the project is written from scratch (i.e. not just >>gathering up a bunch of prototypes or separate projects), you plan >>ahead, and you are strict with your naming conventions (proper >>prefixing), then it is less of a problem, if at all. >> >>If you include more than one namespace, then you can still get name >>collisions. > > > I think the namecase issue can be overcome in PHP by using classes. This > is what I do, not specifically for the namespace issue, but to sort of > organize and encapsulate my code. If I have something that is an "entity", > such as a "project activity" or such, I make a class, and put all > functions that have to do with project activities (assessing the database, > arranging things to create output HTML tables, or parts of tables, etc.) > in that class. Then the function is called by instantiating an object > > $myobject = new myobjectclass > $myobject->myfunction() > > or a variable directly > > $myobject->name > > or if instantiation is not needed (to just access a function) > > myobjectclass::myfunction() > > In effect, one could create a class just to create a namespace for a group > of functions. > > // SI Yea PHP is decent for large projects. I would recommend you use PHP MVC(model view controller). Use Smarty to seperate the content from the php and use classes to isolate your functionality/business logic. AP |