Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
sraka1 committed Aug 28, 2017
2 parents af304fd + 0a4f9cf commit fc28e32
Show file tree
Hide file tree
Showing 359 changed files with 18,190 additions and 45,394 deletions.
33 changes: 24 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,38 @@
# vendor libs
vendor/*

htrouter.phar
# config
src/xAPI/Config/*.yml
!src/xAPI/Config/Templates/*.yml

# file storage
storage/logs/*

storage/files/*
src/xAPI/View/V10/OAuth/.Cache/[A-z0-9]*
cache/*

# doc generator
sami.phar
docs/*

SamiConfig.php

cache/*
# phpBench
phpbench.phar
phpbench.phar.pubkey
phpbench.json

storage/*

src/xAPI/Config/Config.yml
benchmarks/*
!benchmarks/Example
!benchmarks/*.md
!benchmarks/autoload.php

# development
htrouter.phar
sftp-config.json

.DS_Store
dev/*

# linting, code standards
.php_cs.cache
phplint.sh

src/xAPI/View/V10/OAuth/Templates/*
40 changes: 14 additions & 26 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# How to Contribute

lxHive is developed by its community consisting of lxHive users, enthusiasts,
Brightcookie employees, customers, partners, and others. We strongly encourage you to
contribute to lxHive's open source efforts by implementing new features,
We strongly encourage you to contribute to lxHive's open source efforts by implementing new features,
enhancing existing features, and fixing bugs. We also welcome your participation
in writing documentation and guides.

To maintain code quality, all code changes are reviewed by a core set of lxHive project
maintainers, namely @sraka1 and @RoboSparrow.
maintainers.

As you have ideas for features you want to implement, follow the contribution
steps outlined in the sections, below. For more details on specific steps, and
Expand All @@ -16,46 +14,36 @@ Lastly, visit the links listed in the *Additional Resources* section, below.

## Getting Started

* Sign up for a [GitHub account](https://github.com/signup/free) (if you don't have one already) to be able to participate.
* [Create a new issue](https://github.com/Brightcookie/lxHive/issues/new) for your issue. If a ticket
already exists for the issue, participate via the existing ticket.
* Describe the issue clearly. If it is a bug, include steps to reproduce it.
* Select an appropriate category for the issue.
* Select the earliest version (or commit) of the product affected by the issue.
* Fork the lxHive repository.
* Select an appropriate label for the issue.

## Making Changes

* Ensure you have a working lxHive development environment. A quick startup guide on setting up an instance
is part of the README file included in this repository.
* Create a branch from an existing branch (typically the *development* branch) from
which you want to base your changes.
Use the following nomenclature when naming your branch:
* If you are working on a bugfix, prefix the branch name with bugfix-*
* If you are working on a new feature/improvement, prefix the branch name with feature-*
* If you are working solely on increasing ADL test compliance, prefix the branch name with compliance-*
* You will also notice some branches named release-x.y.z (where x.y.z is a valid semantic versioning version), which will be opened by the core maintainers in preparation for a new release (ironing out bugs out of new features before the release is made available).
* Fork the lxHive repository.
* Create a **new** branch from the affected existing branch.
* Commit logical units of work.
* Follow the [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md),
[PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md),
[PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) and
* Follow the [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md),
[PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md),
[PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) and
[Symfony](http://symfony.com/doc/current/contributing/code/standards.html) code standards.
* Include a reference to the issue (e.g. #13) in your commit messages.
For example:

Improve code readability - #13

* *Test* your changes thoroughly! Consider the wide variety of operating
systems, databases, application servers, and other related technologies. Make sure your changes in one environment don't break something in
another environment. See the [xAPITests](https://github.com/sraka1/xAPITests) and [xAPI_LRS_Test](https://github.com/adlnet/xAPI_LRS_Test)
repositories for details on executing automated tests against your test instance.
* *Test* your changes thoroughly! Consider the wide variety of operating systems, database versions, application servers, and other related technologies.

* Unit tests: see docs in `tests` folder
* [ADL Conformance Test Suite](https://github.com/adlnet/lrs-conformance-test-suite)
* [xAPITests](https://github.com/sraka1/xAPITests)

## Submitting Changes

* Push changes in your branch to your fork.
* [Create a pull request](https://github.com/Brightcookie/lxHive/compare) and mention the issue it fixes [as described here](https://github.com/blog/1506-closing-issues-via-pull-requests).
* You're done! Well, not quite ... be sure to respond to comments and questions
to your pull request until it is closed.
* You're done! Your changes will be reviewed. Please respond to comments and questions to your pull request until it is closed.

## Additional Resources

Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTORS.md

This file was deleted.

84 changes: 55 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@

# ![lxHive](./public/assets/images/lxHive.logo.png)

* v0.9.1
* supports xAPI specs <= 1.0.2

[![Circle CI](https://circleci.com/gh/Brightcookie/lxHive/tree/master.svg?style=svg)](https://circleci.com/gh/Brightcookie/lxHive/tree/master)

## <a name="introduction" />Introduction
* Current release: **0.10.0**
* Supports xAPI spec <= 1.0.3

[![CircleCI branch](https://img.shields.io/circleci/project/github/Brightcookie/lxHive/development.svg)](https://circleci.com/gh/Brightcookie/lxHive/tree/development)
[![lx-Test-Suite](https://img.shields.io/badge/lx--Test--Suite-82.75%25-yellowgreen.svg)](https://github.com/Brightcookie/lx-Test-Suite)
[![lrs-conformance-test-suite](https://img.shields.io/badge/lrs--conformance--test--suite-86.02%25-yellowgreen.svg)](https://github.com/adlnet/lrs-conformance-test-suite)
[![SensioLabs Insight](https://img.shields.io/sensiolabs/i/9e0e6f28-b099-4c84-ad85-ccf4de70d6a6.svg)](https://insight.sensiolabs.com/projects/9e0e6f28-b099-4c84-ad85-ccf4de70d6a6)
[![GitHub issues](https://img.shields.io/github/issues/Brightcookie/lxHive.svg)](https://github.com/Brightcookie/lxHive/issues)
[![GitHub forks](https://img.shields.io/github/forks/Brightcookie/lxHive.svg)](https://github.com/Brightcookie/lxHive/network)
[![GitHub stars](https://img.shields.io/github/stars/Brightcookie/lxHive.svg)](https://github.com/Brightcookie/lxHive/stargazers)
[![GitHub license](https://img.shields.io/badge/license-AGPL-blue.svg)](https://raw.githubusercontent.com/Brightcookie/lxHive/master/LICENSE.md)

> **Important note:** Current version (0.10.0) is **not compatible** with older lxHive versions. It is not possible to upgrade a legacy lxHive instance.
> This incompatibility is due to :
>
> * different server requirements
> * a changed database model
> * behavioural changes (permissions)
>
> See the [changelog](changelog.md) for more details. At the moment there are no plans to release an open source database migration script. Please [get in touch](https://www.brightcookie.com/contact-us/) with us should you need to migrate data.
## 1. <a name="introduction" />Introduction

**lxHive** is a fast and lightweight open source xAPI conformant Learning Record Store (LRS).
**lxHive** logs and returns activity statements as defined in the [Experience API specification](https://github.com/adlnet/xAPI-Spec) (formerly TinCan API) currently at xAPI Version 1.0.2.
Expand All @@ -15,18 +31,18 @@ The Experience API (also referred to as 'xAPI') is a learning software specifica

The results of learning experiences are stored in a Learning Record Store (LRS). The LRS is defined as part of the Experience API Specification and controls at its core the following functions:

1. authentication of authorised users
2. validation of compliance to the xAPI Standard
3. the storage of learning related data
4. retrieval of learning related data
1. Authentication of authorised users
2. Validation of compliance to the xAPI Standard
3. The storage of learning related data
4. Retrieval of learning related data

The application uses [MongoDB](https://www.mongodb.org/) and [PHP](http://php.net/) and should be easy to install on any web server. It supports Basic Authentication, OAuth 2.0 (Authorization Code Grant) and supports pluggable file storage mechanisms.

## <a name="license" />License
## 2. <a name="license" />License

* GNU GPL v3

## <a name="xAPi-Endpoints" />Document storage endpoints
## 3. <a name="xAPi-Endpoints" />Document storage endpoints

| endpoint | xAPI version | PUT | POST | GET | DELETE | Notes | Links
| --- | --- |:-----:|:-----:|:-----:|:------:| --- |---
Expand All @@ -40,28 +56,30 @@ The application uses [MongoDB](https://www.mongodb.org/) and [PHP](http://php.ne

* see our [wiki](https://github.com/Brightcookie/lxHive/wiki/List-of-xAPI-and-lxHive-Endpoints) for a complete list of lxHive endpoints

## <a name="installation" />Installation
## 4. <a name="installation" />Installation

### Requirements

* PHP >= 5.4, with [mongo extension](http://php.net/manual/en/mongo.installation.php) installed
* PHP >= 5.5.9, with [MongoDB extension](http://php.net/manual/en/class.mongodb.php) installed
* (optional) PHPUnit to run tests.
* .htaccess enabled (or similar HTTP rewrite function)
* [Composer](https://getcomposer.org/) installed
* [Mongo DB](https://www.mongodb.org/) installed (supports Mongo 3.x)
* [Mongo DB](https://www.mongodb.org/) installed (requires version >= 3.0)
* [OpenSSL](https://www.openssl.org/)

#### Notes:

* Make sure you have set the `date.timezone` setting in your php.ini
* lxHive >= 0.10.0 supports **PHP 7.x**
* since lxHive 0.10.0 we switched the PHP Mongo driver from `mongo` (deprecated) to `mongodb`

### Setup

* see also our Wiki for a comprehensive [step-bystep guide](https://github.com/Brightcookie/lxHive/wiki/Step-by-step:-Install-lxHive-and-setup-authentication-for-your-app)
* *Note: Check out our Wiki for a more comprehensive [step-by-step guide].(https://github.com/Brightcookie/lxHive/wiki/Step-by-step:-Install-lxHive-and-setup-authentication-for-your-app)*

#### 1. Application install and set-up

1. Install dependencies via `composer install`.
1. Install dependencies via `composer install --no-dev -o`.
2. Point your server's `DocumentRoot` directive to the `public` folder
3. Set up your database & client account:

Expand All @@ -71,10 +89,8 @@ The application uses [MongoDB](https://www.mongodb.org/) and [PHP](http://php.ne
$ cd /<path_to_application_root>
# View available commands
$ ./X
# Set up database
$ ./X setup:db
# Set up OAuth scopes
$ ./X setup:oauth
# Run the setup
$ ./X setup
# Create a new user
$ ./X user:create

Expand Down Expand Up @@ -114,17 +130,27 @@ Default file storage structure:
...
```

## 3. Development

### Documentation

* [Contributing guidelines](CONTRIBUTING.md)
* [lxHive Wiki](https://github.com/Brightcookie/lxHive-Internal/wiki)
* Compile code documentation: run `sh generate-docs.sh` from project root (file must be executable)

### Unit testing

* [Instructions](tests/readme.md)

## Documentation
### Benchmarking

See the Wiki and the `docs` directory for more detailed documentation.
* [Instructions](benchmarks/readme.md)

## Contributors
## 4. Contributors

The Brightcookie team
The [Brightcookie](https://www.brightcookie.com/) team

* Jakob Murko - systems architect, lead developer
* Leo Gaggl - creator, mentor, specs
* Kien Vu - legacy support, application development
* Matthew Smith - initial alpha prototype development & spec
* Joerg Boeselt - tests, specs, pm
* Leo Gaggl - creator, mentor, conformance
* Joerg Boeselt - development, tests, conformance, project management
* Matthew Smith - alpha prototype
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.1
0.10.0
69 changes: 29 additions & 40 deletions X
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of lxHive LRS - http://lxhive.org/
*
* Copyright (C) 2015 Brightcookie Pty Ltd
* Copyright (C) 2017 Brightcookie Pty Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -14,7 +14,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with lxHive. If not, see <http://www.gnu.org/licenses/>.
*
Expand All @@ -24,69 +24,58 @@
$argv = $_SERVER['argv'];

if (isset($argv[0]) && is_dir($argv[0])) {
$workingDirectory = $argv[0];
array_shift($argv);
$_SERVER['argv'] = $argv;
$workingDirectory = $argv[0];
array_shift($argv);
$_SERVER['argv'] = $argv;
} else {
$workingDirectory = __DIR__;
$workingDirectory = __DIR__;
}

if (!file_exists($workingDirectory . '/public/index.php')) {
echo 'You must run X from the root directory of your lxHive install or specify its correct path as the first argument!' . PHP_EOL;
exit;
echo 'You must run X from the root directory of your lxHive install or specify its correct path as the first argument!' . PHP_EOL;
exit;
}

if (!file_exists($workingDirectory . '/vendor/autoload.php')) {
echo 'You must run composer install before running X!' . PHP_EOL;
exit;
echo 'You must run composer install before running X!' . PHP_EOL;
exit;
}

require_once $workingDirectory . '/vendor/autoload.php';
require_once $workingDirectory . '/public/index.php';

use Symfony\Component\Console\Application;
use API\Bootstrap;
use API\Console\Application;
use API\Console\UserCreateCommand;
use API\Console\BasicTokenCreateCommand;
use API\Console\BasicTokenListCommand;
use API\Console\BasicTokenDeleteCommand;
use API\Console\BasicTokenExpireCommand;
use API\Console\OAuthClientCreateCommand;
use API\Console\OAuthClientListCommand;
use API\Console\AuthScopeCreateCommand;
use API\Console\SetupDbCommand;
use API\Console\SetupCommand;
use API\Console\SetupOAuthCommand;
use Sokil\Mongo\Migrator\Console\Command\Create as MigrationCreateCommand;
use Sokil\Mongo\Migrator\Console\Command\Init as MigrationInitCommand;
use Sokil\Mongo\Migrator\Console\Command\Migrate as MigrationMigrateCommand;
use Sokil\Mongo\Migrator\Console\Command\Rollback as MigrationRollbackCommand;
use Sokil\Mongo\Migrator\Console\Command\Status as MigrationStatusCommand;
use API\Console\LrsReportCommand;
use API\AppInitException;

// If container cannot be instantiated due to missing Config file, allow only Setup command to be executed!
try {
$bootstrapper = Bootstrap::factory(Bootstrap::Console);
$application = $bootstrapper->bootCliApp();
} catch (AppInitException $e) {
$application = new Application();
$application->add(new SetupCommand());
$application->add(new LrsReportCommand());
$application->run();
}

$application = new Application();
$application->add(new UserCreateCommand());
$application->add(new BasicTokenListCommand());
$application->add(new BasicTokenDeleteCommand());
$application->add(new BasicTokenExpireCommand());
$application->add(new BasicTokenCreateCommand());
$application->add(new OAuthClientCreateCommand());
$application->add(new OAuthClientListCommand());
$application->add(new AuthScopeCreateCommand());
$application->add(new SetupDbCommand());
$application->add(new SetupOAuthCommand());
$migrationCreateCommand = new MigrationCreateCommand();
$migrationCreateCommand->setName('db:migration:create');
$migrationInitCommand = new MigrationInitCommand();
$migrationInitCommand->setName('db:migration:init');
$migrationMigrateCommand = new MigrationMigrateCommand();
$migrationMigrateCommand->setName('db:migration:migrate');
$migrationRollbackCommand = new MigrationRollbackCommand();
$migrationRollbackCommand->setName('db:migration:rollback');
$migrationStatusCommand = new MigrationStatusCommand();
$migrationStatusCommand->setName('db:migration:status');
$application->add($migrationCreateCommand);
$application->add($migrationInitCommand);
$application->add($migrationMigrateCommand);
$application->add($migrationRollbackCommand);
$application->add($migrationStatusCommand);
$application->add(new SetupCommand());
$application->add(new LrsReportCommand());
$application->run();

?>
?>
File renamed without changes.
Loading

0 comments on commit fc28e32

Please sign in to comment.