Skip to content

Instantly share code, notes, and snippets.

@hypeJunction
Created April 23, 2018 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hypeJunction/b1f89b829dfa669974cc465a46d3ab07 to your computer and use it in GitHub Desktop.
Save hypeJunction/b1f89b829dfa669974cc465a46d3ab07 to your computer and use it in GitHub Desktop.
Elgg project management

The easiest way to install and manage your Elgg project

Step 1. Install Composer

https://getcomposer.org/download/

Step 2. Intall Elgg as a Composer Project

composer self-update
composer global require fxp/composer-asset-plugin
composer create-project elgg/starter-project:dev-master ./path/to/my/project
cd ./path/to/my/project
composer install

## go to your browser and install Elgg via the installation interface

Step 3. Setup version controls

cd ./path/to/my/project
git init
git add .
git commit -a -m 'Initial commit'
git remote add origin <git repository url>
git push -u origin master

Step 3. Install plugins

Install plugins as composer depencies. This assumes that a plugin has been registered on https://packagist.org/

composer install hypejunction/hypefeed
composer install hypejunction/hypeinteractions
# whatever else you need

Step 4. Commit

Make sure composer.lock is not ignored in .gitignore

git add .
git commit -a -m 'Add new plugins'
git push origin master

Step 5. Deploy to production

Initial Deploy

cd ./path/to/www

# you can also use git clone
git init
git remote add origin <git repository url>
git pull origin master

composer install

Subsequent Deploys

cd ./path/to/www
git pull origin master

# never run composer update in production
composer install

Working on plugin repositories during project development

It happens often that you want to make pull requests or update your plugins while you are working on a project. What I do is require plugins with --prefer-source flag.

composer require hypejunction/hypefeed --prefer-source

# make some changes
cd hypeFeed
git checkout master
git commit -a -m 'Changes made'
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment