Skip to content

Commit ab99a66

Browse files
committed
More readme details.
1 parent 485942e commit ab99a66

File tree

4 files changed

+77
-5
lines changed

4 files changed

+77
-5
lines changed

.travis.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
language: php
2+
3+
php:
4+
- 7.0
5+
- 7.1
6+
7+
env:
8+
global:
9+
- secure:
10+
11+
before_install:
12+
- travis_retry composer self-update
13+
14+
install:
15+
- travis_retry composer install --no-interaction --prefer-dist
16+
17+
script:
18+
- php vendor/bin/phpunit

README.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
1-
# Azure File Storage Filesystem Driver for Laravel 5
21

3-
Still under development, but fundtional.
2+
[![GitHub issues](https://img.shields.io/github/issues/academe/laravel-azure-file-storage-driver.svg)](https://github.com/academe/laravel-azure-file-storage-driver/issues)
3+
[![GitHub license](https://img.shields.io/github/license/academe/laravel-azure-file-storage-driver.svg)](https://github.com/academe/laravel-azure-file-storage-driver/blob/master/LICENCE)
4+
5+
# Microsoft Azure File Storage Filesystem Driver for Laravel 5
6+
7+
This package allows Microsoft Azure File Storage
8+
to be used as a filesystem in laravel 5.
49

510
## Installation
611

7-
TODO: Laravel 5.5+ and earlier versions.
12+
academe/laravel-azure-file-storage-driver
13+
14+
## Usage
15+
16+
If you're on Laravel 5.4 or earlier, add the service provider in your `config/app.php`:
17+
18+
'providers' => [
19+
...
20+
Academe\Laravel\AzureFileStorageDriver\ServiceProvider::class,
21+
...
22+
],
23+
24+
For Laravel 5.5+ this step is not necessary.
825

9-
## Configuration in `config/filesystems.php`:
26+
## Configuration
27+
28+
Add the following to `config/filesystems.php`:
1029

1130
```php
1231
[
@@ -35,6 +54,12 @@ TODO: Laravel 5.5+ and earlier versions.
3554
];
3655
```
3756

57+
If you want to use multiple Azure file storage shares, then create additional
58+
entries in the `disks` array with the appropriate settings for each share.
59+
60+
An example list of environment variable entries can be found in `.env.example`.
61+
You can add that to your `.env` file and add your credentials there.
62+
3863
## Usage
3964

4065
See [the Laravel documentation](https://laravel.com/docs/5.5/filesystem)
@@ -47,6 +72,7 @@ use Storage;
4772
// List all files recursively from the root of the Azure share:
4873
4974
$files = Storage::disk('azure-file-storage')->listAll();
75+
dump($files);
5076
5177
// Example:
5278
// array:25 [▼

phpunit.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit backupGlobals="false"
3+
backupStaticAttributes="false"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="false"
10+
stopOnFailure="false">
11+
<testsuites>
12+
<testsuite name="Application Test Suite">
13+
<directory suffix="Test.php">./tests</directory>
14+
</testsuite>
15+
</testsuites>
16+
</phpunit>

src/ServiceProvider.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
namespace Academe\Laravel\AzureFileStorageDriver;
44

5+
/**
6+
* laravel Service Provider.
7+
*/
8+
59
use Storage;
610
use League\Flysystem\Filesystem;
711

@@ -11,12 +15,20 @@
1115

1216
class ServiceProvider extends ServiceProviderContract
1317
{
18+
/**
19+
* @var string The name of the driver.
20+
*/
21+
const DRIVER_NAME = 'azure-file-storage';
22+
1423
/**
1524
* Bootstrap the application services.
25+
* Extend the storage filesystem withe the new driver.
26+
*
27+
* @return void
1628
*/
1729
public function boot()
1830
{
19-
Storage::extend('azure-file-storage', function ($app, $config) {
31+
Storage::extend(self::DRIVER_NAME, function ($app, $config) {
2032
$connectionString = sprintf(
2133
'DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s',
2234
$config['storageAccount'],

0 commit comments

Comments
 (0)