Page 3 of 4

Re: Extension Developers Prepare for the Cloud!

Posted: Thu Jun 29, 2017 11:48 am
by JNeuhoff
Actually, creating twig-templates is harder, and for Opencart offers no major advantages.
It's easy enough to add support for the PHP template engine to the OC frontend.

Re: Extension Developers Prepare for the Cloud!

Posted: Thu Jun 29, 2017 5:25 pm
by ovi
JNeuhoff wrote:
Thu Jun 29, 2017 11:48 am
Actually, creating twig-templates is harder, and for Opencart offers no major advantages.
It's easy enough to add support for the PHP template engine to the OC frontend.
It's not harder to create twig templates (you just have to get used to with twig), but I agree that twig doesn't offer any advantages for Opencart.

If anybody knows any real advantages of twig for OC please post them here, because IMO twig is not suitable for OC, because most extensions do changes in templates and now they must support 2 different versions: one for tpl (OC 1.5.x and OC 2.x) and the other for twig (OC 3.x +). And I still believe, based on the few tests I made, that twig slows down OC.

Re: Extension Developers Prepare for the Cloud!

Posted: Thu Jun 29, 2017 5:55 pm
by ashwani_multi
i m converting my all module 3.x found that much slower any suggestion

Re: Extension Developers Prepare for the Cloud!

Posted: Thu Jul 06, 2017 3:57 pm
by DigitCart
Daniel wrote:
Fri Mar 03, 2017 2:04 pm
3. All files are only allowed to be written in extension folders, except templates which of course go under the template folder.
artcore wrote:
Mon Jun 26, 2017 6:54 pm
$allowed = array(
'admin/controller/extension/',
'admin/language/',
'admin/model/extension/',
'admin/view/image/',
'admin/view/javascript/',
'admin/view/stylesheet/',
'admin/view/template/extension/',
'catalog/controller/extension/',
'catalog/language/',
'catalog/model/extension/',
'catalog/view/javascript/',
'catalog/view/theme/',
'system/config/',
'system/library/',
'image/catalog/'
);
I am confused. Can we use the system/library directory?

Re: Extension Developers Prepare for the Cloud!

Posted: Thu Jul 06, 2017 9:04 pm
by OpenCart Addons
DigitCart wrote:
Thu Jul 06, 2017 3:57 pm
I am confused. Can we use the system/library directory?
Yes, you can add extension files to system/library/

The OpenCart wiki has been updated to show what directories you're able to add extension files to.


Regards,
Joel.

Re: Extension Developers Prepare for the Cloud!

Posted: Thu Jul 13, 2017 11:33 pm
by ovi
Daniel wrote:
Fri Mar 03, 2017 2:04 pm
1. You are not allowed to modify any DB tables. If you need to store any data for your extension you need to create a new table and use joins.
Are we allowed to create indexes or the restrictions is for columns only?

Re: Extension Developers Prepare for the Cloud!

Posted: Fri Jul 14, 2017 12:23 am
by uksitebuilder
You can of course do anything you like with the tables you create.

Re: Extension Developers Prepare for the Cloud!

Posted: Fri Jul 14, 2017 2:52 am
by ovi
ovi wrote:
Thu Jul 13, 2017 11:33 pm
Daniel wrote:
Fri Mar 03, 2017 2:04 pm
1. You are not allowed to modify any DB tables. If you need to store any data for your extension you need to create a new table and use joins.
Are we allowed to create indexes or the restrictions is for columns only?
What I meant is: Are we allowed to create indexes on Opencart's default tables?

Re: Extension Developers Prepare for the Cloud!

Posted: Fri Jul 14, 2017 1:30 pm
by uksitebuilder
That would be modifying them, so I would say no, but it is a grey area.

If you believe there are tables that should be indexed that aren't currently indexed, you should probably put in a pull request at github for changes to the install sql

Re: Extension Developers Prepare for the Cloud!

Posted: Mon Jul 31, 2017 7:14 pm
by JNeuhoff
Daniel wrote:
Fri Mar 03, 2017 2:04 pm
3. All files are only allowed to be written in extension folders, except templates which of course go under the template folder.
This approach has the following subtle issue which should be resolved:

