![]() |
Update - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Update (/showthread.php?tid=53399) |
Update - El Forum - 07-22-2012 [eluser]Unknown[/eluser] When i try to update i get this : Fatal error: Cannot redeclare class Locale in /home/tenrouis/public_html/admin/application/libraries/Locale.php on line 12 Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); When I take it out, I get this : Fatal error: Cannot redeclare __() (previously declared in /home/tenrouis/public_html/admin/application/helpers/locale_helper.php:10) in /home/tenrouis/public_html/admin/application/libraries/Locale.php on line 126 Update - El Forum - 07-22-2012 [eluser]InsiteFX[/eluser] Code: function Locale() { Update - El Forum - 07-23-2012 [eluser]goFrendiAsgard[/eluser] @laxus: I think you have function __ in both, local_helper.php and Locale.php, try to rename the function name @InsiteFX: I think your suggestion is a "best-practice", but what @laxus write is not wrong. Update - El Forum - 07-23-2012 [eluser]Unknown[/eluser] I still get the same error. Update - El Forum - 07-23-2012 [eluser]PhilTem[/eluser] [quote author="goFrendiAsgard" date="1343027015"]@InsiteFX: I think your suggestion is a "best-practice", but what @laxus write is not wrong.[/quote] @goFrendiAsgard: If you refer to the __construct() rename, he's not referring to best-practice but more to PHP 5 conformity since __construct() is used as constructor and a function named the same as your class can either be the constructor (for PHP < 5.3.3) or a function that impractically was named the same as your class (for PHP >= 5.3.3) Update - El Forum - 07-23-2012 [eluser]TWP Marketing[/eluser] Isn't this error caused by the same class name in application/libraries and in application/helpers? When you remove the library file 'Locale.php', it may need a cache flush. Update - El Forum - 07-23-2012 [eluser]PhilTem[/eluser] [quote author="TWP Marketing" date="1343071149"]Isn't this error caused by the same class name in application/libraries and in application/helpers? When you remove the library file 'Locale.php', it may need a cache flush.[/quote] You have classes in your application/helpers? You shouldn't have. The helpers are supposed to be functions that can be called and not methods of classes. Or I got your point wrong ![]() Update - El Forum - 07-23-2012 [eluser]TWP Marketing[/eluser] No, you're correct. The helpers don't have a class name, not being a library. I'm looking for what could generate the error message of the OP. Update - El Forum - 07-23-2012 [eluser]PhilTem[/eluser] I don't have a clue yet about what is causing the error. However, I was just stumbling over this line when reading through the OP's code Code: $this->table = ('languages'); Maybe my PHP knowledge is too limited (even after almost 10 years of working with PHP), but what do the brackets do? And furthermore: Could the OP please post the 'locale_helper.php' source code? Maybe the error is in there ![]() Update - El Forum - 07-23-2012 [eluser]TWP Marketing[/eluser] @Philtem [quote author="PhilTem" date="1343074487"]I don't have a clue yet about what is causing the error. However, I was just stumbling over this line when reading through the OP's code Code: $this->table = ('languages'); I would guess this is a typo, maybe done with copy/paste. @Iaxus Could you check the code you posted in your first post and make sure this line is correct? |