I'm trying to use the composer vimeo package "vimeo/vimeo-api": "dev-master".
Things get ugly in composers own ClassLoader.php, in the function below it gets as far as: if (0 === strpos($class, $prefix))
and breaks out of the loop because at this point $class = 'Vimeo'
and $prefix = 'Vimeo/'
so the result is false.
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
if (0 === strpos($class, $prefix)) {
foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
return $file;
}
}
}
}
}
...
The composer.json file that is inside the vimeo package declares a psr-4 autoload of 'Vimeo\' as follows:
{
"name": "vimeo/vimeo-api",
"description": "Official PHP library for the Vimeo API.",
"homepage": "https://github.com/vimeo/vimeo.php",
"keywords": ["vimeo", "video"],
"license": "Apache-2.0",
"authors": [
{
"name": "Vimeo",
"homepage": "http://vimeo.com"
}
],
"minimum-stability": "dev",
"require": {
"php": ">=5.3.0"
},
"autoload": {
"psr-4": {
"Vimeo\\": "src/Vimeo"
}
}
}
The composer created autoload_psr4.php is as follows:
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Vimeo\\' => array($vendorDir . '/vimeo/vimeo-api/src/Vimeo')
);
So when I come to instantiate the class 'new Vimeo('arg','arg');' I get a class not found error.
Could it be something to do with the fact I am running inside of the Zendframework (1.12.8), or composer messing up or something?