CakePhp 3 elastic search - cakephp-3.0

I have installed the elastic search based on the documentation
http://book.cakephp.org/3.0/en/elasticsearch.html
I am getting an error "Unknown repository type "Elastic". Make sure you register a type before trying to use it."
by adding $this->loadModel('test', 'Elastic');

Please make sure you have the Elasticsearch plugin installed via Composer.
And then load the plugin by adding a line in config/bootstrap.php.
Plugin::load('Cake/ElasticSearch', ['bootstrap' => true]);
*If you have Composer installed globally, run:
composer require cakephp/elastic-search "#stable"
in your application root directory. Hope this will help!

Related

Checksum error for plugin github.com/hashicorp/azure version 1.3.1

Overview of the Issue
Hello there, I'm facing a checksum error while performing a packer init with azure plugin.
Failed getting the "github.com/hashicorp/azure" plugin: 1 error occurred: * could not get sha256 checksum file for github.com/hashicorp/azure version 1.3.1. Is the file present on the release and correctly named ? Get "https://objects.githubusercontent.com/github-production-release-asset-2e65be/361409316/cbfe3de3-680b-4c47-b744-bbde6a784bac?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230103%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230103T103126Z&X-Amz-Expires=300&X-Amz-Signature=52275607836fbd0304f7ce9d44575c6f128b4978fe43bd0c7f12e0b81e628552&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=361409316&response-content-disposition=attachment%3B%20filename%3Dpacker-plugin-azure_v1.3.1_SHA256SUMS&response-content-type=application%2Foctet-stream": x509: certificate signed by unknown authority
Reproduction Steps
Use hashicorp azure plugin, I guess
Plugin and Packer version
Azure plugin version 1.3.1
Packer version 1.8.2
Operating system and Environment details
Packer is running on an Ubuntu WSL
What did I tried exactly and what did I expected ?
I tried a Packer Init. Packer is supposed to initiate the plugins.
I tried to update packer, update the host, install ca-certificate. None of this resolve the issue.
Do you know how I can get away with this errors ?
Thank you :)
I tried a Packer Init. Packer is supposed to initiate the plugins.

Package installation error in Yii2 framework?

I have a requirement to use PHPOffice/PhpSpreadsheet, to install PhpSpreadsheet I followed this link.
So I installed PhpSpreadsheet into my project using 'composer' by running the command
composer require phpoffice/phpspreadsheet
at command prompt while installing it said that
Using version dev-master for phpoffice/phpspreadsheet
and was installed successfully(FYI check Screenshot), after installing when I tried to login into my application, I am getting a different error as
Cannot redeclare PHPMailerAutoload()
(previously declared in" for emails I am using 'phpmailer' including the path as
require_once('../vendor/phpmailer/PHPMailerAutoload.php');
as my "PHPMailer" folder resides in 'vendor' folder of Yii2 framework.
By the way I am building my application on Yii2 framework and I am very new to Yii2 framework.
Can anyone please tell, how to fix this? Thanks.
You don't have to use require for packages installed via composer. Yii autoload's feature will take care for that. You just have to write the appropriate use statements in your code. Actually, the mailer is a component declared into the main app, so you don't need the use statement at all
Yii::$app->mailer->compose('/my/mail_view', ['model' => $model])
->setFrom([Yii::$app->params['myMail'] => 'My Name'])
->setTo($model->email)
->setSubject('My subject')
->send();

How to correct install and use plugin installed via composer

I installed a cakephp 3 app via composer from the root of my website c:wamp/www/my_app, and I developed untill i need to implement acl.
I installed the acl plugin for cakephp 3 via composer for the same path c:/wamp/www/myapp and i configured it, was everything well, but when i test the implementation of acl, i get the following error:
Missing Component, Create the class AclComponent below in file: src\Controller\Component\AclComponent.php
and seems to be true, theres no such file in the above location, instead the file is in vendor/cakephp/acl/src/controller/component.
Was investigating and i find that composer doesnt install plugins in a cake default path, theres many articles about, but how doi correct my installation? I already did all the stuff to implement the access control lists.
Thanks in advance error screenshot

Error: Class MigrationShell could not be loaded (Cakephp -3.0 )

I am using cakephp 3.0 and i am facing problem while installing migration plugin..i am following the steps mentioned below
Installation - First get the plugin!
$:~/public_html/cakephp3/myCakeApp/plugins$ git clone git://github.com/CakeDC/migrations.git
Add the following to app/Config/bootstrap.php
CakePlugin::load('Migrations');
now next installation part is given in documentation as(may be this part may work for cakephp 2.x)
$ app/Console/cake
Available Shells:
migration [Migrations]
i am not getting this part and also don't know how to load MigrationShell in cakephp 3.. Can anybody help me out please??
CakePHP 3 comes with its own migrations plugin. Create a fresh CakePHP 3 project and you will be able to execute bin/cake migrations
You can read the documentation of the official migrations plugin in this page:
https://github.com/cakephp/migrations

Install curl and json extension in laravel

I am creating a registration form, i want to add a google captcha to the form however i noticed that the package requires PHP 5.4 or greater and "ext-curl" and "ext-json" i have looked around to try and find out how to get these dependencies installed but i have found no solution, currently when i try adding the google captcha package to my composer.json and doing a composer.update i get an error then i have to take it out from my composer.jon file and re-run composer update to fix the error. I think it might have something to do with these 2 dependencies does anyone know how i can get them installed?
I use the inbuilt PHP server in Laravel on windows 7 platform.
Directly from easyphp administration, use test code:
<?php phpinfo();?>