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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:55:35+00:00 2026-05-25T21:55:35+00:00

We have used Zend_Log, which is configured in application.ini differently for different circumstances. We

  • 0

We have used Zend_Log, which is configured in application.ini differently for different circumstances. We initialize it/get it in the bootstrap and store it in the registry:

$r = $this->getPluginResource('log');
$logger = $r->getLog();

But we’ve subclassed Zend_Log (say, Our_Log) to add customized features, and want to get it the same way. So then we have to make a new Resource Plugin. That seems quite easy – just copy Application/Resource/Log.php, rename the file to Ourlog.php, rename the class to class Zend_Application_Resource_Ourlog. For now, let’s not worry about “Our_Log”, the class — just use the new Resource Plugin to get a Zend_Log, to reduce the variables.

So then, our new code in the bootstrap is:

$r = $this->getPluginResource('ourlog');
$logger = $r->getLog();

but of course this doesn’t work, error applying method to non-object “r”. According to the documentation,

“As long as you register the prefix path for this resource plugin, you
can then use it in your application.”

but how do you register a prefix path? That would have been helpful. But that shouldn’t matter, I used the same prefix path as the default, and I know the file is being read because I “require” it.

Anyway, any guidance on what simple step I’m missing would be greatly appreciated.


Thanks for the pointers — so close, so close (I think). I thought I was getting it…

Okay, so I renamed the class Xyz_Resource_Xyzlog, I put it in library/Xyz/Resource/Xyzlog.php

Then, because I don’t love ini files, in the bootstrap I put:

$loader=$this->getPluginLoader();
$loader->addPrefixPath('Xyz_Resource','Xyz/Resource/');
$r = $this->getPluginResource('xyzlog');
if (!is_object($r)) die ('Not an object!!');

Sudden Death. So, okay, do the ini:

pluginPaths.Xyz_Resource='Xyz/Resource/'

The same. No help. I believed that the basepaths of the plugin paths would include the PHP “include” paths. Am I mistaken in that? Any other ideas? I’ll happily write up what finally works for me to help some other poor soul in this circumstance. Something to do with Name Spaces, maybe?

  • 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-25T21:55:36+00:00Added an answer on May 25, 2026 at 9:55 pm

    Plugin classes are resolved using the plugin loader, which works slightly differently to the autoloader; so just requiring the class in doesn’t help you here. Instead, add this to your application.ini:

    pluginPaths.Application_Resource = "Application/Resource"
    

    you should then be able to use the class as normal. Since your path above will be checked before the default Zend one, you can also name your class ‘Log’ and still extend the Logger resource to override the standard functionality.

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

Sidebar

Related Questions

I have used geocoder in my ruby on rails application for a while but
I am developing an application using Zend Framework 1.11.10. I have used this article
i am using zend framework for my application and i have used few regex
I have used the silverlight control in CRM 2011.It also published on form but
We have used Shibboleth to authenticate users. It works great. The issue is that
I have used some jquery components in my web site, Suddenly i'm getting an
I have used a plugin that uses prototype js, it's working fine but the
I have used NSSets many times in my apps, but I have never created
I have used this website for testing http://www.webpagetest.org and among some suggestions for optimization
I have used auto complete textbox previously. That auto complete works only when i

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.