[Tutorial] How to Port 1.4.x Extension to 1.5.x
1 post
• Page 1 of 1
[Tutorial] How to Port 1.4.x Extension to 1.5.x
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'
REPLACE WITH:
- Code: Select all
$this->url->link('common/home')
b. HTTP, with arguments:
FIND:
- Code: Select all
HTTP_SERVER . 'index.php?route=product/product&product_id=' . $result['product_id']
REPLACE WITH:
- Code: Select all
$this->url->link('product/product', 'product_id=' . $result['product_id'])
c. HTTPS, no argument:
FIND:
- Code: Select all
HTTP_SERVER . 'index.php?route=account/login'
REPLACE WITH:
- Code: Select all
$this->url->link('account/login', '', 'SSL')
d. HTTPS, with argument:
FIND:
- Code: Select all
HTTP_SERVER . 'index.php?route=product/product&product_id=' . $result['product_id']
REPLACE WITH:
- Code: Select all
$this->url->link('account/order', 'order_id=' . $result['order_id'], 'SSL')
e. HTTPS, with token argument:
FIND:
- Code: Select all
HTTPS_SERVER . 'index.php?route=catalog/category&token=' . $this->session->data['token']
REPLACE WITH:
- Code: Select all
$this->url->link('catalog/category', 'token=' . $this->session->data['token'], 'SSL')
2. Breadcrumbs have moved to the individual controller
GLOBAL FIND:
- Code: Select all
$this->document->breadcrumbs
GLOBAL REPLACE WITH:
- Code: Select all
$this->data['breadcrumbs']
3. Document class is private now and requires the use of accessor functions
FIND:
- Code: Select all
$this->document->title = xxxxx
REPLACE WITH:
- Code: Select all
$this->document->setTitle('xxxxx')
4. Render has changed
GLOBAL FIND:
- Code: Select all
$this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
GLOBAL REPLACE WITH:
- 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.

Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
-

Qphoria - Administrator
- Posts: 18199
- Joined: Mon Jul 21, 2008 7:02 pm

1 post
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests













