473,425 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,425 software developers and data experts.

Beginner Question: Define PHP "framework" for me


I've just grabbed a PHP book and can deal with the syntax and now I
need to decide to learn specific packages and features.

Define "framework".

What are the major framework flavors ?

Under what conditions can I use two or more frameworks?

Sorry for the beginners question.

Thanks
--
a d y k e s @ p a n i x . c o m

Don't blame me. I voted for Gore.
Jul 19 '05 #1
6 3643
Look in the index on the back of the book there probably is something
that refers to "framework" if that truly was something the book was
covering ...instead of trying to get your course studies problems
solved by us.

As to your question, blackmail can incorporate two frameworks
incrimination and photographic.

Jul 19 '05 #2
In article <db**********@panix3.panix.com>, ad****@panix.com (Al Dykes)
wrote:
I've just grabbed a PHP book and can deal with the syntax and now I
need to decide to learn specific packages and features.

Define "framework".

What are the major framework flavors ?

Under what conditions can I use two or more frameworks?

Sorry for the beginners question.

Thanks


A frame work is a set of classes that can be used to perform the more
mundane manipulations of the data in your application.

The stuff on http://pear.php.net could be considered a framework of
sorts. There are bunches of classes that provide some utility and
abstraction of different processing.

For example, PEAR DB lets you use the same code to interact with
multiple types of databases. So instead of coding mysql_query() and
pg_query() in your app, you simply instance an object of class DB,
define the database type and connection via the DSN and use the _same_
methods in the class to interact with _whatever_ database it is. In
short, your app user can use any database supported by PEAR DB without
modifying the code (SQL excepted - that is more a database level thing
than a PHP thing.)

I recently wrote some code that lets me take in user input in an
Unsafe(), SafeSQL(), or SafeHTMLSQL() manner in PHP/PostgreSQL E-Zine
Issue 2 http://amduus.com/phpezine/archive/Issue2.pdf Source code (
http://amduus.com/phpezine/archive/issue2.zip ). It takes into account
sourcing from _POST, _GET, _SERVER, etc.

If I want something from what the user entered, I do:

-----
include_once("ObjSafeIO.php");

$IO = new ObjSafeIO;

// Protect from SQL Injection
$FirstName = $IO->SafeSQL("FirstName");

or

// Protect from SQL Injection / Cross scripting attacks
$FirstName = $IO->SafeHTMLSQL ("FirstName");
-----

The class searches across the _POST, _GET, etc for an entry of FirstName
and then applies the manipulations to it to make it safe for SQL use and
for display on a web based app... or not safe depending on what I want
to use the value for.

Hope this helps explain things.
Jul 21 '05 #3
In article <db**********@panix3.panix.com>, ad****@panix.com (Al Dykes)
wrote:
I've just grabbed a PHP book and can deal with the syntax and now I
need to decide to learn specific packages and features.

Define "framework".

What are the major framework flavors ?

Under what conditions can I use two or more frameworks?

Sorry for the beginners question.

Thanks


Oh yea, here is some code that uses the DB framework and the IO
framework I was telling you about in another message on this thread.

There is nothing like reading code to learn what to do:

http://jobhunter.amduus.com/curpackage.zip

(and I am sure others will be able to tell you what I did wrong in the
code :P )
Jul 21 '05 #4
Scott Auge wrote:
In article <db**********@panix3.panix.com>, ad****@panix.com (Al Dykes)
wrote:
I've just grabbed a PHP book and can deal with the syntax and now I
need to decide to learn specific packages and features.

Define "framework".


A frame work is a set of classes that can be used to perform the more
mundane manipulations of the data in your application.


Dunno about a 'frame work' but a framework is more loosely defined than
that. It's merely a library of code and data structures and typically some
rules about how to use them which make developing applications easier and
more consistent. Really the term is rather mis-applied in PHP since it
refers to a system which you embed your own code into (rather than a set of
functions/classes accessed bound together by your code).

Mixing 'frameworks' is obviously inappropriate given the more correct
definition. The approach taken by most PHP framework developers should make
it possible to mix and match however most try to comprehensive so there
will be a lot of overlap. PEAR (which I don't think describes itself as a
framework) could be used with other libraries.

Frameworks typicaaly provide facitilities for
- templating
- navigation
- access control
- database abstraction

HTH

C.

Jul 21 '05 #5

"Al Dykes" <ad****@panix.com> wrote in message
news:db**********@panix3.panix.com...

I've just grabbed a PHP book and can deal with the syntax and now I
need to decide to learn specific packages and features.

Define "framework".

What are the major framework flavors ?

Under what conditions can I use two or more frameworks?

Sorry for the beginners question.

