Monthly Archiv: April, 2020

Community News: Latest PECL Releases (04.28.2020)

Latest PECL Releases:

  • mysql_xdevapi 8.0.20
    WL#13001 DevAPI: Connection compression orabug #30864458: some methods should not be reported as deprecated anymore

  • ice 1.6.0
    - Composer, update zephir to 0.12.18 - Add the image component - Dump, recursion fix #265 - PHP 7.0, drop support - Code cleanup - Update prototypes - Flash, add dismissible class - Dispatcher, continue if before returns a value - Update zephir parser to 1.3.4 - Websocket, long message fix #262
  • swoole 4.5.0
    New APIs --- + DTLS supports, we can build WebRTC applications now (#3188) (@matyhtf) + Built-in `FastCGI` client, we can proxy HTTP request to FPM with one line of code now (swoole/library#17) (@twose) + `Co::wait`, `Co::waitPid`, `Co::waitSignal` (#3158) (@twose) + `Co::waitEvent` (#3197) (@twose) + `Co::set(['exit_condition' => $callable])` to exit condition of reactor (#2918) (#3012) (@twose) + `Co::getElapsed` to get the coroutine elapsed time (#3162) (@doubaokun) + `Socket::checkLiveness`, `Socket::peek` (#3057) (@twose) + `Socket->setProtocol(['open_fastcgi_protocol' => $bool])` (#3103) (@twose) + `Server::get(Master|Manager|Worker)Pid`, `Server::getWorkerId` (#2793) (#3019) (@matyhtf) + `Server::getWorkerStatus` (SWOOLE_WORKER_BUSY, SWOOLE_WORKER_IDLE) (#3225) (@matyhtf) + `Server->on('beforeReload', $callable)` and `Server->on('afterReload', $callable)` (Server reload event on manager process) (#3130) (@huanghantao) + `HttpServer` support `http_index_files` and `http_autoindex` with static handler (#3171) (@huanghantao) + `Http2Client->read(float $timeout = -1)`, support CoroutineHTTP2Client read more than once (#3011) (#3117) (@twose) + `HttpRequest->getContent` (alias of rawContent) (#3128) (@huanghantao) + `swoole_mime_type_(add|set|delete|get|exists)` (mime APIs) (#3134) (@twose)

    Enhancement

    • Optimize memory-copy between master and worker (4x faster) (#3075) (#3087) (@huanghantao)
    • Optimize websocket dispatch (1x faster) (#3076) (@matyhtf)
    • Optimize memory-copy in websocket_construct_frame (1x faster) (#3097) (@matyhtf)
    • Optimize SSL validation (#3226) (@matyhtf)
    • Separate SSL accept and SSL handshake (#3214) (@twose)
    • Support MIPS (#3196) (@ekongyun)
    • Resolve the domain name when use udp coroutine client (#3236) (#3239) (@huanghantao)
    • Support some common options for CoroutineHttpServer (#3257) (@twose)
    • Support set cookies when websocket handshake (#3270) (#3272) (@twose)
    • Support CURLOPT_FAILONERROR (swoole/library#20) (@sy-records)
    • Support CURLOPT_FAILONERROR (swoole/library#20) (@sy-records)
    • Support CURLOPT_SSLCERTTYPE, CURLOPT_SSLCERT, CURLOPT_SSLKEYTYPE, CURLOPT_SSLKEY (swoole/library#22) (@sy-records)
    • Support CURLOPT_HTTPGET (swoole/library@d730bd08) (@shiguangqi)

    Remove

    • Remove Runtime::enableStrictMode method (b45838e3) (@twose)
    • Remove Buffer class (559a49a8) (@twose)

    Kernel

    • New C++ API: coroutine::async with lambda (#3127) (@matyhtf)
    • Refactor event API and reactor fd to swSocket (#3030) (@matyhtf)
    • Convert all source files to C++ (#3030) (71f987f3) (@matyhtf)
    • Code optimizations (#3063) (#3067) (#3115) (#3135) (#3138) (#3139) (#3151) (#3168) (@huanghantao)
    • Code optimization for header files (#3051) (@matyhtf)
    • Refactor enable_reuse_port option (#3192) (@matyhtf)
    • Reactor Socket API (#3193) (@matyhtf)
    • Reduce one system call (3b5aa85d) (@matyhtf)
    • Remove swServerGS::now (#3152) (@huanghantao)
    • Improve protocol setter (#3108) (@twose)
    • Use the Better way to init C object on stack (#3069) (@twose)
    • Use type uchar for bit field (#3071) (@twose)
    • Support parallel test (#3215) (@twose)

    Fixed

    • Fixed enable_delay_receive (#3221) (#3224) (@matyhtf)
    • All other bug fix patches have already been merged into the v4.4.x branch, we will not reiterate them here
  • xdebug 2.9.5
    Sat, Apr 25, 2020 - xdebug 2.9.5

    = Fixed bugs:

    • Fixed issue #1772: Crash with exception thrown inside a destructor
    • Fixed issue #1775: Segfault when another extension compiles a PHP file during RINIT
    • Fixed issue #1779: Nested multi-line built-in function in namespace are not covered
  • swoole 4.4.18
    Enhancement --- + Resolve the domain name when use udp coroutine client (#3236) (#3239) (@huanghantao) + Do not close stdout and stderr (show error logs after shutdown) (#3249) (@twose) + Support some common options for CoroutineHttpServer (#3257) (@twose) + Support set cookies when websocket handshake (#3270) (#3272) (@twose) + Support CURLOPT_FAILONERROR (swoole/library#20) (@sy-records) + Support CURLOPT_SSLCERTTYPE, CURLOPT_SSLCERT, CURLOPT_SSLKEYTYPE, CURLOPT_SSLKEY (swoole/library#22) (@sy-records) + Support CURLOPT_HTTPGET (swoole/library@d730bd08) (@shiguangqi) + Compatible with different versions of Redis extension as much as possible (swoole/library#24) (@twose) + Disable Cloning of Database Proxy Objects (swoole/library#23) (@deminy)

    Fixed

    • Fixed SSL handshake failure (dc5ac29a) (@twose)
    • Fixed memory error when generate error message (#3229) (@twose)
    • Fixed empty proxy authorization info (#3243) (@twose)
    • Fixed channel unreal memory leak (#3260) (@twose)
    • Fixed memory leak of CoHttpServer (#3271) (@twose)
    • Fixed ConnectionPool->fill (swoole/library#18) (@NHZEX)
    • Fixed use new client for the redirection requests (swoole/library#21) (@doubaokun)
    • Fixed null socket error in ioException (swoole/library@4d15a4c3) (@twose)
    • Fixed ConnectionPool@put when error happens (swoole/library#25) (@Sinute)
    • Fixed mysqli write_property error (swoole/library#26) (@twose)
  • timezonedb 2020.1
    Updated to version 2020.1 (2020a)
  • xattr 1.4.0
    - drop dupport for PHP older than 7.2 - add type hinting in reflection
  • yaml 2.1.0
    New Features: - Basic PHP8 (master branch) compatiblity Bugs Fixed: - #79494: The 64-bit YAML ext uses 32-bit signed integer arithmetics (cmb69) - Use ZEND_LONG_FMT to fix -Wformat warnings (carusogabriel) - Fix memory leaks when writing timestamps (cmb69) - Update tests/yaml_parse_file_002.phpt for PHP8 (carusogabriel) - #78353: Remove deprecated TSRM macros (a.dankovtsev)
  • datadog_trace 0.43.0
    **Note: This release comes with minor behavior changes for tracing closures on PHP 7. Please see [the PR for details](https://github.com/DataDog/dd-trace-php/pull/762).**

    Added

    • Service mapping with DD_SERVICE_MAPPING=pdo:payments-db,mysqli:orders-db #801, #817
    • Auto flushing with DD_TRACE_AUTO_FLUSH_ENABLED=1 (PHP 7) #819, #826
    • Disable automatic root-span creation with DD_TRACE_GENERATE_ROOT_SPAN=0 #834

    Changed

    • Always return unaltered VM dispatch (PHP 7) #762
    • Uri to resource name ON by default #798
    • Sandbox Guzzle #809, #816
    • Sandbox predis integration #813
    • Sandbox curl (PHP 7) #814, #817, #831
    • Convert pid from long to string for internal spans #825
    • Move some Configuration methods to functions written at the C level #829
  • selinux 0.5.0
    - drop support for PHP 5 - preliminary support for PHP 8
  • xattr 1.3.1
    - preliminary support for PHP 8
  • mailparse 3.1.0
    - add arginfo to all functions - fix MimeMessage constructor name

Creating a simple link registry

The problem: if you publish any document as PDF, in print, etc. and the text contains URLs, there is a chance that one day those URLs won't work anymore. There's nothing to do about that, it happens.

Luckily, this is a solved problem. The solution is to link to a stable and trustworthy website, that is, one that you maintain and host (of course, you're trustworthy!). Then in the document you link to that website, and the website redirects visitors to the actual location.

An example: my book contains a link to https://enjoy.gitstore.app/repositories/matthiasnoback/read-with-the-author. When I moved that repository to a new organization on GitHub, this link resulted in a 404 Page not found error. The proper URL is now https://enjoy.gitstore.app/repositories/read-with-the-author/read-with-the-author. Chris from Gitstore was able to save the day by setting up a redirect on their site, but I wanted to make sure this kind of problem would never be a problem for me again.

The ingredients for the solution:

  • A domain name (I registered advwebapparch.com)
  • A simple website that can redirect visitors to the actual locations

I wanted to hook this new website into my existing Docker-based setup which uses Traefik to forward traffic to the right container based on labels. It turns out, with a simple Nginx image and some custom setup we can easily set up a website that is able to redirecting visitors.

The Dockerfile for such an image:

FROM nginx:stable-alpine
COPY default.conf /etc/nginx/conf.d/default.conf

Where default.conf looks like this:

server {
    listen 80 default_server;
    index index.html;
    root /srv;

    error_page 404 /404.html;

    rewrite /repository https://enjoy.gitstore.app/repositories/read-with-the-author/read-with-the-author redirect;
}

This already works, and when I deploying the resulting image to the server that receives traffic for advwebapparch.com, a request for /repository will indeed redirect a visitor to https://enjoy.gitstore.app/repositories/read-with-the-author/read-with-the-author using a temporary redirect.

Generating the Nginx configuration from a text file

When I'm working on my book, I don't want to manually update a server configuration file every time I'm adding a URL. Instead, I'd like to work with a simple text file. Let's name this file forwards.txt:

/repository https://enjoy.gitstore.app/repositories/read-with-the-author/read-with-the-author
/blog https://matthiasnoback.nl

And then I want the Docker image build process to add rewrite rules automatically, So I wrote a little PHP script that does this runs during the build. Here's what the Dockerfile looks like. It uses a multi-stage build:

FROM php:7.4-alpine as php
# This will copy build.php from the build context to the image
COPY . .
# This will generate default.conf based on template.conf
RUN php build.php

FROM nginx:stable-alpine
# Copy the default.conf from the php image to the nginx image
COPY --from=php default.conf /etc/nginx/conf.d/default.conf

Here's what happens inside the PHP script:

function insertRewritesInNginxConf(string $conf): string
{
    $rewrites = [];

    foreach (file('forwards.txt') as $line) {
        $line = trim($line);
        if (empty($line)) {
            continue;
        }

        $rewrites[] = '    ' . 'rewrite ' . $line . ' redirect;';
    }

    return str_replace(
        '%INSERT_URL_REWRITES_HERE%',
        implode("\n", $rewrites),
        $conf
    );
}

/*
 * Generate the Nginx configuration which includes all the actual
 * redirect instructions
 */
file_put_contents(
    'default.conf',
    insertRewritesInNginxConf(file_get_contents('template.conf'))
);

We should add a bit of validation for the data from the forwards.txt file so we don't end up with a broken Nginx configuration, but otherwise, this works just fine.

I don't want to manually check that all the links that are inside the "link registry" still work. Instead, I'd like to use Oh Dear for that, which does uptime monitoring and checks for broken links as well.

For this purpose I added another function to the PHP script, which, based

Truncated by Planet PHP, read more at the original (another 1844 bytes)

2 New Free File Synchronization Software: easily back up your data to a separate drive

Two new programs have been added to the Free File Synchronization Software page. One of them can even back up across a local network and the Internet. As everyone who has worked on a computer for some time knows, it is very important to back up (at the very least) your data onto a separate device on a regular basis, since computers can fail at unexpected times. Software like these are used to automatically mirror the data on your main computer with your backup drive or system, so that it is kept up to date.

Note: if you want to back up an entire computer, and not just your data, please see the Free Hard Disk Backup and Restore, Hard Disk Image and Cloning Utilities page instead.

WordPress Recaptcha Integration

Package:
WordPress Recaptcha Integration
Summary:
Plugin to integrate Recaptcha to protect forms
Groups:
Content management, PHP 5, Security
Author:
Malik Naik
Description:
This package provides a WordPress Plugin to integrate Recaptcha to protect forms...

Read more at https://www.phpclasses.org/package/11628-PHP-Plugin-to-integrate-Recaptcha-to-protect-forms.html#2020-04-27-19:37:31

How to Get Those Creative Juices Flowing Again

What do you do if you’re partway through an important project for a client and you get, well… stuck? You simply can’t wring any more good ideas from that brain of yours, and none of your ordinary tricks to relieve creative block are working.

To many designers, this is the kiss of death, but I’m here today to tell you that it doesn’t have to be. We’re going to explore some unusual but very effective ways to get those creative juices flowing again so that you can get back in the flow of things and continue to wow your clients.

Creativity in Routine?

Here’s a fact about the human brain that you may not know: every single decision you make throughout your day will have a negative effect on your ability to successfully complete a task. That’s right – whether it’s choosing which color to make that dropdown menu, or whether you should wear that green shirt or the blue one, every time you’re forced to make a decision, you lose just a bit more mental energy.

This is why you may find yourself burnt out by lunchtime if you begin your day by answering emails or answering silly questions from dense clients. Those small decisions have used up a huge amount of your energy for the day. Sure, you can recover some of it by eating a nutritious lunch or having a quick nap, but you won’t be quite as productive after noon as you were before.

Adopting systems and routines that automate a lot of your daily decisions can help tremendously in recovering some of that creativity you thought was lost forever.

Consider taking a full day to plan the little things you know you will have to do for the week, even down to what color shirt you’ll wear. Try to batch your email responses if you can – it’s not a crime to cut and paste responses if they’re relevant and get the point across.

The more things you can automate, the more you can turn your focus to the work that truly matters.

designer journal todo list calendar planner

Getting a Jolt of Energy

Starting a new project can be very intimidating. And yes, I’m about to use yet another of my famous food analogies, so get ready.

Have you ever been to a restaurant, and the waiter hands you a menu that’s absolutely terrifying? I don’t mean it has teeth or it growls at you or anything like that. I mean, there are so many items on the menu, and the descriptions are so lengthy that you almost lose your appetite and want to run back out the front door?

Too much choice can do more than confuse us – it can just about ruin our experience and make us want to hide while we try to process everything in front of us.

For me, it seems like the more freedom I have with a design project, the scarier, more confusing, and more impossible it becomes to get started.

Of course, freedom in my design work is something I’ve strived very hard to achieve, and I’m very fortunate to have it. But sometimes, with a big, hairy project deadline looming over my head, I almost wish I was a student again, with rigid assignments and a limited scope as to what I could work on.

What’s the solution to this problem? I’ve found that doing something spontaneous to get my blood pumping and my creative energy flowing helps tremendously. Exercise is the most obvious choice here, and I don’t need to tell you how many ills it can help cure besides creative block.

However, there are other options, such as spending quality time with friends or loved ones, working on something else, like a personal project, or, my personal favorite, cooking.

energy flowing light stream idea creative

Calm Those Jitters

Sometimes, your problem isn’t that you’re frightened into submission by your project. Rather, you’re inundated with too much energy, which can manifest as nervous fidgeting, hair-pulling, or procrastinating by doing meaningless busy work.

This can be just as maddening because you’re not exactly sure where to begin, and you know you should be doing something productive, but you just can’t figure out what.

You may not realize it, but your brain is like clay. Whatever approach you decide to take for your work will leave an impression on your brain for next time. So, if you react to a challenging project with stress, nerves, or excessive anxiety, you’re saving a copy of that reaction in your brain’s hard drive, which will automatically pull up every time you’re faced with a similar dilemma.

In this case, you need a solution that will burn off or diminish some of that excess energy. A calming activity, such as meditation, walking, journaling, or reading, will help soothe your brain and help it focus on the task at hand.

The post How to Get Those Creative Juices Flowing Again appeared first on Speckyboy Design Magazine.

Spread the Word: Beautiful Testimonial UI Examples

Everybody wants to receive positive feedback for a job well done. That’s one reason why so many businesses include testimonials on their website.

Beyond the warm and fuzzy feelings, testimonials can also help recruit new customers. Knowing that others have had a good experience inspires confidence. In all, it’s a happy little cycle that helps to keep business booming.

In terms of implementing a testimonial UI, simple is often better. That doesn’t mean they have to be boring, however. The clever use of color, layout, and special effects can turn your testimonials into something that stands out.

Let’s take a look at some examples that will give your testimonials a place to shine.

All Aboard the Carousel

Testimonials are often paired with sliders and carousels for both interactivity and efficiency. Several examples in our collection utilize them. However, this example is unique in its design. While there are standard navigation arrows at the bottom of the feature, clicking on the client photos on either side will also enable you to slide back and forth.

See the Pen Responsive Testimonial Carousel by Md Nahidul Islam (@thenahid)

Shapes and Rainbows

If you’re looking to add a testimonial section to your page that stands out, it would be hard to top this. First, there’s the animated, color-changing gradient in the background. Second, the use of CSS clip-path makes for an awesome badge-like look on the images. Even with all of that, the UI is still simple and classy.

See the Pen Responsive testimonial slider by hellokatili (@hellokatili)

No JavaScript Required

For all the CSS purists out there, here’s a solution that doesn’t need a single line of JavaScript. While it’s nothing earth-shattering in terms of looks, that’s actually a good thing. It leaves plenty of room for you to style it to match your needs. In addition, this would fit nicely in a relatively small space.

See the Pen Testimonial Slider Pure CSS by MAHESH AMBURE (@maheshambure21)

It’s in the Cards

This card UI is both simple and beautiful. Each card has its own background photo – presumably to use a client’s photo or logo. CSS opacity is used to allow enough contrast to place white text on top. It also encourages the use of smaller amounts of content, which is much easier to digest than a longer testimonial.

See the Pen #1574 – Testimonial Card by LittleSnippets.net (@littlesnippets)

A New Angle

The design is what we’re focused on in this non-functioning demo. It goes to show that simplicity can be really effective. The slight angle on the background photo draws your eyes in, while the generous padding around the quote itself gives off an airy feel.

See the Pen Stripe’s Testimonial Widget in Tailwind CSS by Adam Wathan (@adamwathan)

Hover Quotes

Here’s a different take on a testimonial UI. It’s full-screen, and you have to hover over images to see each person’s respective quote. The look is incredibly sharp, and the transitions are smooth. This could be a nice choice for more artistically focused websites.

See the Pen Testimonial Hover Reveal by Dave Knispel (@daveknispel)

A Different Take

There’s a lot to like in this example. The side-by-side carousel layout makes for an interesting visual effect. Images move to the left as quotes change on the right. Speaking of the quote area, it offers plenty of whitespace and is easy to read. It makes for a package that is anything but typical.

See the Pen testimonial slider , swiper slider by md aqil (@md-aqil)

Color Card

Another prime example of simplicity, this card layout uses a couple of CSS effects to differentiate itself. First is the slightly-rotated quote mark in the background. CSS transform is used to break uniformity – in a good way. Also, the color gradient in the footer makes the whole card, dare we say, “pop.”

See the Pen mdJWryR by bradley (@bradleyham)

Beautiful Praise

The whole idea behind collecting testimonials is to demonstrate that you know how to make customers happy. For several different businesses and organizations, they serve as a key selling tool.

When it comes to displaying testimonials on a website, there are several compelling options. The examples above show how color, movement, typography, and layout can all play an important role in building an attention-getting UI. It’s up to you to decide which approach works best for your brand.

Want to see even more testimonial UIs? Take a look at our CodePen collection and discover what else designers are doing.

The post Spread the Word: Beautiful Testimonial UI Examples appeared first on Speckyboy Design Magazine.

Simple PHP Web Terminal Emulator

Package:
Simple PHP Web Terminal Emulator
Summary:
Display the output of terminal commands in a page
Groups:
Console, HTML, PHP 5
Author:
Guillermina Gonjon
Description:
This class can display the output of terminal commands in a page...

Read more at https://www.phpclasses.org/package/11627-PHP-Display-the-output-of-terminal-commands-in-a-page.html#2020-04-26-20:23:19

Making bugs ex-bugs with Xdebug

Xdebug is an indispensable tool for every PHP developer. PHP’s favorite real-time debugger, it supports breakpoints, more detailed debug output, and deeper introspection of PHP code to determine just what it’s doing (and what it’s doing wrong). Sadly, it comes at a huge cost in performance, though, making it unsuitable for production. Not on Platform.sh, though. Xdebug is now available on all Grid environments, secure and without a performance loss.

Simple MySQLi database access wrapper

Package:
Simple MySQLi database access wrapper
Summary:
Connect and query a MySQL database using MySQLi
Groups:
Databases
Author:
Chetankumar Digambarrao Akarte
Description:
This class can Connect and query a MySQL database using the MySQLi extension...

Read more at https://www.phpclasses.org/package/11624-PHP-Connect-and-query-a-MySQL-database-using-MySQLi.html#2020-04-26-03:02:16

leomoon PHP Twitter RSS

Package:
leomoon PHP Twitter RSS
Summary:
Generate RSS feeds from Twitter user statuses
Groups:
PHP 5, Social Networking, Web services
Author:
Arash Soleimani
Description:
This package can generate RSS feeds from Twitter statuses...

Read more at https://www.phpclasses.org/package/11626-PHP-Generate-RSS-feeds-from-Twitter-user-statuses.html#2020-04-25-23:47:23
Powered by Gewgley