|
Posted by David Gillen on 12/30/05 13:29
An noise sounding like Josse Barrera said:
> Hi All,
>
> I have just recently (~ 3wks) playing around with PHP. I come from an
> OOP background (mostly C++) so I have taken to PHP5 like a duck to
> water. However, I have a number of nagging questions that I have not yet
> manage to resolve (all the websites I have visited seem to assume I
> already know the answers - or could it be that PHP is so loosely held
> together that it lets one get away without a proper architecture for an
> application (is "application" the correct term for a bunch of PHP
> scripts running server side or is there another term?)
>
> Question 1:
>===========
> Is there any such thing as a PHP application (or are PHP solutions just
> a bunch of "loosely coupled" scripts thrown together)?
>
Depends how you want to define it yourself, but I'd say Yes. You can have a
php application.
> Question 2:
>=============
> Assuming there IS such a thing as a PHP application, how does one go
> about putting one together?. In the C++ world, there is the concept of
> libraries, in Java there are packages, In .Net there are assemblies.
>
> i). How do PHP solutions logically partition functionality?.
>
> Writing extensions in C seems to be one way to go, but apart from that
> being overkill, I my ISP may not even allow me to load my extension.
> There must be a simpler way to partition logic surely ?.
>
Generally work with a library of php classes which have the common
functionality I want across multiple applications.
Either classes written specifically for a job, or ones available freely on the
interweb.
> Question 3:
>==============
> I have seen a few examples that seem to partition functionality by
> splitting objects into various files (a bit like the use of header files
> in C/C++), along with a liberal showering of calls to include() in the
> code - however, unlike header files, the files "included" contain not
> just the class definitions etc, but also (more critically), the
> implementation (i.e. any business logic that may show how your system
> may be compromised).
>
> i). Is it possible to have your "header" files (i.e. class
> implementation source code) stored in a directory location that is
> hidden in some way - the main goal is to thwart any hacker who may
> simply look at your include() method calls, casually navigate to the
> appropriate directories and peruse your source code at his/her leisure.
>
Yes. Have the class files etc in a path outside of the webtree, and then
define your include path to include those directories. Will thwart a casual
cracker, someone who is persistent enough will always get it. But you
shouldn't worry about it. That is up to the sys admin, not the developer.
db
--
/(bb|[^b]{2})/
Trees with square roots don't have very natural logs.
What's the difference between ignorance and apathy? Who knows? Who cares?
Navigation:
[Reply to this message]
|