Yii2 Module setup in advanced template - yii2-advanced-app

I have created a module in frontend folder path is frontend/modules/module-name/Module.php. I am getting ReflectionException error as Class app\modules\module-name\Module does not exist. In frontend/config/main.php i have added this configuration
'modules' => [
'module-name' => [
'class' => 'app\modules\module-name\Module'
]
Can anyone help why i am getting this ReflectionException error

You said that you are using an advanced template, folder path is frontend/modules/module-name/Module.php, but you are requiring app\modules\module-name\Module class. It looks like a namespace from basic application template.
In case of advanced template, make sure that Module.php file is in frontend/modules/module-name folder, has a namespace frontend\modules\module-name and you are requiring frontend\modules\module-name\Module class.

Related

Circular reference detected on TYPO3 11 backend login page

I have a weird error when trying to call the TYPO3 11 backend login page.
I updated from TYPO3 10 and can't login anymore.
I already removed all of my custom extensions, but the error persists and I can't make out where it comes from or why.
It seems to crash when reaching the first f:form.hidden field of the default login Fluid template.
As this is an obvious issue that probably would have got caught by core devs, I am pretty sure that this is correlated to a configuration of my instance, but as I said, this is to weird of an issue for me and I have no idea where to dig for the issue.
This is error message:
I can provide the whole stacktrace if needed.
Did you update your .htaccess file with the new rules for the TYPO3 backend? You can find a sample file in the the Resources folder of install tool extension: typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/root-htaccess
And I assume that you cleared all caches in the install tool and did a composer dump-autoload.
I discovered the source of this issue.
I had the following configuration automatically generated in my LocalConfiguration.php.
'SC_OPTIONS' => [
'GLOBAL' => [
'softRefParser' => [
'email' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'ext_fileref' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'notify' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'substitute' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'typolink' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'typolink_tag' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
'url' => 'TYPO3\\CMS\\Core\\Database\\SoftReferenceIndex',
],
],
...
This caused the above error message. After removing this part from my configuration, the system lets me login and works flawlessly.

Type error: Argument 1 passed to Jenssegers\Mongodb\Query\Builder::__construct() must be an instance of Jenssegers\Mongodb\Connection

An application which is written in Laravel using mondodb as backend where "jenssegers/laravel-mongodb" vendor used as interface. Post loading application in browser throws following error :
Type error: Argument 1 passed to
Jenssegers\Mongodb\Query\Builder::__construct() must be an instance of
Jenssegers\Mongodb\Connection, instance of
Illuminate\Database\MySqlConnection given
Solution which helped me :
In .env file which overrides the config files.
it had DB_CONNECTION=mysql.
Changing it to following, fixed this bug.
DB_CONNECTION=mongodb
Work of caution :
Please ensure to provide correct value based on your server setup for following .env variable, I've kept it as default.
DB_CONNECTION=mongodb
DB_HOST=127.0.0.1
DB_PORT=27017
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
if using two database connection together and have this problem with passport
modify setting in this Path:
vendor/laravel/passport/config/passport.php
and then change this lines:
'storage' => [
'database' => [
'connection' => env('DB_CONNECTION', 'yourdb'),
],
],

i am trying to configure Lexik JWT Bundle but i am getting error which is given below

There is no extension able to load the configuration for "jwt_private_key_path" (in /var/www/html/EduboldPortalApp/eduboldportal/app/config/parameters.yml). Looked for namespace "jwt_private_key_path", found "framework", "security", "twig", "monolog", "swiftmailer", "doctrine", "sensio_framework_extra", "doctrine_mongodb", "lexik_jwt_authentication", "fos_rest", "debug", "web_profiler", "sensio_distribution" in /var/www/html/EduboldPortalApp/eduboldportal/app/config/parameters.yml (which is being imported from "/var/www/html/EduboldPortalApp/eduboldportal/app/config/config.yml").
There is no extension able to load the configuration for "jwt_private_key_path" (in /var/www/html/EduboldPortalApp/eduboldportal/app/config/parameters.yml). Looked for namespace "jwt_private_key_path", found "framework", "security", "twig", "monolog", "swiftmailer", "doctrine", "sensio_framework_extra", "doctrine_mongodb", "lexik_jwt_authentication", "fos_rest", "debug", "web_profiler", "sensio_distribution"
Are you sure the bundle has been added to the app/AppKernel.php ?
From the error it seems like symfony is not loading the bundle.

Joomla - How to install custom logger class

To meet my needs, I have created a custom logger class which extends JLogLoggerFormattedtext.
The file is located in the /libraries/joomla/log/logger directory.
This way I can use it like any other logger class and it works fine :
JLog::addLogger(
array(
'logger' => 'formattedtextsmt',
'text_file' => 'my_comp_site.log.php',
),
[..]
);
But now, I d'like to make it part either from a component I developed or a dedicated library so that it can be installed properly from the admin UI.
How can I do to make my logger class available for addLogger when it is not located in the joomla/log/logger directory ?

load external class placed in vendor folder in controller by composer cakephp3

Actually i want to use soap class in my cakephp application. For that i have created one class file named Wsdl as it call function of wsdl using soap which is placed in Vendor directory.
Now in my ClassController i want to include this class by composer.
below is my composer.json file code:
"autoload": {
"psr-4": {
"App\\": "src"
},
"classmap": [
"./vendor/WsdlClass/Wsdl"
]
},
in my ClassController i am trying to include this file using
useing code:
use Vendor\WsdlClass\Wsdl;
I am getting error of
Error: Class 'vendor\WsdlClass\Wsdl' not found
How can i fix this issue of composer??