• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error after update

#1
Hi, 
I recently upgraded to CI4 and also updated my WAMP to the latest version.

But my project hasn't worked since. There is MY_Controller class that is inherited from CI_Controller placed in application/core/

It gives me this error:

Code:
An uncaught Exception was encountered
Type: Error

Message: The "Generator" class is reserved for internal use and cannot be manually instantiated

Filename: C:\wamp64\www\alnoor\system\core\Loader.php

Line Number: 1285

Backtrace:

File: C:\wamp64\www\alnoor\application\core\MY_Controller.php
Line: 7
Function: __construct

File: C:\wamp64\www\alnoor\index.php
Line: 315
Function: require_once

Anybody knows what this means or how can I get it fixed?
Reply

#2
Version 3.x to 4 is less an upgrade than a migration - you'll have to rewrite the code for the site. See https://codeigniter4.github.io/userguide...e_4xx.html for details.
Reply

#3
(03-04-2020, 05:14 AM)maxxd Wrote: Version 3.x to 4 is less an upgrade than a migration - you'll have to rewrite the code for the site. See https://codeigniter4.github.io/userguide...e_4xx.html for details.

Hi, thanks for the reply.

It turns out there's a built in class called 'Generator', and I have a custom library with the same name. So that created the conflict.
I changed my library's name to 'My_generator' and changed the code accordingly and it works now, or at least shows a homepage.
However, you're right about the migration, I might get more errors like this as I test my code.
Reply

#4
@saror88 You should read up on namespaces. They'll help you to not have conflicts like this, and you'll get a whole lot more use out of CI4 once you get used to it.
Support Development  • Practical CodeIgniter 3  •
Myth:AuthVulcan - CLI Tools for CI4
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.