I tried to create new module in vendor
directory in Magento Enterprise 2.0.0.
The module could not be loaded after I ran the Magento setup:upgrade
.
If I move my files to the app/code
directory, the module will be set up successfully.
For Magento 2 Enterprise edition, all modules are in vendor
directory but Community edition uses app/code
directory. I wonder if it is possible to create custom module in the vendor
directory. If yes, what are the differences between creating a custom module in app/code
and vendor
.
vendor/Test/Testing/registration.php
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Test_Testing',
__DIR__ );
vendor/Test/Testing/composer.json
{ "name": "test/testing", "description": "Testing", "require": {
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/framework": "100.0.*" }, "type": "magento2-module", "version": "0.1.0", "license": [
"proprietary" ], "autoload": {
"files": [ "registration.php" ],
"psr-4": {
"Test\\Testing\\": ""
} } }
vendor/Test/Testing/etc/module.xml
<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Test_Testing" setup_version="0.1.0">
</module> </config>
Company\Reviews\Cron\Check
in file/vendor/company/Reviews/Cron/Check.php
and I have a cronjob likeCompany\Reviews\Cron\Check
but in databasecron_schedule
it just says "Class Company\Reviews\Cron\Check does not exist"