I have started getting errors about missing classes (although they exist), though I have not changed anything. I have reinstalled the composer and vendor.
Sometimes I am getting the error:
Class 'core\SomeClass' not found in <..>htdocs\type705c\src\bootstrap.php on line 310
Sometimes the error arose that the doctrine ArrayCache
not found:
Fatal error: Class 'Doctrine\Common\Cache\ArrayCache' not found in C:\Bitnami\wampstack-5.6.30-2\apache2\htdocs\type705c\src\bootstrap.php on line 258
I just keep deleting vendor/composer directory and sometimes get one or another error.
One class exists in
\vendor\doctrine\cache\lib\Doctrine\Common\Cache\ArrayCache.php
SomeClass class exists in \core
Bootstrap.php
<..>
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Configuration;
use Symfony\Component\Console\Application;
use Doctrine\Common\Cache\ArrayCache;
use Doctrine\Common\Cache\ApcCache;
$entitiesPaths = array( __DIR__.'/Bundle/Entity' );
$proxiesPaths = array( __DIR__.'/Bundle/Proxies' );
if ($isDevMode) {
$cache = new \Doctrine\Common\Cache\ArrayCache;
} else {
$cache = new \Doctrine\Common\Cache\ApcCache;
}
$config = new Configuration;
$config->setMetadataCacheImpl($cache);
$driverImpl = $config->newDefaultAnnotationDriver($entitiesPaths);
$config->setMetadataDriverImpl($driverImpl);
$config->setQueryCacheImpl($cache);
$config->setProxyDir($proxiesPaths);
$config->setProxyNamespace('DoctrineProxies\__CG__\Bundle\Proxies');
if ($isDevMode) {
$config->setAutoGenerateProxyClasses(true);
} else {
$config->setAutoGenerateProxyClasses(false);
}
<..>
$some='some';
echo "<br> 307 ".$some; //echoes if ArrayCache is found, else do not
use core\SomeClass;
$ecind = new SomeClass();
At this point, if there are no errors with ArrayCache, arose error that core\SomeClass.php is missing, and I do not see it in autoload_static.php, thus it is really missing.
I always use the same composer dump-autoload to generate namespaces.
autoload_static.php ( in case the ArrayCache
not found. )
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInita89eb0d2fe0809574fc31efca00ceb2f
{
public static $prefixLengthsPsr4 = array (
'c' =>
array (
'core\\' => 5,
),
'R' =>
array (
'RedeyeVentures\\GeoPattern\\SVGElements\\' => 38,
'RedeyeVentures\\GeoPattern\\' => 26,
),
'L' =>
array (
'Bundle\\Resources\\Fnc\\' => 24,
'Bundle\\Entity\\' => 17,
),
'D' =>
array (
'DoctrineProxies\\__CG__\\Bundle\\Entity\\' => 40,
),
);
public static $prefixDirsPsr4 = array (
'core\\' =>
array (
0 => __DIR__ . '/../..' . '/src/core',
),
'RedeyeVentures\\GeoPattern\\SVGElements\\' =>
array (
0 => __DIR__ . '/../..' . '/src/ComponentsOthers/geopattern-php-master/src/GeoPattern/SVGElements',
),
'RedeyeVentures\\GeoPattern\\' =>
array (
0 => __DIR__ . '/../..' . '/src/ComponentsOthers/geopattern-php-master/src/GeoPattern',
),
'Bundle\\Resources\\Fnc\\' =>
array (
0 => __DIR__ . '/../..' . '/src/Bundle/Resources/Fnc',
),
'Bundle\\Entity\\' =>
array (
0 => __DIR__ . '/../..' . '/src/Bundle/Entity',
),
'Bundle\\DataFixtures\\ownFixtures\\' =>
array (
0 => __DIR__ . '/../..' . '/src/Bundle/DataFixtures/ownFixtures',
),
'Bundle\\DataFixtures\\ORM\\' =>
array (
0 => __DIR__ . '/../..' . '/src/Bundle/DataFixtures/ORM',
),
'Bundle\\Controller\\' =>
array (
0 => __DIR__ . '/../..' . '/src/Bundle/Controller',
),
'Bundle\\Components\\StringC\\' =>
array (
0 => __DIR__ . '/../..' . '/src/Bundle/Components/StringC',
),
'Bundle\\Components\\SocialC\\' =>
array (
0 => __DIR__ . '/../..' . '/src/Bundle/Components/SocialC',
),
'Bundle\\Components\\HttC\\' =>
array (
0 => __DIR__ . '/../..' . '/src/Bundle/Components/HttC',
),
'Bundle\\Components\\FormC\\' =>
array (
0 => __DIR__ . '/../..' . '/src/Bundle/Components/FormC',
),
'Bundle\\Components\\FileC\\' =>
array (
0 => __DIR__ . '/../..' . '/src/Bundle/Components/FileC',
),
'Bundle\\Components\\ErrC\\' =>
array (
0 => __DIR__ . '/../..' . '/src/Bundle/Components/ErrC',
),
'Bundle\\Components\\ArrayC\\' =>
array (
0 => __DIR__ . '/../..' . '/src/Bundle/Components/ArrayC',
),
'DoctrineProxies\\__CG__\\Bundle\\Entity\\' =>
array (
0 => __DIR__ . '/../..' . '/src/Bundle/Proxies',
),
);
public static $prefixesPsr0 = array (
'M' =>
array (
'Migrations' =>
array (
0 => __DIR__ . '/../..' . '/src/migrations',
),
),
'L' =>
array (
'Bundle\\Entity\\' =>
array (
0 => __DIR__ . '/../..' . '/src/Bundle/Entity',
),
),
);
public static $fallbackDirsPsr0 = array (
0 => __DIR__ . '/../..' . '/src',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInita89eb0d2fe0809574fc31efca00ceb2f::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInita89eb0d2fe0809574fc31efca00ceb2f::$prefixDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInita89eb0d2fe0809574fc31efca00ceb2f::$prefixesPsr0;
$loader->fallbackDirsPsr0 = ComposerStaticInita89eb0d2fe0809574fc31efca00ceb2f::$fallbackDirsPsr0;
}, null, ClassLoader::class);
}
}