 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Codeception: Codeception released with CodeCoverage support
by Chris Cornutt January 09, 2013 @ 11:14:19
The Codeception testing tool has released a new major update with some interesting new features - the expected feature for generating code coverage reports (similar to other tools) but there's also the idea of "remote code coverage" introduced.
There is no magic in local codecoverage. XDebug and PHP_CodeCoverage libraries do their job. The tricky thing is remote codecoverage. We attach small script into application's front controller. When a special header is sent this script starts to collect coverage information. And in the end of tests, this data is merged, serialized and sent back to Codeception. So you can test and collect coverage report even on staging servers in real environment.
They also mention a few other updates in the release - new Redis and MongoDb modules, UX improvements and the normal bugfixes. You can find out more about the code coverage feature in their manual or just about the project in general from the main site.
voice your opinion now!
codeception unittest tool codecoverage remote report update
PHPMaster.com: Using an Access Database with PHP
by Chris Cornutt May 08, 2012 @ 14:57:38
On the PHPMaster.com site there's a new tutorial (from David Francis) about connecting to a database (a basic introduction using PDO) and doing some of the common operations with the connection.
Wouldn't it have been better for them to able to maintain their database where ever they were? Of course, but how? Simple - put it online. [...] In this article I'll focus on the essential elements of PHP you'll need to use an existing Access database online. One other item that's standard with a Windows installation is the availability of ODBC drivers. These are essential for the use of Access from PHP.
He includes a sample database structure (with "product", "product_category" and "category" tables) and includes some sample code showing how to connect to the remote database and perform some basic actions - select, update, insert and delete
voice your opinion now!
tutorial database remote access pdo
Chris Hartjes' Blog: Better Remote Code Development
by Chris Cornutt January 06, 2012 @ 11:02:55
Chris Hartjes is asking for suggestions to help solve a common problem for developers (remote or otherwise) that have to develop in a non-local setup: a better method for remote code development.
I've been playing around with Sublime Text (because of the awesome vim bindings) and was thinking about why do I always have to be logged into the remote server to do my work. Normally I connect using SSH, then attach to my tmux session and then fire up vim. This is okay but it lacks a certain elegance in it's approach. [...] What I'm chafing against is having to deal with multiple environments all the time to get my work done.
His ultimate goal is to be able to update and commit code without having to be logged into the remote server - essentially to replicate the local development experience regardless of the underlying technology. Have a suggestion or a method that's currently working for you? Leave him a comment!
voice your opinion now!
remote code development opinion suggestion environment
Lars Tesmer's Blog: How to Unit Test a Class Making Calls to an URL (or the Filesystem) With PHPUnit
by Chris Cornutt September 21, 2011 @ 12:04:47
Lars Tesmer has a suggestion for all of the unit testers out there (you do unit test your code, right?) when needing to test a piece of code that makes a call to something on the file system or a remote resource. Their examples come from tests written against the Assetic codebase.
For our most recent After Work Hacking my co-workers and me decided to write unit tests for the open source project Assetic. That turned out to be a better decision than our last one, yet we still ran into an interesting challenge.
In testing the HttpAsset class from the tool, they came across the problem - a call to a remote/file resource that could not be tested because of a file_get_contents call that depends on an external source. They came up with a few options to try to test this example, some better than others:
- Give it a real URL to test with
- Wrap the file_get_contents inside of a new class (ex. a "ContentFetcher")
- Use vfsStream to mock out the file system in the unit test
In their case, vfsStream couldn't be used due to how the fetch call was made, but the tool can be very handy if you need to mock out an external file system resource.
voice your opinion now!
phpunit unittest remote url filesystem resource mock vfsstream
Ldeveloper Tech Blog: PHP - Fatal error Uncaught SoapFault exception Could not connect to host...
by Chris Cornutt August 12, 2011 @ 11:38:04
On the Ldeveloper Tech Blog today there's a helpful new post about an error PHP's SOAP extension could throw about not being able to connect to the host despite all settings being correct.
I receive this nasty error yesterday and it took me some time to figure out the problem: "Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in...". This ["new SoapClient"] line passes without any problems and this [var_dump on __getFunctions] shows the function prototypes correctly.
His script connects to the service as its supposed to but the "could not connect" is still thrown. He found a few references to OpenSSL issues that could cause it, but his code was correct so he turned to the other side - the service itself. As it turns out, it wasn't configured correctly.
It was configured to send invalid url and the function calls were using that invalid url. So there are two solutions [...] the first is to configure the server correctly. The other is to give __doReguest the correct location.
voice your opinion now!
soap connect host openssl service remote error
DZone.com: Hardening PHP How to securely include remote code (part 1)
by Chris Cornutt June 10, 2011 @ 10:28:26
On the PHP on Windows blog from DZone.com Krzysztof Kotowicz has a new post - part one in a series on securing your PHP application - a look at securely including remote code from a source outside of your application.
First post of the series discussing various methods of including remote PHP code in your application - from security standpoint. In this post we discuss the history of remote code execution vulnerabilities in PHP apps and ways to prevent them. We finish off by presenting an unsecure method of including a remote code and describe what is the problem with that method.
He looks at the insecurity of a standard include/require, the allow_url_include php.ini setting and the issues with using hardcoded locations (like incorrect DNS records pointing to the wrong host).
voice your opinion now!
harden application include remote code security
IBM developerWorks: Accessing third-party content with oEmbed and PHP
by Chris Cornutt March 14, 2011 @ 13:42:44
On IBM's developerWorks there's a recent article from Vikram Vaswani about using the oEmbed tool to pull content into your site from sources like YouTube, Twitter and Facebook.
If you have your photos in Flickr, your videos in YouTube, and your TV shows in Hulu, how do you bring them all into your blog posts on Blogger? Of course, you can do this by hyperlinking to the appropriate content, but wouldn't it be nicer if you could just embed them into your post at the appropriate place? Enter oEmbed.
He gives examples showing how to pull in content from a few different places - a video from YouTube, one from Revision3 and an image from deviantART. He also talks about using the oohEmbed service to access additional content on things like Wikipedia, Slideshare and Amazon. There's also a bit at the end looking at an alternative PHP library that could be used to do similar things, php-oembed.
voice your opinion now!
oembed content thirdparty remote oohembed
|
Community Events
Don't see your event here? Let us know!
|