Thanks
--
a d y k e s @ p a n i x . c o m

Don't blame me. I voted for Gore.


"Framework" is the same as "Infrastructure" and is sometimes referred to as
"glue code" or "plumbing". After a programmer develops a component he simply
plugs it into the framework and it's ready to go. A framework typically
supplies the following:
- a logon mechanism
- a method of defining and displaying menus so that the user can decide
which component to execute.
- a method of defining which user is allowed to access which component
(access control)
- a method of passing parameters between one component and another

There may also be additional features such as:
- an audit logging system
- a workflow system

A framework should be totally application independent. In other words it has
no knowledge of any particular type of application as that is the
responsibility of the application components.

Think of how the term "infrastructure" applies in the physical world. This
describes a system of roads, power supplies, water and sewage systems,
communication systems etc. If you build a house within an area where such an
infrastructure exists then you have something of value. On the other hand if
you build a house in an area where there is no infrastructure - no roads, no
power, no water, no sewage, no communications - then you have an enormous
amount of work to do before it becomes inhabitable.

Once you develop a good infrastructure/framework you should be able to
re-use it time and time again for many different applications. This means
that you can spend more of your valuable time on coding the business rules
and less time on the plumbing.

--
Tony Marston

http://www.tonymarston.net

Jul 21 '05 #6
In article <db*******************@news.demon.co.uk>,
Tony Marston <to**@marston-home.demon.co.uk> wrote:

"Al Dykes" <ad****@panix.com> wrote in message
news:db**********@panix3.panix.com...

I've just grabbed a PHP book and can deal with the syntax and now I
need to decide to learn specific packages and features.

Define "framework".

What are the major framework flavors ?

Under what conditions can I use two or more frameworks?

Sorry for the beginners question.

Thanks
--
a d y k e s @ p a n i x . c o m

Don't blame me. I voted for Gore.


"Framework" is the same as "Infrastructure" and is sometimes referred to as
"glue code" or "plumbing". After a programmer develops a component he simply
plugs it into the framework and it's ready to go. A framework typically
supplies the following:
- a logon mechanism
- a method of defining and displaying menus so that the user can decide
which component to execute.
- a method of defining which user is allowed to access which component
(access control)
- a method of passing parameters between one component and another

There may also be additional features such as:
- an audit logging system
- a workflow system

A framework should be totally application independent. In other words it has
no knowledge of any particular type of application as that is the
responsibility of the application components.

Think of how the term "infrastructure" applies in the physical world. This
describes a system of roads, power supplies, water and sewage systems,
communication systems etc. If you build a house within an area where such an
infrastructure exists then you have something of value. On the other hand if
you build a house in an area where there is no infrastructure - no roads, no
power, no water, no sewage, no communications - then you have an enormous
amount of work to do before it becomes inhabitable.

Once you develop a good infrastructure/framework you should be able to
re-use it time and time again for many different applications. This means
that you can spend more of your valuable time on coding the business rules
and less time on the plumbing.


Thanks, everyone. I was looking for something more formal and not
finding it. Now I see why.
--
a d y k e s @ p a n i x . c o m

Don't blame me. I voted for Gore.
Jul 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Mart | last post by:
What class does everyone out there use if they want to store a set of values efficiently? In java I use a HashSet, but there is no equivalent in C#. Even worse, the lowest level interface to...
43
by: Zeng | last post by:
It's so messy w/o the "friend" relationship. Does anyone know why it was not supported in C#. It's almost about as bad as it doesn't support the inheritance hierarchy and method reference...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
5
by: Dan C Douglas | last post by:
I have just installed VS.NET 2003 on my computer. I have a project that I have been developing on VS.NET 2002. I haven't upgraded this project to VS.NET 2003 yet and I am still developing it in...
71
by: Greg | last post by:
Is it your general opinion that C# is generally designed/intended/ready to replace C++? I know the answer is not black and white but please repond YES or NO (add any comments if you would like) ...
2
by: Jeremy S. | last post by:
What might be a relatively useful or effective way to explain what a "Framework" is to non technical business managers. My situation is that I've been presenting the .NET Framework to these sorts...
4
by: pcnerd | last post by:
I've been playing with "classic" VB since version 3. I have VB6 Learning Edition. Recently, I wanted to try VB.NET. I got a beginner's book with a CD with the software & installed it. There are...
0
by: Bakunin | last post by:
Hi, I have a brief question regarding the .net framework renders class definitions of schemas to wsdl descritions. I have observed the following: 1. I have a schema with a mandatory field (in...
3
by: Frank Milverckowitz | last post by:
Hi, Newbie question about SqlDataReader column value access... In java jdbc code to get a value from a table column we can pass the column name (instead of an int index or offset): String...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.