Beginner Question: Define PHP "framework" for me

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Al Dykes

    #1

    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.
  • larry@portcommodore.com

    #2
    Re: Beginner Question: Define PHP "framework " for me

    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.

    Comment

    • Scott Auge

      #3
      Re: Beginner Question: Define PHP "framework " for me

      In article <dbhg2s$q30$1@p anix3.panix.com >, adykes@panix.co m (Al Dykes)
      wrote:
      [color=blue]
      > 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[/color]

      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("O bjSafeIO.php");

      $IO = new ObjSafeIO;

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

      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.

      Comment

      • Scott Auge

        #4
        Re: Beginner Question: Define PHP &quot;framework &quot; for me

        In article <dbhg2s$q30$1@p anix3.panix.com >, adykes@panix.co m (Al Dykes)
        wrote:
        [color=blue]
        > 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[/color]

        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:



        (and I am sure others will be able to tell you what I did wrong in the
        code :P )

        Comment

        • Colin McKinnon

          #5
          Re: Beginner Question: Define PHP &quot;framework &quot; for me

          Scott Auge wrote:
          [color=blue]
          > In article <dbhg2s$q30$1@p anix3.panix.com >, adykes@panix.co m (Al Dykes)
          > wrote:
          >[color=green]
          >> 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" .
          >>[/color]
          >
          > A frame work is a set of classes that can be used to perform the more
          > mundane manipulations of the data in your application.
          >[/color]

          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.

          Comment

          • Tony Marston

            #6
            Re: Beginner Question: Define PHP &quot;framework &quot; for me


            "Al Dykes" <adykes@panix.c om> wrote in message
            news:dbhg2s$q30 $1@panix3.panix .com...[color=blue]
            >
            > 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.[/color]

            "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

            This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL




            Comment

            • Al Dykes

              #7
              Re: Beginner Question: Define PHP &quot;framework &quot; for me

              In article <dbifug$6k9$1$8 300dec7@news.de mon.co.uk>,
              Tony Marston <tony@marston-home.demon.co.u k> wrote:[color=blue]
              >
              >"Al Dykes" <adykes@panix.c om> wrote in message
              >news:dbhg2s$q3 0$1@panix3.pani x.com...[color=green]
              >>
              >> 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.[/color]
              >
              >"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
              >responsibili ty 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,
              >communicatio n systems etc. If you build a house within an area where such an
              >infrastructu re 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.
              >[/color]

              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.

              Comment

              Working...