Code Monkey home page Code Monkey logo

pathogen's People

Contributors

darianbr avatar ezzatron avatar rixbeck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

bolt mschop

pathogen's Issues

Home directory resolution system

It's a common use case for paths to use ~ or ~user to indicate home directories. Pathogen should have a system for dealing with these cases.

Some things that probably need to happen:

  1. FileSystemPathFactoryInterface includes methods to get the current working directory, and system temporary directory. It probably needs to be expanded to have methods to get the current home directory, and the home directory of a specified user. They should always internally use the 'platform' path factory - this just ensures that they are Windows paths on Windows, and Unix-style on anything else.
  2. A new resolver at FileSystem\Resolver\HomeDirectoryResolver that implements the newly refactored PathResolverInterface and uses an instance of PlatformFileSystemPathFactory to produce home directory paths using the new methods created in 1. This resolver could probably cache home directory lookups, I assume they're unlikely to change at runtime.

This task could be tackled at the same time as #36.

Refactor resolver interfaces

BoundPathResolverInterface is not the best name. There are other circumstances where a path may need to be resolved without need of a base path (against the environment, for example).

Perhaps the interfaces should be PathResolverInterface for something that simply accepts a path and returns a resolved path with no need for other parameters, and BasePathResolverInterface for the type that takes a base path to resolve against.

Subdirectory/relative path extraction

Is it currently possible to do a "reverse resolving"? Get relative subdirectory path from base path and absolute path?

$basePath = '/var/www/';
$absolutePath = FileSystemPath::fromString('/var/www/project/public/index.php');
$relativePath = $absolutePath->getRelativePath($basePath);
// project/public/index.php

Project homepage displays wrong branch/outdated docs

The github landing page for pathogen displays the dev branch and it's outdated documentation. Example: the ::fromString(...) calls we're removed some time ago, but are the main instantiation method shown on the front page's readme. Thanks!

Support for relative Windows paths with drive letters

Yes, this really is a thing. Example:

D:.\foo

means .\foo relative to the current working directory for D: drive. Windows paths have a current working directory per drive it seems. Fortunately (or unfortunately), there is no way to retrieve the CWD for a drive other than the current one via PHP.

So, in combination with #30, a few things need to happen to improve Windows path support:

  • Relative Windows paths need to store an optional drive
  • Relative Windows paths need an additional property to mark them as 'absolute, but driveless'
  • Absolute Windows paths need to make the drive mandatory
  • A custom Windows path resolver needs to be implemented to handle the drive-related logic. Something like:
    • If the path is absolute, return immediately.
    • If the relative path is 'driveless absolute', set the drive to the current drive and return.
    • If the relative path has a drive, and it's different to the current drive, resolve against the root of the drive specified in the path.
    • Resolve all other cases against the CWD.

Re-implement working directory resolver

The previous version simply took a static 'working directory' path that never changed. Pretty useless. This version needs to implement the recently refactored PathResolverInterface and fetch the current working directory from a PlatformFileSystemPathFactory on each resolution. Closely tied to #33.

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.