在互联网上,我已经看到了一堆类似的问题,但至少有一个帮助,它不是,在网站本身上og: image中的图片已指示,它可以工作,但 Facebook 调试器写入以下内容:
他建议添加og:image:width和og:image:height,但在元数据中他也观察到他缺乏什么
这个问题只在 Facebook 上,在其他平台上一切正常。
我需要将执行值写入Makefile中的一个变量以供进一步使用,但是由于某种原因它总是一个空字符串,我尝试了不同的方法,我只是在浪费我的时间,我不明白什么问题是因为命令本身在控制台中工作,但变量始终为空,声明示例:
#VARIABLES
var = $(echo $(date +%s | md5sum | head -c${1:-32};echo ;))
test:
echo "$(var)";
如果上面的代码不是一个工作选项,那么也许有一个选项如何编写一个模拟来生成一个可以在 Makefail 中工作的唯一哈希,但我当然想弄清楚为什么上面的代码在make 命令被执行...
怎么做正则重定向,有个概念,但是问题是切换到浏览器的时候,并没有显示“连接不安全”的提示,而是马上做了一个重定向https://i.imgur.com /HWcaqzp.png,nginx 网络服务器,也许有人 - 加入了一些东西?
关键是,假设我们有一个文章表:
|id|title|description|
|1 |А 1 |B 3 |
|2 |А 2 |B 2 |
|3 |А 3 |B 1 |
|4 |B 1 |А 3 |
|5 |B 2 |А 2 |
|6 |B 3 |А 1 |
选择时SELECT id FROM article WHERE (title LIKE "%B%" OR description LIKE "%B%")
首先,你应该去例如id标题然后描述і这里的时刻不是一个平庸的按id排序,即按给定的列,即id的显示顺序并不重要,但主要的是首先是那些标题匹配的记录,因此已经在描述中,反之亦然。
mysql在服务端是不行的,它是安装在端口上的,里面也有一个端口(就是肌肉本身已经涨到顶了),但是当你连接上的时候,你就得到了这个废话: ” SQLSTATE[HY000] [2006] MySQL server has gone away”为什么我不想连接,我通过内部 docker 网络运行 - 它没有帮助(也许有人遇到过它?最重要的是,这样一个问题仅在服务器上,它在本地上升没有问题
分期-mariadb
staging-mariadb | 2020-05-26 08:17:50+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.4.13+maria~bionic started.
staging-mariadb | 2020-05-26 08:17:50+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
staging-mariadb | 2020-05-26 08:17:50+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.4.13+maria~bionic started.
staging-mariadb | 2020-05-26 8:17:51 0 [Note] mysqld (mysqld 10.4.13-MariaDB-1:10.4.13+maria~bionic) starting as process 1 ...
staging-mariadb | 2020-05-26 8:17:51 0 [Note] InnoDB: Using Linux native AIO
staging-mariadb | 2020-05-26 8:17:51 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
staging-mariadb | 2020-05-26 8:17:51 0 [Note] InnoDB: Uses event mutexes
staging-mariadb | 2020-05-26 8:17:51 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
staging-mariadb | 2020-05-26 8:17:51 0 [Note] InnoDB: Number of pools: 1
staging-mariadb | 2020-05-26 8:17:51 0 [Note] InnoDB: Using SSE2 crc32 instructions
staging-mariadb | 2020-05-26 8:17:51 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
staging-mariadb | 2020-05-26 8:17:51 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
staging-mariadb | 2020-05-26 8:17:51 0 [Note] InnoDB: Completed initialization of buffer pool
staging-mariadb | 2020-05-26 8:17:51 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
staging-mariadb | 2020-05-26 8:17:51 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
staging-mariadb | 2020-05-26 8:17:51 0 [Note] InnoDB: Creating shared tablespace for temporary tables
staging-mariadb | 2020-05-26 8:17:51 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
staging-mariadb | 2020-05-26 8:17:51 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
staging-mariadb | 2020-05-26 8:17:51 0 [Note] InnoDB: Waiting for purge to start
staging-mariadb | 2020-05-26 8:17:51 0 [Note] InnoDB: 10.4.13 started; log sequence number 60990; transaction id 21
staging-mariadb | 2020-05-26 8:17:51 0 [Note] Plugin 'FEEDBACK' is disabled.
staging-mariadb | 2020-05-26 8:17:51 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
staging-mariadb | 2020-05-26 8:17:51 0 [Note] Server socket created on IP: '::'.
staging-mariadb | 2020-05-26 8:17:51 0 [Note] InnoDB: Buffer pool(s) load completed at 200526 8:17:51
staging-mariadb | 2020-05-26 8:17:51 0 [Warning] 'user' entry 'root@3995f63929b6' ignored in --skip-name-resolve mode.
staging-mariadb | 2020-05-26 8:17:51 0 [Warning] 'user' entry '@3995f63929b6' ignored in --skip-name-resolve mode.
staging-mariadb | 2020-05-26 8:17:51 0 [Warning] 'proxies_priv' entry '@% root@3995f63929b6' ignored in --skip-name-resolve mode.
staging-mariadb | 2020-05-26 8:17:51 0 [Note] Reading of all Master_info entries succeeded
staging-mariadb | 2020-05-26 8:17:51 0 [Note] Added new Master_info '' to hash table
staging-mariadb | 2020-05-26 8:17:51 0 [Note] mysqld: ready for connections.
staging-mariadb | Version: '10.4.13-MariaDB-1:10.4.13+maria~bionic' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
staging-mariadb | 2020-05-26 8:21:54 8 [Warning] Aborted connection 8 to db: 'unconnected' user: 'unauthenticated' host: '192.168.144.3' (This connection closed normally without authentication)
staging-mariadb | 2020-05-26 8:21:54 9 [Warning] Aborted connection 9 to db: 'unconnected' user: 'unauthenticated' host: '192.168.144.3' (This connection closed normally without authentication)
码头工人撰写
version: "3.7"
services:
staging-nginx:
container_name: staging-nginx
build:
context: project/docker
dockerfile: staging/nginx/Dockerfile
ports:
- ${PROJECT_PORT}:80
volumes:
- ./project:/app
depends_on:
- staging-php-fpm
- staging-php-cli
staging-php-fpm:
container_name: staging-php-fpm
build:
context: project/docker
dockerfile: staging/php-fpm/Dockerfile
environment:
YII_DEBUG: ${YII_DEBUG}
YII_ENV: ${YII_ENV}
COOKIE_KEY: ${COOKIE_KEY}
MYSQL_HOST: ${MYSQL_HOST}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_DATABASE_TABLE_PREFIX: ${MYSQL_DATABASE_TABLE_PREFIX}
PROJECT_PORT: ${PROJECT_PORT}
MYSQL_PORT: ${MYSQL_PORT}
PHPMYADMIN_PORT: ${PHPMYADMIN_PORT}
API_URL: ${API_URL}
API_PATH: ${API_PATH}
API_NAME: ${API_NAME}
API_EXACT_VERSION: ${API_EXACT_VERSION}
APP_ADMIN_NAME: ${APP_ADMIN_NAME}
APP_ADMIN_EMAIL: ${APP_ADMIN_EMAIL}
APP_ADMIN_PASSWORD: ${APP_ADMIN_PASSWORD}
volumes:
- ./project:/app
depends_on:
- staging-mariadb
staging-php-cli:
container_name: project-php-cli
build:
context: project/docker
dockerfile: staging/php-cli/Dockerfile
environment:
YII_DEBUG: ${YII_DEBUG}
YII_ENV: ${YII_ENV}
COOKIE_KEY: ${COOKIE_KEY}
MYSQL_HOST: ${MYSQL_HOST}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_DATABASE_TABLE_PREFIX: ${MYSQL_DATABASE_TABLE_PREFIX}
PROJECT_PORT: ${PROJECT_PORT}
MYSQL_PORT: ${MYSQL_PORT}
PHPMYADMIN_PORT: ${PHPMYADMIN_PORT}
API_URL: ${API_URL}
API_PATH: ${API_PATH}
API_NAME: ${API_NAME}
API_EXACT_VERSION: ${API_EXACT_VERSION}
APP_ADMIN_NAME: ${APP_ADMIN_NAME}
APP_ADMIN_EMAIL: ${APP_ADMIN_EMAIL}
APP_ADMIN_PASSWORD: ${APP_ADMIN_PASSWORD}
volumes:
- ./project:/app
- composer:/root/.composer/cache
depends_on:
- staging-mariadb
staging-mariadb:
container_name: staging-mariadb
build:
context: project/docker
dockerfile: staging/mariadb/Dockerfile
environment:
MYSQL_RANDOM_ROOT_PASSWORD: 1
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
ports:
- ${MYSQL_PORT}:3306
volumes:
- db:/var/lib/mysql
volumes:
composer:
db:
请帮忙,我不明白,请求是针对记录的每一行执行,还是执行一次,例如id IN (SELECT id FROM table WHERE status="active")
?
我想禁止按列构建 FK 的学说,因为连接将在代码级别进行,并且它的排放会干扰开发。有可能实现这一点吗?
/**
* @var Product
*
* @ORM\OneToOne(targetEntity="Product",
* inversedBy="warehouse",
* orphanRemoval=true,
* cascade={"persist", "remove"}
* )
* @ORM\JoinColumn(name="id", referencedColumnName="id", onDelete="CASCADE")
*/
private ?Product $product;
有一个Product类,它有一个仓库(WarehouseLocation),在它的“位置” ProductAttitude 中可以有一个仓库,因此,将位置和产品绑定到仓库将通过实体标识符在一个表上,即,身份证=身份证
产品:
/**
* @ORM\OneToOne(targetEntity="WarehouseLocation") //пример
* @ORM\JoinColumn(name="id", referencedColumnName="id")
*/
private ?WarehouseLocation $warehouse;
到基本级别的链接不仅是代码级别。如何将WarehouseLocation实体映射到类属性,如上面的示例。我不需要单独处理实体,我想通过主要的,是否可以在 symfony 中实现这个,因为它可以在其他框架中实现。
将请求传递给“knplabs/knp-paginator-bundle”包的 paginate() 方法时出现问题
/**
* @param integer $page
* @param integer $size
* @param Option\Locale $locale
*
* @return PaginationInterface
*/
public function all(int $page, int $size, Option\Locale $locale): PaginationInterface
{
$qb = $this->connection->createQueryBuilder()
->select(
'so.id',
'so.option_type_id',
'so.slug',
'so.position',
'so.name as default_name',
'sot.content as name',
'sot.locale',
)
->from('shop_options', 'so')
->leftJoin(
'so',
'shop_option_translations',
'sot',
'so.id = sot.object_id and sot.locale = :locale and sot.field = :name_field'
)
->setParameter(':locale', $locale->getName())
->setParameter(':name_field', Option\Option::NAME_FIELD)
->orderBy('so.position', 'ASC')
->execute();
$pagination = $this->paginator->paginate($qb, $page, $size); // Тут ошибка
$options = array_map(
static fn ($option) => $this->denormalizer->denormalize(
$option,
TranslatedOption::class,
'array',
[AbstractObjectNormalizer::DISABLE_TYPE_ENFORCEMENT => true]
),
(array)$pagination->getItems()
);
$pagination->setItems($options);
return $pagination;
错误:
{
"status_code": 500,
"message": "failure",
"data": [],
"meta": [],
"errors": [
{
"error": {
"message": "0",
"code": 0
},
"details": [],
"info": "One of listeners must count and slice given target"
}
]
}
没有分页,选择工作正常,我哪里出错了?
当我尝试下载 1.5 GB 的文件时,它会上升到 1.2 GB 并再次开始下载。此功能仅用于生产。文件下载代码:
if (file_exists($file) === true) {
if (ob_get_level()) {
ob_end_clean();
}
header('Content-Description: File Transfer');
header('Content-Type: application/zip');
header('Content-Disposition: attachment; filename=' . basename($file));
header('Content-Transfer-Encoding: binary');
header('Cache-Control: no-store');
header('Cache-Control: no-cache, no-store, must-revalidate');
header('Content-Length: ' . filesize($file));
readfile($file);
exit;
}