Welcome Guest, Not a member yet? Register   Sign In
Codeigniter 2.2.0 & DataMapper 1.8.2 "Class 'Router' not found"
#1

[eluser]cmarfil[/eluser]
Hello,

I followed the installation guide DataMapper on a clean install of codeigniter and get the following error:

Code:
Fatal error: Class 'Router' not found in /var/www/vhosts/ciapp.com/application/third_party/datamapper/bootstrap.php on line 87

Anyone know how to fix it?

Codeigniter 2.2.0
DataMapper 1.8.2

Thanks.
#2

[eluser]InsiteFX[/eluser]
And what is on line 87 ?
#3

[eluser]cmarfil[/eluser]
On line 87: $_classes[$class] = new $name();

Here is the complete file:

Code:
<?php
/**
* Data Mapper ORM bootstrap
*
* Hooks Datamapper into the CodeIgniter core
*
* @license     MIT License
* @package     DataMapper ORM
* @category    DataMapper ORM
* @author      Harro "WanWizard" Verton
* @link        http://datamapper.wanwizard.eu/
* @version     2.0.0-dev
*/

/**
* Class registry
*
* This function acts as a singleton.  If the requested class does not
* exist it is instantiated and set to a static variable.  If it has
* previously been instantiated the variable is returned.
*
* @access public
* @param string the class name being requested
* @param string the directory where the class should be found
* @param string the class name prefix
* @return object
*/
if ( ! function_exists('load_class'))
{
function &load;_class($class, $directory = 'libraries', $prefix = 'CI_')
{
  static $_classes = array();

  // Does the class exist?  If so, we're done...
  if (isset($_classes[$class]))
  {
   return $_classes[$class];
  }

  $name = FALSE;

  // Look for the class first in the native system/libraries folder
  // thenin the local application/libraries folder
  foreach (array(BASEPATH, APPPATH) as $path)
  {
   if (file_exists($path.$directory.'/'.$class.'.php'))
   {
    $name = $prefix.$class;

    if (class_exists($name) === FALSE)
    {
     require($path.$directory.'/'.$class.'.php');
    }

    break;
   }
  }

  // Is the request a class extension?  If so we load it too
  if (file_exists(APPPATH.$directory.'/'.config_item('subclass_prefix').$class.'.php'))
  {
   $name = config_item('subclass_prefix').$class;

   if (class_exists($name) === FALSE)
   {
    require(APPPATH.$directory.'/'.config_item('subclass_prefix').$class.'.php');
   }
  }

  // Do we have a DataMapper extension for this class?
  if (file_exists($file = APPPATH.'third_party/datamapper/system/'.$class.'.php'))
  {
   require_once($file);
  }

  // Did we find the class?
  if ($name === FALSE)
  {
   // Note: We use exit() rather then show_error() in order to avoid a
   // self-referencing loop with the Excptions class
   exit('Unable to locate the specified class: '.$class.'.php');
  }

  // Keep track of what we just loaded
  is_loaded($class);

  $_classes[$class] = new $name();
  return $_classes[$class];
}
}
#4

[eluser]InsiteFX[/eluser]
Are you running the newest version?

Datamapper 1.8.2.1
#5

[eluser]cmarfil[/eluser]
Yes, 1.8.2.1 :S
#6

[eluser]InsiteFX[/eluser]
Your Router not found is the CI_Router, sounds like you are having a configuration error or setup error here.

Double check your Datamapper installation and make sure it is correct.
#7

[eluser]cmarfil[/eluser]
Solved, srry, I downloaded version 3 of codeigniter, datamapper is not compatible.

Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB