Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Freek van Der Herten:
Automatically close stale issues and pull requests
May 02, 2018 @ 14:31:17

In a post to his site Freek van Der Herten shares some functionality that Spatie uses to help keep the stale pull requests under control across their 180+ repositories: a Botman-based bot that assesses the last updated date and closes after a given amount of time.

At Spatie we have over 180 public repositories. Some of our packages have become quite popular. We're very grateful that many of our users open up issues and PRs to ask questions, notify us of problems and try to solve those problems, ...

Most of these issues and PRs are handled by our team. But sometimes those issues and PRs become stale. [...] That's why we created a bot that can automatically close stale issues and PRs. Here's [an example] of the bot in action.

He then shares the code they currently use for the bot, making use of the BotMan package as a base and the knp-labs/github-api package for the GitHub interaction. The code includes the GitHub service provider, a client class, an Issue object and the command that's run to find and close out the stale pull requests and issues.

tagged: stale pullrequest issue github automatically close bot botman tutorial

Link: https://murze.be/automatically-close-stale-issues-and-pull-requests

Freek Van der Herten:
A tool to automatically rerun PHPUnit tests when source code changes
Aug 04, 2017 @ 15:12:37

In this post to his site Freek Van der Herten shares information about a tool that can help to streamline your development workflow. The phpunit-watcher tool mimics tools from other languages to watch for changes in the source of your application and automatically execute your PHPUnit tests when modifications are made.

In the JavaScript world Jest, built by Facebook, is an excellent tool to run tests. Not only can it automatically rerun your tests when source code changes, but there’s also an interactive mode where you can set a filter on which tests to run while the tool is running. Would it be great if we could have these awesome features while working with PHPUnit?

Our newly released phpunit-watcher tool provides a Jest like experience. You can simply install it by running composer global require spatie/phpunit-watcher.

Once the tool is installed it can then be run from the command line, sitting and waiting for changes to the target files and directory. It's configurable in case you don't follow some of the usual package directory structures and can be filtered to only run on certain filename matches. This can also be done manually (real-time) via the tool. Screenshots are included showing the tool in action too.

tagged: phpunit watcher automatically execute unittest package

Link: https://murze.be/2017/08/tool-automatically-rerun-phpunit-tests-source-code-changes/

Ruslan Yakushev's Blog:
WinCache and WordPress plugin upgrade problem
Apr 15, 2011 @ 15:12:51

In a new post to his blog Ruslan Yakushev points out a new build of WinCache (the Windows caching tool for PHP) that makes life easier for WordPress users who want it to be able to to the auto-upgrade correctly.

The WinCache extension 1.1 for PHP has been released last year. Since then several customers reported a bug in the extension that prevents WordPress and other PHP applications from performing automatic upgrades or their plugins. This was reported on WordPress forum as well as on WinCache forum. The new build of WinCache with the fix for this problem is available now at the following location: https://sourceforge.net/projects/wincache/files/development/

He asks for feedback if things still don't work - either as a comment in the WinCache forum or as a bug to the PECL database. This will help them improve the support in future releases and make it even easier for those running WordPress on Windows to keep their sites running smoothly.

tagged: eincache wordpress problem upgrade automatically bug release

Link:

Mpwebwizard.com:
Use a mirror for hits from popular websites
Dec 18, 2006 @ 21:49:00

There's a tutorial over on mpwebwizard.com that's been updated and talks about using a mirror to handle hits from a popular website (like digg or slashdot).

caching services such as coral content distribution network provide an alternative for when your site goes down, but why wait until it gets to that stage? why not just send all your hits from high-end websites to the coral cache version? well, there isn't a good reason not to, so i'll show you how to do it automatically.

He provides the simple script that looks for certain sites in the "HTTP_REFERER" value of incoming calls and pushes them off to the cached location with a header() redirect. The whole thing is only 12 lines, not counting the $sites array.

tagged: mirror automatically tutorial coral content distribution network referrer mirror automatically tutorial coral content distribution network referrer

Link:

Mpwebwizard.com:
Use a mirror for hits from popular websites
Dec 18, 2006 @ 21:49:00

There's a tutorial over on mpwebwizard.com that's been updated and talks about using a mirror to handle hits from a popular website (like digg or slashdot).

caching services such as coral content distribution network provide an alternative for when your site goes down, but why wait until it gets to that stage? why not just send all your hits from high-end websites to the coral cache version? well, there isn't a good reason not to, so i'll show you how to do it automatically.

He provides the simple script that looks for certain sites in the "HTTP_REFERER" value of incoming calls and pushes them off to the cached location with a header() redirect. The whole thing is only 12 lines, not counting the $sites array.

tagged: mirror automatically tutorial coral content distribution network referrer mirror automatically tutorial coral content distribution network referrer

Link:

Bubble.ro:
How to create the histogram of an image using PHP
Nov 01, 2006 @ 16:18:43

On the Bubble.ro website, there's an interesting tutorial that guides you through the creation of a histogram for any image (that PHP can handle) automatically with a little GD functionality.

The algorithm to calculate the histogram for an image is pretty straight forward if you know how to extract the RGB value of each pixel, by counting the number of pixels of each value (and then divide by the total number of pixels in order to get a normalized value).

They share the simple script that grabs the image's data, analyzes it, and, superimposed on one corner of it, places the histogram image. They have the full source and examples available for download.

tagged: histogram image gd automatically highs lows histogram image gd automatically highs lows

Link:

Bubble.ro:
How to create the histogram of an image using PHP
Nov 01, 2006 @ 16:18:43

On the Bubble.ro website, there's an interesting tutorial that guides you through the creation of a histogram for any image (that PHP can handle) automatically with a little GD functionality.

The algorithm to calculate the histogram for an image is pretty straight forward if you know how to extract the RGB value of each pixel, by counting the number of pixels of each value (and then divide by the total number of pixels in order to get a normalized value).

They share the simple script that grabs the image's data, analyzes it, and, superimposed on one corner of it, places the histogram image. They have the full source and examples available for download.

tagged: histogram image gd automatically highs lows histogram image gd automatically highs lows

Link:


Trending Topics: