...

View Full Version : Resolved File not finding Class



Chris Hick
08-17-2012, 01:07 AM
Okay, so I have an initialize file that is in charge of including all of my classes.


<?php
// load config file first
require_once('config.php');

// load basic functions next so that everything after can use them
require_once('functions.php');

// load core objects
require_once('session.php');
require_once('database.php');
require_once('database_object.php');
require_once('logger.php');
require_once('pagination.php');
require_once('getter.php');
require_once("designatedPage.php");
require_once("newmenu.php");
require_once("phpmailer/class.smtp.php");
require_once("phpmailer/class.pop3.php");
require_once("phpmailer/class.phpmailer.php");
require_once("Smarty.class.php");
require_once("SmartyValidate.class.php");

//load in database-type classes
require_once('user.php');
require_once("subject.php");
require_once("keyword.php");
require_once("siteLevels.php");
require_once("hash.php");
require_once("siteMessage.php");
require_once("characterSheet.php");
require_once("photographs.php");
require_once("topic.php");
require_once("post.php");
require_once("postcomment.php");
It has been going great, but then I get on my computer today and it says Fatal error: Class 'Post' not found in index.php
I don't understand why it is suddenly doing this???? Any ideas???

Fou-Lu
08-17-2012, 02:21 AM
Since it worked before, something has changed with the structure or the file itself has been altered.

Given the error itself, this would indicate overall that your error is that post.php no longer contains a definition for the class post. If the file couldn't be found, it will issue a fatal warning on the require, not on the on a call to new.

DrDOS
08-17-2012, 04:03 AM
Class 'Post' not found in index.php

Why is post capitalized in the error message?

Fou-Lu
08-17-2012, 05:00 AM
Class 'Post' not found in index.php

Why is post capitalized in the error message?

Class errors are dictated as typed. So if I type new POST, it would resolve the error indicating class POST doesn't exist.
Classes like functions are case insensitive in PHP, but I'd strongly recommend that all filename paths to be lowercase (for a phar issue when loading via namespace and registered autoloaders).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum