这是我的情况:
我正在尝试编写一个适用于“严格”类型(整数、布尔值和浮点数)的 Symfony REST API,因为默认的 Symfony 行为不支持它,我想避免强制转换类型(例如:JMS Serializer 转换字符串值成整数字段类型)
为此,我创建了一个实现JMS\Serializer\Handler\SubscribingHandlerInterface
(例如 a StrictIntegerHandler)的自定义处理程序:
<?php
namespace AppBundle\Serializer;
use JMS\Serializer\Context;
use JMS\Serializer\GraphNavigator;
use JMS\Serializer\Handler\SubscribingHandlerInterface;
use JMS\Serializer\JsonDeserializationVisitor;
use JMS\Serializer\JsonSerializationVisitor;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
class StrictIntegerHandler implements SubscribingHandlerInterface
{
public static function getSubscribingMethods()
{
return [
[
'direction' => GraphNavigator::DIRECTION_DESERIALIZATION,
'format' => 'json',
'type' => 'strict_integer',
'method' => 'deserializeStrictIntegerFromJSON',
],
[
'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
'format' => 'json',
'type' => 'strict_integer',
'method' => 'serializeStrictIntegerToJSON',
],
];
}
public function deserializeStrictIntegerFromJSON(
JsonDeserializationVisitor …Run Code Online (Sandbox Code Playgroud) 我已经按照下一个指南https://hub.docker.com/r/iliyan/jenkins-ci-php/来使用Jenkins下载docker镜像。
使用docker start CONTAINERNAME命令启动容器时,可以从localhost:8080访问Jenkins 。
问题来了,当我改变詹金斯的配置和使用詹金斯重新启动docker stop CONTAINERNAME和docker start CONTAINERNAME我的詹金斯不包含任何我以前的配置变化..
如何保持Jenkins配置?