我试图获得数百个远程图像的图像大小(图像尺寸,宽度和高度),并且getimagesize速度太慢.
我做了一些阅读,发现最快的方法是file_get_contents从图像中读取一定数量的字节并检查二进制数据中的大小.
以前有人试过吗?我该如何检查不同的格式?有人见过这个库吗?
我做了一个带验证的表单(带有刀片模板引擎的laravel),它按预期工作.
这是代码:
@if ($errors->first('email'))
{{ Form::text('email', null, $attributes = array('class'=>'error')) }}
{{ $errors->first('email', '<small class=error>:message</small>') }}
@else
{{ Form::text('email') }}
@endif
Run Code Online (Sandbox Code Playgroud)
有更清洁的解决方案吗?
我只想写Form::text('email')一次......
我尝试连接到 bitbucket 管道中的数据库并使用文档中所述的服务定义,但出现以下错误:
+ mysql -h 127.0.0.1 -u root -ptest_user_password -e "SHOW DATABASES"
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111 "Connection refused")
Run Code Online (Sandbox Code Playgroud)
这是我的bitbucket-pipelines.yaml:
image: debian:stretch
pipelines:
pull-requests:
'*':
- step:
script:
- apt-get update && apt-get install -y mysql-client
- mysql -h 127.0.0.1 -u root -ptest_user_password -e "SHOW DATABASES"
definitions:
services:
mysql:
image: mysql:5.7
variables:
MYSQL_DATABASE: 'pipelines'
MYSQL_ROOT_PASSWORD: 'test_user_password'
Run Code Online (Sandbox Code Playgroud)
有什么想法我做错了吗?