Skip to content

Commit 34c261b

Browse files
committed
Merge pull request #722 from LearningLocker/develop
v1.10.0
2 parents aae7d4b + 40adae0 commit 34c261b

File tree

11 files changed

+1127
-6
lines changed

11 files changed

+1127
-6
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.9.0
1+
1.10.0

app/controllers/ReportingController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function statements($lrs_id, $report_id) {
110110
public function typeahead($lrs, $segment, $query){
111111
$options = self::$segments[$segment];
112112
return Response::json($this->report->setQuery(
113-
$lrs,
113+
new \MongoId($lrs),
114114
$query,
115115
self::statementKey.$options['return'],
116116
self::statementKey.$options['query']
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php namespace Locker\Repository\File;
2+
use WindowsAzure\Common\ServicesBuilder;
3+
use League\Flysystem\Azure\AzureAdapter;
4+
5+
class AzureFlyRepository extends FlyRepository {
6+
7+
public function __construct(Callable $conf) {
8+
$endpoint = sprintf(
9+
$conf('FS_AZURE_PROTOCOL'),
10+
$conf('FS_AZURE_USERNAME'),
11+
conf('FS_AZURE_API_KEY')
12+
);
13+
$blobRestProxy = ServicesBuilder::getInstance()->createBlobService($endpoint);
14+
$adapter = new AzureAdapter($blobRestProxy, conf('FS_AZURE_CONTAINER'));
15+
$this->constructFileSystem($adapter);
16+
}
17+
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php namespace Locker\Repository\File;
2+
use Barracuda\Copy\API as CopyAPI;
3+
use League\Flysystem\Copy\CopyAdapter as CopyAdapter;
4+
5+
class CopyFlyRepository extends FlyRepository {
6+
7+
public function __construct(Callable $conf) {
8+
$client = new API(
9+
$conf('FS_COPY_CONSUMER_KEY'),
10+
$conf('FS_COPY_CONSUMER_SECRET'),
11+
$conf('FS_COPY_ACCESS_TOKEN'),
12+
$conf('FS_COPY_TOKEN_SECRET')
13+
);
14+
$adapter = new CopyAdapter($client, $conf('FS_COPY_PREFIX'));
15+
$this->constructFileSystem($adapter);
16+
}
17+
18+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php namespace Locker\Repository\File;
2+
use Dropbox\Client as DropboxClient;
3+
use League\Flysystem\Dropbox\DropboxAdapter as DropboxAdapter;
4+
5+
class DropboxFlyRepository extends FlyRepository {
6+
7+
public function __construct(Callable $conf) {
8+
$client = new DropboxClient($conf('FS_DROPBOX_ACCESS_TOKEN'), $conf('FS_DROPBOX_APP_SECRET'));
9+
$adapter = new DropboxAdapter($client, [$conf('FS_DROPBOX_PREFIX')]);
10+
$this->constructFileSystem($adapter);
11+
}
12+
13+
}

app/locker/repository/File/Factory.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ public static function createRepo($repo) {
1212
$repos = [
1313
'Local' => 'LocalFlyRepository',
1414
'Rackspace' => 'RackspaceFlyRepository',
15+
'Copy' => 'CopyFlyRepository',
16+
'Dropbox' => 'DropboxFlyRepository',
17+
'Azure' => 'AzureFlyRepository',
18+
'S3V3' => 'S3V3FlyRepository',
1519
];
1620
$repo = ucfirst(strtolower($repo));
1721
$conf = function ($var) {
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php namespace Locker\Repository\File;
2+
use Aws\S3\S3Client as S3Client;
3+
use League\Flysystem\AwsS3v3\AwsS3Adapter as AwsS3Adapter;
4+
5+
class S3V3FlyRepository extends FlyRepository {
6+
7+
public function __construct(Callable $conf) {
8+
$client = S3Client::factory([
9+
'credentials' => [
10+
'key' => $conf('FS_S3V3_KEY'),
11+
'secret' => $conf('FS_S3V3_SECRET'),
12+
],
13+
'region' => $conf('FS_S3V3_REGION'),
14+
'version' => $conf('FS_S3V3_VERSION'),
15+
]);
16+
17+
$adapter = new AwsS3Adapter($client, $conf('FS_S3V3_BUCKET'), $conf('FS_S3V3_PREFIX'));
18+
$this->constructFileSystem($adapter);
19+
}
20+
21+
}

app/locker/repository/File/readme.md

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ This page documents how to use different storage adapters in Learning Locker. Th
33

44
- [Local](#local)
55
- [Rackspace](#rackspace)
6+
- [Copy.com](#copycom)
7+
- [Dropbox](#dropbox)
8+
- [Azure](#azure)
9+
- [AWS S3 V3](#aws-s3-v3)
610

711
### Local
812
Your .env.local.php file should look something like this.
@@ -39,8 +43,72 @@ If you're migrating from another file repository (i.e. "Local"), you'll need to
3943
php artisan ll:file-repo Rackspace -f Local
4044
```
4145

46+
### Copy.com
47+
Your .env.local.php file should look something like this.
48+
```php
49+
'FS_REPO' => 'Copy',
50+
'FS_COPY_CONSUMER_KEY' => 'YOUR CONSUMER KEY',
51+
'FS_COPY_CONSUMER_SECRET' => 'YOUR CONSUMER SECRET',
52+
'FS_COPY_ACCESS_TOKEN' => 'YOUR ACCESS TOKEN',
53+
'FS_COPY_TOKEN_SECRET' => 'YOUR TOKEN SECRET',
54+
'FS_COPY_PREFIX' => 'YOUR PREFIX',
55+
```
56+
57+
If you're migrating from another file repository (i.e. "Local"), you'll need to run the command below.
58+
59+
```shell
60+
php artisan ll:file-repo Copy -f Local
61+
```
62+
63+
### Dropbox
64+
Your .env.local.php file should look something like this.
65+
```php
66+
'FS_REPO' => 'Dropbox',
67+
'FS_DROPBOX_ACCESS_TOKEN' => 'YOUR ACCESS TOKEN',
68+
'FS_DROPBOX_APP_SECRET' => 'YOUR APP SECRET',
69+
'FS_DROPBOX_PREFIX' => 'YOUR PREFIX',
70+
```
71+
72+
If you're migrating from another file repository (i.e. "Local"), you'll need to run the command below.
73+
74+
```shell
75+
php artisan ll:file-repo Dropbox -f Local
76+
```
77+
78+
### Azure
79+
Your .env.local.php file should look something like this.
80+
```php
81+
'FS_REPO' => 'Azure',
82+
'FS_AZURE_PROTOCOL' => 'DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s',
83+
'FS_AZURE_USERNAME' => 'YOUR USERNAME',
84+
'FS_AZURE_API_KEY' => 'YOUR API KEY',
85+
'FS_AZURE_CONTAINER' => 'YOUR CONTAINER',
86+
```
87+
88+
If you're migrating from another file repository (i.e. "Local"), you'll need to run the command below.
89+
```shell
90+
php artisan ll:file-repo Azure -f Local
91+
```
92+
93+
### AWS S3 V3
94+
Your .env.local.php file should look something like this.
95+
```php
96+
'FS_REPO' => 'S3V3',
97+
'FS_S3V3_KEY' => 'YOUR KEY',
98+
'FS_S3V3_SECRET' => 'YOUR SECRET',
99+
'FS_S3V3_REGION' => 'YOUR REGION',
100+
'FS_S3V3_VERSION' => 'YOUR VERSION',
101+
'FS_S3V3_BUCKET' => 'YOUR BUCKET',
102+
'FS_S3V3_PREFIX' => 'YOUR PREFIX',
103+
```
104+
105+
If you're migrating from another file repository (i.e. "Local"), you'll need to run the command below.
106+
```shell
107+
php artisan ll:file-repo S3V3 -f Local
108+
```
109+
42110
### Useful Development Links
43111
- http://docs.rackspace.com/sdks/api/php/class-OpenCloud.Rackspace.html
44112
- http://flysystem.thephpleague.com/api/
45113
- https://github.com/thephpleague/flysystem-aws-s3-v2/issues/3
46-
- https://github.com/thephpleague/flysystem-rackspace/issues/7
114+
- https://github.com/thephpleague/flysystem-rackspace/issues/7

app/views/partials/reporting/statements.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
@section('buttons')
3232
<a id="edit" href="{{ route('reporting.index', [$report->lrs_id]) }}#{{$report->_id}}/edit" class="btn btn-info"><i class="icon icon-pencil"></i> {{ Lang::get('site.edit') }}</a>
33-
<a id="graph" data-toggle="tooltip" data-placement="top" title="View a graph of statements that match this report" href="{{ route('reporting.index', [$report->lrs]) }}#{{$report->_id}}/graph" class="btn btn-success"><i class="icon icon-signal"></i> {{ Lang::get('reporting.graph') }}</a>
33+
<a id="graph" data-toggle="tooltip" data-placement="top" title="View a graph of statements that match this report" href="{{ route('reporting.index', [$report->lrs_id]) }}#{{$report->_id}}/graph" class="btn btn-success"><i class="icon icon-signal"></i> {{ Lang::get('reporting.graph') }}</a>
3434
@stop
3535

3636
@section('footer')

composer.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
{
3030
"type": "vcs",
3131
"url": "[email protected]:LearningLocker/oauth2-server-laravel"
32+
},
33+
{
34+
"type": "pear",
35+
"url": "http://pear.php.net"
3236
}
3337
],
3438
"require": {
@@ -45,7 +49,11 @@
4549
"bshaffer/oauth2-server-httpfoundation-bridge": "1.1.x",
4650
"jenssegers/mongodb-session": "~1.0",
4751
"league/flysystem": "~1.0",
48-
"league/flysystem-rackspace": "^1.0"
52+
"league/flysystem-rackspace": "^1.0",
53+
"league/flysystem-copy": "^1.0",
54+
"league/flysystem-dropbox": "^1.0",
55+
"league/flysystem-azure": "^1.0",
56+
"league/flysystem-aws-s3-v3": "^1.0"
4957
},
5058
"require-dev": {
5159
"phpunit/phpunit": "4.1.*"

0 commit comments

Comments
 (0)