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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:43:06+00:00 2026-06-03T12:43:06+00:00

How to register namespaces (with PHP 5.3) in the Symfony 1.4 for the autoloader

  • 0

How to register namespaces (with PHP 5.3) in the Symfony 1.4 for the autoloader class feature (like the Symfony 2.0)?

  • 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-03T12:43:08+00:00Added an answer on June 3, 2026 at 12:43 pm

    You can use Autoloader from Symfony2 in Symfony 1.4 framework.

    1. Copy Symfony2 classloaders to vendor directory of your Symfony 1.4 sandbox project:

    SF_ROOT_DIR/lib/vendor/Symfony2/src/Symfony/Component/ClassLoader/UniversalClassLoader.php

    SF_ROOT_DIR/lib/vendor/Symfony2/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php

    2. Modify your SF_ROOT_DIR/config/ProjectConfiguration.class.php file as follows:

    require_once dirname(__FILE__) . '/../lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php';
    require_once dirname(__FILE__) . '/../lib/autoload/sfClassLoader.class.php';
    sfCoreAutoload::register();
    
    class ProjectConfiguration extends sfProjectConfiguration {
    
        public function setup() {
            $this->namespacesClassLoader();
            $this->enablePlugins('sfDoctrinePlugin');
        }
    
        public function namespacesClassLoader() {
           if (extension_loaded('apc')) {
               $loader = new ApcUniversalClassLoader('S2A');
           } else {
               $loader = new UniversalClassLoader();
           }
           $loader->registerNamespaces(array(
              'Pohon' => __DIR__ . '/../lib/vendor/Pohon/src'));
           $loader->register();
        }
    
    }
    

    3. Register desired namespaces:

    eg. I want to load class:

    Pohon\Tools\String\Utils\Slugify.

    Filename must be:

    SF_ROOT_DIR/lib/vendor/Pohon/src/Pohon/Tools/String/Utils/Slugify.php

    and registered namespace as follows:

    Pohon => SF_ROOT_DIR/lib/vendor/Pohon/src

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

Sidebar

Related Questions

I'm trying to autoload a class within symfony 2. The class lives in vendor/lessc/lessc.inc.php
In zend framework I register my namespace like this (in application.php): 'autoloaderNamespaces' => array(
I use namespace for a class like this below, class_tidy.php, namespace foo; class tidy
To register a COM server, we run something like in elevated mode: regsvr32.exe com.dll
It's possible to register a class with a parameter expected to be passed from
My application file: <?php // /src/app.php require_once __DIR__ . '/../lib/vendor/Sensio/silex.phar'; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response;
Situation: I have a wrapper panel UserControl like this (namespaces and visual details removed
I have some class /library/QPF/Loader.php namespace QPF; class Loader { protected static $loader =
I've read some posts about namespaces and autoload in php 5.3+, but still haven't
This is what my Html helper looks like: namespace WebApp.WebUI { public static class

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.