How to extend classes in purchased product (Multiscraper) built on Codeigniter 2.1.3

三世轮回 提交于 2019-12-11 23:42:33

问题


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.

来源:https://stackoverflow.com/questions/53809701/how-to-extend-classes-in-purchased-product-multiscraper-built-on-codeigniter-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!