Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6811051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:16:48+00:00 2026-05-26T20:16:48+00:00

my class naming convention: class.ClassName.php my class file naming convention: class.classname.php (hence the strtolower).

  • 0

my class naming convention: class.ClassName.php

my class file naming convention: class.classname.php (hence the strtolower).

the class files are located in the include path: /home/content/XX/XXXXXX/html/projects/include/

//autoload.php
<?php
    class Autoload {
        public static function autoloadClasses($className) {
            $className = strtolower($className);
            $file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include/class.' . $className. '.php';
            require_once($file);
        }
    }
    $register = spl_autoload_register('Autoload::autoloadClasses');
?>

//check4.php
<?php
    $company = $s->company;
    $projectName = 'development';
    $items = array('type', 'scope', 'table', 'conditions');
    $things = array('select', '*', 'todos', array('company'=>$company, PROJECT_NAME=>$projectName));
    $combinedArray = array_combine($items, $things);
    $q = new Query($combinedArray);
?>

verified classes exist and are included http://technicheian.com/images/includedClasses.png

on every page that makes use of a class (e.g. this one calling Query; located class.query.php:

05-Nov-2011 20:18:30]PHP Fatal error: Class 'Query' not found in /home/content/XX/XXXXXX/html/projects/check4.php on line 9

at the end of class.session.php is $s = new Session (noted here to say that the $company variable should not be empty).

I’ve read pretty much every article, how-to, etc. I can find. What am I missing?

running php 5.2

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:16:49+00:00Added an answer on May 26, 2026 at 8:16 pm

    delete the file_exists check and look at your error logs. You will see which file you were trying to require. I think it may be confusion on what __FILE__ does (because it is working on the autoload.php file).

    Edit: It looks like this

    dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include/class.'

    should be changed to

    /home/content/XX/XXXXXX/html/projects/include/class.

    There are a number of things for you to check to ensure that autoloading works:

    1. For your custom autoloading to be active it must be registered. So the spl_autoload_register('Autoload::autoloadClasses') must be executed. A good way of doing this is to edit php.ini and set the auto_prepend file to call your autoload file.
    2. Your autoload code must then find the correct file with the correct extension (possibly respecting the php include_path priority that you want).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All my PHP files conform to class.className.php as a naming conventoin. So I put
You can have different naming convention for class members, static objects, global objects, and
I know the naming convention for class methods in C# is to begin with
Possible Duplicates: Using “Base” in a Class Name C# Class naming convention: Is it
I quite often see the following naming convention used in java code. class SomeClass
Naming classes is sometimes hard. What do you think name of the class should
I'm creating a class. What's the best practice for naming properties/methods when your preferred
I tried making a wrapper class that encapsulates an object, a string (for naming
Which naming convention is more preferable in C++? The underscore method or the camelCase
Is there a naming convention for a property/variable that has a dot/decimal in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.