草庐IT

autoload-dev

全部标签

php - 运行 phpunit 时未找到 fatal error 'File/Iterator/Autoload.php'

我尝试在phpunit中运行测试类时遇到此错误。C:\xampp\htdocs\unittest>phpunitUnitTestusertest.phpPHPWarning:require_once(File/Iterator/Autoload.php):failedtoopenstreamNosuchfileordirectoryinC:\xampp\php\pear\PHPUnit\Autoload.phponline45PHPStacktrace:PHP1.{main}()C:\xampp\php\phpunit:0PHP2.require()C:\xampp\php\phpun

php - composer.json 中的 dev-master,这是疯了吗?

关闭。这个问题是opinion-based.它目前不接受答案。想要改进这个问题吗?更新问题,以便editingthispost提供事实和引用来回答它.关闭8年前。Improvethisquestion我正在使用composer(在Symfony2项目中)并且经常在更新库时遇到错误。许多库(根据我的经验)使用dev-master作为其依赖项的版本(或者更糟的是他们使用*)。每当有东西提交到主分支时,您就可以更新库,并且随着时间的推移,API更改的可能性会更高。今天在master中的版本是1.2.1,明天可能是1.2.7,没有任何危害,然后成为以后的1.7或2.x,肯定不兼容。我的问题是我

php spl_autoload_register vs __autoload?

你好,除了我们可以使用自己的名字自动加载外,使用这个有什么不同吗?有什么性能差异吗?他们如何在内部运作?之间function__autoload_libraries($class){include_once'lib.'.$class.'.php';}spl_autoload_register('__autoload_libraries');对比function__autoload($class){include_once'lib.'.$class.'.php';} 最佳答案 __autoload通常被认为是过时的。它只允许一个自动加

php - 运行时异常 : Unable to create the cache directory (/var/www/sonata/app/cache/dev)

我安装了Sonataadminbundle。安装后我刷新我的页面有缓存问题然后我使用以下命令删除缓存:rm-rfapp/cacheapp/log然后我重新创建目录:mkdirapp/cacheapp/log但是我得到了以下错误:RuntimeException:Unabletocreatethecachedirectory(/var/www/sonata/app/cache/dev). 最佳答案 看起来像是文件/目录权限问题。该目录必须可由网络服务器写入。创建目录后,您应该使用调整权限chown-Rwww-data:www-data

php - 在 php __autoload() 中将 CamelCase 转换为 under_score_case

PHP手册suggests自动加载类,如function__autoload($class_name){require_once("some_dir/".$class_name.".php");}并且这种方法可以很好地加载保存在文件my_dir/FooClass.php中的类FooClass像classFooClass{//someimplementation}问题如何才能使用_autoload()函数并访问my_dir/foo_class.php文件中保存的FooClass? 最佳答案 你可以像这样转换类名......functi

php - 多个 spl_autoload_register

拥有多个spl_autoload_register的好处是什么例子:spl_autoload_register('autoload_systems');spl_autoload_register('autoload_thirdparties');spl_autoload_register('autoload_services');对比:使用一个spl_autoload_register('autoload');或__autoload();然后在函数内部做逻辑。eg:$ftp=newsystems_ftp();$services=newservices_cron_email();

php - 为什么访问 Laravel 应用程序时出现 "no such file or directory ... autoload.php"?

我是Laravel的新手,一直在尝试安装Laravel,浪费了三个小时可惜没有成功。当我通过公共(public)目录访问时,出现以下错误:Warning:require(C:\wamp\www\laravel\bootstrap/../vendor/autoload.php):failedtoopenstream:NosuchfileordirectoryinC:\wamp\www\laravel\bootstrap\autoload.phponline17CallStack还有以下内容:Fatalerror:require():Failedopeningrequired'C:\wam

php - 清除缓存时无法写入缓存文件 "/var/www/myapp/app/cache/dev/classes.php"

我在Ubuntu11.10上安装了Symfony2.0.7。我有这个问题:我使用以下命令更改了cacheelogs目录的权限:chmod777-Rcachechmod777-Rlogs以及我所期望的所有功能。然后我做了:app/consolecache:clearClearingthecacheforthedevenvironmentwithdebugtruepermissionsofcache/devchangeto755andsymfonycannotwriteinthat:RuntimeException:Failedtowritecachefile"/var/www/myapp

php - Cakephp cake_core_ 缓存无法写入 'cake_dev_en-us'

我已经尝试了一切,但我不断收到以下蛋糕错误:(!)Warning:_cake_core_cachewasunabletowrite'cake_dev_en-us'toFilecachein/var/www/bloglic-2013/cake/lib/Cake/Cache/Cache.phponline309Warning:/var/www/bloglic-2013/cake/app/tmp/cache/persistent/isnotwritablein/var/www/bloglic-2013/cake/lib/Cake/Cache/Engine/FileEngine.phponli

php - 为什么我必须运行 "composer dump-autoload"命令才能使迁移在 laravel 中工作?

我在我的应用程序中构建了一些迁移类来创建我需要的表,但我不断收到错误。我需要运行这个命令:composer转储自动加载只有这样它才能按预期再次工作。我做错了什么会产生此错误,还是这是迁移的正常行为?以下是我在运行迁移过程时遇到的错误:[Symfony\Component\Debug\Exception\FatalErrorException]Class'CreateVideoStatusTable'notfound 最佳答案 好的,我想我知道您遇到的问题。基本上,因为Composer看不到您正在创建的迁移文件,您必须运行dump-a