2017 © Pedro Peláez
 

library laravel-storage-safe

image

pallares/laravel-storage-safe

  • Wednesday, October 25, 2017
  • by skyrpex
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,305 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 31 % Grown

The README.md

Laravel Storage Safe

This package offers a storage-safe application to substitute the one that comes with Laravel 5.2., (*1)

A storage-safe application creates the required storage directories in a temporary directory. This directory is named using a hash of the user ID who executes the script and the absolute path to the original application., (*2)

Installation

composer require pallares/laravel-storage-safe, (*3)

Usage

It is NOT recommended to use this application directly in production environments, as it will slow down the startup process., (*4)

In order to use it with minimal impact, please amend the bootstrap/app.php file:, (*5)

// ...

// Laravel may fail to use the storage if the user who executes
// the script is different from the user who owns this file.
$app = function_exists('posix_geteuid') && (posix_geteuid() !== fileowner(__FILE__))
    ? new Pallares\Laravel\StorageSafe\Application(realpath(__DIR__.'/../'))
    : new Illuminate\Foundation\Application(realpath(__DIR__.'/../'));

// ...

The snippet above will use the storage-safe application on Posix systems and only when the user that executes the script is different than the user of the current file., (*6)

Of course, you can use your own methods to check this scenario. For example, I can safely tell that I'll need the storage-safe app if the directory where the code is begins with /home/. This check is faster than calling posix_* and fileowner., (*7)

Why this package?

Chances are that you don't need this package. I do because I have certain environments where the Apache's daemon user writes inside my current app's storage., (*8)

Chmod'ing the storage directory won't solve my problem as I'm not a sudo'er, so I can't remove deamon's files 💩., (*9)

The Versions

25/10 2017

dev-master

9999999-dev

  Sources   Download

The Requires

 

The Development Requires

25/10 2017

3.0.0

3.0.0.0

  Sources   Download

The Requires

 

The Development Requires

16/08 2017

v3.x-dev

3.9999999.9999999.9999999-dev

  Sources   Download

The Requires

 

The Development Requires

10/08 2017

v2.x-dev

2.9999999.9999999.9999999-dev

  Sources   Download

The Requires

 

The Development Requires

10/08 2017

2.1.0

2.1.0.0

  Sources   Download

The Requires

 

The Development Requires

11/07 2017

2.0.0

2.0.0.0

  Sources   Download

The Requires

 

The Development Requires

10/07 2017

1.0.1

1.0.1.0

  Sources   Download

The Requires

 

The Development Requires

10/07 2017

1.0.0

1.0.0.0

  Sources   Download

The Requires

 

The Development Requires