Download the PHP package automad/extension-skeleton without Composer

On this page you can find all versions of the php package automad/extension-skeleton. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package extension-skeleton

Automad Extension Skeleton

You can use this package as a Composer package skeleton for new Automad extensions. Follow the steps below to get started. Note that this guide only shows one strategy and tries to help inexperienced developers to understand the basics of package development. In case you are already familiar with Composer you will probably have your own workflow.

1. Create a Composer Package

Before starting to develop the actual extension, the package skeleton has to be created in a temporary location. Your extension will be cloned to the packages directory by Composer in a later step to create the autoloader on installation. Use the following command to create a new extension skeleton in a directory called temp somewhere on your computer:

composer create-project automad/extension-skeleton temp

2. Initialize a Repository

Change to the temp directory and initialize a new Mercurial or Git repository.

3. Edit The composer.json file

Edit the name and description fields in the composer.json. To install extensions to the packages directory and make autoloading work, the following fields are required in an extension's composer.json file as well and should not be changed:

{
    "type": "automad-package",
    "keywords": ["extension"],
    "require": {
        "automad/package-installer": "^1.1"
    },
    "autoload": {
        "classmap": [""]
    }
}

4. Rename and Edit The Class File

Before publishing the extension, the structure of the class file has to be defined to enable Composer to create the autoloader when the package is installed. The actual development of the extension is done in a later step. Note that it is good practice to use a combination of YourVendor/YourExtension to call extensions in Automad templates and set up the PHP namespace accordingly:

namespace YourVendor;
class YourExtension {
    public function YourExtension($Automad, $options) {
        ...
    }
}

Also rename the file accordingly to follow the Composer naming convention. Such an extension could then be used later in templates like:

<@ YourVendor/YourExtension { key: 'value' } @>

5. Publish Your Extension

Commit and push your new package to Bitbucket or GitHub. The temporary repository can be removed now. Follow the guide on Packagist to publish your extension.

6. Require Your Extension

The actual development of the extension has to be done within the packages directory of an Automad installation. Therefore navigate to the base directory of Automad and require your package like this:

composer require vendor/package:@dev

The package will then be installed and an autoloader will be created by Composer. Note that "@dev" is needed to clone the repository to be able to commit and push your changes.


All versions of extension-skeleton with dependencies

PHP Build Version
Package Version
Requires automad/package-installer Version ^1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package automad/extension-skeleton contains the following files

Loading the files please wait ....