Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2 from Raruto/composer-install
Browse files Browse the repository at this point in the history
Add composer installation instructions
  • Loading branch information
pauloamgomes authored Mar 22, 2021
2 parents 8ae0857 + c0e7516 commit 35aa8fd
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
composer.lock
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,44 @@ That means if the user closes by mistake the browser (by mistake or by a system

## Installation

Download and unpack add-on to `<cockpit-folder>/addons/Autosave` folder.
### Manual

Download [latest release](https://github.com/pauloamgomes/CockpitCMS-Autosave) and extract to `COCKPIT_PATH/addons/Autosave` directory

### Git

```sh
git clone https://github.com/pauloamgomes/CockpitCMS-Autosave.git ./addons/Autosave
```

### Cockpit CLI

```sh
php ./cp install/addon --name Autosave --url https://github.com/pauloamgomes/CockpitCMS-Autosave.git
```

### Composer

1. Make sure path to cockpit addons is defined in your projects' _composer.json_ file:

```json
{
"name": "MY_PROJECT",
"extra": {
"installer-paths": {
"cockpit/addons/{$name}": ["type:cockpit-module"]
}
}
}
```

2. In your project root run:

```sh
composer require pauloamgomes/cockpitcms-autosave
```

---

## Configuration

Expand Down
11 changes: 10 additions & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
<?php
/**
* Cockpit autosave editor addon
*
* @author Paulo Gomes
* @package CockpitCMS-Autosave
* @license MIT
*
* @source https://github.com/pauloamgomes/CockpitCMS-Autosave
* @see { README.md } for usage info.
*/

if (COCKPIT_ADMIN && !COCKPIT_API_REQUEST) {
$this->module('autosave')->extend([
Expand Down Expand Up @@ -87,4 +97,3 @@
if (COCKPIT_API_REQUEST) {
include_once __DIR__ . '/actions.php';
}

25 changes: 25 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "pauloamgomes/cockpitcms-autosave",
"description": "Autosave addon for Cockpit CMS, provides autosave capabilities for collections and singletons",
"keywords": ["cms", "headless", "api", "cockpit", "autosave-addon"],
"homepage": "https://github.com/pauloamgomes/CockpitCMS-Autosave",
"license": "MIT",
"type": "cockpit-module",
"authors": [
{
"name": "Paulo Gomes",
"email": "pauloamgomes@gmail.com",
"homepage": "https://www.pauloamgomes.net"
}
],
"require": {
"php": ">= 7.3",
"composer/installers": "^1.10"
},
"suggest": {
"aheinze/cockpit": "Please install Cockpit before installing this addon"
},
"extra": {
"installer-name": "Autosave"
}
}

0 comments on commit 35aa8fd

Please sign in to comment.