Migration problem from PSR-0 to PSR-4

Asked

Viewed 122 times

0

I’m new here but I’ve been programming for over 10 years in PHP and I’ve been programming Object Oriented for a short time. Doing some tests I saw that the PSR-0 is deprecated and then a project of mine I am developing I decided to migrate to the PSR-4 there got the problem. at the time of running the application started to give the following error: Fatal error: Class 'PS Init Bootstrap' not found in E: Projeto Sistema App Init.php on line 6, the file exists and worked on PSR-0.

I’ll post my Composer.json and my folder structure to see if I can fix this error or I’ll have to go back to PSR-0.

-/Sistema
   - App
      - Clientes
         - Controllers
         - Models
         - Views
      - Init.php
   - public
      - .htaccess
      - index.php
   - vendor
      - PS
         - Init
            - Bootstrap.php 

Composer.json

{
"name": "PortalSinos/Sistema",
"require": {
    "php": ">=5.3"
},

"minimum-stability": "alpha",
"authors": [
{
    "name": "Alexandro Zaleski",
    "email": "[email protected]"
}
],
"autoload": {
"psr-4": {
    "PS\\": "vendor/",
    "App\\": "App/"
}
},
"config":{
    "bin-dir": "bin"
}}

If you can help me figure out what the mistake is, I’d appreciate it..

Thanks..

  • A hint: The issue of namespaces, take a look, maybe some adjustment will solve your problem.

  • I looked and re-looked but I couldn’t fix it.. I’ll wait until tomorrow.. If I don’t make it, I’ll go back to PSR-0 and play the boat.. Anything changes later.. thank you

  • 1

    Solved the problem.. where I was setting "PS": "vendor/" had to put "PS": "vendor/PS/" there worked.. Thanks

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.