title: Understanding PSR-4 Composer without any framework
body: <p>I try to understand and learn how it works PSR-4, because I like refactor with this standard, a little app.</p>
  
  <p>According several manuals, and post on stack overflow, my structure and files are ok.</p>
  
  <pre><code>/vendor
    /abkrim
       /rclub
          /src/
              ResellerApi.php
  </code></pre>
  
  <p>ResellerApi.php content:</p>
  
  <pre><code>&lt;?php
  
  namespace Abkrim\Rclub;
  // Also try namespace Abkrim\Rclub\ResellerApi;
  
  class ResellerApi
  {
     private $url;
     private $proxy;
     private $auth_userid;
     private $api_key;
  
    function __construct() {
        $this-&gt;url          = 'https://test.XXXXXX.com/api/domains/';
        $this-&gt;proxy        = '94.xxx.xxx.xxx:1111';
        $this-&gt;$auth_userid = '837465';
        $this-&gt;$api_key     = 'VU5EksjwGa28mA93tgviQd7eWgiSQLOz';
     }
     public function show() {
         //composer-autoload
     }
  }
  </code></pre>
  
  <p>On my composer.json (global)</p>
  
  <pre class="lang-php prettyprint-override"><code>{
    "name": "abkrim/resellerclub",
    "description": "Una pequeña app para modificar los contactos .ES",
    "license": "MIT",
    "authors": [
      {
        "name": "Abdelkarim Mateos",
        "email": "abdelkarim@tamainut.com"
      }
    ],
    "autoload": {
      "psr-4": {
        "Abkrim\\Rclub": "vendor/abkrim/rclub/" //Final edition Work Fine 
        //"Abkrim\\Rclub": "src/"
      }
    }
  }
  </code></pre>
  
  <p>And on my work dir /reseller.php</p>
  
  <pre class="lang-pp prettyprint-override"><code>&lt;?php
  
  use Abkrim\Rclub\ResellerApi;
  
  require_once __DIR__.'/vendor/autoload.php';  // That it's he question. If not put autoload, not work.
  
  // Also try below with up comment
  //  use Abkrim\Rclub;
  
  $con = new ResellerApi();
  $con-&gt;show();
  </code></pre>
  
  <p>PHPstorm not show error.</p>
  
  <p>But php show error...</p>
  
  <pre><code>PHP Fatal error:  Class 'Abkrim\Rclub\ResellerApi' not found in /Volumes/iDatos/abkrim/ownCloudTDC/tamainut/desarrollo/resellerclub/reseller/reseller.php on line 7
  </code></pre>
  
  <p>Edited: 
  After run composer dump-autoload (or composer update) on file vendor/composer/autoload_psr4.php</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  // autoload_psr4.php @generated by Composer
  
  $vendorDir = dirname(dirname(__FILE__));
  $baseDir = dirname($vendorDir);
  
  return array(
      'Abkrim\\Rclub' =&gt; array($baseDir . '/src'),
  );
  </code></pre>
  
  <p>Too many manuals show examples, but it's a mixed with Laravel, Sympony, ... I like understand PSR-4 ...</p>