rdlowrey/auryn

Class 'Auryn\Provider' not found

funkytaco opened this issue · 3 comments

I removed my composer.lock file and started getting Class 'Auryn\Provider' not found with the line:
$injector = new \Auryn\Provider;

It looks like the working version is much older than the version I updated to.

Working:

{
    "name": "rdlowrey/auryn",
    "version": "v0.14.2",
    "source": {
        "type": "git",
        "url": "https://github.com/rdlowrey/Auryn.git",
        "reference": "bfee56a9e0d2e71b04f04236cb8eff2f8cb1c4fa"
    },
    "dist": {
        "type": "zip",
        "url": "https://api.github.com/repos/rdlowrey/Auryn/zipball/bfee56a9e0d2e71b04f04236cb8eff2f8cb1c4fa",
        "reference": "bfee56a9e0d2e71b04f04236cb8eff2f8cb1c4fa",
        "shasum": ""
    },
    "require": {
        "php": ">=5.3.0"
    },
    "require-dev": {
        "phpunit/phpunit": "4.0.*"
    },
    "type": "library",
    "autoload": {
        "psr-4": {
            "Auryn\\": "lib/"
        }
    },
    "notification-url": "https://packagist.org/downloads/",
    "license": [
        "MIT"
    ],
    "authors": [
        {
            "name": "Dan Ackroyd",
            "email": "Danack@example.com",
            "homepage": "http://www.basereality.com",
            "role": "Developer"
        },
        {
            "name": "Daniel Lowrey",
            "email": "rdlowrey@example.com",
            "role": "Creator / Main Developer"
        },
        {
            "name": "Levi Morrison",
            "email": "levim@example.com",
            "homepage": "http://morrisonlevi.github.com/",
            "role": "Developer"
        }
    ],
    "description": "Auryn is a dependency injector for bootstrapping object-oriented PHP applications.",
    "homepage": "https://github.com/rdlowrey/Auryn",
    "keywords": [
        "dependency injection",
        "dic",
        "ioc"
    ],
    "time": "2014-10-27 15:01:04"
}

Not working:

{
    "name": "rdlowrey/auryn",
    "version": "v1.0.1",
    "source": {
        "type": "git",
        "url": "https://github.com/rdlowrey/auryn.git",
        "reference": "cfce81b3a979452364eff22b9bb5c51cfba7ed12"
    },
    "dist": {
        "type": "zip",
        "url": "https://api.github.com/repos/rdlowrey/auryn/zipball/cfce81b3a979452364eff22b9bb5c51cfba7ed12",
        "reference": "cfce81b3a979452364eff22b9bb5c51cfba7ed12",
        "shasum": ""
    },
    "require": {
        "php": ">=5.3.0"
    },
    "require-dev": {
        "athletic/athletic": "~0.1",
        "fabpot/php-cs-fixer": "~1.9",
        "phpunit/phpunit": "^4.7"
    },
    "type": "library",
    "autoload": {
        "psr-4": {
            "Auryn\\": "lib/"
        }
    },
    "notification-url": "https://packagist.org/downloads/",
    "license": [
        "MIT"
    ],
    "authors": [
        {
            "name": "Dan Ackroyd",
            "email": "Danack@example.com",
            "homepage": "http://www.basereality.com",
            "role": "Developer"
        },
        {
            "name": "Levi Morrison",
            "email": "levim@example.com",
            "homepage": "http://morrisonlevi.github.com/",
            "role": "Developer"
        },
        {
            "name": "Daniel Lowrey",
            "email": "rdlowrey@example.com",
            "homepage": "https://github.com/rdlowrey",
            "role": "Creator / Main Developer"
        }
    ],
    "description": "Auryn is a dependency injector for bootstrapping object-oriented PHP applications.",
    "homepage": "https://github.com/rdlowrey/auryn",
    "keywords": [
        "dependency injection",
        "dic",
        "ioc"
    ],
    "time": "2015-07-26 16:16:05"
},

It looks like maybe I just need to switch that line of code to:
$injector = new \Auryn\Injector;

Are there any other gotchas?

$injector = new \Auryn\Injector; is the main thing to be aware of. Pre-1.0.0 releases aren't officially supported but it should be a pretty simple upgrade path. Just in case, though, here's the list of changes from the version you were using to the now-stable 1.0.x release series:

  • Injector::buildExecutable() and Injector::execute() no longer accept the
    optional $makeAccessible parameter to allow invocation of protected/private
    methods.
  • Provider class renamed -> Injector; Injector interface removed
  • Exceptions consolidated into single InjectorException
  • Indexed arrays may now be used for injection definitions
  • New delegate (+) and definition (@) prefixes added for one-offs
  • Removed ProviderBuilder class
  • Renamed ReflectionPool -> Reflector
  • Renamed Invokable -> Executable
  • Add Injector::inspect() method for retrieving definitions
  • Removed InjectorBuilder class
  • Major internal refactoring
  • Miscellaneous bugfixes

Thanks!