+ Driver
+
+
+
+ in package
+
+
+
+
+
+
+
+
+ Class Driver
+ +Base class for all package drivers
++ Table of Contents + +
+ +-
+
- + $lockFile + + : string + + + +
- + $pkgData + + : array<string|int, mixed> + + + +
- + $timeout + + : int + +
- Defines timeout for API requests (in seconds) + +
- + $userAgent + + : string + +
- Controls `User-Agent` header + +
- + __construct() + + : void + +
- Constructor + +
- + spreadLove() + + : array<string|int, mixed> + +
- Spreads love + +
- + extend() + + : array<string|int, mixed> + +
- Retrieves additional package information + +
- + extract() + + : array<string|int, mixed> + +
- Extracts raw data from input files + +
- + fetchRemote() + + : string + +
- Fetches information from API endpoint + +
+ Properties + +
++ $lockFile + + + +
+ + + +
+ public
+ string
+ $lockFile
+
+
+
+
+
+
+
+
++ $pkgData + + + +
+ + + +
+ public
+ array<string|int, mixed>
+ $pkgData
+
+
+
+
+
+
+
+
++ $timeout + + + +
+ + +Defines timeout for API requests (in seconds)
+ +
+ public
+ int
+ $timeout
+ = 3
+
+
+
+
+
++ $userAgent + + + +
+ + +Controls `User-Agent` header
+ +
+ public
+ string
+ $userAgent
+ = 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'
+
+
+
+
+
++ Methods + +
++ __construct() + +
+ + +Constructor
+ +
+ public
+ __construct(array<string|int, mixed> $pkgData, string $lockFile) : void
+
+
+ Parameters
+-
+
- + $pkgData + : array<string|int, mixed> + +
-
+
+ +Path to data file
+
+ - + $lockFile + : string + +
-
+
+ +Lockfile contents
+
+
Return values
+ void + — + + ++ spreadLove() + +
+ + +Spreads love
+ +
+ public
+ spreadLove() : array<string|int, mixed>
+
+ Extracts data from files & retrieves additional information, +providing hooks for both tasks & delegating them to its subclasses
+Return values
+ array<string|int, mixed> + — + + ++ extend() + +
+ + +Retrieves additional package information
+ +
+ protected
+ abstract extend(array<string|int, mixed> $data) : array<string|int, mixed>
+
+
+ Parameters
+-
+
- + $data + : array<string|int, mixed> + +
-
+
+ +Extracted data
+
+
Return values
+ array<string|int, mixed> + — +Processed data
++ extract() + +
+ + +Extracts raw data from input files
+ +
+ protected
+ abstract extract() : array<string|int, mixed>
+
+
+
+
+
+ Return values
+ array<string|int, mixed> + — +Extracted data
++ fetchRemote() + +
+ + +Fetches information from API endpoint
+ +
+ protected
+ fetchRemote(string $apiURL) : string
+
+
+ Parameters
+-
+
- + $apiURL + : string + +
-
+
+ +API endpoint
+
+
+ Tags + +
+ + +Return values
+ string + — +Response text - empty if connection failed
+