Assuming I install 3 different module extensions via the admin backend at

Extensions > Installer > Upload

where each module extension creates the same folder (highlighted in bold):
  1. admin/model/extension/module/my-module-1.php
  2. admin/model/extension/module/my-module-2.php
  3. admin/model/extension/module/my-module-3.php
If I then uninstall the first extension module via

Extensions > Installer > Uninstall

it will then remove the folder module
  1. admin/model/extension/module
leaving the 2nd and 3rd extension with a missing folder and its file. See also this github entry.

Re: Extension Developers Prepare for the Cloud!

Posted: Fri Aug 25, 2017 5:44 am
by Daniel
Ill fix this issue tomorrow.

Re: Extension Developers Prepare for the Cloud!

Posted: Tue Sep 12, 2017 3:17 pm
by open4dev
Hello

I would like to ask some clarifications about the cloud version in order to decide the best approach for migrating my extensions.
1) It is not clear to me how/what will be stored in the cloud. Is there a document/link that explains in more detail this new app model?
2) Will there be a special "OC3 cloud version" or are we talking about the same software?
3) An extension of mine adds a new column (i.e. a new property) in the products table and an additional property for each product option. If I were to create new tables (instead of altering existing ones) for my extension that would be used with joins, I would have to create new tables to store the relations product_id-<new_property> and product_option_id-<new_option_property>. Since the products are the main concept of the app, these tables will replicate rather a lot of information for databases with a lot of products/product options. Is this the correct way to go?

Having the above clarifications would help me migrate my extensions respecting this new spirit of the cloud philosophy.
Thanks in advance
Best regards

Re: Extension Developers Prepare for the Cloud!

Posted: Tue Sep 12, 2017 8:27 pm
by JNeuhoff
OK, I'll try to answer from what I have learned about the cloud version so far:
open4dev wrote:
Tue Sep 12, 2017 3:17 pm
I would like to ask some clarifications about the cloud version in order to decide the best approach for migrating my extensions.
1) It is not clear to me how/what will be stored in the cloud. Is there a document/link that explains in more detail this new app model?
Basically the hosting, no need to download and install on your own webhost. There is also the online marketplace for extensions for simple extension installs, though at the moment there's hardly any extensions listed in there.
open4dev wrote:
Tue Sep 12, 2017 3:17 pm
2) Will there be a special "OC3 cloud version" or are we talking about the same software?
From what I can see on github the cloud version is pretty much the same as the other OC 3.0.2.x release.
open4dev wrote:
Tue Sep 12, 2017 3:17 pm
3) An extension of mine adds a new column (i.e. a new property) in the products table and an additional property for each product option. If I were to create new tables (instead of altering existing ones) for my extension that would be used with joins, I would have to create new tables to store the relations product_id-<new_property> and product_option_id-<new_option_property>. Since the products are the main concept of the app, these tables will replicate rather a lot of information for databases with a lot of products/product options. Is this the correct way to go?
Any additional DB fields for e.g. the 'oc_product' or other tables would have to be stored in their own DB tables, and the model would have to be extended for the DB queries using SQL joins. Also the allowed folders for 3rd party extensions are more restrictive, too, you can see the list of allowed folders for extensions in file admin/controller/marketplace/install.php

Re: Extension Developers Prepare for the Cloud!

Posted: Thu Sep 14, 2017 2:39 pm
by open4dev
@JNeuhoff

Thanks for taking the time answering my questions, I appreciate that.

So if I understand it correctly I could opt-out from the cloud version, right? My modules will be installable when a user uses his/her own webhost but will not be installable in the cloud version. If later I decide to support the cloud version I could create a new version of my module specifically for the cloud.

Is my understanding correct?

