CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Custom PHP Directory
Pages: [1]

Author Topic: Custom PHP Directory  (Read 2068 times)

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Custom PHP Directory
January 28, 2010, 06:38:21 pm
In my global settings, I have my site configured to use a folder called 'civicrm_custom_php' for my PHP override files. This directory is in my web root.

In this directory, I'm overriding 2 files that go in CRM/Utils:
Pager.php
Recent.php

When I just have the Pager.php file in there, everything works great. But when I add in Recent.php, it throws this PHP error:

Fatal error: Cannot redeclare class CRM_Utils_Recent in /public_html/civicrm_custom_php/CRM/Utils/Recent.php on line 41

Once I remove that file, the error is gone. But obviously I'd like to avoid editing the direct Civi PHP files. I'm confused on why this would work for my other files and not this one. I tried it without making a single change to Recent.php, just putting it in my custom folder, still the same issue. I understand it thinks its redeclaring the same class, but then why wouldn't any of my other custom files do the same thing?

thanks much,
emilyf

JoopSJ

  • I post occasionally
  • **
  • Posts: 80
  • Karma: 2
Re: Custom PHP Directory
January 30, 2010, 05:46:56 am
I had the same thing.
I'm overriding:
Address.php and
Date.php

Address.php is overriden without any problem, but the class is declared twice for Date.
In my case this is not relevant anymore: I was overriding Date.php due to a patch and this patch made it to the current release.
So I don't need to override date.php anymore.

I just want to confirm this behavior.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Custom PHP Directory

This forum was archived on 2017-11-26.