Welcome Guest, Not a member yet? Register   Sign In
upgrade from 1.4.x to 2.1.2 Error
#1

[eluser]Grego606[/eluser]
Here is what I've done so far:

Installed the latest CI in a new folder.
up dated config, database, routes and autoload
Copied controllers, models and view files from legacy site.
changed controllers to have CI_Controller and __construct()

My reward:

An Error Was Encountered
The configuration file application.php does not exist.

The error log:
[03-Oct-2012 23:53:18 UTC] PHP Fatal error: Call to undefined method CI_Controller::CI_Controller() in /home/opendoor/public_html/cg/application/controllers/home.php on line 7

home.php
/* line 5: */ public function __construct() {
/* line 6: */ parent::__construct();
/* line 7: */ }



What happen? And how do I fix it?


#2

[eluser]LuckyFella73[/eluser]
Please post the complete home.php Controller code.
#3

[eluser]Grego606[/eluser]
Code:
<?php

class Home extends CI_Controller {
  //The constructor
   public function __construct() {
    parent::__construct();
   }

function index()
{
  $this->load->model('songs_model');

  $data['song'] = $this->songs_model->get_random();

  $this->load->view('../../templates/homepage', $data);
}

function licensing()
{
  // test browser: firefox not able to display pdf's
  $this->load->view('../../templates/licensing');
}

function aboutus()
{
  $this->load->view('../../templates/aboutus');
}

/* bonus pages */
function styxii()
{
  $this->load->view('../../templates/includes/head');
  
  $this->load->view('../../templates/albumPages/styxii');
  
  $this->load->view('../../templates/includes/footer');
  $this->load->view('../../templates/includes/analytics');
}

  function gloria()
{
  $this->load->view('../../templates/includes/head');
  
  $this->load->view('../../templates/albumPages/gloria');
  
  $this->load->view('../../templates/includes/footer');
  $this->load->view('../../templates/includes/analytics');
}

  function bestofAB()
{
  $this->load->view('../../templates/includes/head');
  
  $this->load->view('../../templates/albumPages/bestofAB');
  
  $this->load->view('../../templates/includes/footer');
  $this->load->view('../../templates/includes/analytics');
}

  function crow()
{
  $this->load->view('../../templates/includes/head');
  
  $this->load->view('../../templates/albumPages/crow');
  
  $this->load->view('../../templates/includes/footer');
  $this->load->view('../../templates/includes/analytics');
}

  function zazu()
{
  $this->load->view('../../templates/includes/head');
  
  $this->load->view('../../templates/albumPages/zazu');
  
  $this->load->view('../../templates/includes/footer');
  $this->load->view('../../templates/includes/analytics');
}

  function manofMiricles()
{
  $this->load->view('../../templates/includes/head');
  
  $this->load->view('../../templates/albumPages/manofMiricles');
  
  $this->load->view('../../templates/includes/footer');
  $this->load->view('../../templates/includes/analytics');
}
  function test()
{
  $this->load->view('../../templates/includes/head');
  
  $this->load->view('../../templates/albumPages/test');
  
  $this->load->view('../../templates/includes/footer');
  $this->load->view('../../templates/includes/analytics');
}
function contactus()
{
  $this->load->view('../../templates/includes/head');
  
  $this->load->view('../../templates/contactus');
  
  $this->load->view('../../templates/includes/footer');
  $this->load->view('../../templates/includes/analytics');
}


}

/* End of file home.php */
/* Location: ./application/controllers/home.php */
#4

[eluser]LuckyFella73[/eluser]
Are you sure you are calling this controller in a 2.1.2
version of CI?

I copied your class to a working CI project and don't get
the error you have.
#5

[eluser]Grego606[/eluser]
Pretty sure.

I downloaded the latest from this site, expanded it in a directory and copied the controllers in.

http://cg.classicgaragerock.com
#6

[eluser]LuckyFella73[/eluser]
Quote:The configuration file application.php does not exist.

I would start to get rid of this error. Is it defined in
autoload.php accidently or did you just forget to copy this
config file?

#7

[eluser]Grego606[/eluser]
Found all the config and library items that defined the administrative aria.

Parse error: syntax error, unexpected T_STRING, expecting '{' in /home/opendoor/public_html/cg/application/models/datamapper.php on line 46


Code:
class DataMapper CI_Model { // this is line 46

var $table;
var $fields;
var $model;
var $error;
var $valid = FALSE;
var $validated = FALSE;
var $all = array();
var $validation = array();
var $changed = array();
var $has_many = array();
var $has_one = array();
var $error_prefix = '<p>';
var $error_suffix = '</p>';
var $created_field = 'created';
var $updated_field = 'updated';
#8

[eluser]PhilTem[/eluser]
I'd say you're Missing an extends on line 46 of that model Wink
#9

[eluser]Grego606[/eluser]
[quote author="PhilTem" date="1349450949"]I'd say you're Missing an extends on line 46 of that model Wink[/quote]

I saw that, but since it came from a fresh download of CI, I figured it must be correct.

When I put "extends" in I get:

Fatal error: Call to undefined method CI_Model::Model() in /home/opendoor/public_html/cg/application/models/datamapper.php on line 71

Code:
/**
  * Constructor
  *
  * Initialize DataMapper.
  */
function DataMapper()
{
  parent::Model(); // line 71
.
.
.

#10

[eluser]Ed Robindon[/eluser]
Where does datamapper.php come from? Doesn't seem to be part if ci...




Theme © iAndrew 2016 - Forum software by © MyBB