Download the PHP package metra/cascading-filesystem without Composer

On this page you can find all versions of the php package metra/cascading-filesystem. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cascading-filesystem

Cascading Filesystem

Installation

Add this package as a dependency in your project's composer.json configuration:

Now run composer install in the terminal at the root of your project.

You must then enable composer autoloading (if you haven't already) by requiring the autoload file:

For more information on composer please refer to its documentation.

Concept

The cascading filesystem (often abbreviated to CFS) is a collection of separate directory paths. The contents of these directories are virtually merged together creating the illusion that all of the the files are in the same directory. Files that are in latter defined directories take precedence over (and replace) files of the same location. This makes it is possible to overload any file simply by placing it in the same location of a latter directory.

For example, let's say we had these three directories in the cascading filesystem:

This would be the result when the directory's contents are virtually merged together:

Instantiation

Finding Files

This finds the file path with the highest precedence in the cascading filesystem and returns its absolute location:

You can also retrieve every location that the file exists, this would return an array of absolute file paths:

This lists the files of a directory in the merged CFS:

Modules

Modules are really just an extended concept of a directory in the cascading filesystem. The additional functionality a module gains is that it can be initialized and classes within it can be autoloaded. Modules provide an easy way to organize your code and make any part more shareable or transportable across different applications.

Initialization

To initialize all of the enabled modules in the cascading filesystem:

This should be done before you start using the modules as they may have prerequisites which are fulfilled by initialization.

Specification

If you would like your module to be initialized you must add an init.php file at the root. When the user initializes all of their modules, this init file will be included into the PHP script. This is the ideal place to execute any PHP code necessary for the module to function.

Autoloading

To enable the autoloading of classes inside of modules you must first register the autoloader class by executing its register method:

There is also a backwards compatibility autoloader for module classes which still use the old file naming convention (lowercase):

Now the autoloader is registered you can go ahead and use any classes as if they're already included. There is also an unregister() method for unregistering an autoloader after its registration. For more precise control over registering an autoloader, you may enable its autoload method directly using spl_autoload_register().

Specification

All classes that need to be autoloaded must follow this specification:

  1. All classes must be placed in a classes/ directory at the root of the module.
  2. All classes must follow the PSR-0 standard.
    • All class names must be capitalized, e.g. Foo_Bar_Baz, Teapot, Hello_World.
    • The class's filename and location must match the class's name exactly (including case). For example, the class Foo_Bar_Baz must be located at classes/Foo/Bar/Baz.php.
    • Any underscore characters in the class name are converted to slashes.

If your classes do not follow this convention, they cannot be autoloaded by this package. You would have to manually include your classes or create your own autoloader.

Where to Find Modules


All versions of cascading-filesystem with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package metra/cascading-filesystem contains the following files

Loading the files please wait ....