Php 对未定义方法Pelago\Emogrifier::DisableInvisibleNodeMoval()的Laravel错误调用
我在gitlab克隆我们的LaravelWebAPI项目。然后我想迁移和服务,以便在postman中测试api。但是当我做一个迁移或服务时,有一个错误 CssInlinerPlugin.php第18行中的Php 对未定义方法Pelago\Emogrifier::DisableInvisibleNodeMoval()的Laravel错误调用,php,laravel,Php,Laravel,我在gitlab克隆我们的LaravelWebAPI项目。然后我想迁移和服务,以便在postman中测试api。但是当我做一个迁移或服务时,有一个错误 CssInlinerPlugin.php第18行中的: 调用未定义的方法Pelago\Emogrifier::DisableInvisibleNodeMoval() 有人能帮我吗?我不知道如何解决这个问题,因为连谷歌都没有答案。提前谢谢 CssInlinerPlugin.php <?php namespace Snowfire\Beaut
:
调用未定义的方法Pelago\Emogrifier::DisableInvisibleNodeMoval()
有人能帮我吗?我不知道如何解决这个问题,因为连谷歌都没有答案。提前谢谢
CssInlinerPlugin.php
<?php
namespace Snowfire\Beautymail;
class CssInlinerPlugin implements \Swift_Events_SendListener
{
/**
* @var \Pelago\Emogrifier
*/
protected $inliner;
/**
* Initialize the CSS inliner.
*/
public function __construct()
{
$this->inliner = new \Pelago\Emogrifier();
$this->inliner->disableInvisibleNodeRemoval();
}
/**
* Inline the CSS before an email is sent.
*
* @param \Swift_Events_SendEvent $evt
*/
public function beforeSendPerformed(\Swift_Events_SendEvent $evt)
{
$message = $evt->getMessage();
$properTypes = [
'text/html',
'multipart/alternative',
'multipart/mixed',
];
if ($message->getBody() && in_array($message->getContentType(), $properTypes)) {
$this->inliner->setHtml($message->getBody());
$message->setBody($this->inliner->emogrify());
}
foreach ($message->getChildren() as $part) {
if (strpos($part->getContentType(), 'text/html') === 0) {
$this->inliner->setHtml($part->getBody());
$message->setBody($this->inliner->emogrify());
}
}
}
/**
* Do nothing.
*
* @param \Swift_Events_SendEvent $evt
*/
public function sendPerformed(\Swift_Events_SendEvent $evt)
{
// Do Nothing
}
}
当我安装composer时
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package phpoffice/phpexcel is abandoned, you should avoid using it. Use phpoffice/phpspreadsheet instead.
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
You can run ".\vendor\bin\upgrade-carbon" to get help in updating carbon and other frameworks and libraries that depend on it.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
In CssInlinerPlugin.php line 18:
Call to undefined method Pelago\Emogrifier::disableInvisibleNodeRemoval()
Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1
该软件包似乎存在以下问题:
他们在这里列出了一些解决方案。可能尝试将版本更改为2.2.0?是否安装了composer?是的,先生。是的。当我安装composer时,我会在问题中包括日志。在我的
composer.json中没有“pelago/emogrifier”:“2.2.0”
包。我应该直接在require
数组中写入日志并运行composer更新吗?是的,在他们修复包之前,这是一个临时修复。或者你可以试试旧版本的beautymail,我明白了。因此,我需要编写“pelago/Emogrifer”:“2.2.0”
,直接发送给composer,那么“snowfire/beautymail”:“dev master”
软件包呢?我是否应该删除它?没有雪火的版本。devmaster
是什么意思?把两者都留下,看看它是否有效。看起来开发大师是因为他们没有发布版本,比如版本a 1.0.0.p,是的。没问题!
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package phpoffice/phpexcel is abandoned, you should avoid using it. Use phpoffice/phpspreadsheet instead.
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
You can run ".\vendor\bin\upgrade-carbon" to get help in updating carbon and other frameworks and libraries that depend on it.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
In CssInlinerPlugin.php line 18:
Call to undefined method Pelago\Emogrifier::disableInvisibleNodeRemoval()
Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1