Feature #46910

Composer integration - PackageStates.php

Added by Patrick Pussar over 8 years ago. Updated over 8 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2013-04-04
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.4
Has patch:
No
Complexity:

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'=>'',

#1

Updated by Christian Jul Jensen over 8 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 over 8 years ago

  • Target version set to 2.1
#3

Updated by Robert Lemke over 8 years ago

  • Target version deleted (2.1)

Also available in: Atom PDF