Download the PHP package dd/evolutioncms-libraries-ddinstaller without Composer
On this page you can find all versions of the php package dd/evolutioncms-libraries-ddinstaller. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download dd/evolutioncms-libraries-ddinstaller
More information about dd/evolutioncms-libraries-ddinstaller
Files in dd/evolutioncms-libraries-ddinstaller
Download dd/evolutioncms-libraries-ddinstaller
More information about dd/evolutioncms-libraries-ddinstaller
Files in dd/evolutioncms-libraries-ddinstaller
Vendor dd
Package evolutioncms-libraries-ddinstaller
Short Description The library for install and update snippets, plugins and libraries.
License
Package evolutioncms-libraries-ddinstaller
Short Description The library for install and update snippets, plugins and libraries.
License
Please rate this library. Is it a good library?
Informations about the package evolutioncms-libraries-ddinstaller
(MODX)EvolutionCMS.libraries.ddInstaller
The library for installing and updating snippets, plugins, and libraries from GitHub repositories.
How it works
Terms
- “Site” — your site.
- “Resource” — snippet, plugin or library that you want to install or update.
Algorithm
- First, the library downloads the repository archive of Resource from GitHub using API and temporary saves it in
assets/cache/ddInstaller/
. - Then it decides whether to install / update Resource or not.
To do this it looks at thecomposer.json
file from the archive and compares withcomposer.json
of Resource on your Site:- Resource will be installed or updated if:
composer.json
in the archive:- Is exist.
- And not empty.
- And contains the valid
version
field.
composer.json
on Site:- Is not exist.
- Or empty.
- Or doesn't contain the
version
field. - Or the
version
field is invalid.
version
in the archive >version
on Site.
- Otherwise, Resource will not be installed.
- Resource will be installed or updated if:
- To avoid accumulation of trash files, the library removes the existing Resource folder before installation and creates it again (e. g.
assets/snippets/ddGetDate/
). - If Resource is a snippet or plugin, the library tries to find its DB file (e. g.
ddGetDate_snippet.php
) and installs / upates it to DB. - Finally, the library copies remaining files and subfolders to the Resource folder.
Requires
- PHP >= 7.4
- (MODX)EvolutionCMS >= 1.1
- (MODX)EvolutionCMS.libraries.ddTools >= 0.62
- (MODX)EvolutionCMS.snippets.ddMakeHttpRequest >= 2.3
Installation
Elements → Manage Files:
- Create a new folder
assets/libs/ddInstaller/
. - Extract the archive to the folder.
Parameters description
\DDInstaller::install($params)
Installs or updates needed snippet, plugin, or library.
-
$params
- Description: Parameters, the pass-by-name style is used.
- Valid values:
arrayAssociative
object
stringJsonObject
— as JSONstringHjsonObject
— as HJSONstringQueryFormatted
— as Query string
- Required
-
$params->url
- Description: Resource GitHub URL.
- E. g.
'https://github.com/DivanDesign/EvolutionCMS.snippets.ddGetDate'
- E. g.
- Valid values:
stringUrl
- Required
- Description: Resource GitHub URL.
$params->type
- Description: Resource type.
- The parameter is case insensitive.
- If
$params->url
contain the following words, you can avoid this parameter and the method will detect type automatically:'snippet'
,'snippets'
—'snippet'
'plugin'
,'plugins'
—'plugin'
'library'
,'libraries'
—'library'
- Valid values:
'snippet'
'plugin'
'library'
- any empty value — will be auto detected from
$params->url
- Default value: —
- Description: Resource type.
Returns
$result
- Description: Installation status.
- Valid values:
true
— if the resource is installed or updated successfullyfalse
— if something went wrong or the resource on Site is already up to date
Examples
Install or update the ddGetDate
snippet
Just run the following PHP code in your sources or Console:
- If
ddGetDate
is not exist on your Site, the library will just install it. - If
ddGetDate
is already exist on your Site, the library will check it version and update it if needed.
Links
All versions of evolutioncms-libraries-ddinstaller with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.4.0
dd/evolutioncms-libraries-ddtools Version >=0.62.0
dd/evolutioncms-snippets-ddmakehttprequest Version >=2.3.0
dd/evolutioncms-libraries-ddtools Version >=0.62.0
dd/evolutioncms-snippets-ddmakehttprequest Version >=2.3.0
The package dd/evolutioncms-libraries-ddinstaller contains the following files
Loading the files please wait ....