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

Class: PEAR_PackageUpdate_Web

Source Location: /PEAR_PackageUpdate_Web-0.2.2/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 Laurent Laville

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 96]
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

          $errwidget =

          [line 123]

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

          Type:   object


          [ Top ]

          $mainwidget =

          [line 105]

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

          Type:   object


          [ Top ]

          $prefwidget =

          [line 114]

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

          Type:   object


          [ Top ]



          Method Detail

          createErrorDialog   [line 252]

          void createErrorDialog( [ $context = false])

          Creates the dialog that will show errors to the user.
          • Since: 0.1.0
          • Access: protected

          Parameters:

             $context   — 

          [ Top ]

          createMainDialog   [line 132]

          void createMainDialog( )

          Creates the dialog that will ask the user if it is ok to update.
          • Since: 0.1.0
          • Access: protected

          [ Top ]

          createPrefDialog   [line 187]

          void createPrefDialog( $prefs)

          Creates the dialog that will ask the user for his preferences.
          • Since: 0.1.0
          • Access: protected

          Parameters:

             $prefs   — 

          [ Top ]

          errorDialog   [line 399]

          boolean errorDialog( [boolean $context = false])

          Presents an error in a dialog window.
          • Return: true if an error was displayed.
          • Since: 0.1.0
          • Access: public

          Parameters:

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

          [ Top ]

          forceRestart   [line 347]

          void forceRestart( )

          Redirects or exits to force the user to restart the application.
          • Since: 0.1.0
          • Access: public

          [ Top ]

          getHtmlRendererWithLabel   [line 456]

          object instance &getHtmlRendererWithLabel( &$widget)

          Returns HTML renderer for a dialog with input labels and values
          • Return: of a QuickForm renderer
          • Since: 0.1.0
          • Access: protected

          Parameters:

             &$widget   — 

          [ Top ]

          getHtmlRendererWithoutLabel   [line 500]

          object instance &getHtmlRendererWithoutLabel( &$widget)

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

          Parameters:

             &$widget   — 

          [ Top ]

          prefDialog   [line 295]

          boolean prefDialog( )

          Creates and runs a dialog for setting preferences.
          • Return: true if the preferences were set and saved.
          • Since: 0.1.0
          • Access: public

          [ Top ]

          presentUpdate   [line 361]

          boolean presentUpdate( )

          Presents the user with the option to update.
          • Return: true if the user would like to update the package.
          • Since: 0.1.0
          • Access: public

          [ Top ]

          toHtml   [line 548]

          string toHtml( $renderer)

          Returns HTML code of a dialog box.
          • Since: 0.1.0
          • Access: public

          Parameters:

             $renderer   — 

          [ Top ]


          Documentation generated on Mon, 11 Mar 2019 14:41:57 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.