944,054 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 1034
  • PHP RSS
Nov 11th, 2009
0

Fatal error: Class 'cite' not found

Expand Post »
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:

PHP Syntax (Toggle Plain Text)
  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. /**#@-*/
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
newtodaniweb is offline Offline
3 posts
since Nov 2009
Nov 11th, 2009
0
Re: Fatal error: Class 'cite' not found
The line:
php Syntax (Toggle Plain Text)
  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.
Reputation Points: 395
Solved Threads: 192
Veteran Poster
darkagn is offline Offline
1,136 posts
since Aug 2007
Nov 11th, 2009
0
Re: Fatal error: Class 'cite' not found
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; Nov 11th, 2009 at 3:25 am.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
newtodaniweb is offline Offline
3 posts
since Nov 2009
Nov 11th, 2009
0
Re: Fatal error: Class 'cite' not found
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
newtodaniweb is offline Offline
3 posts
since Nov 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: textarea count commas.
Next Thread in PHP Forum Timeline: header problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC