OXID 6.0 - Module with namespaces not working on Windows

Hello,

I’ve created an example module for OXID6 GitHub - linslin/oxid6-example-module: A simple and basic OXID 6 example module. which uses namespaces. Unfortunately this module is not working when using namespaces and I can’t figure out whats wrong. I’ve tried a lot but it seems that something is broken with composer autoloader. I’m using oxid-esales/oxideshop-ce v6.0.0 with Windows10 64bit, PHP7.1. I also tried PHP5.6 but it still not working.

The same module runs like charm on Ubuntu 16.04 with PHP5.6.3.

Install via composer:

composer require linslin/oxid6-example-module:dev-master

This is my OXID error log:

[05 Dec 15:21:46.003093 2017] [exception] [type OxidEsales\Eshop\Core\Exception\SystemComponentException] [code 0] [file C:\development\webroot\test-shop\app\vendor\oxid-esales\oxideshop-ce\source\Core\UtilsObject.php] [line 222] [message EXCEPTION_SYSTEMCOMPONENT_CLASSNOTFOUND linslinexamplemodulemain]
[05 Dec 15:21:46.003093 2017] [exception] [stacktrace] #0 C:\development\webroot\test-shop\app\source\oxfunctions.php(103): OxidEsales\EshopCommunity\Core\UtilsObject->oxNew(‘linslinexamplem…’)
#1 C:\development\webroot\test-shop\app\vendor\oxid-esales\oxideshop-ce\source\Core\ShopControl.php(372): oxNew(‘linslinexamplem…’)
#2 C:\development\webroot\test-shop\app\vendor\oxid-esales\oxideshop-ce\source\Core\ShopControl.php(272): OxidEsales\EshopCommunity\Core\ShopControl->_initializeViewObject(‘linslinexamplem…’, NULL, NULL, NULL)
#3 C:\development\webroot\test-shop\app\vendor\oxid-esales\oxideshop-ce\source\Core\ShopControl.php(137): OxidEsales\EshopCommunity\Core\ShopControl->_process(‘linslinexamplem…’, NULL, NULL, NULL)
#4 C:\development\webroot\test-shop\app\vendor\oxid-esales\oxideshop-ce\source\Core\OXID.php(26): OxidEsales\EshopCommunity\Core\ShopControl->start()
#5 C:\development\webroot\test-shop\app\source\index.php(15): OxidEsales\EshopCommunity\Core\OXID::run()
#6 C:\development\webroot\test-shop\app\source\admin\index.php(11): require_once(‘C:\development\…’)
#7 {main}

I also tried this example GitHub - proudcommerce/psHelloWorld: OXID 6 module example but this results in the same error “controller not found”. I followed the official docu about Modules in OXID 6 but it seems to be not correct.

I’ve 2 questions:

  • How to make this module work right so “Hello World” getting displayed inside the admin backend?
  • How could I debug this error by myself?

Thanks in advance
Lin

I tested in a fresh oxid installation, its working.

composer require proudcommerce/pshelloworld:dev-packagist

After this i can activate the module without any exception and can see the [psHelloWorld] meta title on the startpage.

Do you finde module in /vendor/composer/installed.json and vendor/composer/autoload_static.php?

@ProudCommerce thanks for your feedback.Yes, ps/pshelloworld is present in /vendor/composer/installed.json and vendor/composer/autoload_static.php.

autoload_static.php

    'ProudSourcing\\HelloWorld\\' => 
    array (
        0 => __DIR__ . '/../..' . '/source/modules/ps/pshelloworld',
    ),

Have you tried this one https://github.com/linslin/oxid6-example-module too? Could you please tell me which OS you using?

Thanks

I have installed your module without any problems. No exception …

composer require linslin/oxid6-example-module

macOS Sierra (docker PHP7)

Ok, it seems to work nice on my linux machine with PHP5.6.3. Could someone test composer require linslin/oxid6-example-module:dev-master on an other Windows machine and tell me if its working? Does someone know why my module is not working on a Windows10 machine?

Thanks!

Modules are currently not supported on Windows

Hi!

This came up already within another thread (see here: Installationsproblem wg Git / Composer).

As this functionality seems to me to be essential I am really astonished to learn that it is missing so far. I honestly wonder why it has been released with such a misbehaviour.

Anyway, shit happens… :slight_smile:
Well, can someone inform us if and when the community can expect it to be fixed?

Thanks a lot,
Steffen

imho using windows for webserver is a misbehaviour.
Its like people living in the city and buying 4x4 offroad jeeps, then complaining about narrow streets and small parking lots.

Since oxid never officially supported something else than apache on linux, i would not expect it to be “fixed”.

2 Likes

Folks, could you please open a bug about it? I mean: not that I really get the point (why not simply work with one of VMs within your Windows host?), but maybe someone could help with a little effort to resolve this issue. Cheers!
https://bugs.oxid-esales.com

1 Like

Thanks for your quick replies!
Well, seems like a variation of the old story of making assumptions about a perfect and great world instead of having a look onto the real world. Unfortunately the real world exists with dumb folks working onto windows machines :confused: , and some of them might have at least respect concerning that virtualization…

But now I see definitely clearer the reason behind the suggestion to install a virtual machine with an embedded Linux. To my mind this wasn’t necessary so far, or did I miss something?

I would expect that a least a couple of users won’t be able to handle that virtualization issue, and that’s not necessarily the fault of that users. I’m afraid Nerds tend to forget the ugly real world mentioned above :wink:.

Kind regards,
Steffen

1 Like

Issue now opened at 0006737: Module with namespaces not working on Windows - OXID eShop bugtrack

@vanilla_thunder “imho using windows for webserver is a misbehaviour.”

Since PHP & Apache are cross-platform tools your statement is totally wrong. How should this be a misbehaviour since PHP & Apache are made for cross-platform. In that way it’s a absolutely normal behavior to use them for what they were made for. I realy love all platforms (Unix, Linux, Windows) but I realy dont like *NIX guys hating all stuff which is not *NIX. IMO this is a misbehaviour =)

So let me tell you:

  • Apache supports Unix, Linux, Win32, Netware and some others
  • PHP supports Unix, Linux, Windows and some others
2 Likes

Have a look at the system requirements, there was not a single word about any operating systems in all those years: OXID eShop - The shop system for demanding e-commerce projects • OXID eSales AG

Since V6 it says: “Apache Versionen 2.2 and 2.4 (on Linux)”
So Apache, PHP, MYSQL and even Stuff like Git, Composer etc. is cross-platform, but not OXID?

Here’s what i changed, in \vendor\oxid-esales\oxideshop-ce\source\Core\Module\ModuleChainsGenerator.php (mind the backslashes ;)), from line 229, method createClassExtensions:
(I wanted to post it here, but the forum won’t let me, i added a note in bugtracker)

2 Likes

okay, my bad, i was sure there was something like “apache 1.3 on linux” before the recent website update.
But i even found this in an old readme file from v4.6:

so, leofonic is right. i’m sorry for my fake news.

Since my statement displays my opinion, it can’t be wrong per definition.
And if you take couple of seconds to read my post more carefully than you did before, you should realize that i did not say anything about PHP, but just webserver in general. Webservers are more than just PHP. A developer should actually know this fact…
By the way, i’m absolutely not a “windows hating *nix guy”. I use windows at home and at work, but unlike some other people i’m aware, that a desktop OS which originally was developed for other purposes than servers and is also known for having more security holes and bugs than every other software, can not fully replace a dediacted server OS and provide all the same functions and features in the same seamless way.
Just tell your hoster you want a windows server on the internet “for PHP and stuff”. He will laugh and say “good joke. You are joking, right? Please tell me, you were joking. You are not joking? Whats wrong with you?”

Just because you can install apache on a potato, it doesn’t mean you should run a webserver on it.

Hey @leofonic,

I tried your fix but it’s not working over here :(. I probaby missed something. Do I have to change some stuff in my module code, too? Currently it looks like createClassExtensions() is never called over here.

Update:
OK, well I figured out that I have to reinstall my module via composer. Thanks @leofonic!

Well that’s how web people see it, but there are a lot more windows servers out there than linux servers.

1 Like

I also tried this example https://github.com/linslin/oxid6-example-module but this results in the same error “[message EXCEPTION_SYSTEMCOMPONENT_CLASSNOTFOUND linslinexamplemodulemain]".

Ohhhh i have probably the same problem, but i want to create widget with metadata 2.0 and have the same error and im using oxid_vm.

If you are using oxid_vm, its an other problem.

There is a fix in OXID 6.1 :wink:

1 Like

I made a PR :wink:

1 Like