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 7913815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:55:51+00:00 2026-06-03T13:55:51+00:00

Within a Zend app, is there a way to define a class which does

  • 0

Within a Zend app, is there a way to define a class which does not conform to autoloading naming conventions and still have it recognized when I try to use it later on? I imagine you define the class and register it, somehow, with the autoloader, but after reading the autoloader manpage, I still don’t understand how to do it.

My use case is during testing (and no, I don’t want a mock or stub in this case). I define a new class at the top of my test script, but when my application code references that class, the autolader aggressively tires to load it based on naming convention.

<?php 

class Non_Conforming_Dummy_Class 
{
}

// should I register this new class with the autoloader right here? 

class Whatever
{
public function useIt()
    {
        $class = new Non_Conforming_Dummy_Class;
    }
}

I get a ‘no such file or directory’ which looks for Non/Conforming/Dummy/Class.php

  • 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-06-03T13:55:52+00:00Added an answer on June 3, 2026 at 1:55 pm

    The ZF Autoloader will load any classes following PSR-0 convention. Any classes not following that convention cannot be loaded with the Autoloader. However, you can

    register arbitrary autoloader callbacks, optionally with a specific namespace (or group of namespaces). Zend_Loader_Autoloader will attempt to match these first before using its internal autoloading mechanism.

    This means, you can add your own autoloader that knows your naming scheme to ZF’s autoloader:

    $autoloader->pushAutoloader(array('myAutoloader', 'autoload'), 'MyPrefix');
    

    See http://framework.zend.com/manual/en/zend.loader.autoloader.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code which calls a stored procedure within ZEND. Is there a
I'm working within zend forms. Currently this is how it looks: I want to
I am trying to setup ext javascript grid within zend framework mvc. I included
I'm actually using Doctrine2 within a Zend Framework project. I'm build an API to
I am working on implementing Zend Framework within an existing project that has 2
I would like to change the fetch mode within an extended class of Zend_Db_Table_Abstract.
Within my ASP.NET App I am using a Method to check user permissions to
I'm building a Zend-based Web app that will permit third-party extensions. Essentially, this application's
I have an existing large(ish) PHP web app (using Apache and MySQL) which now
I am currently developing a facebook canvas (iframe) based application. Is there any way

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.