composer: Vendor\Package is not autoloadable, can not call post-update-cmd script

I am getting Class Vendor\AppComponents\Composer\PostUpdate is not autoloadable, can not call post-update-cmd script.

In file autoload_classmap.php is the class registered properly.

<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    'Vendor\\AppComponents\\Composer\\PostUpdate' => $vendorDir . '/vendor/app-components/src/Composer/PostUpdate.php',
);

Composer.json

{
  ...
  "scripts": {
    "post-update-cmd": "Vendor\\AppComponents\\Composer\\PostUpdate::copyClientSide"
  }
}

Class

namespace Vendor\AppComponents\Composer;

class PostUpdate
{
    public static function copyClientSide()
    {
        // Code..
    }
}

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 16 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@domnulnopcea the issue is that when doing a single composer run, it could require building classmaps hundred times, which is a major performance issue.

@Seldaek the documentation should explain that packages providing composer scripts must use a PSR autoloading. I don’t think it is mentionned in the doc currently