草庐IT

last_time_parsed

全部标签

php - "Maximum execution time of 60 seconds is exceeded"当我重写 toArray() 函数时

我需要覆盖函数toArray()来检查用户是否有适当的权限来获取特定的列,所以我创建了这个函数:publicfunctiontoArray($options=0){if(!auth()->user()->hasPermissionTo('users.show.email')){$this->hidden[]='email';}//etc...returnparent::toJson($options);}但是当我在Controller中使用User::Get()来获取所有用户的列表时,我没有得到任何结果,但是60秒后我得到:[2019-04-0623:18:33]local.ERROR

php - JSON.parse 错误 #1132 : Invalid JSON parse input (Flex/Actionscript/PHP)

我收到“错误#1132:无效的JSON解析输入”并且无法理解原因。我的json是由php生成的:json_encode($x)。如果在TextArea(flex)中显示,则输出json显示如下:{"title":"TheIncredibles","year":"2004","type":"movie","id":"9806","imdb_id":"tt0317705","rating":8.6,"tagline":"Nogut,noglory","overview":"BobParrhasgivenuphissuperherodaystologintimeasaninsurancead

php - 如何解析包含 "parse_ini_file"特殊字符的 ini 文件?

我有一个folder.ini包含:[Labels];Ordnernamename=testverzeichnis;Ordnerbeschreibungdescription=verzeichniszutestenvondaten[Contents][Publisher]publisher=e-Solutionscopyright=AndréReinhardt当我用parse_ini_file()解析它时,我得到了�而不是é。我的代码:$ini_array=parse_ini_file("sad-Kopie(6)/folder.ini",TRUE);print_r($ini_array)

php - 如何在运行时覆盖 max_execution_time 的 php.ini 值?

我没有访问服务器中的php.ini的权限。我想更改最大执行时间,以便我的脚本可以运行超过30秒。有什么办法可以在我的脚本开始时做到这一点吗? 最佳答案 使用ini_setini_set('max_execution_time',300);//thiswillsetmax_executiontimefor300seconds将此行写在php文件中代码的开头。或使用HankyPankyㇱset_time_limit(300); 关于php-如何在运行时覆盖max_execution_time

php - 多用户应用程序中的 Postgresql 和 PHP : is the currval a efficent way to retrieve the last row inserted id,?

我想知道我用来检索插入到postgresql表中的最后一行的id的方法是否有效..它显然有效,但是当我有许多用户同时在同一个表中添加行时,引用序列currval值可能会出现问题。我的实际做法是:$pgConnection=pg_connect('host=127.0.0.1dbname=testuser=myuserpassword=xxxxx')ordie('cantconnect');$insert=pg_query("INSERTINTOcustomer(name)VALUES('blabla')");$last_id_query=pg_query("SELECTcurrval(

php - 如何转义由 PHP parse_ini_file 函数解析的文件中的特殊字符?

我想在配置文件中保留某个字符串,以便由PHP解析parse_ini_file()功能。但是,此字符串包含一些需要以某种方式编码的特殊字符(代码如0x2C或0x3D)。有什么办法可以在这样的文件中写一个十六进制代码的特殊字符吗? 最佳答案 转义INI值的正确方法是将它们包含在"doublequotes"中.如果您的字符串不包含双引号,您可以将其用作用双引号括起来的值。根据http://php.net/manual/en/function.parse-ini-file.php#100046,只要值中没有两个连续的双引号,用反斜杠转义单引

php - time() 根据服务器返回不同的时间戳

我现在搜索了好几个小时,好像以前没有人遇到过这个问题。我在两台服务器上运行一个脚本,将当前时间戳写入数据库。两者具有相同的操作系统、软件...和相同的时区。现在我发现,一些时间戳和当前时间()之间的差异是一个负数(是的,计算是正确的:time()-$older_timestamp)我将time()转储到两台服务器上,结果:正好相差一小时。检查一下:time()onserver#1:-1hourtime()onserver#2:correcttimestamp因为time()应该始终基于UTC,所以我无法解释这是怎么发生的。有人知道吗?来自亚琛的问候 最佳答案

php - 匹配 HH :MM:SS time format in php? 的正则表达式

这个问题在这里已经有了答案:RegexpatternforHH:MM:SStimestring(2个答案)关闭9年前。HH:MM:SS的正则表达式是什么HH是hours,但不限于日期或时钟,它可以是从0到任何整数的任何数字MM是分钟,最大值是59,从00开始SS是Seconds最大值是59并且从00开始

php - ? : in old version of PHP causing parse error

我一直在使用SimpleImage类进行图像处理,但它在一个特定站点上不起作用服务器上的PHP版本是5.1.6-所以六岁了解析错误:语法错误,意外的“:”在...引起错误的有问题的行$height=$height?:$width;$quality=$quality?:$this->quality;$filename=$filename?:$this->filename;有解决办法吗? 最佳答案 三元运算符简写$val1?:$val2是introducedinPHP5.3,并且与$val1相同?$val1:$val2

php - 火力基地: "Could not parse auth token."

你好,我正在使用带有php的firebase并使用这个library.我收到此错误“无法解析身份验证token。”我的授权token是正确的,因为我也使用了与node.js相同的token。我的代码是这样的require"vendor/autoload.php";constDEFAULT_URL='https://xxxxxxxxx.firebaseio.com';constDEFAULT_TOKEN='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';$firebase=new\Firebase\FirebaseLib(DEFAULT_URL,DEFAULT_TOK