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

  • Home
  • SEARCH
  • 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 6360345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:38:13+00:00 2026-05-24T23:38:13+00:00

Hi I am using CakePHP and there are some Vendor files I need to

  • 0

Hi I am using CakePHP and there are some Vendor files I need to add to the autoloading. Is this the correct method:

In the bootstrap.php, I have the following code:

function __autoload($className){

        $classFile = '../vendors/phprtf/' . str_replace('_', '/', $className) . '.php';

        // check if file exists
         if(file_exists($classFile)) {
            require $classFile;
        }

}

The PHPRTFLite has a lot of class files under various sub directories. So listing all of them is not a good option.

It seems to be working for now.

  • 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-24T23:38:13+00:00Added an answer on May 24, 2026 at 11:38 pm

    You should use spl_autoload_register() for the flexibility it offers.

    If your code has an existing __autoload function then this function
    must be explicitly registered on the __autoload stack. This is because
    spl_autoload_register() will effectively replace the engine cache for
    the __autoload function by either spl_autoload() or
    spl_autoload_call().

    If there must be multiple autoload functions, spl_autoload_register()
    allows for this. It effectively creates a queue of autoload functions,
    and runs through each of them in the order they are defined. By
    contrast, __autoload() may only be defined once.

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

Sidebar

Related Questions

I have the following code to generate some spans using cakephp's helper <div id=numberRow>
I have a PHP SOAP web service, using CakePHP, which is returning a variable
I am using CakePHP framework with MySQL database and I have problem in saving
I'm using CakePHP but it's a question about the MVC pattern. I have in
I just started using CakePHP for a small project. I have rails experience, and
I am using CakePHP 1.26 and CDN JQuery in this URL: http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js In a
I am using cakePHP 1.26. I got a simple Table with some data in
I am using cakephp v1.26. I got a function in a controller like this:
I have a site set up using CakePHP and MySQL and I want to
I am using cakephp with postgresql. Some of my tables are very large.When using

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.