2017 © Pedro PelĂĄez
 

library flysystem-local-symlink-plugin

Local symlink plugin for Flysystem.

image

falc/flysystem-local-symlink-plugin

Local symlink plugin for Flysystem.

  • Sunday, December 13, 2015
  • by Falc
  • Repository
  • 1 Watchers
  • 9 Stars
  • 6,878 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 25 % Grown

The README.md

Flysystem Local Symlink Plugin

Requirements

Installation

Using composer:, (*1)

composer require falc/flysystem-local-symlink-plugin

Or add it manually:, (*2)

{
    "require": {
        "falc/flysystem-local-symlink-plugin": "1.*"
    }
}

Usage

This plugin requires a Filesystem instance using the Local adapter., (*3)

use Falc\Flysystem\Plugin\Symlink\Local as LocalSymlinkPlugin;
use League\Flysystem\Adapter\Local as LocalAdapter;
use League\Flysystem\Filesystem;

$filesystem = new Filesystem(new LocalAdapter('/'));

Use symlink($target, $symlink) to create a symlink., (*4)

$filesystem->addPlugin(new LocalSymlinkPlugin\Symlink());

$success = $filesystem->symlink('/tmp/some/target', '/tmp/symlink');

Use deleteSymlink($symlink) to delete a symlink., (*5)

$filesystem->addPlugin(new LocalSymlinkPlugin\DeleteSymlink());

$success = $filesystem->deleteSymlink('/tmp/symlink');

Use isSymlink($filename) to check if a file exists and is a symlink., (*6)

$filesystem->addPlugin(new LocalSymlinkPlugin\IsSymlink());

$isSymlink = $filesystem->isSymlink('/tmp/symlink');

Full and relative paths

The above examples show how to create symlinks using / as root and full paths. But it is possible to use relative paths too., (*7)

use Falc\Flysystem\Plugin\Symlink\Local as LocalSymlinkPlugin;
use League\Flysystem\Adapter\Local as LocalAdapter;
use League\Flysystem\Filesystem;

$filesystem = new Filesystem(new LocalAdapter('/home/falc'));
$filesystem->addPlugin(new LocalSymlinkPlugin\Symlink());
$filesystem->addPlugin(new LocalSymlinkPlugin\IsSymlink());
$filesystem->addPlugin(new LocalSymlinkPlugin\DeleteSymlink());

// Result: /home/falc/flytest -> /home/falc/projects/cli/flytest
$filesystem->symlink('projects/cli/flytest', 'flytest');

// It is possible to check it or delete it in the same way:
$isSymlink = $filesystem->isSymlink('flytest');
$filesystem->deleteSymlink('flytest');

The Versions

13/12 2015

dev-master

9999999-dev

Local symlink plugin for Flysystem.

  Sources   Download

MIT

The Requires

 

plugin flysystem local symlink

13/12 2015

v1.2.0

1.2.0.0

Local symlink plugin for Flysystem.

  Sources   Download

MIT

The Requires

 

plugin flysystem local symlink

11/03 2015

v1.1.0

1.1.0.0

Local symlink plugin for Flysystem.

  Sources   Download

MIT

The Requires

 

plugin flysystem local symlink

27/01 2015

v1.0.0

1.0.0.0

Local symlink plugin for Flysystem.

  Sources   Download

MIT

The Requires

 

plugin flysystem local symlink