0

I hope my question is specific enough, even though most of you may be unfamiliar with Multiscraper (MS), you are probably familiar with Codeigniter (CI).

MS is basically built on CI 2.1.3, and is a webpage scraper for various shopping carts.

I will give a specific example of a class I want to extend. e.g.

file path:

multiscraper\application\controllers\opencart\process.php

class:

class Process extends CI_Controller {
 ... 
}

So, why do I want to extend this class? Because I have modifications and additions I want to make to improve functionality.

Why do I not make these changes in the same file? Because the developers of the product post updates to their product which may offer improvements. If I start modifying the original files directly, it will become very difficult to manage these updates when they arrive. I am hoping for a way to extend these classes with only the functions I want to improve upon. Since they will be in separate files, then it will be much easier to debug and fix things after an update.

So I was hoping to create a :

file path:

multiscraper\application\controllers\opencart\process_custom.php
or 
multiscraper\application\controllers\process_custom.php

class:

class Process_custom extends Process {
    function __construct(){
         parent::__construct();

    }
    function_to_replace {

    }
}

Unfortunately neither locations worked for me.

NOTE: bear in mind that I should not modify the original names of the classes or the filenames of the original files. I can only use my own class names and file names in the new files which I create.

Can anyone help me out here?

Thanks in advance.

conanDrum
  • 215
  • 2
  • 7
  • what error message appeared to you, can you show us? – Ray A Dec 17 '18 at 06:22
  • no errors. I checked the error log, but nothing in there. It only just does not pick up the class which I created to extend the existing class which was already there. So basically, the processing goes straight to the Process class instead of the Process_custom class. – conanDrum Dec 17 '18 at 13:11
  • In this case, you need to modify the code of the routing to add your custom class – Ray A Dec 17 '18 at 13:41
  • @Ray. Are you saying there is a way? Can you elaborate with an example to fit my case above please? – conanDrum Dec 17 '18 at 21:25
  • @Ray. Can you provide an example that would work ? – conanDrum Dec 21 '18 at 01:57

0 Answers0