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

Class: PEAR_PackageUpdate_Web

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

Variables

Methods


Child classes:

PEAR_PackageUpdate_Web3
This is a HTML driver for PEAR_PackageUpdate.

Inherited Variables

Inherited Methods


Class Details

[line 89]
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 125]

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

          Type:   string


          [ Top ]

          $errwidget =

          [line 116]

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

          Type:   object


          [ Top ]

          $mainwidget =

          [line 98]

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

          Type:   object


          [ Top ]

          $prefwidget =

          [line 107]

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

          Type:   object


          [ Top ]



          Method Detail

          checkUpdate   [line 369]

          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: 0.4.0
          • Access: public

          [ Top ]

          createErrorDialog   [line 255]

          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 134]

          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 190]

          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 425]

          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 350]

          void forceRestart( )

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

          [ Top ]

          getHtmlRendererWithLabel   [line 482]

          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 526]

          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 ]

          getStyleSheet   [line 575]

          string getStyleSheet( [bool $content = true])

          Returns the custom style sheet to use for layout
          • Since: 0.3.0
          • Access: public

          Parameters:

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

          [ Top ]

          prefDialog   [line 298]

          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 387]

          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 ]

          setStyleSheet   [line 593]

          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: 0.3.0
          • Access: public

          Parameters:

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

          [ Top ]

          toHtml   [line 616]

          string toHtml( $renderer)

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

          Overridden in child classes as:

          PEAR_PackageUpdate_Web3::toHtml()

          Parameters:

             $renderer   — 

          [ Top ]


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