PHP Class UpdateModel, vanilla

Inheritance: extends Gdn_Model
Mostrar archivo Open project: vanilla/vanilla Class Usage Examples

Public Properties

Property Type Description
$AddonSiteUrl URL to the addons site.

Public Methods

Method Description
analyzeAddon ( string $Path, boolean $ThrowError = true ) : array Check an addon's file to extract the addon information out of it.
compareAddons ( array $MyAddons, array $LatestAddons ) : boolean
findFiles ( string $path, array $fileNames ) : array Find a list of filenames in a folder or zip.
getAddonUpdates ( boolean $Enabled = false ) : array | boolean Deprecated.
getAddons ( boolean $Enabled = false ) : array Deprecated.
parseCoreVersion ( string $Path ) : string Parse the version out of the core's index.php file.
parseInfoArray ( string $Path, string $Variable = false ) : array | false Offers a quick and dirty way of parsing an addon's info array without using eval().
runStructure ( boolean $captureOnly = false ) Run the structure for all addons.

Protected Methods

Method Description
checkRequiredFields ( $info ) : array Check globally required fields in our addon info.

Private Methods

Method Description
addAddon ( $Addon, &$Addons )
getInfoFiles ( string $Path, array $InfoPaths ) : array
getInfoZip ( string $Path, array $InfoPaths, boolean $TmpPath = false, boolean $ThrowError = true ) : array Open a zip archive and inspect its contents for the requested paths.

Method Details

analyzeAddon() public static method

Check an addon's file to extract the addon information out of it.
public static analyzeAddon ( string $Path, boolean $ThrowError = true ) : array
$Path string The path to the file.
$ThrowError boolean Whether or not to throw an exception if there is a problem analyzing the addon.
return array An array of addon information.

checkRequiredFields() protected static method

Check globally required fields in our addon info.
protected static checkRequiredFields ( $info ) : array
$info
return array $results

compareAddons() public method

public compareAddons ( array $MyAddons, array $LatestAddons ) : boolean
$MyAddons array
$LatestAddons array
return boolean

findFiles() public static method

Find a list of filenames in a folder or zip.
public static findFiles ( string $path, array $fileNames ) : array
$path string Folder or zip file to look in.
$fileNames array List of files to attempt to locate inside $path.
return array

getAddonUpdates() public method

Deprecated.
Deprecation:
public getAddonUpdates ( boolean $Enabled = false ) : array | boolean
$Enabled boolean Deprecated.
return array | boolean Deprecated.

getAddons() public method

Deprecated.
public getAddons ( boolean $Enabled = false ) : array
$Enabled boolean Deprecated.
return array Deprecated.

parseCoreVersion() public static method

Parse the version out of the core's index.php file.
public static parseCoreVersion ( string $Path ) : string
$Path string The path to the index.php file.
return string A string containing the version or empty if the file could not be parsed.

parseInfoArray() public static method

Offers a quick and dirty way of parsing an addon's info array without using eval().
public static parseInfoArray ( string $Path, string $Variable = false ) : array | false
$Path string The path to the info array.
$Variable string The name of variable containing the information.
return array | false The info array or false if the file could not be parsed.

runStructure() public method

The structure runs the addons in priority order so that higher priority addons override lower priority ones.
public runStructure ( boolean $captureOnly = false )
$captureOnly boolean Run the structure or just capture the SQL changes.

Property Details

$AddonSiteUrl public_oe property

URL to the addons site.
public $AddonSiteUrl