草庐IT

Return-Path

全部标签

php - php : @return tag 中的代码注释

我想知道如何按照PEAR标准为`@return标记、php中的以下函数编写代码注释。在遍历PEARstandards时,我了解到:Returntagsshouldcontainthedatatypethenadescriptionofthedatareturned:(Thispartisquiteclear)Description:Byconvention,thefirstnouninthedescriptionisthedatatypeoftheparameter.Articleslike"a","an",and"the"canprecedethenoun.Thedescriptio

php - PHP项目中 "Source files"和 "Include path"有什么区别?

NetBeans中的PHP项目中的“源文件”和“包含路径”有什么区别? 最佳答案 源文件是您作为项目的一部分自己编写的文件。包含路径包含将被扫描以进行自动完成的文件和在您键入时提供的提示。这主要用于您将使用的外部库,但您的源文件会自动包含在自动完成的包含路径中。 关于php-PHP项目中"Sourcefiles"和"Includepath"有什么区别?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/

php - Symfony2 上的动态 default_target_path

我正在使用Symfony2和FOSUserbundle开发应用程序。当用户登录系统时,我想将他们重定向到/user/username,用户名是否明显随每个用户而变化。Security.yml的一个选项是default_target_path。是否可以将default_target_path设置为动态路径,或者我需要覆盖负责登录的FOSUB类。 最佳答案 覆盖SecuredController和Templemate.在用户登录时在Controller中创建变量并将其传递给您的模板 关于ph

php - 命令 'php' 无法识别但已在 Windows PATH 中注册

我在Windows服务器上的PATH字符串中设置了“C:\Ampps\php”,但是当我在PHPStorm终端上键入“php”时,我总是得到“php”未被识别为内部或外部命令、可运行程序或批处理文件。这是PHPStorm7.1.3的错误吗?如果我从外部打开一个新的命令提示符窗口,它可以从命令行运行。 最佳答案 对于任何在PhpStrom中遇到此类问题的新读者,只需直接从PhpStrom终端设置路径即可setpath=%path%;c:/xammps/PHP不建议使用xammps或其他此类程序中的PHP,因为它将成为您的工作PHP目录

php - Laravel 错误 - 未知 : Failed opening required '. ./public' (include_path ='.;C:\php\pear\' ) in Unknown on line 0

我正在使用Laravel5,我正在使用PHP函数php-Slocalhost:8888folder-name-t来显示网站。在我更新到Window10之前一切正常。现在,我尝试在我的浏览器中运行该项目,我在我的cmd中看到一个空白页面和这条消息:[MonAug0300:17:052015]PHPFatalerror:Unknown:Failedopeningrequired'public'(include_path='.;C:\php\pear\')inUnknownonline0出了什么问题? 最佳答案 听起来像是权限问题。我在W

php - PHP include_path 主值从何而来?

通过phpinfo,我得到以下include_pathMasterValue。.:/usr/share/pear:/usr/share/php似乎没有在任何地方设置...phpini已将所有include_path(s)注释掉,我的应用程序没有手动设置它,apacheconf/phpconf/其他各种conf/ini没有设置它,没有搜索set_include_path或phpvalue或ini_set等时的结果。还有什么地方可以设置“include_path”吗?我特别询问有关主值的问题。(我在CentOS5.4上) 最佳答案 来自

PHPUnit stub : default return value from map

我在PHPUnit手册中读到,对于以下示例,方法调用doSomething('a','b','c')将返回d方法调用doSomething('e','f','g')将返回h。getMockBuilder('SomeClass')->getMock();//Createamapofargumentstoreturnvalues.$map=array(array('a','b','c','d'),array('e','f','g','h'));//Configurethestub.$stub->method('doSomething')->will($this->returnValueMa

php - set_include_path() 不适用于相对 require()

我正在“要求”一个文件,该文件有自己的require()调用。但是调用set_include_path()并不适用于require()中的相对路径。不幸的是,我无法控制所需的代码文件。C:/myapp/index.php-我的代码set_include_path(get_include_path().';C:/app/subfolder');require('C:/app/subfolder/index.php');C:/app/subfolder/index.php-第三方代码(无控制)require('../config.php');//RequirefilelocatedatC:

php - 工厂方法的正确 phpdoc @return

我很好奇如何记录以下场景。想象一组类:abstractclassPersonality{}classMeextendsPersonality{}classMyselfextendsPersonality{}classIreneextendsPersonality{}如果我正在编写工厂式方法来实例化并返回Personality类的子类,我将如何正确记录@return?@returnmixedA"Personality"subclassobject或@returnPersonalityA"Personality"subclassobject 最佳答案

php - 如何向 "return false"发送消息?

PHP中是否有任何选项可以从函数“返回false”并发送相应的消息(如出错的地方)?抛出异常是实现此目标的最佳方式吗? 最佳答案 抛出异常总是好的,但它不等于returnfalse但是如果你的逻辑可以支持异常,那么抛出它是可以的。可能是某种不同的类型,但不是一般的Exception 关于php-如何向"returnfalse"发送消息?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/question