COMPONENT.php
WIKINDX : Bibliographic Management system.
Tags
Table of Contents
Functions
- extractComponentPackage() : bool
- Extract a WIKINDX Component Package to a folder
- extractComponentPackageDefinition() : array<string|int, mixed>
- Extract the component.json file of a WIKINDX Component Package to an array
Functions
extractComponentPackage()
Extract a WIKINDX Component Package to a folder
extractComponentPackage(string $ComponentPackageFile, string $DestinationFolder) : bool
Only Zip packages are supported.
If missing, the destination folder is created silently. otherwise its contents is overwritten and existing files that are not in the archive are deleted.
It is not necessary to delete the files of the previous component that occupies the same destination, which limits the loss of an already installed component if the operation does not complete.
However, it is always possible to end up in an inconsistent state if the operation failed between the decompression of two files. It should be very rare.
So a component should never create files and folders in its code directories otherwise they will be deleted. Use the private cache and data folders of a component for this task.*
BUGS: https://bugs.php.net/bug.php?id=79912 Phar crashs with an exception on Gzip/Bzip2 archives
Parameters
- $ComponentPackageFile : string
-
Absolute or relative path to an archive file created with \FILE\createComponentPackage
- $DestinationFolder : string
-
Absolute or relative path of a folder where the archive is extracted
Return values
bool —TRUE on success, FALSE otherwise
extractComponentPackageDefinition()
Extract the component.json file of a WIKINDX Component Package to an array
extractComponentPackageDefinition(string $ComponentPackageFile) : array<string|int, mixed>
Only Zip packages are supported.
The component.json file is read in memory before parsing.
Parameters
- $ComponentPackageFile : string
-
Absolute or relative path to an archive file created with \FILE\createComponentPackage
Return values
array<string|int, mixed> —Structured definition of the component