草庐IT

non-class

全部标签

php - 警告 : get_class() expects parameter 1 to be object

一周前我写了一个代码,它运行良好。但是今天当我检查它时,它给了我一些问题,比如Warning:get_class()expectsparameter1tobeobject,arraygivenin/home/ccc/public_html/horoscope/xml2json.phponline182Warning:get_class()expectsparameter1tobeobject,stringgivenin/home/ccc/public_html/horoscope/xml2json.phponline182Warning:get_class()expectsparame

php - Laravel 4 PHP fatal error : Class 'Illuminate\Foundation\Testing\TestCase' not found

当我使用Laravel4运行phpunit时出现以下错误。PHPFatalerror:Class'Illuminate\Foundation\Testing\TestCase'notfoundinComposer.json"require":{"laravel/framework":"4.0.*","phpunit/phpunit":"3.7.*"},应用.php'Illuminate\Foundation\Testing\TestCase'我应该做什么? 最佳答案 看起来自动加载不包含新要求。请务必运行composerupdate

php - 布局在 Laravel 4 中抛出 "Attempt to assign property of non-object"

在Layouts文件夹中,我有一个名为signup.blade.php的布局在我的Controller中,我像这样为其分配布局:protected$layout='layouts.signup';在一个名为“signup”的单独文件夹中,我有一个名为“signup1.blade.php”的文件,它包含典型的Blade模板内容。这是一个名为“内容”的部分。在我的代码之前@section('content')最后有@stop。我的Controller看起来像这样:publicfunctionSignUp(){$this->layout->content=View::make('signup

php - Symfony2 : How to use INSERT DELAYED with doctrine or create a non-blocking database operation?

出于性能原因,我想使用mysql的INSERTDELAYED查询来保留一个日志对象。您是否知道如何使用Doctrine来执行此操作? 最佳答案 为什么你可能不应该使用INSERTDELAYED:AsofMySQL5.6.6,INSERTDELAYEDisdeprecated,andwillberemovedinafuturerelease.UseINSERT(withoutDELAYED)instead.(officialdocumentation)symfony2解决方案:使用symfony2,您可以通过为kernel.termi

php - 错误 : Object of class DateTime could not be converted to string

我在显示值时遇到错误:$thedate=$row2['date'];echo$thedate;在php中,数据库中的值($thedate)是“2015-05-0521:52:31.000”我如何格式化它才能将其作为字符串显示在php页面上?目前它显示错误“DateTime类的对象无法转换为字符串”。 最佳答案 你有一个DateTime对象,所以你必须使用format()格式化你的输出,例如echo$thedate->format("Y-m-d"); 关于php-错误:Objectofcl

php - Prestashop : how to override a module class contained in a file that includes other classes?

prestashop覆盖系统通过使用文件命名方案与许多其他系统一样工作。所以基本上,我将在/overrides/classes中创建一个与/classes中另一个具有相同类和文件名的类,只是为了简化。好吧,我必须覆盖它(使用最新的prestashop版本可以覆盖模块,而以前我们不能):include_once(dirname(__FILE__).'/MailAlert.php');classMailAlertsextendsModule{[....]}我可以用这个覆盖它:classMailAlertsOverrideextendsMailAlerts{[....]}好吧,它有效,文件和

php - Laravel 错误未捕获异常 'ReflectionException',消息为 'Class App\Http\Kernel does not exist'

当我想在我的laravel5.2项目中添加表单时,我在composer中遇到了一些错误。之后我的整个项目都出现了一个奇怪的错误:Fatalerror:Uncaughtexception'ReflectionException'withmessage'ClassApp\Http\Kerneldoesnotexist'inC:\xampp\htdocs\gifkadeh\vendor\laravel\framework\src\Illuminate\Container\Container.php:738Stacktrace:#0C:\xampp\htdocs\gifkadeh\vendor

php - 在 Laravel 5.1 中找不到 "Class ' app\Http\Controllers\Controller'

我是Laravel的新手,在学习教程时遇到此错误。这是我在“testController.php”中的代码。这是我的“routes.php”。'test','uses'=>'testController@getHome',]);Route::get('about',['as'=>'about','uses'=>'testController@getAbout',]);我收到这个错误:Class'app\Http\Controllers\Controller'notfound我该如何修复这个错误? 最佳答案 让我们一步一步来。1。检查

PHP CLASS undefined variable (但已定义)

这个问题在这里已经有了答案:"Notice:Undefinedvariable","Notice:Undefinedindex","Warning:Undefinedarraykey",and"Notice:Undefinedoffset"usingPHP(29个答案)关闭5年前。我只是想不通为什么会出现这个错误:Notice:Undefinedvariable:authTimein/.../classname.class.phponline33classClassName{private$authTime=null;constAPI_URL='...';constCLIENT_ID=

PHP 7.2.7 : Attempted to call an undefined method named "setEncryptionName" of class "ZipArchive"

我正在尝试使用PHP7.2.7创建一个加密的、受密码保护的ZIP文件。但是,我收到以下错误消息:Attemptedtocallanundefinedmethodnamed"setEncryptionName"ofclass"ZipArchive".http://php.net/manual/en/ziparchive.setencryptionname.php如果我删除$zip->setEncryptionName()那么一切都会100%,除了ZIP文件没有密码保护。我在Google和论坛上进行了搜索,但找不到遇到过类似问题的人,可能是因为PHP版本和功能仍然太新。