ajaxchat | IM and SMS within a Chat Windows using Twilio Toll Free SMS | SMS library
kandi X-RAY | ajaxchat Summary
kandi X-RAY | ajaxchat Summary
IM and SMS within a Chat Windows using Twilio Toll Free SMS.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ajaxchat
ajaxchat Key Features
ajaxchat Examples and Code Snippets
Community Discussions
Trending Discussions on ajaxchat
QUESTION
I am setting up Ajax-Chat in my Apache Server (2.4) with PHP 7 but I am getting this error
Deprecated: Non-static method AJAXChatFileSystem::getFileContents() should not be called statically in C:\Apache24\htdocs\services\chat\lib\class\AJAXChatTemplate.php on line 37
I tried changing function getContent()
to public static function getContent()
but after that it's showing:
...Fatal error:Uncaught Error: Using $this when not in object context in C:\Apache24\htdocs\services\chat\lib\class\AJAXChatTemplate.php:36
ANSWER
Answered 2019-Feb-12 at 11:42Calling a non-static method statically in PHP is deprecated behaviour since version 7.0 and raises an E_DEPRECATED
warning. This means that support for this behavour works, but may (and probably will) be removed in a future version.
This behaviour raised an E_STRICT
warning in PHP versions 5.*.
Changing your own AJAXChatTemplate::getContent()
method to static does not work because it uses $this
which only makes sense in the context of an instance of a class. Therefore it triggers a fatal error in a static context.
You are using the AJAX-Chat library—you haven't stated what version you are using but there is an issue that discusses the error you encounterd.
In line with this reported issue, a commit to recent versions of this library were made to change this a static behaviour.
To resolve your issue, you have two choices:
Continue to use the version of AJAX-Chat that you have currently installed
Just use the AJAXChatFileSystem::getFileContents()
non-statically. Create an instance of the class and use that by modifying your getContent()
method like so:
QUESTION
I'm trying to do the next thing:
...ANSWER
Answered 2017-May-10 at 13:11Ouch! The best approach is not to build your HTML elements in this manner in the first place and use the DOM to construct and inject them into your document.
This makes the code MUCH easier to read and modify and removes the concatenation issue entirely.
Now, if you have errors, you can focus on the values your are assigning to the properties and not the syntax of the HTML.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ajaxchat
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page