PEAR_PackageUpdate_Web
[ class tree: PEAR_PackageUpdate_Web ] [ index: PEAR_PackageUpdate_Web ] [ all elements ]

Class: PEAR_PackageUpdate_Web

Source Location: /PEAR_PackageUpdate_Web-1.0.1/Web.php

Class Overview

PEAR_PackageUpdate
   |
   --PEAR_PackageUpdate_Web

This is a HTML driver for PEAR_PackageUpdate.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2006-2008 Laurent Laville

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 91]
This is a HTML driver for PEAR_PackageUpdate.

A package to make adding self updating functionality to other packages easy.

The interface for this package must allow for the following functionality:

          • allow user to confirm or cancel upgrade
          • download and install the package
          • don't ask again
          • don't ask until next release
          • only ask for state XXXX or higher
          • update channel automatically
          • PHP-GTK/CLI apps must exit to allow classes to reload
          • web front end could send headers to reload certain page
          This class is simply a wrapper for PEAR classes that actually do the work.

          EXAMPLE:

          1.  <?php
          2.   class Goo {
          3.       function __construct()
          4.       {
          5.           // Check for updates...
          6.           require_once 'PEAR/PackageUpdate.php';
          7.           $ppu =PEAR_PackageUpdate::factory('Web''XML_RPC''pear');
          8.           if ($ppu !== false{
          9.               if ($ppu->checkUpdate()) {
          10.                   // Use a dialog window to ask permission to update.
          11.                   if ($ppu->presentUpdate()) {
          12.                       if ($ppu->update()) {
          13.                           // If the update succeeded, the application should
          14.                           // be restarted.
          15.                           $ppu->forceRestart();
          16.                       }
          17.                   }
          18.               }
          19.           }
          20.           // ...
          21.       }
          22.       // ...
          23.   }
          24.  ?>



          [ Top ]


          Class Variables

          $css =

          [line 127]

          Style sheet for the custom layout
          • Since: 0.3.0
          • Access: public

          Type:   string


          [ Top ]

          $errwidget =

          [line 118]

          The error Dialog widget.
          • Since: 0.1.0
          • Access: public

          Type:   object


          [ Top ]

          $mainwidget =

          [line 100]

          The main Dialog widget.
          • Since: 0.1.0
          • Access: public

          Type:   object


          [ Top ]

          $prefwidget =

          [line 109]

          The preference Dialog widget.
          • Since: 0.1.0
          • Access: public

          Type:   object


          [ Top ]



          Method Detail

          checkUpdate   [line 398]

          boolean checkUpdate( )

          Checks to see if an update is available, and if package was already installed.

          Respects the user preferences when determining if an update is available. Returns true if an update is available and the user may want to update the package.

          • Return: true if an update is available.
          • Since: version 0.4.0 (2007-07-01)
          • Access: public

          [ Top ]

          createErrorDialog   [line 281]

          void createErrorDialog( [boolean $context = false])

          Creates the dialog that will show errors to the user.
          • Since: version 0.1.0 (2006-04-30)
          • Access: protected

          Parameters:

          boolean   $context   —  (optional) Decides to show or not the context (file, line) of error

          [ Top ]

          createMainDialog   [line 136]

          void createMainDialog( )

          Creates the dialog that will ask the user if it is ok to update.
          • Since: version 0.1.0 (2006-04-30)
          • Access: protected

          [ Top ]

          createPrefDialog   [line 198]

          void createPrefDialog( array $prefs)

          Creates the dialog that will ask the user for his preferences.
          • Since: version 0.1.0 (2006-04-30)
          • Access: protected

          Parameters:

          array   $prefs   —  User's preferences

          [ Top ]

          errorDialog   [line 457]

          boolean errorDialog( [boolean $context = false])

          Presents an error in a dialog window.
          • Return: true if an error was displayed.
          • Since: version 0.1.0 (2006-04-30)
          • Access: public

          Parameters:

          boolean   $context   —  (optional) true if you want to have error context details

          [ Top ]

          forceRestart   [line 379]

          void forceRestart( )

          Redirects or exits to force the user to restart the application.
          • Since: version 0.1.0 (2006-04-30)
          • Access: public

          [ Top ]

          getHtmlRendererWithLabel   [line 516]

          object instance &getHtmlRendererWithLabel( object &$widget)

          Returns HTML renderer for a dialog with input labels and values
          • Return: of a QuickForm renderer
          • Since: version 0.1.0 (2006-04-30)
          • Access: protected

          Parameters:

          object   &$widget   —  instance of HTML_QuickForm (main dialog)

          [ Top ]

          getHtmlRendererWithoutLabel   [line 563]

          object instance &getHtmlRendererWithoutLabel( object &$widget)

          Returns HTML renderer for a dialog with only input values (no labels)
          • Return: of a QuickForm renderer
          • Since: version 0.1.0 (2006-04-30)
          • Access: protected

          Parameters:

          object   &$widget   —  instance of HTML_QuickForm (main dialog)

          [ Top ]

          getStyleSheet   [line 614]

          string getStyleSheet( [bool $content = true])

          Returns the custom style sheet to use for layout
          • Since: version 0.3.0 (2006-07-17)
          • Access: public

          Parameters:

          bool   $content   —  (optional) Either return css filename or string contents

          [ Top ]

          prefDialog   [line 326]

          boolean prefDialog( )

          Creates and runs a dialog for setting preferences.
          • Return: true if the preferences were set and saved.
          • Since: version 0.1.0 (2006-04-30)
          • Access: public

          [ Top ]

          presentUpdate   [line 417]

          boolean presentUpdate( )

          Presents the user with the option to update.
          • Return: true if the user would like to update the package.
          • Since: version 0.1.0 (2006-04-30)
          • Access: public

          [ Top ]

          setStyleSheet   [line 633]

          bool setStyleSheet( [string $css = null])

          Set the custom style sheet to use your own styles
          • Return: True if custom styles, false if default styles applied
          • Since: version 0.3.0 (2006-07-17)
          • Access: public

          Parameters:

          string   $css   —  (optional) File to read user-defined styles from

          [ Top ]

          toHtml   [line 658]

          string toHtml( object $renderer)

          Returns HTML code of a dialog box.
          • Since: version 0.1.0 (2006-04-30)
          • Access: public

          Parameters:

          object   $renderer   —  instance of a QuickForm renderer

          [ Top ]


          Documentation generated on Mon, 11 Mar 2019 15:23:03 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.