susanBuck / e2-fall22

0 stars 0 forks source link

autoload can resolve namespace #35

Closed traveler9878 closed 2 years ago

traveler9878 commented 2 years ago

I'm walking through the composer setup and I have copied the game code into index.php and the Game object can't be resolved.

susanBuck commented 2 years ago

Can you update your e2 repository with the latest code? It's hard to say what is going on without seeing more context.

traveler9878 commented 2 years ago

Composer installed, I have the vendor folder in my project, and the rps game code is downloaded. The one thing that was strange following the composer setup instructions is that i did not get prompted to overwrite the php.ini. Calling it a day will revisit. Thanks.

traveler9878 commented 2 years ago

hi, sure, one sec

traveler9878 commented 2 years ago

it's uploaded to git

traveler9878 commented 2 years ago

The only thing I see is that the src directory isn't included in the require path but it's late so I'm thinking some sleep is needed to revisit...

susanBuck commented 2 years ago

When I visit http://e2rps.davidcurtis.me I see a blank white screen.

This makes sense because if we look at rps/index.php there's no output being produced.

Try wrapping $game->play('rock'); in a var_dump so results are output to the page:

var_dump($game->play('rock'));
traveler9878 commented 2 years ago

I'm getting the red line under Game() with an undefined error message on mouseover, i'll wrap the call to play though and update the repository

traveler9878 commented 2 years ago

lol those are the hardest problems to solve the ones where there's no problem and it's working... intellisense issue

susanBuck commented 2 years ago

:-)

Yah seems like a VSCode/intellisense issue - I'd suggest closing and re-opening the index.php file. It's possible it just isn't registering the latest composer autoload config.

traveler9878 commented 2 years ago

I worked on the game assignments and came back to it and it's working now...

traveler9878 commented 2 years ago

No red line under Game()

traveler9878 commented 2 years ago

Thanks!