Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

composer support: add "autoload.classmap" support #49

Open
quasilyte opened this issue Nov 29, 2020 · 0 comments
Open

composer support: add "autoload.classmap" support #49

quasilyte opened this issue Nov 29, 2020 · 0 comments

Comments

@quasilyte
Copy link
Contributor

quasilyte commented Nov 29, 2020

Some projects use ["autoload"]["classmap"] mechanism:

https://github.com/sebastianbergmann/phpunit/blob/master/composer.json#L72

See https://getcomposer.org/doc/04-schema.md#classmap

Another example of a project that uses it: https://github.com/phar-io/version

quasilyte added a commit that referenced this issue Jul 12, 2022
`autoload.classmap` is another popular method of classes
autoloading in composer.

Implementing this feature increases the number of composer packages
that can be used by KPHP code.

Classmap works like this:
for a given files list (dirs or regular files),
collect all files with `.inc` and `.php` extension recursively and
build autoloading maps for them.

Unlike PSR4, classmap doesn't require any conventions.
A file can have multiple classes, its name could be anything,
namespaces can be arbitrary as well.

It's hard to implement this feature in KPHP without actually parsing the php files.
As a compromise, we're scanning the classmap folders and
require all files found during the composer autoload file inclusion.

Fixes #49
quasilyte added a commit that referenced this issue Jul 13, 2022
`autoload.classmap` is another popular method of classes
autoloading in composer.

Implementing this feature increases the number of composer packages
that can be used by KPHP code.

Classmap works like this:
for a given files list (dirs or regular files),
collect all files with `.inc` and `.php` extension recursively and
build autoloading maps for them.

Unlike PSR4, classmap doesn't require any conventions.
A file can have multiple classes, its name could be anything,
namespaces can be arbitrary as well.

It's hard to implement this feature in KPHP without actually parsing the php files.
As a compromise, we're scanning the classmap folders and
require all files found during the composer autoload file inclusion.

Fixes #49
quasilyte added a commit that referenced this issue Sep 2, 2022
`autoload.classmap` is another popular method of classes
autoloading in composer.

Implementing this feature increases the number of composer packages
that can be used by KPHP code.

Classmap works like this:
for a given files list (dirs or regular files),
collect all files with `.inc` and `.php` extension recursively and
build autoloading maps for them.

Unlike PSR4, classmap doesn't require any conventions.
A file can have multiple classes, its name could be anything,
namespaces can be arbitrary as well.

It's hard to implement this feature in KPHP without actually parsing the php files.
As a compromise, we're scanning the classmap folders and
require all files found during the composer autoload file inclusion.

Fixes #49
quasilyte added a commit that referenced this issue Sep 2, 2022
`autoload.classmap` is another popular method of classes
autoloading in composer.

Implementing this feature increases the number of composer packages
that can be used by KPHP code.

Classmap works like this:
for a given files list (dirs or regular files),
collect all files with `.inc` and `.php` extension recursively and
build autoloading maps for them.

Unlike PSR4, classmap doesn't require any conventions.
A file can have multiple classes, its name could be anything,
namespaces can be arbitrary as well.

It's hard to implement this feature in KPHP without actually parsing the php files.
As a compromise, we're scanning the classmap folders and
require all files found during the composer autoload file inclusion.

Fixes #49
quasilyte added a commit that referenced this issue Sep 2, 2022
`autoload.classmap` is another popular method of classes
autoloading in composer.

Implementing this feature increases the number of composer packages
that can be used by KPHP code.

Classmap works like this:
for a given files list (dirs or regular files),
collect all files with `.inc` and `.php` extension recursively and
build autoloading maps for them.

Unlike PSR4, classmap doesn't require any conventions.
A file can have multiple classes, its name could be anything,
namespaces can be arbitrary as well.

It's hard to implement this feature in KPHP without actually parsing the php files.
As a compromise, we're scanning the classmap folders and
require all files found during the composer autoload file inclusion.

Fixes #49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant