[Tutorial] How to Port 1.4.x Extension to 1.5.x
Posted: Fri Apr 29, 2011 11:17 am
So some of you extension developers have likely been looking through the code to convert your 1.4.x extensions to 1.5.x.
Here is a brief breakdown (tho not limited to just these changes). Using a good code editor, follow the steps below using specific find/replace based on the context. Perhaps a good regex string can make it more global, but for now, some examples for manual completion.
1. URL's have changed to the new url class
a. HTTP, no arguments:
FIND:
REPLACE WITH:
b. HTTP, with arguments:
FIND:
REPLACE WITH:
c. HTTPS, no argument:
FIND:
REPLACE WITH:
d. HTTPS, with argument:
FIND:
REPLACE WITH:
e. HTTPS, with token argument:
FIND:
REPLACE WITH:
2. Breadcrumbs have moved to the individual controller
GLOBAL FIND:
GLOBAL REPLACE WITH:
3. Document class is private now and requires the use of accessor functions
FIND:
REPLACE WITH:
4. Render has changed
GLOBAL FIND:
GLOBAL REPLACE WITH:
5. Multiple Instance Modules
Modules are a whole new ball game now. They are instance based so your best bet it to look at the existing latest module and see how it breaks down.
Here is a brief breakdown (tho not limited to just these changes). Using a good code editor, follow the steps below using specific find/replace based on the context. Perhaps a good regex string can make it more global, but for now, some examples for manual completion.
1. URL's have changed to the new url class
a. HTTP, no arguments:
FIND:
Code: Select all
HTTP_SERVER . 'index.php?route=common/home'
Code: Select all
$this->url->link('common/home')
FIND:
Code: Select all
HTTP_SERVER . 'index.php?route=product/product&product_id=' . $result['product_id']
Code: Select all
$this->url->link('product/product', 'product_id=' . $result['product_id'])
FIND:
Code: Select all
HTTP_SERVER . 'index.php?route=account/login'
Code: Select all
$this->url->link('account/login', '', 'SSL')
FIND:
Code: Select all
HTTP_SERVER . 'index.php?route=product/product&product_id=' . $result['product_id']
Code: Select all
$this->url->link('account/order', 'order_id=' . $result['order_id'], 'SSL')
FIND:
Code: Select all
HTTPS_SERVER . 'index.php?route=catalog/category&token=' . $this->session->data['token']
Code: Select all
$this->url->link('catalog/category', 'token=' . $this->session->data['token'], 'SSL')
GLOBAL FIND:
Code: Select all
$this->document->breadcrumbs
Code: Select all
$this->data['breadcrumbs']
FIND:
Code: Select all
$this->document->title = xxxxx
Code: Select all
$this->document->setTitle('xxxxx')
GLOBAL FIND:
Code: Select all
$this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
Code: Select all
$this->response->setOutput($this->render());
5. Multiple Instance Modules
Modules are a whole new ball game now. They are instance based so your best bet it to look at the existing latest module and see how it breaks down.