Welcome Guest, Not a member yet? Register   Sign In
Class redeclare - Problem
#1

[eluser]Stoppy[/eluser]
Hi,
I develop a website, it's 2 years I developed it on Linux (Centos and Debian) and it's 2 years I deployed the project and it's working fine.

I used to develop directly on a project i had on a VPS (centos) where I had my git repos, my backups, and so on...

Now due new necessities I finally decided to create the environment on my mac using MAMP Pro.

I cloned my repository and I started to work on my mac.

I finded out this error and I cannot understand why it happens considering it's working on other servers, production too.

I created a Library 'My_pagination' to extend the original codeigniter one.

There is just the declaration, the constructor and another method:

Code:
<?php

class MY_pagination{
  
  public function __construct()
  {
   $this->ci =& get_instance();
   $this->ci->load->library('pagination');
  }
  
  public function getPagination($maxRecord,$uriSegment,$countRows,$baseUrl)
  {

....

BUT I receive this error where I try to load it whit $this->load->library('my_pagination');

Code:
Fatal error: Cannot redeclare class MY_pagination in /Users/......my path...../web/application/libraries/My_pagination.php on line 3

I am thinking there is something bad with it on mac...

LOCAL MAC

- PHP 5.3.27
- Xcache

DEV & PODUCTION

- PHP 5.3.3


Thank you



#2

[eluser]Stoppy[/eluser]
Right now I solved changing the name to this library. And reediting the code in my application.




Theme © iAndrew 2016 - Forum software by © MyBB