E
E
evgeniy_omh2019-07-16 18:46:42
PHP
evgeniy_omh, 2019-07-16 18:46:42

How to use public_function in new file?

Friends, good afternoon. A bit off on this one. I've read a lot and nothing works.
The point is the following. There is a site on opencart, one of the opencard modules is encrypted with ioncub_loader.
There is a page that needs to be opened through the CLI, the page is also encrypted with an ioncube and just does not open.
BUT, the author, who encrypted the whole thing, issued a clean code of the following form with the following comment

public function do_seo() {
$this->load->model('localization/language');
$this->load->model('module/revolution');
$seo_data = $this->config->get('revtheme_seo');
$languages ​​= $this->model_localization_language->getLanguages();
$this->model_module_revolution->do_seodata($seo_data, $languages);
}
Call this function where needed.

That is, as I understand it, I have to create a separate php file with code that would call this function.
And through the CLI already run this PHP file.
Actually, how should the code inside this file look like? I re-read a lot about public functions, but some errors are poured at startup. Not strong. Tell me please

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zoozag, 2019-07-18
@zoozag

You need to create a controller in:
catalog/controller/folder(for example api)/filename(for example seo).php
in it you create a class:

<?php
class ControllerApiSeo extends Controller {
  // Тут вставляете код 
}

After that, you can access this method at:
{site address}/index.php?route=api/seo/do_seo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question