Welcome Guest, Not a member yet? Register   Sign In
Inherited an CI project and am pretty lost with it.
#1

Hello!

I inherited some old(?) CI project against my will and now I need to make some updates but I'm pretty lost with the configuration.

A little background: I know PHP and I've been using Drupal for like 10 or so years. I've done stuff with Joomla, WP, Symfony and plain PHP. I'd like to think myself as a PHP professional. I have also inherited stuff before that I had no prior experience with and always managed to get by.

But now I'm stuck with this. This is running live currently and we're at the planning stage of an new system but before we get that going, customer wants some changes to their CI application. There's no documentation to go by.

I have downloaded the code from live server to my local environment running Ddev based Docker setup. This setup has worked for Symfony, Drupal, Joomla & WP sites, so I'm assuming it should be fine for CI app as well.

I also have gone through the configs in system/application/config and tried to make necessary changes for local Docker env. I'm pretty sure I've got most things configured, since I do get DB connection and can see configs with xdebug. The system is also redirecting me to /login path which makes me think that atleast something works.

However, I'm completely stuck with some routing troubles. 

No matter what URL I try to access, I get redirected to /login with 404 error. In my log I see this:
Code:
ERROR - 2019-03-29 00:57:01 --> Severity: Notice  --> Only variables should be passed by reference /var/www/html/system/codeigniter/Common.php 150
DEBUG - 2019-03-29 00:57:01 --> Config Class Initialized
ERROR - 2019-03-29 00:57:01 --> Severity: Notice  --> Only variables should be passed by reference /var/www/html/system/codeigniter/Common.php 150
DEBUG - 2019-03-29 00:57:01 --> Hooks Class Initialized
ERROR - 2019-03-29 00:57:01 --> Severity: Notice  --> Only variables should be passed by reference /var/www/html/system/codeigniter/Common.php 150
DEBUG - 2019-03-29 00:57:01 --> URI Class Initialized
ERROR - 2019-03-29 00:57:01 --> Severity: Notice  --> Only variables should be passed by reference /var/www/html/system/codeigniter/Common.php 142
ERROR - 2019-03-29 00:57:16 --> 404 Page Not Found --> q

While debugging system/libraries/Router.php I can see that it tries to access URI "q". So perhaps there's something wrong with url rewriting?

TBH, I have a lot to learn with CI, but it would be easier if I'd get this app up locally to debug more.

From what I've read, CI is pretty loose with how you do stuff so I fear that this app may not have been coded following best practices. 

But if I get this up locally I'm pretty sure I can reverse-engineer how this CI app works.

So as I'm going through the documentation, I would really appreciate any input as to how to get this up and running.

Thanks for any advice.

/ Janne
Reply
#2

Hello,
it's a very old codeigniter instalation.
If your PHP version is greater than 7.*, change it to 5.* (if you can) .
Or upgrade Codeigniter with new version.
see: https://github.com/bcit-ci/CodeIgniter/issues/5224
Reply
#3

(This post was last modified: 03-29-2019, 08:19 AM by InsiteFX.)

Sounds like a lot of it may have to do with the php version your using.

What php version was the app running on and what is your php version?

Is the app using HMVC modules?
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#4

@Janne,

Also, by any chance do you know what CI version your running?
Reply
#5

Thanks for the responses fellas!

About PHP version, I have my local environment on 7.2.14, but quick glance to the server where the live site lives has 7.2.15. Or that's what php --version tells me.

Previous developer did tell me before he disappeared that they had to move other one their site (running Joomla 1.5 in legacy mode, yikes) to new server because their old host stopped supporting PHP5.6 and that cannot be updated to more recent version. I thought they did not move this CI app because it did support PHP7.

From what I can tell, there's no HMVC modules installed.
This was not present in config.php
<?php
$config['modules_locations'] = array(
   APPPATH.'modules/' => '../modules/',
);


I do not know the CI version, can that be found from the code? First commits are from 2010, but the previous developer took over in 2011, I'd guess that most of the work has been done in 2011-2012.

If updating core is somewhat easy process, I could try that out. But since I have no idea if the core files have been overridden this is a bit risky move. So I'd rather get this running first.

Thanks all!

/ Janne
Reply
#6

Hmm, did I just lose my post or are they being monitored as well?

/ Janne
Reply
#7

(04-01-2019, 12:07 AM)Janne Wrote: Hmm, did I just lose my post or are they being monitored as well?

/ Janne

The first few posts of new users are moderated. This was mentioned in the policies at signup, and also in the forum guidelines linked to at the top of each subforum.
Reply
#8

(04-01-2019, 12:14 AM)ciadmin Wrote:
(04-01-2019, 12:07 AM)Janne Wrote: Hmm, did I just lose my post or are they being monitored as well?

/ Janne

The first few posts of new users are moderated. This was mentioned in the policies at signup, and also in the forum guidelines linked to at the top of each subforum.

Haha, all good.


I did ofcourse read all of that. I just wasn't sure that I didn't click "Cancel" Smile

Thanks!
Reply
#9

(04-01-2019, 12:02 AM)Janne Wrote: Thanks for the responses fellas!

About PHP version, I have my local environment on 7.2.14, but quick glance to the server where the live site lives has 7.2.15. Or that's what php --version tells me.

Previous developer did tell me before he disappeared that they had to move other one their site (running Joomla 1.5 in legacy mode, yikes) to new server because their old host stopped supporting PHP5.6 and that cannot be updated to more recent version. I thought they did not move this CI app because it did support PHP7.

From what I can tell, there's no HMVC modules installed.
This was not present in config.php
<?php
$config['modules_locations'] = array(
   APPPATH.'modules/' => '../modules/',
);


I do not know the CI version, can that be found from the code? First commits are from 2010, but the previous developer took over in 2011, I'd guess that most of the work has been done in 2011-2012.

If updating core is somewhat easy process, I could try that out. But since I have no idea if the core files have been overridden this is a bit risky move. So I'd rather get this running first.

Thanks all!

/ Janne

If the app use wiredesignz for HMVC, there is no

PHP Code:
<?php
$config
['modules_locations'] = array(
 
  APPPATH.'modules/' => '../modules/',
); 

You should find an MX folder into third_party folder and MY_Router.php, MY_Loader.php into application/core
Reply
#10

(This post was last modified: 04-01-2019, 05:22 AM by Krycek.)

Version can be found in system/core/codeigniter.php (const CI_VERSION), there it will list the version number or use echo CI_VERSION;

Edit: If HMVC is used (you can see this probably in the third_party folder which should contain an MX directory)
As for HMVC (probably of WireDesignz), this is not compatible (see the pull requests on howto fix some of the issues).
But for PHP7.3 you could use https://github.com/N3Cr0N/CodeIgniter-HMVC instead of https://bitbucket.org/wiredesignz/codeig...sions-hmvc (which is not supported anymore ?)
Reply




Theme © iAndrew 2016 - Forum software by © MyBB