GithubHelp home page GithubHelp logo

khameleon's People

Contributors

niktux avatar

Watchers

 avatar  avatar

Forkers

nlenardou

khameleon's Issues

Add Directory::putFile

$dir = $fs->putDirectory('path/to/newdir');
$file = $dir->putFile('newfile');
echo $file->getPath(); // prints <rootDir>/path/to/newdir/newfile

Add CachedFileSystem

// idea
$fs = new CachedFileSystem(
    new Memcache\FileSystem(),
    new Local\FileSystem()
);

$fs->setConfig(new CacheConfiguration(/* ... */);

Add symbolic link concept

Handling from FileSystem object

Handling with paths

$link = $fs->putSymlink('path/to/mylink', 'path/to/target');
$fs->createLink('path/to/mylink', 'path/to/target');

Handling with objects

// creates path/to/linkName
$fs->link($fileObject, 'path/to/linkName');

// creates path/to/existingDir/<targetName>
$fs->link($fileObject, 'path/to/existingDir'); 

Handling from Directory object

Handling with paths

$link = $dir->putSymlink('linkName', 'path/to/target');

Handling with objects

$dir->link($targetObject, 'optionalLinkName');
$dir->link($targetObject);

Add DepthLimitIterator

$dir = $this->fs->get('path/to/dir');

$nearestChildren = new DepthLimitIterator($dir, 2); 

Add mounting point concept

$fs = new Composite\FileSystem(new Local\FileSystem());
$fs->mount('/cache', new Memcache\FileSystem());
$fs->mount('/data/shared', new Database\FileSystem());

All paths will go to local FS except :

  • /cache filetree which uses memcache FS
  • /data/shared filetree which uses Database FS

Implements Memory\FileSystem::removeDirectory

    /**
     * Remove recursively a directory
     *
     * @param string path
     * @throws \Khameleon\Exceptions\RemovalException
     * @throws \Khameleon\Exceptions\WrongNodeTypeException
     * @throws \Khameleon\Exceptions\InvalidMountingPointException
    */
    public function removeDirectory($path);

Add Directory::putDirectory

$dir = $fs->putDirectory('path/to/newdir');
$subdir = $dir->putDirectory('newsubdir');
echo $subdir->getPath(); // prints <rootDir>/path/to/newdir/newsubdir

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.