Very thick question, but is there any way to print your own debug messages to the console in Codeception? I mean messages that have nothing to do with assertions, purely for debugging the tests themselves (e.g. like you would var_dump() a variable in any regular PHP website) I have already tried var_dump(), e…
Tag: php
PHPMailer GoDaddy Server SMTP Connection Refused
The other day I was experiencing some problems with my GoDaddy hosted site. I called their tech support, and the person that I spoke with suggested that my problems were related to the fact that I was on a Windows box and would be better served on a Linux box. Having no opinion on this, I agreed and they swit…
Laravel Facades – Passing parameter to __construct()
If I am creating a Facade, and I want to pass parameters before it becomes instantiated, what do I do?
php-echo doesn’t stop after semicolon
this is a noob question.A very big noob question. I’m trying echo something,using notepad++ to code. But what I get is this: What am I doing wrong? Answer You are getting this result because you are running from Notepad++ Run -> Launch in Browser. This is wrong. Use any web server to make it work. It…
Codeigniter Rename file on upload
I’m trying to add time as the prefix of the image name along with the original name when uploading, But I couldn’t figure it out. Please help me with the following code to add a prefix to my original file name when uploading. Answer You can encrypt file name with use of CI native option: OR You ca…
How install PHP’s MongoDB driver — “pecl install mongo” fails
How do I install PHP’s MongoDB client driver? I’ve done this already: But the next step fails: When I have a look at http://pecl.php.net/mongo, I find listed many versions of the Mongo driver. Am I supposed to include a version number or something? However all installation instructions I’ve …
php is not recognized as an internal or external command using xampp
I am using xampp, so my php folder is in C:xamppphp and I add in my PATH environment variables the C:xamppphp but when I am running on cmd the php command I am getting the following message: php is not recognized as an internal or external command. Any idea what I am missing? Answer When adding an entry to en…
Calling AppModel function in AppController for cakephp
I have a function that I want all of my controllers to be able to use, so I have defined it in AppController. Now part of what this function will do has no business being in a controller and so it should be in a model, but since this is a universal operation, it only seems correct that it be
Trying to use variable in MySQL INNER JOIN
I am a php and MySQL newbie. What I have done is created an html form with a <select> dropdown. Based on the selection from the form, it changes the $_SESSION[campaignID] variable. Changing the selection in the form is supposed to then change what displays on the page. The page consists of a forum style…
Modify microseconds of a PHP DateTime object
I have a PHP DateTime object with microseconds created as follows: How can I modify the microseconds value of $dt, without creating a completely new DateTime instance? Answer You can’t. There are three methods that can modify the value of a DateTime instance: add, sub and modify. We can rule out add and…