Feature #46910

Composer integration - PackageStates.php

Added by Patrick Pussar over 2 years ago. Updated about 2 years ago.

Status:New Start date:2013-04-04
Priority:Should have Due date:
Assigned To:- % Done:

0%

Category:-
Target version:-
PHP Version:5.4 Complexity:
Has patch:No

Description

It seems that composer packages without autoload.psr-0 definition in its composer.json are not integrated correctly in Configuration/PackageStates.php which results in class not found exceptions.

E.g. using https://github.com/leafo/lessphp
composer.json:

   "autoload": {
        "classmap": ["lessc.inc.php"]
    },

result in PackageStates.php:

 'leafo.lessphp' =>
    array (
      'manifestPath' => '',
      'composerName' => 'leafo/lessphp',
      'state' => 'active',
      'packagePath' => 'Libraries/leafo/lessphp/',
      'classesPath' => 'Classes/',
    ),

The classpath is wrong in that case. Correct would be 'classPath'=>'',

History

#1 Updated by Christian Jul Jensen over 2 years ago

  • Tracker changed from Bug to Feature
  • Priority changed from Must have to Should have
  • Target version deleted (2.0)

You are right, currently only PSR-0 compatible 3rd-party code is supported. It is not only about the generation of packagestates, but also bout the way we autoload and reflect/proxy code. We want to have suport for other autoload schemes, but it requires some bigger changes.

Best practice currently is to add a Package.php to your "consuming" Flow package and include the autoloader generated by composer for the package. It will allow to you use the code, but you will not get AOP etc.

#2 Updated by Robert Lemke about 2 years ago

  • Target version set to 2.1

#3 Updated by Robert Lemke about 2 years ago

  • Target version deleted (2.1)

Also available in: Atom PDF