草庐IT

function_exists

全部标签

php - 第 332 行的 fatal error : Call to a member function getId() on a non-object in C:\wamp\www\magentno\lib\Varien\Data\Tree\Dbp. php

我正在使用Magento1.8.0.0,我通过本地主机在WAMP服务器上安装了一个测试版本,当我想添加类别时,出现下一个错误:fatalerror:在C:\wamp\www\magentno\lib\Varien\Data\Tree\Dbp.php中的非对象上调用成员函数getId()第332行我还没有开店,因为我需要那个类别。我已经在出现错误的行中添加了tryandcatch代码。这是给出错误的代码:publicfunctionloadEnsuredNodes($category,$rootNode){$pathIds=$category->getPathIds();$rootNod

php - file_exists 或 getimagesize 仅适用于本地绝对文件路径,但不适用于 PHP 中的 URL

我最近更新了我的一台服务器,从那时起,我遇到了一些特定PHP命令的问题(见下文)。我相信这是一个配置问题,但我已经调查了几件事并且不知道更多。所以也许你们中的一个人有一个好主意:我使用以下代码来显示内部网站上的标准Logo或用户定义的Logo:if(L_HEADER){$logo=L_HEADER;}else{$logo='logo.png';}$properties=getimagesize(CONFIG_URL.'images/'.$logo)L_HEADER和CONFIG_URL是具有预定义值的常量(另一个文件):L_HEADER包含“opb_beta.png”CONFIG_UR

php - 运行 phpcs 时,错误 : Referenced sniff "PHPCompatibility" does not exist is coming

我想运行phpcs工具,但是这个错误来了,错误:引用的嗅探“PHPCompatibility”不存在我运行了phpcs-i。这给了我,安装的编码标准是PEAR、PSR1、Zend、Squiz、PSR12、PSR2、MySource和PHPCompatibility。但总是会出现这个错误,错误:引用的嗅探“PHPCompatibility”不存在。有什么原因吗? 最佳答案 根据当前PHPCompatibilityCodingStandard执行此步骤所需的文档:打开您的composer.json文件并将以下行添加到:"require-

php - Firestore : Key writes does not exist in the provided array

谁能告诉我,以下错误消息试图告诉我什么?Fatalerror:Uncaughtexception'InvalidArgumentException'withmessage'Keywritesdoesnotexistintheprovidedarray.'in/vendor/google/cloud/Core/src/ArrayTrait.php:38Stacktrace:#0/vendor/google/cloud/Firestore/src/Connection/Grpc.php(127):Google\Cloud\Firestore\Connection\Grpc->pluck('

php - 使用 gzopen() : undefined function 时出现 fatal error

我想使用gzopen函数打开一个.gz文件,但出现了这个错误:Fatalerror:Calltoundefinedfunctiongzopen()这里是关于我的安装的一些细节:OS:Ubuntu10.04uptodateApacheversion:2.2.14PHP:5.2.10-2ubuntu6在phpinfo()的Zlib部分,我得到了这个:ZLibSupportenabledStreamWrappersupportcompress.zlib://StreamFiltersupportzlib.inflate,zlib.deflateCompiledVersion1.2.3.3Li

php - 在 5.3 之前的 PHP 中使用 "create_function"比较器进行排序?

我以前从未在PHP中使用过匿名函数,但我发现了一段使用匿名函数对对象进行排序的代码usort($numTurnsPerUser,build_sorter('turns'));functionbuild_sorter($key){returnfunction($a,$b)use($key){returnstrnatcmp($a[$key],$b[$key]);};}此代码将按键对对象进行排序(我传入“turns”)。例如,一个看起来像这样的对象:(用JSON编写,只是为了便于阅读)$numTurnsPerUser={"31":{"turns":15,"order":0},"36":{"t

PHP/MySQLi - fatal error : Call to a member function mysqli_query() on a non-object

这是我的代码:require"../include/functions.php";error_reporting(E_ALL);ini_set('display_errors','1');ConnectWithMySQLiDatabase();$Cat=addslashes($_POST["Category"]);$v=$conn->mysqli_query($conn,"SELECT*FROM`categories`WHERE`id`=$Cat");$vrowi=mysqli_fetch_array($v,MYSQLI_ASSOC);$url=$conn->real_escape_s

php - 在 PHP 中,max_execution_time 会影响通过 register_shutdown_function() 调用运行的关闭函数吗?

我有一个使用register_shutdown_function()注册的关闭函数,需要很长时间才能完成。PHP的max_execution_time会导致PHP终止此函数还是会一直运行直到完成或出错? 最佳答案 它将运行完成。http://us2.php.net/manual/en/function.register-shutdown-function.php#33575 关于php-在PHP中,max_execution_time会影响通过register_shutdown_func

php - fatal error : Call to a member function

我需要帮助来调试我的代码。我是php的新手,目前正在使用codeigniter框架。我试图将我的数据库表的内容显示到我的页面/controllers/users.php$load->model('Users');}functionindex(){$data['users']=$this->Users->getUsersWhere('useridUsers->getNumUsers();$data['title']='Displayinguserdata';$data['header']='UserList';//load'users_view'view$this->load->view

php - wordpress "function &get_post"中此类函数定义的含义

这个问题在这里已经有了答案:WhatdoesitmeantostartaPHPfunctionwithanampersand?(3个答案)Reference—WhatdoesthissymbolmeaninPHP?(24个答案)关闭7年前。我最近在做wordpress研究,试图挖掘查询机制是如何处理的。我遇到了这样一个函数定义function&get_post(&$post,$output=OBJECT,$filter='raw')我以前没见过类似的东西,不确定&符号(&)是否必须做有地址的东西。(传统上认为使用&符号(&))。我在这方面很天真,如果它简单的话就饶了我吧。任何人都可以对