| 73 | | * List of components used by WiFiDog |
| 74 | | * |
| | 75 | * An array of components used by WiFiDog |
| | 76 | * The main array key is the EXACT name name of the dependency. Do NOT translate it or blindly change it; |
| | 77 | * It is used in the code if various ways, for example to detect PHP or PEAR modules |
| | 78 | * Documentation of the various array keys: |
| | 79 | * 'mandatory' => Optional. Set to true if the dependency absolutely required for basic operation of an auth server |
| | 80 | * 'type' => Mandatory. The type of Dependency. Currently, allowed values are: |
| | 81 | * "phpExtension": Standard PHP extension |
| | 82 | * "peclStandard": Standard (in the PECL reposidory) PECL PHP module |
| | 83 | * "peclStandard": Standard (in the PEAR reposidory) PEAR PHP module |
| | 84 | * "pearCustom": PEAR-compatible tarball |
| | 85 | * "localLib": Custom PHP extension, to be downloaded and installed in wifidog/lib |
| | 86 | * 'detectFiles' => Mandatory for most type of dependencies, the relative path to the file that must exist for the dependency to be considered present. |
| | 87 | * The path is relative to the PHP path, or wifidog/lib depending on the type of install |
| | 88 | * 'description' => Description of the dependency, and what it's used for in wifidog |
| | 89 | * 'website' => URL to the dependency's official website |
| | 90 | * 'installSourceUrl' => For localLib and pearCustom dependency, the URL where the dependency can be downloaded. |
| | 91 | * 'installMethod' => For localLib, the protocol to be used to download and install the dependency. Currently, allowed values are: |
| | 92 | * 'tarball': Decompress a tarball in wifidog/lib |
| | 93 | * 'installDestination' => For localLib, the path, relative to wifidog/lib where the dependency should be installed |
| | 94 | * |
| 95 | | |
| | 115 | "Smarty" => array ( |
| | 116 | 'mandatory' => true, |
| | 117 | "type" => "localLib", |
| | 118 | "detectFiles" => "lib/Smarty-2.6.18/libs/Smarty.class.php", |
| | 119 | 'description' => "Required for all parts of wifidog", |
| | 120 | 'website' => "http://smarty.php.net/", |
| | 121 | 'installSourceUrl' => "http://smarty.php.net/do_download.php?download_file=Smarty-2.6.18.tar.gz", |
| | 122 | 'installMethod' => "tarball", |
| | 123 | 'installDestination' => "/" |
| | 124 | ), |
| | 421 | /** |
| | 422 | * Checks if one of the mandatory components is missing. |
| | 423 | * |
| | 424 | * @param string $errmsg Reference of a string which would contain an |
| | 425 | * error message. |
| | 426 | * |
| | 427 | * @return boolean Returns false if any components are missing. |
| | 428 | */ |
| | 429 | public static function checkMandatoryComponents(&$errmsg = null) |
| | 430 | { |
| | 431 | // Init values |
| | 432 | $returnValue = true; |
| | 433 | $components = self::getDependencies(); |
| | 434 | foreach($components as $component) { |
| | 435 | if($component->isMandatory()) { |
| | 436 | $returnValue &= self::check($component->getId(), $errmsg); |
| | 437 | } |
| | 438 | } |
| | 439 | |
| | 440 | return $returnValue; |
| | 441 | } |
| | 442 | |
| 426 | | $name = $this->getId().'_install'; |
| 427 | | $html .= sprintf(_("<input type='submit' name='%s' value='Install %s'/>"), $name,$this->getId()); |
| | 471 | if($this->getInstallSourceUrl()) { |
| | 472 | $name = $this->getId().'_install'; |
| | 473 | $value = sprintf(_("Install %s"), $this->getId()); |
| | 474 | $html .= sprintf("<input type='submit' name='%s' value='%s'/>", $name, $value); |
| | 475 | |
| | 476 | } |
| | 477 | else { |
| | 478 | $html .= sprintf(_("Sorry, i couldn't find the source for %s in installSourceUrl"), $this->getId()); |
| | 479 | } |
| | 480 | |