JNeuhoff wrote:
Tue Sep 12, 2017 8:27 pm
Also the allowed folders for 3rd party extensions are more restrictive, too, you can see the list of allowed folders for extensions in file admin/controller/marketplace/install.php
Actually there is an additional hidden restriction: while the admin/controller/extension/ folder is allowed to be written, the way the permissions are checked in the admin/controller/startup/permission.php do not allow to create a sub-folder in the extension directory i.e. extension/my_module/my_controller.php will result in a "permission denied" page, while extension/my_controller.php will work ok. This is the case only for the controller part of the extension, language, model and template parts do not have this issue.

Re: Extension Developers Prepare for the Cloud!

Posted: Thu Sep 14, 2017 10:05 pm
by imdevlper18
Actually there is an additional hidden restriction: while the admin/controller/extension/ folder is allowed to be written, the way the permissions are checked in the admin/controller/startup/permission.php do not allow to create a sub-folder in the extension directory i.e. extension/my_module/my_controller.php will result in a "permission denied" page,
Thanks. Was shifting one extension and i created a folder as there were lot of files. But shall need to undo this.
Thanks for information.

Re: Extension Developers Prepare for the Cloud!

Posted: Thu Sep 14, 2017 11:11 pm
by JNeuhoff
Actually there is an additional hidden restriction: while the admin/controller/extension/ folder is allowed to be written, the way the permissions are checked in the admin/controller/startup/permission.php do not allow to create a sub-folder in the extension directory i.e. extension/my_module/my_controller.php will result in a "permission denied" page, while extension/my_controller.php will work ok. This is the case only for the controller part of the extension, language, model and template parts do not have this issue.
Thanks for pointing that one out. I came across the same issue and had to restructure my extensions accordingly.

Re: Extension Developers Prepare for the Cloud!

Posted: Sat Sep 30, 2017 12:42 am
by stalker780
Including anything except upload folder and install.xml in archive is now restricted for cloud extensions.

Is it possible to allow keeping at least install.txt or readme.txt file there?

Cause now people are asking questions without reading installation instructions I filled on a module page. Seems they are used to look inside archive and to search instructions there, but not on a download page.

At least for now OC3 and OC Cloud means the same. Right? Modules can be purchased via admin area (at least it's planned) the same as via marketplace on opencart.com. And in the last case people can explore archives.

Is it planned that OC3 and Cloud extensions will be different and|or incompatible? Or "Cloud" that's just a name of a new admin area marketplace?

Re: Extension Developers Prepare for the Cloud!

Posted: Sat Sep 30, 2017 12:56 am
by JNeuhoff
As you noticed they are now not allowing any files other than the upload folder and install.xml in the ocmod.zip file for the OpenCart Cloud version. The OpenCart site will soon be flooded with unneeded support requests because too many users won't find the online documentation on the OpenCart marketplace.

We may end supporting the OpenCart cloud installer and instead advise our customers to use the normal OpenCart extension installer.

Re: Extension Developers Prepare for the Cloud!

Posted: Sat Sep 30, 2017 1:27 am
by stalker780
open4dev wrote:
Thu Sep 14, 2017 2:39 pm
Actually there is an additional hidden restriction: while the admin/controller/extension/ folder is allowed to be written, the way the permissions are checked in the admin/controller/startup/permission.php do not allow to create a sub-folder in the extension directory i.e. extension/my_module/my_controller.php will result in a "permission denied" page, while extension/my_controller.php will work ok. This is the case only for the controller part of the extension, language, model and template parts do not have this issue.
I created both "extension/my_extension.php" file and "extension/my_extension" folder.
Leaving my_extension.php empty.

This placeholder file is used only to grant access for extension.

Re: Extension Developers Prepare for the Cloud!

Posted: Sat Sep 30, 2017 1:40 am
by stalker780
JNeuhoff wrote:
Sat Sep 30, 2017 12:56 am
As you noticed they are now not allowing any files other than the upload folder and install.xml in the ocmod.zip file for the OpenCart Cloud version. The OpenCart site will soon be flooded with unneeded support requests because too many users won't find the online documentation on the OpenCart marketplace.

We may end supporting the OpenCart cloud installer and instead advise our customers to use the normal OpenCart extension installer.
Ahaha! :laugh:

It's better if they would restrict using AngularJS and other frameworks and selfwritten templates as Journal2 does :laugh: