致命错误:Class' ipsRegistry'找不到 - PHP

时间:2014-04-18 22:16:31

标签: php class error-handling

当我尝试使用ipsRegistry类时,我总是遇到此错误。

Fatal error: Class 'ipsRegistry' not found in path/info.php on line 4

我不知道为什么会这样。

info.php的

<?php
require_once( 'http://website.com/forum/initdata.php' );
require_once( 'http://website.com/forum/admin/sources/base/ipsRegistry.php' );
$registry = ipsRegistry::instance();
$registry->init();

// Fetch member details
$member = $registry->member()->fetchMemberData();

// Print the display name
print $member['members_display_name'];
?>

ipsRegistery.php包含类:

<?php
/**
 * <pre>
 * Invision Power Services
 * IP.Board v3.4.6
 * ipsRegistry:: Registry file controlls handling of objects needed throughout IPB
 * Last Updated: $Date: 2013-10-16 12:57:41 -0400 (Wed, 16 Oct 2013) $
 * </pre>
 *
 * @author      $Author: AndyMillne $
 * @copyright   (c) 2001 - 2009 Invision Power Services, Inc.
 * @license     http://www.invisionpower.com/company/standards.php#license
 * @package     IP.Board
 * @link        http://www.invisionpower.com
 * @since       Tue. 17th August 2004
 * @version     $Rev: 12380 $
 */

/**
* Base registry class
*/
class ipsRegistry
{
    /**
     * Holds instance of registry (singleton implementation)
     *
     * @var     object
     */
    private static $instance;

    /**
     * Registry initialized yet?
     *
     * @var     boolean
     */
    private static $initiated = FALSE;

    /**
     * SEO templates
     *
     * @var     array
     */
    protected static $_seoTemplates = array();

    /**
     * Incoming URI - used in SEO / fURL stuffs
     *
     * @var     string
     */
    protected static $_uri = '';

    /**
     * Flag to note incorrect FURL (no furl template match)
     *
     * @var     string
     */
    protected static $_noFurlMatch = false;

    /**#@+
     * Holds data for app / coreVariables
     *
     * @var     array
     */
    protected static $_coreVariables            = array();
    protected static $_masterCoreVariables  = array();
    /**#@-*/

    /**
     * Handles for other singletons
     *
     * @var     array
     */
    protected static $handles                   = array();

文件本身很长,上面的代码只是一个片段。我该如何解决这个问题?它是文件路径的问题吗?

2 个答案:

答案 0 :(得分:0)

您不能要求它在网站中的文件。您只需要一个文件系统中的文件。如果你把http://包含输出而不是整个文件。

答案 1 :(得分:0)

有点晚但可能有助于未来的查询...

尝试更改:

require_once( 'http://website.com/forum/initdata.php' );
require_once( 'http://website.com/forum/admin/sources/base/ipsRegistry.php' );     

要:

 require_once(IPS_ROOT_PATH."sources/base/ipsRegistry.php");
 require_once(IPS_ROOT_PATH."sources/base/ipsController.php");
相关问题