草庐IT

parent_directory

全部标签

php - Windows 更新警告 : Unknown: failed to open stream: No such file or directory in Unknown on line 0

Warning:Unknown:failedtoopenstream:NosuchfileordirectoryinUnknownonline0Fatalerror:Unknown:Failedopeningrequired'C:/School/OneDrive-Noorderpoort/PHP/htdocs/Jaar1/Blok1/Les7/oefening16.php'(include_path='C:\xampp\php\PEAR')inUnknownonline0经过长时间的Windows更新后,当我尝试通过本地主机打开php文件时突然出现此错误。我该如何解决这个问题?

php - Zend 框架 (1.7.5) : how to change controller directory

使用ZendFramework我想使用存储在非默认目录中的Controller。我想要实现的是,如果请求的路径以admin/controllers/admin开头,则使用layout/admin和views/admin等。我将如何以合理优雅的方式实现这一目标? 最佳答案 $front=Zend_Controller_Front::getInstance();$front->setControllerDirectory(...path...);或多个路径$front=Zend_Controller_Front::getInstance

php - .htaccess 重写规则 : two domains using same server and directory

作为背景知识,我们有两个域:mydomain.commydomain.czmydomain.cz指向mydomain.com的服务器并使用相同的目录。我们在.htaccess(两个域共享)中有一个RewriteRule,如下所示:RewriteRule^([0-9]+)/?$project.php?id=$1[NC,L]#HandleprojectrequestsRewriteRule^([0-9]+)/?$project_cz.php?id=$1[NC,L]#Handleprojectrequests此RewriteRule在使用来自mydomain.com/project.php?

php - Dompdf 错误 "No block-level parent found. Not good."

require_once("function/dompdf/dompdf_config.inc.php");$dompdf=newDOMPDF();foreach($modulesas$module){$output="Hello".$module['name'];$dompdf->load_html($output);$dompdf->render();$output_pdf=$dompdf->output();file_put_contents($dir.$name_modulo.".pdf",$output_pdf);}Fatalerror:Uncaughtexception'D

php - 检查目录路径是否以 DIRECTORY_SEPARATOR 结尾

在PHP中,我从用户那里接收到本地文件目录$path的字符串我想知道他们是否包含尾部斜杠(/)。我希望这是跨平台的,所以我想使用PHP常量DIRECTORY_SEPARATOR我失败的尝试包括尝试像preg_match("/".DIRECTORY_SEPARATOR."$/",$path);我基本上只是想要一种优雅的方法来测试字符串是否以DIRECTORY_SEPARATOR结尾。 最佳答案 修复正则表达式:preg_match("/".preg_quote(DIRECTORY_SEPARATOR)."$/",$path);但可能有

php - 发生客户端错误 : Could not create storage directory:/tmp/Google_Client/00

此错误对YoutubeAPIv3.0意味着什么:Aclienterroroccurred:Couldnotcreatestoragedirectory:/tmp/Google_Client/00我在Google的文档中使用PHPYoutubeAPI找到here. 最佳答案 我在不更改GoogleAPI的任何行的情况下解决了这个问题。在您的PHP代码中,您只需要指定缓存文件夹所在的位置:$config=newGoogle_Config();$config->setClassConfig('Google_Cache_File',arra

php - 奏鸣曲管理包 : possible to add a child admin object that can have different parents?

我正在使用原则继承映射来使各种对象链接到评论实体。这是通过各种具体的“线程”实现的,这些线程与评论具有一对多的关系。所以以'Story'元素为例,会有一个相关的'StoryThread'实体,它可以有很多评论。一切正常,但我在尝试为SonataAdminBundle定义CommentAdmin类时遇到了麻烦,该类可用作父实体的子实体。例如,我希望能够使用如下路线:/admin/bundle/story/story/1/comment/list/admin/bundle/media/gallery/1/comment/list有没有人对我如何实现这一目标有任何指示?我很想发布一些代码摘录

php - 在 Windows 上的 file_exists() 中使用 DIRECTORY_SEPARATOR

var_dump(DIRECTORY_SEPARATOR)//string'\'(length=1)var_dump(file_exists("C:/1212.txt"));//truevar_dump(file_exists("C:\1212.txt"));//falsevar_dump(file_exists("C:".DIRECTORY_SEPARATOR."1212.txt"));//falseDIRECTORY_SEPARATOR有什么作用?为什么在使用DIRECTORY_SEPARATOR时上述情况为假? 最佳答案 Wh

php - Laravel 5 本地化 : exclude/public/directory

我正在尝试在我的Laravel5项目中实现本地化,但遇到了问题。我放入的捕捉语言的中间件如下:app=$app;$this->redirector=$redirector;$this->request=$request;}/***Handleanincomingrequest.**@param\Illuminate\Http\Request$request*@param\Closure$next*@returnmixed*/publicfunctionhandle($request,Closure$next){//Makesurecurrentlocaleexists.$locale=

php - 组合递归迭代器结果 : children with parents

我正在尝试遍历包含大量PHP文件的目录,并检测每个文件中定义了哪些类。考虑以下几点:$php_files_and_content=newPhpFileAndContentIterator($dir);foreach($php_files_and_contentas$filepath=>$sourceCode){//echo$filepath,$sourceCode}上面的$php_files_and_content变量表示一个迭代器,其中键是文件路径,内容是文件的源代码(好像这在示例中并不明显)。然后将其提供给另一个迭代器,它将匹配源代码中所有定义的类,ala:classDefined