DEV Community

Mohan Upadhyay for The Coders Blog

Posted on • Originally published at thecodersblog.com on

Simple and Quick Guide to Install and Manage Elgg Project

Elgg is a PHP based open-source software used for social networking in individuals and organizations. It has all the component needed to create an online social environment such as blogging, microblogging, file sharing, networking, group and number of other feature.

Let’s dive into the setup process.

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

Enter fullscreen mode Exit fullscreen mode

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

Enter fullscreen mode Exit fullscreen mode

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

Enter fullscreen mode Exit fullscreen mode

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

Enter fullscreen mode Exit fullscreen mode

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

Enter fullscreen mode Exit fullscreen mode

Subsequent Deploys

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

# never run composer update in production
composer install

Enter fullscreen mode Exit fullscreen mode

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

Enter fullscreen mode Exit fullscreen mode
References:
  1. Image: Unsplash
  2. Elgg officail Guide.

Top comments (0)