草庐IT

get_declared_classes

全部标签

PHP Laravel 错误 : Object of class stdClass could not be converted to string

我正在使用Laravel为应用程序开发一项功能,我遇到了这个我无法弄清楚的奇怪错误。我有以下代码作为我的Controller的辅助函数,在我添加对以下函数的调用之前它工作得很好:protectedfunctionf($p){$cIds=$cs->select('cs.id')->get();$cs=DB::table('cs')->select('cs.id')->join('pucs','cs.id','=','pucs.c_id')->where('pucs.p_id','=',(string)$p->id)->whereIn('cs.id',$cIds)->lists('cs.i

php - CodeIgniter &get_instance() 在 php5.6 版本中不工作?

我的codeigniter网站在php5.4版本中运行正常,但是当我将我的php版本升级到php5.6.30时,它无法正常工作。function&get_instance(){returnCI_Controller::get_instance();}以上函数位于我文件的第233行,它返回空值。错误-fatalerror:在第233行的Coginiter_site\system\core\CodeIgniter.php中找不到类“CI_Controller”我已经追踪到错误点-system/core/common.php下的代码if(!function_exists('load_clas

php - 拉维尔 : Class 'App\DB' not found

我正在尝试使用DB类来运行查询。我在我的Controller中使用它是这样的:use\DB;我在我的代码中使用它是这样的:$changeCar=DB::select(DB::raw($query));我试过像这样包含它:useIlluminate\Support\Facades\DB但还是一样。另外,尝试在代码中使用反斜杠,而不是像这样包含它:$changeCar=\DB::select(\DB::raw($query));我的代码:namespaceApp\Http\Controllers;useIlluminate\Http\Request;useIlluminate\Suppor

php - Symfony 自动服务加载失败并显示 "Class does not exist"

我正在使用Symfony的依赖注入(inject)组件(独立的,不在Symfony应用程序中)尝试新的自动服务加载,版本v3.3.13。如果我手动定义一个服务,该类会被正确加载:#services.ymlmyasset:class:Mysite\Asset\Asset#inaPHPfile$container->get('myasset');#works如果我设置了自动加载,它会失败并显示错误消息:ReflectionException:第1070行的/var/www/vendor/symfony/dependency-injection/ContainerBuilder.php中不存

php - docker 和 PHP : getting dependencies (composer) into the container

一点背景:我是docker的新手,还不知道任何最佳实践。我的任务是创建一个基于php的网络服务,我决定使用docker-compose进行配置。因为我们都是花哨的开发人员,所以我们知道-如今不使用composer就无法构建php应用程序。我的问题:我应该在构建中安装依赖项吗?因此,将其添加到我的Dockerfile中:RUNcd/app&&composerinstall--no-interaction--prefer-source--optimize-autoloader或者我应该在开发期间安装依赖项并使用包含的依赖项构建容器镜像吗?我只知道一种不这样做的方法:在开发机器上本地安装依赖

php - php 的 file_get_contents 是否忽略文件锁定?

我已经阅读了php的manualpage关于“file_get_contents”函数,它没有说明“file_get_contents”在php文件锁定方面的行为方式。然而,在评论部分,用户Chris建议file_get_contentsdoesnotnormallyrespectPHP'sflocklocking,i.e.advisorylocking.Youcanworkaroundthiswithsomeextracodetorequestasharedlock,like...我测试成功了。我还测试了即使文件已被flock()锁定独家LOCK_EX可以让另一个php进程通过fil

php - 拉维尔 5.4 : get products with favorite and display favorites product for each user

我正在尝试获取收藏夹中的所有产品并像用户登录一样显示它们,收藏夹中的该产品将显示为收藏夹,否则他可以将它们添加到收藏夹。这是我的Controller$products=(newProduct)->where('quantity','>',0)->with('favorite')->orderBy('price',$sort)->get();现在如果我制作dd($product->favorite)我会像这样得到最喜欢的数组[{"id":1,"product_id":7,"user_id":1,"created_at":"2018-04-0109:16:23","updated_at":

php - "GET/index.php"404 dockerize Laravel 应用程序

我尝试进行非常简单的设置,以对接Laravel应用程序。即使nginx能够将请求转发到Laravel容器,我仍然得到GET/index.php"404C:\yocto\snapweb>docker-composelogs--followlaravelAttachingtosnapweb_laravel_1laravel_1|[23-Jul-201807:10:04]NOTICE:fpmisrunning,pid1laravel_1|[23-Jul-201807:10:04]NOTICE:readytohandleconnectionslaravel_1|172.18.0.3-23/Ju

php - 如何删除 woocommerce 容器 div '<div class="woocommerce">'

我为woocommerce创建了一个自定义主题并复制了templates文件夹到我的主题根目录woocommerce.现在我发现woocommerce中的所有页面都有一个类为woocommerce的div容器.我想更改它的类别或将其从我的主题中删除。我在我的主题文件中搜索了我一无所获。!有什么办法可以更改或删除它吗? 最佳答案 不,您不能更改或删除,这可能会破坏一切,请在此处阅读更多信息-https://github.com/woocommerce/woocommerce/issues/12191.

php - 消息 : file_get_contents(sso. json):无法打开流:没有这样的文件或目录

我正在尝试手动从JSON文件中获取数据,而不是从URL中获取数据。我使用函数file_get_contents。我得到了错误:Message:file_get_contents(sso.json):failedtoopenstream:Nosuchfileordirectory即使路径是正确的。这是我的结构项目:->kalenderkerja->application->controllers->agendakerjaKalender.phpsso.json->assets->...这是我在user()函数中的代码Kalender.phppublicfunctionuser(){$ur