Download the PHP package kuria/class-loader without Composer

On this page you can find all versions of the php package kuria/class-loader. 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 class-loader

Class loader ############

PHP class loader that implements both PSR-0 and PSR-4 autoloading.

Features

Requirements

Usage examples

Registering prefixes

// load the class loader manually require '/path/to/src/ClassLoader.php';

// create an instance $debug = true; // true during development, false in production

$classLoader = new ClassLoader($debug);

// register the autoloader $classLoader->register();

// PSR-4 prefix $classLoader->addPrefix('Foo\\Bar\\', 'vendor/foo/bar/src');

$classLoader->addPrefixes([ 'Kuria\\Error\\' => 'vendor/kuria/error/src', 'Foo\\Baz\\' => 'example/foo/baz', ]);

// PSR-0 prefix $classLoader->addPrefix('Example\\FooBar\\', 'vendor/example/foobar', ClassLoader::PSR0);

$classLoader->addPrefixes([ 'Kuria\\Error\\' => 'vendor/kuria/error/src', 'Foo' => 'example/foo', ], ClassLoader::PSR0);

// PSR-4 fallback (empty prefix) $classLoader->addPrefix('', 'src');

// PSR-0 fallback (empty prefix) $classLoader->addPrefix('', 'old-code/example', ClassLoader::PSR0);

// single class $classLoader->addClass('Foo', 'path/to/foo.class.php');

// class map $classLoader->addClassMap([ 'Bar' => 'path/to/bar.class.php', 'Baz' => 'path/to/baz.class.php', ]);

Using the composer bridge

The ComposerBridge class can be used to initialize autoloading for packages managed by Composer.

require __DIR . '/vendor/kuria/class-loader/src/ComposerBridge.php';

$classLoader = new ClassLoader();

ComposerBridge::configure($classLoader, __DIR . '/vendor');

$classLoader->register();

Disabling prefixes

If you are using an optimized autoloader, you can pass an optional third parameter to configure() to disable prefixes completely. Only the class maps and files will be loaded.

Debug mode

If debug mode is enabled, a check is performed after a file has been loaded to determine whether the class, interface or trait was defined in that file.

This helps detect wrong or misspelled namespaces or class names.

To enable debug mode, call $classLoader->setDebug(true) or pass true to the appropriate constructor argument.


All versions of class-loader with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
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 kuria/class-loader contains the following files

Loading the files please wait ....