title: Fatal error: ` Class 'Doctrine\Common\Cache\ArrayCache' not found. Composer is not working properly
body: <p>I have started getting errors about missing classes (although they exist), though I have not changed anything. I have reinstalled the composer and vendor.</p>
  
  <p>Sometimes I am getting the error:</p>
  
  <blockquote>
    <p>Class 'core\SomeClass' not found in &lt;..>htdocs\type705c\src\bootstrap.php on line 310</p>
  </blockquote>
  
  <p>Sometimes the error arose that the doctrine <code>ArrayCache</code> not found:</p>
  
  <blockquote>
    <p>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</p>
  </blockquote>
  
  <p>I just keep deleting vendor/composer directory and sometimes get one or another error.</p>
  
  <p>One class exists in
  <code>\vendor\doctrine\cache\lib\Doctrine\Common\Cache\ArrayCache.php</code></p>
  
  <p>SomeClass class exists in  \core</p>
  
  <p>Bootstrap.php</p>
  
  <pre><code> &lt;..&gt; 
  
      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-&gt;setMetadataCacheImpl($cache);
      $driverImpl = $config-&gt;newDefaultAnnotationDriver($entitiesPaths);
      $config-&gt;setMetadataDriverImpl($driverImpl);
      $config-&gt;setQueryCacheImpl($cache);
      $config-&gt;setProxyDir($proxiesPaths);
      $config-&gt;setProxyNamespace('DoctrineProxies\__CG__\Bundle\Proxies');
  
      if ($isDevMode) {
          $config-&gt;setAutoGenerateProxyClasses(true);
      } else {
          $config-&gt;setAutoGenerateProxyClasses(false);
      }
      &lt;..&gt;
  
  $some='some';
  echo "&lt;br&gt; 307 ".$some; //echoes if ArrayCache is found, else do not 
  
  use core\SomeClass;
  $ecind = new SomeClass(); 
  </code></pre>
  
  <p>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. </p>
  
  <p>I always use the same composer dump-autoload to generate namespaces. </p>
  
  <p>autoload_static.php  ( in case the  <code>ArrayCache</code> not found. )
      
  
  <pre><code>    // autoload_static.php @generated by Composer
  
      namespace Composer\Autoload;
  
      class ComposerStaticInita89eb0d2fe0809574fc31efca00ceb2f
      {
          public static $prefixLengthsPsr4 = array (
              'c' =&gt; 
              array (
                  'core\\' =&gt; 5,
              ),
              'R' =&gt; 
              array (
                  'RedeyeVentures\\GeoPattern\\SVGElements\\' =&gt; 38,
                  'RedeyeVentures\\GeoPattern\\' =&gt; 26,
              ),
              'L' =&gt; 
              array (
                  'Bundle\\Resources\\Fnc\\' =&gt; 24,
                  'Bundle\\Entity\\' =&gt; 17,
              ),
              'D' =&gt; 
              array (
                  'DoctrineProxies\\__CG__\\Bundle\\Entity\\' =&gt; 40,
              ),
          );
  
          public static $prefixDirsPsr4 = array (
              'core\\' =&gt; 
              array (
                  0 =&gt; __DIR__ . '/../..' . '/src/core',
              ),
              'RedeyeVentures\\GeoPattern\\SVGElements\\' =&gt; 
              array (
                  0 =&gt; __DIR__ . '/../..' . '/src/ComponentsOthers/geopattern-php-master/src/GeoPattern/SVGElements',
              ),
              'RedeyeVentures\\GeoPattern\\' =&gt; 
              array (
                  0 =&gt; __DIR__ . '/../..' . '/src/ComponentsOthers/geopattern-php-master/src/GeoPattern',
              ),
              'Bundle\\Resources\\Fnc\\' =&gt; 
              array (
                  0 =&gt; __DIR__ . '/../..' . '/src/Bundle/Resources/Fnc',
              ),
              'Bundle\\Entity\\' =&gt; 
              array (
                  0 =&gt; __DIR__ . '/../..' . '/src/Bundle/Entity',
              ),
              'Bundle\\DataFixtures\\ownFixtures\\' =&gt; 
              array (
                  0 =&gt; __DIR__ . '/../..' . '/src/Bundle/DataFixtures/ownFixtures',
              ),
              'Bundle\\DataFixtures\\ORM\\' =&gt; 
              array (
                  0 =&gt; __DIR__ . '/../..' . '/src/Bundle/DataFixtures/ORM',
              ),
              'Bundle\\Controller\\' =&gt; 
              array (
                  0 =&gt; __DIR__ . '/../..' . '/src/Bundle/Controller',
              ),
              'Bundle\\Components\\StringC\\' =&gt; 
              array (
                  0 =&gt; __DIR__ . '/../..' . '/src/Bundle/Components/StringC',
              ),
              'Bundle\\Components\\SocialC\\' =&gt; 
              array (
                  0 =&gt; __DIR__ . '/../..' . '/src/Bundle/Components/SocialC',
              ),
              'Bundle\\Components\\HttC\\' =&gt; 
              array (
                  0 =&gt; __DIR__ . '/../..' . '/src/Bundle/Components/HttC',
              ),
              'Bundle\\Components\\FormC\\' =&gt; 
              array (
                  0 =&gt; __DIR__ . '/../..' . '/src/Bundle/Components/FormC',
              ),
              'Bundle\\Components\\FileC\\' =&gt; 
              array (
                  0 =&gt; __DIR__ . '/../..' . '/src/Bundle/Components/FileC',
              ),
              'Bundle\\Components\\ErrC\\' =&gt; 
              array (
                  0 =&gt; __DIR__ . '/../..' . '/src/Bundle/Components/ErrC',
              ),
              'Bundle\\Components\\ArrayC\\' =&gt; 
              array (
                  0 =&gt; __DIR__ . '/../..' . '/src/Bundle/Components/ArrayC',
              ),
              'DoctrineProxies\\__CG__\\Bundle\\Entity\\' =&gt; 
              array (
                  0 =&gt; __DIR__ . '/../..' . '/src/Bundle/Proxies',
              ),
          );
  
          public static $prefixesPsr0 = array (
              'M' =&gt; 
              array (
                  'Migrations' =&gt; 
                  array (
                      0 =&gt; __DIR__ . '/../..' . '/src/migrations',
                  ),
              ),
              'L' =&gt; 
              array (
                  'Bundle\\Entity\\' =&gt; 
                  array (
                      0 =&gt; __DIR__ . '/../..' . '/src/Bundle/Entity',
                  ),
              ),
          );
  
          public static $fallbackDirsPsr0 = array (
              0 =&gt; __DIR__ . '/../..' . '/src',
          );
  
          public static function getInitializer(ClassLoader $loader)
          {
              return \Closure::bind(function () use ($loader) {
                  $loader-&gt;prefixLengthsPsr4 = ComposerStaticInita89eb0d2fe0809574fc31efca00ceb2f::$prefixLengthsPsr4;
                  $loader-&gt;prefixDirsPsr4 = ComposerStaticInita89eb0d2fe0809574fc31efca00ceb2f::$prefixDirsPsr4;
                  $loader-&gt;prefixesPsr0 = ComposerStaticInita89eb0d2fe0809574fc31efca00ceb2f::$prefixesPsr0;
                  $loader-&gt;fallbackDirsPsr0 = ComposerStaticInita89eb0d2fe0809574fc31efca00ceb2f::$fallbackDirsPsr0;
  
              }, null, ClassLoader::class);
          }
      }
  </code></pre>