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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:43:05+00:00 2026-06-07T08:43:05+00:00

I have my own lib at folder classes. I am trying to use Zend

  • 0

I have my own lib at folder “classes”. I am trying to use Zend library as standalone. (Integrating their classes into my app).

E.g. as below. Zend classes all put under a folder called Zend

classes/db.class.php

classes/Zend/translate.php ….

I use an autoload function to load classes previously.

if (!function_exists ("__autoload")){
function __autoload($class_name) 
{

    if(file_exists(ABSPATH.'/classes/'.$class_name.'.class.php')){
        require_once ABSPATH.'/classes/'.$class_name.'.class.php';
    }   

}
}

My function check if my app require my class, if so, i will load it from my “classes” folder if not it will load from Zend folder.

Whenever i call

require_once ABSPATH.'/classes/Zend/Loader/Autoloader.php'; 
$loader = Zend_Loader_Autoloader::getInstance(); 

It keep saying that my “own” classes are not loaded. I think this is an issue with Zend auto load, it check and find out that it need db.class.php in the zend folder.

How do i do this as i went to separate libraries between Zend and my Own.

  • 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-07T08:43:07+00:00Added an answer on June 7, 2026 at 8:43 am

    The magic __autoload function does not support multiple autoloaders. If you specify your custom autoloader as shown above and then register a Zend autoloader, the previously installed autoloader will be overwritten by the Zend autoloader.

    Since the Zend component uses spl_autoload_register(), you may also use this method (multiple autoloaders are supported – it basically installs a single autoloader that processes another stack of (user-defined) autoloaders).

    http://php.net/manual/function.spl-autoload-register.php

    // Example (requires PHP >= 5.3 because of the anonymous function)
    spl_autoload_register(function($className) {
        $fileName = ABSPATH .'/classes/'. $className .'.class.php';
        if (is_readable($fileName)) {
            require_once($fileName);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create my own Perl module in /usr/local/lib/perl I have the
I'm trying to write my own functional little lib in Java. If I have
I have own component which works in my testing winform app good but when
I want to use two different Spring web contexts , each have own contextConfig,
I'm trying to hide window after its startup. I have own window-class which is
I have my own installer program which I use to install several applications I
I was building my own class that resides in /lib folder and debugging with
I'm trying to create an Android library JAR and would like to use ant
I got an article app and trying to make a custom filter, I have
I have made my own frameworks, and I use these frameworks in my web

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.