Package Magic - Package Source Documentation

Dashboard > Extend concrete5 > Upload Package

Package magic can 'upload' packages from a range of sources. 

Validation of zip archive contents

Uplods are checked for a range of issues and rejected if any problems are found.

If an upload does not contain a concrete5 package or is incompatible with the concrete5 version, it will be rejected.

Further checks look at whether a package is cleanly built.You have checkbox control over which issues are detected, by ticking to ignore specific checks. Further checks can be added by speifying glob matches.

  • Ignore dot files    
  • Ignore __MACOSX    
  • Ignore Thumbs.db  
  • Ignore .sh and other shell scripts and batch files
  • Ignore executable file types such as .exe
  • Ignore file types containing non alphanumeric characters  
  • Ignore composer files
  • Ignore IDE project files
  • Do not check compilation
  • Allow current version to be overwritten
  • Skip validation for files matching *glob* patterns
  • Additional validation to reject files matching *glob* patterns

If you have a good reson for installing a package containing a file that fails one of these validation checks, you have two choices. You could disable the entire class of checks by deselecting the applicable checkbos. Or you can specify a glob match to exclude just that file from checks using "Skip validation for files matching". For example, if you want to allow .htaccess files, a glob pattern of */.htaccess would allow any subdirectory of the package to contain .htaccess files.

You can similarly specify additional validation through "Detect files matching". Here each line comprises a glob match for the check to apply, then text to use as an error message. For example, entering */Gruntfile.js unwanted Grunt will complain if the package contains a Grunfile.js and provide the error message "Unwanted Grunt".

After uploading

When a new package is successfully uplaoded, the package is immediately shown in the core Extend concrete5 > Add Functionality > Awaiting Installation section, ready for you to do any of Install, Apply Package Build Tools or even download a rebuilt archive without installing.

When an already installed package is uploaded, the default behaviour is to run the upgrade immediately. If that is not possible, the core Extend concrete5 > Update Add-ons page is loaded to run the upgrade.

Any update to a package source is made atomically. After running a Package Magic Upload, the package source will be either all the new source, or should the upload fail, all the old source.

[ Package Magic Starter ]

Package Source Plugins

Package Magic can load packages from sources provided by Package Source plugins.

Functionality can be extended by adding plugin classes for additional Package Sources. Package Source plugins are simple classes that provide the functionality to adapt Package Magic to alternative package sources. They should inherit from PackageSourcePluginBase. Details are provided by comments in the code.

Plugins can be added by placing the plugin classes at packages/anyPackageName/src/PackageMagic/PackageSources/Plugins/PluginName or application/src/PackageMagic/PackageSources/Plugins/PluginName. Plugins can also be similarly placed beneath any namespace declared in a package controller's AutoloaderRegistries.

[ Package Magic Starter ]

Direct Upload

Upload a package zip file.

Select a concrete5 package zip archive file to upload to this site from your own computer.

[ Package Magic ]

From FTP

Load a package zip file from an FTP source.

Load a package arhcive from an FTP or SFTP source. A further dialog manages a list of FTP hosts allowing hosts to be added, removed, edited and selected.

[ Package Magic ]

From FTP Repository

List package archives held in an FTP repository and select to load.

Load a package archive from an FTP or SFTP repository. As with From FTP, a further dialog manages a list of FTP hosts allowing hosts to be added, removed, edited and selected. This source provides a similar capability to From Local Repository, but for an FTP source. Once configured with an FTP or SFTP directory as the root of the repository, package archives will be selectable from the structure beneath that directory.

[ Package Magic ]

From File Manager

Choose a package zip file from the File Manager.

Select a concrete5 package zip archive file that has already been uploaded to the site using the File Manager. Allowed File Types must be configured to include .zip files.

You need to add the "zip" file extension to the Allowed File Types before you can use the From File Manager package source.

[ Package Magic ]

From Incoming

Select a package zip file from the incoming files directory.

When uploading files to a site by FTP, the usual FTP location is application/files/incoming. With this package source, any package archives in the application/files/incoming directory are listed and selectable for upload.

[ Package Magic ]

From Local Repository

List package archives held in a structured repository directory and select to load.

Once configured with a local system directory as the root of the repository, package archives will be selectable from the structure beneath that directory. The directory path must be directly accessible to the web server.

[ Package Magic ]

From URL

Get archive from URL or filepath.

Enter the URL or filepath from which a concrete5 package zip archive file can be copied to the server. If a filepath is entered, it must be directly accessible to the web server.