by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 03 12:01
    Tinywan starred PHP-DI/PHP-DI
  • Aug 03 11:42
    ziishaned starred PHP-DI/PHP-DI
  • Aug 03 11:06
  • Aug 03 09:19
    RazvanFarte starred PHP-DI/PHP-DI
  • Aug 02 07:54
    mnapoli synchronize #726
  • Aug 02 07:54

    mnapoli on v7

    Improve support for PHP 8 (compare)

  • Aug 01 21:24
    mnapoli synchronize #726
  • Aug 01 21:24

    mnapoli on v7

    Update dependency versions to f… (compare)

  • Aug 01 21:18
    mnapoli synchronize #726
  • Aug 01 21:18

    mnapoli on v7

    Remove useless config files (compare)

  • Aug 01 21:17
    mnapoli synchronize #726
  • Aug 01 21:17

    mnapoli on v7

    Fix coding style (compare)

  • Aug 01 21:16
    mnapoli edited #726
  • Aug 01 21:16
    mnapoli synchronize #726
  • Aug 01 21:16

    mnapoli on v7

    Improve type declarations follo… (compare)

  • Aug 01 20:45
    mnapoli edited #726
  • Aug 01 20:41
    mnapoli synchronize #726
  • Aug 01 20:41

    mnapoli on v7

    Remove the obsolete `ignorePhpD… Fix code formatting (compare)

  • Aug 01 20:36
    mnapoli labeled #726
  • Aug 01 20:36
    mnapoli opened #726
gmariani
@gmariani
that's my guess as well, but there is little documentation for people starting off. everyone assumes you know what you're doing. i didn't even know php-di was a thing until i started this project
Anaël Ollier
@nanawel
Trust me, once you'll get used to it, you won't want to do without ;)
The learning curve is just a bit steep
gmariani
@gmariani
i usually can figure this out, but i'm just hitting a brick wall and don't know where to look for help at this point. can't tell if it's a slim issue, php-di issue (which you don't seem to think so) so i guess it's just how i have configure composer (autoload)
i have to say it's really tempting to just say screw it and just manually put the require lines in and be done with it
gmariani
@gmariani
Does PHP-DI actually include the files or is that composer?
gmariani
@gmariani
I figured out the issue. My project had the folder "public" but the web server had "public_html". once i fixed the path issue the problem was resolved. thanks for your help @nanawel
Anaël Ollier
@nanawel
Hi @gmariani. Glad you figured this out! So that was a path issue after all, nothing wrong with PHP-DI :)
Daniel Opitz
@odan
@gmariani It looks like an PSR-4 autoloader issue. Make sure that you defined the correct namespaces and paths in your composer.json file. Linux is case sensitive. For example if you have a namespace App\Action, then your directory should be named like this: src/Action/ and not src/action/.
Jack Price-Burns
@JackPriceBurns
Hello :wave: when using the autowiring to load classes, if the class can not be instantiated because of an exception the container just returns null, is this behaviour intended (I don't know if I've changed something) and is there any way I can make these exceptions get thrown out of the container so I can handle them myself?
dennis-0312
@dennis-0312

Hi. I have this problem, when I upload my project to a host this error activates me: Fatal error: Not captured DI \ NotFoundException: No entry or class was found for 'App \ Controllers \ AuthController' in /home/vrfctuqw/myhonsting.com/ vendor /php-di/php-di/src/Container.php:135 Stack tracking: # 0 /home/vrfctuqw/myhosting.com/vendor/php-di/php-di/src/CompiledContainer.php(64) : DI \ Container-> get ('App \ Controllers ...') # 1 /home/vrfctuqw/myhosting.com/public/index.php(474): DI \ CompiledContainer-> get ('App \ \ Controllers ... ') # 2 {main} included in /home/vrfctuqw/myhosting.com/vendor/php-di/php-di/src/Container.php on line 135

Locally it works correctly, but in hosting I present this. I would like you to help me please

Định Nguyễn Thế
@vatgia
I has a problem when i call a magic menthod in a class.
Sandunika Fernando
@sandunika_fdo_twitter
Hi I have used "mnapoli/php-di": "~4.0", "container-interop/container-interop": "^1.1", for my application and now im moving to php 7 with "php-di/php-di": "6.0.11", "psr/container": "^1.0.0", I'm getting "Entry "Idfix\Contracts\RegistryInterface" cannot be resolved: the class is not instantiable Full definition: Object ( class = #NOT INSTANTIABLE# Idfix\Contracts\RegistryInterface lazy = false )" this issue please advice
Stay The Fuck Home
@KipchirchirIan_twitter
Hello! So, after doing composer update I get a notice that the package jeremeamia/superclosure is abandoned and php-di seems to require/depend on this package. Any solutions to this problem especially that the recommendation is using opis/closure and it's not advisable to edit composer.lock directly??
Maciej Holyszko
@falkenhawk
Vitalijus Trainys
@tvitas
hi, why dependencies still exists to jeremeamia/superclosure? Its abandoned?
Sorry, not read RTFM :)
Closed.
Thanks.
Bram Van der Sype
@Brammm
When trying to compile my container, I'm getting a "The closure was not found within the abstract syntax tree" exception from jeremeamia/superclosure
Can anyone point me in the right direction of how to debug that? @mnapoli ?
The stack trace isn't exactly helpful
I previously had an error because I was using use ($var) in a closure, but took those out
Bram Van der Sype
@Brammm
Oh, apparently you can't use arrow functions
Jens Prangenberg
@jprangenbergde
Hi everyone, does anybody have knowledge about php-di and zend expressive? "I got Cannot compile closures which import variables using the use keyword'", but i cant find an use statement for the given Delegator. Some ideas?
Bram Van der Sype
@Brammm
@mnapoli still using Slim v3 with the php-di bridge, I upgraded composer and now suddenly getting the error "Class 'AssociativeArrayResolver' not found in /var/www/html/cache/CompiledContainer.php on line 1210"
What could be causing that?
Bram Van der Sype
@Brammm
It happened in the upgrade from php-di 6.1 to 6.2, I'm guessing it has something to do with the change of the closure thingy
Adam Bosco
@KuroTsuto

Hey all! I'm wondering if I can look up a key within a get()'d array in a autowire()->constructorParameter() somehow. This was my first stab, and I understand it doesn't work because get() is a definition helper, not an immediate lookup:

return [
  'config' => [
    'foo' => 'bar'
  ],

  'my.object' => autowire( MyClass::class )
    ->constructorParameter( 'foo', get( 'config' )[ 'foo' ] )
]

I understand that I could do this with a factory function, but I'm really curious as to if there is a way to do so without one?