Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Class Map Generator removed #1

Closed
weierophinney opened this issue Dec 31, 2019 · 10 comments
Closed

Class Map Generator removed #1

weierophinney opened this issue Dec 31, 2019 · 10 comments
Labels
Bug Something isn't working Documentation

Comments

@weierophinney
Copy link
Member

You mention the Class Map Generator (bin/classmap_generator.php) on the docs but removed it when zend-loader got separated from zf2. Did you miss the file ou should I remove from docs?


Originally posted by @rcapile at zendframework/zend-loader#12

@weierophinney weierophinney added Bug Something isn't working Documentation labels Dec 31, 2019
@weierophinney
Copy link
Member Author

+1 I used the classmap_generator.php of zendframework/zendframework package (https://github.com/zendframework/zendframework/blob/release-2.5.3/bin/classmap_generator.php) but actually i'm including each package as separate package, so I do not have those files anymore.

How can I recover a classmap_generator.php file?


Originally posted by @pensiero at zendframework/zend-loader#12 (comment)

@weierophinney
Copy link
Member Author

Meanwhile I published this: https://github.com/pensiero/zend-generators


Originally posted by @pensiero at zendframework/zend-loader#12 (comment)

@weierophinney
Copy link
Member Author

A classmap generator shouldn't be needed at all if you just rely on composer's...


Originally posted by @Ocramius at zendframework/zend-loader#12 (comment)

@weierophinney
Copy link
Member Author

Actually in my Module.php the getAutoloaderConfig() method use it:

public function getAutoloaderConfig()
    {
        if (getenv('ENV') == 'development') {
            return [
                'Zend\Loader\StandardAutoloader' => [
                    'namespaces' => [
                        __NAMESPACE__ => __DIR__ . '/../src/' . __NAMESPACE__,
                    ],
                ],
            ];
        } else {
            return [
                'Zend\Loader\ClassMapAutoloader' => [
                    __DIR__ . '/../config/autogenerated/autoload_classmap.config.php',
                ],
            ];
        }
    }

should I replace it with something else?


Originally posted by @pensiero at zendframework/zend-loader#12 (comment)

@weierophinney
Copy link
Member Author

PS: autoload_classmap.config.php is the file generated by the classmap_generator.php script


Originally posted by @pensiero at zendframework/zend-loader#12 (comment)

@weierophinney
Copy link
Member Author

@pensiero just move all that stuff in your composer.json "autoload" section, sit back and relax :-)


Originally posted by @Ocramius at zendframework/zend-loader#12 (comment)

@weierophinney
Copy link
Member Author

Am I good this way?

  "autoload": {
    "psr-4": {
      "Uala\\": "module/Uala/src/",
    }
  },

Originally posted by @pensiero at zendframework/zend-loader#12 (comment)

@weierophinney
Copy link
Member Author

Correct. No more need for pesky manual classmaps.


Originally posted by @Ocramius at zendframework/zend-loader#12 (comment)

@weierophinney
Copy link
Member Author

I wanted to provide a PR, updating the documentation. However, ClassMapAutoloader documentation suggests the usage of classmap_generator.php.

Is there a valid use case for ClassMapAutoloader, without the generator? How would a classmap be generated, if the generator is gone? Is it compatible with a classmap generated by Composer? But then why would one not use Composer?

It seems that ClassMapAutoloader can be removed as well. @Ocramius / @froschdesign can you confirm that?


Originally posted by @arueckauer at zendframework/zend-loader#12 (comment)

@weierophinney
Copy link
Member Author

This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering Committee.
If you have a security issue, please follow our security reporting guidelines.
If you wish to take on the role of maintainer, please nominate yourself

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working Documentation
Projects
None yet
Development

No branches or pull requests

1 participant