Php session

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Php session - Presentation Transcript

    1. Development on Free Software - php - Xavier Castaño García
    2. This session
      • This class will be only practice. We'll try to view this topics:
        • Objects and Inheritance
        • Development with templates
        • Configuration
        • Session
        • Other useful trips...
    3. Objects and inheritance
      • Exercise 1: We are going to develop a class which extends “userhandler.php” in order to check if username and password matches with the parameters passed.
        • Keywords: mysql (mysql_connect, mysql_query).
      • Exercise 2: We are going to extract mysql functions from handler in order to avoid coupling between handler and mysql.
    4. Objects and inheritance
      • Comments:
        • You can see that in php 5 you can:
          • Autoload objects
          • Define visibility
          • Use the scope resolution operator (::) to access static, constants overridden members.
          • Define abstract classes, interfaces.
          • Overloading __set, __get, __isset, __unset and __call.
          • See: http://www.php.net/manual/en/language.oop5.php
    5. Configuration
      • Exercise 3: We are going to add mysql configuration variables to file and the we are going to read from it.
        • Comments: We can do the exercise with a simple php file. But, you could:
          • Use property files.
          • Use XML files.
    6. Development with templates
      • Exercise 4: We are going to develop a form where we ask for user and password.
        • Keywords: Smarty
    7. Development with templates
      • Comments:
        • Smarty is a template engine, but there are more engines.
        • I think HTML shouldn't be mixed with php, with some exceptions.
        • Templates shouldn't have a lot of logic.
          • Good practice: You use an “if” in order to get different colors for even and odd rows.
          • Bad practice: You decide to show a field depending on a value because your business login has this requirement.
    8. Session
      • Exercise 5: We are going to know if user has been authenticated in the same navigation but without asking again the user and password.
        • Keywords: Session
    9. Session
      • Comments:
        • Session allows to store persistent data between different requests.
        • It isn't recommendable use the session to store too much data.
        • Session stores the data serialized, so you could have problems with two simultaneous request modifying it.
    10. Other useful trips...
      • That allows you to add hooks. Methods to be called only using the name of the class and the name of the method itself.
      • Example:
        • $className = “myclass”;
        • $object = new $className;
        • $object->method($params...);
    11. Interesting links
      • PRADO: http://www.xisc.com/
        • PRADO is a component-based and event-driven framework for rapid Web programming in PHP 5.
      • CakePhp: http://www.cakephp.org/
        • CakePHP is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications.
      • Symfony: http://www.symfony-project.org/

    + Andrés ManeiroAndrés Maneiro, 2 years ago

    custom

    1201 views, 0 favs, 0 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1201
      • 1201 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 14
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories