0

I want use composer for my projects.

My project structure:

src
   Easycache
       Common
           Cache
               Cache.php
               CacheInterface.php
               ...

Namespace

namespace Easycache\Common\Cache

Composer.json

"autoload": {
    "psr-0": {"Easycache": "src/"}
}

Where error ? Thanks...

kemal
  • 371
  • 2
  • 4
  • 14

1 Answers1

0

You have autoload error but remember that when you run composer install or composer update you need to use generated autoloader first that is in vendor/autoload if your application still does not see your files, check the generated autoload namespaces and directiories in vendor/composer/autoload_namespaces.php

Also remember to follow psr-0 standard witch says in file Cache.php you need to have class named Cache and it will be reachable under

use Easycache\Common\Cache\Cache;

And for the future, when you ask question say what problem or error is becouse no one here can read in your mind. (Or paste in the exception/error from php)

Adrian Modliszewski
  • 1,114
  • 2
  • 18
  • 31