Class not found

Exercise 2 of 4 in chapter 3 · 150 XP · 4 objectives checked by tests

Topics covered: DebuggingError messageLoading order

Gaston wanted to help. He wrote a Bulletin class (weather report) for his forecast, and while he was at it, he “tidied up” the require_once lines in order of importance. The result: the gazette shows an error instead of the front page, and Madame Lou can't make head or tail of it.

Your mission

  1. Open the preview and read the error message: it says what PHP could not find, and where.
  2. Fix public/index.php until the page shows again. There are two errors, and the second one only appears once the first is fixed.
  3. Gaston's weather report must show in the header: “Gaston's weather: Thursday, storm, 14 °C”.

The files in src/ are correct: only public/index.php needs fixing.

Reminder

Read an error message all the way to the end. Class "Bulletin" not found does not say that the file is missing, but that PHP does not know the class at the moment you use it. With require_once, it is up to you to load every file, and in the right order. The next exercise will take care of that for you.