Back to index

lightning-sunbird  0.9+nobinonly
Functions | Variables
PluginFinderService.php File Reference

Go to the source code of this file.

Functions

 bail ($errstr)
 expandversion ($vstr)
 vercmp ($a, $b)

Variables

 $db_server = ""
 config bits:
 $db_user = ""
 $db_pass = ""
 $db_name = ""
 $mimetype = $_GET['mimetype']
 $reqTargetAppGuid = $_GET['appID']
 $reqTargetAppVersion = $_GET['appVersion']
 $clientOS = $_GET['clientOS']
 $chromeLocale = $_GET['chromeLocale']
print<?xmlversion=\"1.0\"?> n

Function Documentation

bail ( errstr)

Definition at line 47 of file PluginFinderService.php.

                        {
    die("Error: " . $errstr);
}

Here is the call graph for this function:

expandversion ( vstr)

Definition at line 54 of file PluginFinderService.php.

                               {
    $v = explode('.', $vstr);

    if ($vstr == '' || count($v) == 0 || count($v) > 4) {
        bail ('Bogus version.');
    }

    $vlen = count($v);
    $ret = array();
    $hasplus = 0;

    for ($i = 0; $i < 4; $i++) {
        if ($i > $vlen-1) {
            // this version chunk was not specified; give 0
            $ret[] = 0;
        } else {
            $s = $v[$i];
            if ($i == 3) {
                // need to check for +
                $slen = strlen($s);
                if ($s{$slen-1} == '+') {
                    $s = substr($s, 0, $slen-1);
                    $hasplus = 1;
                }
            }

            $ret[] = intval($s);
        }
    }

    $ret[] = $hasplus;

    return $ret;
}
vercmp ( a,
b 
)

Definition at line 89 of file PluginFinderService.php.

                         {
    if ($a == $b)
        return 0;

    $va = expandversion($a);
    $vb = expandversion($b);

    for ($i = 0; $i < 5; $i++)
        if ($va[$i] != $vb[$i])
            return ($vb[$i] - $va[$i]);

    return 0;
}


//
// These are passed in the GET string
//

if (!array_key_exists('mimetype', $_GET))
    bail ("Invalid request.");

$mimetype = $_GET['mimetype'];

if (!array_key_exists('appID', $_GET) 
    || !array_key_exists('appVersion', $_GET)
    || !array_key_exists('clientOS', $_GET))    
    || !array_key_exists('chromeLocale', $_GET))
   )
    bail ("Invalid request.");

$reqTargetAppGuid = $_GET['appID'];
$reqTargetAppVersion = $_GET['appVersion'];
$clientOS = $_GET['clientOS'];
$chromeLocale = $_GET['chromeLocale'];

// check args
if (empty($reqTargetAppVersion) || empty($reqTargetAppGuid)) {
    bail ("Invalid request.");
}

//
// Now to spit out the RDF.  We hand-generate because the data is pretty simple.
//

if ($mimetype == "application/x-mtx") {
  $name = "Viewpoint Media Player";
  $guid = "{03F998B2-0E00-11D3-A498-00104B6EB52E}";
  $version = "5.0";
  $iconUrl = "";
  $XPILocation = "http://www.nexgenmedia.net/flashlinux/invalid.xpi";
  $InstallerShowsUI = false;
  $manualInstallationURL = "http://www.viewpoint.com/pub/products/vmp.html";
  $licenseURL = "http://www.viewpoint.com/pub/privacy.html";
} else if ($mimetype == "application/x-shockwave-flash") {
  $name = "Flash Player";
  $guid = "{D27CDB6E-AE6D-11cf-96B8-444553540000}";
  $version = "7.0.16";
  $iconUrl = "http://goat.austin.ibm.com:8080/flash.gif";
  $XPILocation = "http://www.nexgenmedia.net/flashlinux/flash-linux.xpi";
  $InstallerShowsUI = "false";
  $manualInstallationURL = "http://www.macromedia.com/go/getflashplayer";
  $licenseURL = "http://www.macromedia.com/shockwave/download/license/desktop/";
} else {

Here is the call graph for this function:


Variable Documentation

$chromeLocale = $_GET['chromeLocale']

Definition at line 123 of file PluginFinderService.php.

$clientOS = $_GET['clientOS']

Definition at line 122 of file PluginFinderService.php.

$db_name = ""

Definition at line 44 of file PluginFinderService.php.

$db_pass = ""

Definition at line 43 of file PluginFinderService.php.

$db_server = ""

config bits:

Definition at line 41 of file PluginFinderService.php.

$db_user = ""

Definition at line 42 of file PluginFinderService.php.

$mimetype = $_GET['mimetype']

Definition at line 111 of file PluginFinderService.php.

$reqTargetAppGuid = $_GET['appID']

Definition at line 120 of file PluginFinderService.php.

$reqTargetAppVersion = $_GET['appVersion']

Definition at line 121 of file PluginFinderService.php.

print<RDF:Descriptionabout=\"urn:mozilla:plugin:{$guid}:{$version}\"> n

Definition at line 143 of file PluginFinderService.php.