Fatal error: Class 'cite' not found

Thread Solved

Join Date: Nov 2009
Posts: 3
Reputation: newtodaniweb is an unknown quantity at this point 
Solved Threads: 0
newtodaniweb newtodaniweb is offline Offline
Newbie Poster

Fatal error: Class 'cite' not found

 
0
  #1
31 Days Ago
Greetings! I'm developing my own wiki and installed v1.6.5. I use MySQL v5.0.83. The wiki itself functions fine but after adding the extension Cite.php and adding the call command require_once( "$IP/extensions/Cite/Cite.php"); it gives me the stubborn fatal error message Fatal error: Class 'Cite' not found in $IP/wiki/extensions/Cite/Cite.php on line 54.
From my research this is failing to call Cite.php from itself which sounds impossible. Truly at a loss here.

Cite.php:

  1. <?php
  2. if ( ! defined( 'MEDIAWIKI' ) )
  3. die();
  4. /**#@+
  5.  * A parser extension that adds two tags, <ref> and <references> for adding
  6.  * citations to pages
  7.  *
  8.  * @addtogroup Extensions
  9.  *
  10.  * @link http://www.mediawiki.org/wiki/Extension:Cite/Cite.php Documentation
  11.  *
  12.  * @bug 4579
  13.  *
  14.  * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
  15.  * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
  16.  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
  17.  */
  18.  
  19. if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
  20. $wgHooks['ParserFirstCallInit'][] = 'wfCite';
  21. } else {
  22. $wgExtensionFunctions[] = 'wfCite';
  23. }
  24.  
  25. $wgExtensionCredits['parserhook'][] = array(
  26. 'path' => __FILE__,
  27. 'name' => 'Cite',
  28. 'author' => 'Ævar Arnfjörð Bjarmason',
  29. 'description' => 'Adds <nowiki><ref[ name=id]></nowiki> and <nowiki><references/></nowiki> tags, for citations', // kept for b/c
  30. 'descriptionmsg' => 'cite_desc',
  31. 'url' => 'http://www.mediawiki.org/wiki/Extension:Cite/Cite.php'
  32. );
  33. $wgParserTestFiles[] = dirname( __FILE__ ) . "/citeParserTests.txt";
  34. $wgExtensionMessagesFiles['Cite'] = dirname( __FILE__ ) . "/Cite.i18n.php";
  35. $wgAutoloadClasses['Cite'] = dirname( __FILE__ ) . "/Cite_body.php";
  36. $wgSpecialPageGroups['Cite'] = 'pagetools';
  37.  
  38. define( 'CITE_DEFAULT_GROUP', '');
  39. /**
  40.  * The emergency shut-off switch. Override in local settings to disable
  41.  * groups; or remove all references from this file to enable unconditionally
  42.  */
  43. $wgAllowCiteGroups = true;
  44.  
  45. /**
  46.  * An emergency optimisation measure for caching cite <references /> output.
  47.  */
  48. $wgCiteCacheReferences = false;
  49.  
  50. function wfCite() {
  51. new Cite;
  52. return true;
  53. }
  54.  
  55. /**#@-*/
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 800
Reputation: darkagn has a spectacular aura about darkagn has a spectacular aura about darkagn has a spectacular aura about 
Solved Threads: 110
darkagn's Avatar
darkagn darkagn is offline Offline
Practically a Posting Shark
 
0
  #2
31 Days Ago
The line:
  1. new Cite;
means that there needs to be a class called Cite, not a file called Cite.php. Even if there was a Cite class, the code in the wfCite function wouldn't need that line as it doesn't reference the object after that. Remove that line and your code should be fine.
There are no stupid questions, only those too stupid to ask for help.
echo is a web developer's best friend.
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 3
Reputation: newtodaniweb is an unknown quantity at this point 
Solved Threads: 0
newtodaniweb newtodaniweb is offline Offline
Newbie Poster
 
0
  #3
31 Days Ago
tried it. Removed new Cite; and the page loads but it fails to do anything when I put in the <ref></ref><references /> tags. It must be trying to create the Cite class for use with further handling.

The line error is actually being returned as Line 51 - which is new Cite; I just don't know what to do about it.
Last edited by newtodaniweb; 31 Days Ago at 3:25 am.
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 3
Reputation: newtodaniweb is an unknown quantity at this point 
Solved Threads: 0
newtodaniweb newtodaniweb is offline Offline
Newbie Poster
 
0
  #4
31 Days Ago
I fixed it - incompatible version of cite.php for Mediawiki 1.6.5 I was ahead of the game. Anyone with this problem follow the instructions here http://www.ipbwiki.com/forums/index....ds&showfile=71
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC