PHP 7.3.18 Released

The PHP development team announces the immediate availability of PHP 7.3.18 This is a security release which also contains several bug fixes.All PHP 7.3 users are encouraged to upgrade to this version.For source downloads of PHP 7.3.18 please visit our downloads page, Windows source and binaries can be found on windows.php.net/download/. The list of changes is recorded in the ChangeLog.

PHP 7.2.31 Released

The PHP development team announces the immediate availability of PHP 7.2.31. This is a security release.All PHP 7.2 users are encouraged to upgrade to this version.For source downloads of PHP 7.2.31 please visit our downloads page, Windows source and binaries can be found on windows.php.net/download/. The list of changes is recorded in the ChangeLog.

PHP 7.4.6 Released!

The PHP development team announces the immediate availability of PHP 7.4.6. This is a security release which also contains several bug fixes.All PHP 7.4 users are encouraged to upgrade to this version.For source downloads of PHP 7.4.6 please visit our downloads page, Windows source and binaries can be found on windows.php.net/download/. The list of changes is recorded in the ChangeLog.

DDD and your database

The introduction of Domain-Driven Design (DDD) to a larger audience has led to a few really damaging ideas among developers, like this one (maybe it's more a sentiment than an idea):

Data is bad, behavior is good. The domain model is great, the database awful.

(We're not even discussing CRUD in this article, which apparently is the worst of the worst.)

By now many of us feel ashamed of using an ORM alongside a "DDD domain model", putting some mapping configuration in it, doing things inside your entities (or do you call them aggregates?) just to make them easily serializable to the database.

Infrastructure code in your entities

We want our domain model to be pure objects, have only "domain concerns", leading us to reinvent assertion libraries just because "those are in /vendor". We think that mapping configuration is infrastructure code, whether you use annotations or write your mapping code yourself.

In a previous article (Is all code in vendor infrastructure code?) I've shared my definition of infrastructure code and we discussed a more practical definition as well: infrastructure code is code that is not sufficiently isolated to test it with a unit test. Let's use this definition for domain models that are prepared for persistence - that are "ORM-ready" so to speak. In order to know if we have properly separated infrastructure code from domain code, we only have to check if we can exercise the model's behavior in a unit test. Let's show Michael Feather's definition of a unit test once more:

A test is not a unit test if:

  • It talks to the database
  • It communicates across the network
  • It touches the file system
  • It can't run at the same time as any of your other unit tests
  • You have to do special things to your environment (such as editing config files) to run it.

So to test a domain model's behavior with a unit test it shouldn't need an actual database, a network connection, a file system, etc. No "special setup" should be required. You should be able to instantiate the object and call a method on it, just like that.

Entities should be testable in isolation

Let's look at some common cases where people might be worried that they have infrastructure code in their domain model. What about this code:

/**
 * @Entity
 * @Table(name="todo_items")
 */
final class ToDoItem
{
    /**
     * @Id
     * @Column(type="integer")
     * @GeneratedValue
     */
    private int $id;

    /**
     * @Column(type="string")
     */
    private string $description;

    public function __construct()
    {
    }

    public function setDescription(string $description): void
    {
        $this->description = $description;
    }

    // ...
}

Is it true, does this code pass the test? It does: you can run this code without a database, etc. without external dependencies. You can run this code without preparing the context in a special way. In a unit test you can just do this:

$toDoItem = new ToDoItem();
$toDoItem->setDescription('The description');

// ...

So none of this code is infrastructure code, although those annotations are definitely meant to support persistence and you could say this class has "infrastructure concerns".

What about the following example, which has hand-written mapping code in it?

final class ToDoItem
{
    private int $id;

    private string $description;

    public function __construct()
    {
    }

    public function setDescription(string $description): void
    {
        $this->description = $description;
    }

    public function getState(): array
    {
        return [
            'id' => $this->id,
            'description' => $this->description
        ];
    }

    public static function fromState(array $state): self
    {
        $instance = new self();
        $instance->id = (int)$state['id'];
        $instance->description = (int)$state['description'];

        return $instance;
    }

    public static function getTableName(): string
    {
        return 'todo_items';
    }

    // ...
}

It's not a great model. But again, you can just create an instance of this class, call any method on it, and make some assertions. There are no external dependencies, or special setup needed. So far we haven't seen any example of infrastructure code, even though we saw table names, column names, and column types.

Testing

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

How to Handle Losing Your Motivation as a Designer

Sometimes, you just don’t want to do your work. It can be such a hassle to get up, start up the computer, fire up the software, and do what needs to be done.

You feel tired and bored, having lost sight of why you chose a career in design in the first place, and you find yourself wondering whether you should just give it all up and become a dental hygienist.

It can be really demoralizing to lose your motivation part of the way through a project, but what do you do if you absolutely have to get something done regardless of how you feel about it?

I’m going to tell you about a technique you can use when you’re feeling burnt out and you simply can’t bear to think about taking one more step to complete that big, hairy project staring you in the face.

Riding the Rollercoaster

Emotions are not permanent. Sometimes you’re exuberantly happy, and other times you’re depressed enough to cry. This is normal – it means you’re human and not a robot. Most people realize that their current emotional state won’t last forever.

However, most of us seem to conveniently forget that fact when there’s a pile of work that needs to be done, and it isn’t going to do itself. It doesn’t matter if the work is for a client or boss, or just for ourselves.

We can usually find a way to get our work done when there’s a paycheck involved, but sometimes even that isn’t motivation enough to press on.

Procrastination is a problem that affects us all, but for some people, it can be more devastating than usual. Believe it or not, people have lost their jobs, homes, and families because they couldn’t bring themselves out of the trap of procrastination.

Procrastination usually occurs when the emotional side of our brains – the side that loves to laze in front of the television and eat ice cream – overtakes the rational side of our brains.

rollercoaster representing the career of a designer

The rational side no longer has control, and the emotional side is now telling us that there’s nothing more important than catching up on our favorite show or finishing that new video game we just bought.

If this sounds painfully familiar, I have some news for you. First of all, you should realize that procrastination, despite being an annoyance and a major waste of time, is perfectly normal.

Really. You’re not some lazy freak of nature if you procrastinate now and then. There’s no real cure for procrastination, and to be honest, as a creative person, you probably wouldn’t want the cure even if there was one.

Why? Because procrastination is a major source of distraction, and distraction is what allows you to be creative in the first place.

Think about it. If your life was merely a series of tasks from your to-do list, which you did flawlessly all the time, where would you find the time to be creative?

And what are you usually doing when you’re at your most creative? Are you getting things done productively, like a good little automaton? Or are you goofing off – staring into space, doodling aimlessly, thinking about crazy, abstract things that have nothing to do with the task at hand? If you’re anything like me, the answer is almost always the latter.

The problem comes when your procrastination lasts longer than the period it’s required to be useful. If you find yourself avoiding your work for no other reason than you’re just not motivated to do it, there are a few things you can do to get yourself back on track and complete the work that needs to be completed.

First of all, it’s important to understand the nature of human emotion. Don’t worry – this isn’t some esoteric psychology lesson.

It’s actually quite simple: there’s no way you can maintain the same level of enthusiasm for the entire duration of a long-term project. It’s just not possible. Your brain will eventually run out of energy, and you’ll find yourself exhausted and demotivated.

This is normal. And like procrastination, there’s nothing you can do about it. What you can do, however, is something that many people refuse to do: accept that it’s normal and that you can’t do anything about it.

woman working computer

Once you accept that something is inevitable, you’ll be much better prepared to deal with it when it happens.

If you’ve ever lost a loved one to a long illness, you’ll probably recall how, after a certain period, they will begin to make preparations for their own passing. They’ll update their will, and set everything in order for the day when they’ll no longer be around. There’s nothing they can do to stop what’s coming, but they can accept it and make things go that much smoother.

And if a terminally ill person can accept their own mortality, you can certainly accept that you’ll have to continue working regardless of how you feel about it at any given time.

In order to continue working on a project once you’re past that stage of initial enthusiasm, you have to prepare yourself ahead of time to deal with your fluctuating emotions.

It’s important to realize that you won’t always be at the same level of excitement, and that that’s perfectly okay. That way, when you lose steam halfway through, you’ll have a system in place to deal with it and you won’t be completely lost and frustrated.

A lot of people say things like, “it’s not the destination that matters, but the journey.” After you get through wanting to punch those people in the face, take a moment and really think about what they’re saying. If you’re too focused on your goal, you won’t even notice when your enthusiasm runs out and you’re no longer able to rely on it for motivation.

Set Realistic Expectations

Many times, we lose motivation to work on a project because we just aren’t seeing the results we thought we would in the allotted time period.

If you took on a few freelancing jobs in hopes of saving up enough money to take that trip around the world you’ve been wanting to take, or even to just pay some of your bills that have been piling up, and you haven’t gotten as many clients as you hoped you would, you can easily become discouraged.

If no amount of marketing or niching down your target client base has been showing results, perhaps it’s time to reevaluate the amount of time you’ve given yourself to reach your goals.

Are you expecting to double your income through freelancing within six months? If so, you might want to sit down, because I have some bad news for you. Building a successful freelance career takes time – time that you might not have given yourself in the beginning.

Use your “downtime” of minimal motivation to reassess your goals and create a more realistic scenario. When you’re feeling defeated, it can be much easier to accept that your goals will take you longer than you thought.

Why? Because you give your brain hope that they can eventually be reached, rather than thinking that everything is doomed and you’ll never be successful.

Doomed If You Do, Doomed If You Don’t

If you’ve been successful at completing projects before, you might recall that, though you can laugh and joke about it all now, you probably experienced feelings of doubt and anxiety about the success of your project.

Doubt is one of the biggest killers of motivation, because it robs you of the confidence needed to complete any task.

Even if you’ve planned your goals carefully and rationally, and you haven’t miscalculated anything in terms of time or effort required, if you feel you’re still not getting the results you were hoping for, you can start to lose your enthusiasm.

You may feel as though you’ll never reach your goals… until you do reach them. Then, you become totally confident again and nothing can stop you. Right?

am I good enough quote notepad book handwritten

Well, sometimes. I don’t know about you, but even when I’ve been successful with a project, I’ll still get a nagging feeling that I just haven’t done enough to secure my success. If you experience anxiety about succeeding, you can feel as if you’re a fraud, hiding behind a curtain of false confidence like the Wizard of Oz.

The good thing about these feelings is that they’re usually temporary. Most people have them, and they’ll eventually go away after a while. If you began your project for the right reasons, those reasons will always guide you through the wilderness, and you’ll eventually meet back up with your confidence.

Creative people are natural-born risk-takers. Everything we do – from finding freelance clients to generating valuable work those clients will love – involves a risk of some sort.

Even if the only risk is you feeling demotivated or unenthusiastic from time to time, it can still prove too much for you to handle. But imagine how our lives would be if nothing involved any kind of risk. If everything you touched turned to gold and you could never fail, ever.

The post How to Handle Losing Your Motivation as a Designer appeared first on Speckyboy Design Magazine.

Community News: Latest PECL Releases (05.12.2020)

Latest PECL Releases:

  • event 2.5.5
    Issue #60: fixed a segfault which appeared when Event::add was called on malformed or freed Event object

  • yaf 3.2.2
    - Added Yaf_Dispatcher::setResponse - Removed FINAL flags of Yaf_Request_*, Yaf_Response_* - Fixed bug that ErrorController doesn't respect returnResponse
  • swoole 4.5.1
    Enhancement --- + Support socket context bindto in hook (#3275) (#3278) (@codinghuang) + Support dns resolve in client::sendto (#3292) (@codinghuang) + Process->exit(0) will call os.exit directly (a732fe56) (@matyhtf) + Support `log_date_format` to change format of log date, `log_date_with_microseconds` to show micro-time in log (baf895bc) (@matyhtf) + Support CURLOPT_CAINFO and CURLOPT_CAPATH (swoole/library#32) (@sy-records) + Support CURLOPT_FORBID_REUSE (swoole/library#33) (@sy-records)

    Fixed

    • Fixed 32-bit build (#3276) (#3277) (@remicollet) (@twose)
    • Fixed missing error info (#3280) (@codinghuang)
    • Fixed potential bugs in Table (d7b87b65) (@matyhtf)
    • Fixed null ptr error in Server (defensive programming) (#3304) (#3305) (@twose)
    • Fixed heartbeat timeout null ptr error (#3307) (@twose)
    • Fixed mysqli options error (swoole/library#35)
    • Fixed response header parsing when there is no space after the colon in the response header (swoole/library#27) (@Yurunsoft)

    Deprecated

    • Mark CoroutineSystem::(fread/fgets/fwrite) as deprecated, please use runtime hook instead (it should have been included in v4.5.0) (c7c9bb40) (@twose)

    Kernel

    • Use zend_object_alloc (cf1afb25) (@twose)
    • Add more options for log (#3296) (@matyhtf)
    • Improve code and add more tests (swoole/library) (@deminy)
  • ice 1.6.1
    - Update zephir, Model dafault rules fix #270 - Build with recent GCC fix #266 - Image, gd watermark fix #268
  • redis 5.2.2
    phpredis 5.2.2

    This is a bugfix release that contains a fix for authentication when using persistent connections, and an option to make the ECHO challenge response logic optional.

    • Inexpensive liveness check, and making ECHO optional [56898f81] (Pavlo Yatsukhnenko)

    • Move AUTH to redis_sock_server_open [80f2529b](Pavlo Yatsukhnenko)

    • Sponsors ~ Audiomack.com - https://audiomack.com ~ Till Kruss - https://github.com/tillkruss

ZeroSSL Offers Free, Easy-To-Use SSL Certificates Sponsored

Having a secure website is one of the best ways to establish consumer trust. When users see that padlock icon in their web browser’s address bar, they can breathe a bit easier when inputting personal and financial information.

That’s why encrypting data transfer via an SSL certificate is so important. For users, it brings peace of mind. For website owners, it helps to build a solid reputation. It’s now a must-have feature for every site.

ZeroSSL aims to make the web a more secure place. That’s why they’re offering free SSL certificates that can be up and running in as little as 5 minutes. Certificates are validated in seconds and have the ability to be automatically renewed.

It’s everything you love about free SSL certificates, but without the hassle!

ZeroSSL Home Page

Fast, Reliable and Free SSL Certificates for Every Website

ZeroSSL isn’t the only free SSL certificate option out there. For example, Let’s Encrypt is a popular choice. But it does offer several features that make it stand out:

Get Unlimited 90-Day Certificates for Free; 1-Year, Multi-Domain and Wildcard Options Available

When it comes to security, there are a number of different project requirements. That’s why ZeroSSL offers a variety of SSL certificate options to meet every need.

If you’re looking to quickly secure your website at no cost, their free plan allows you to register an unlimited number of certificates with a 90-day renewal term. Choose from single domain, multi-domain or wildcard options.

Need more? You can also get 1-year certificates as part of affordable monthly or yearly plans. These plans also include perks such as REST-API access and technical support.

Easy to Use

The process for securing your website with ZeroSSL is simple. Use their online tool to select your domain, generate your CSR and validate your domain in a single step. From there, install your certificate and you’re good to go!

In addition, you’ll also gain access to a fully-featured SSL management console. You can use it to manage every aspect of your certificates in one convenient place.

ZeroSSL Management Console

Automate Tasks with AMCE and the ZeroSSL REST API

Put your SSL management on autopilot and relax. ZeroSSL offers a simple and powerful REST API and ACME integrations that automate a number of common tasks. In fact, anything you can do manually in the SSL management console can be automated using ACME or the REST API.

ACME Integrations
ZeroSSL comes with a dedicated ACME Certbot, which enables you to order and renew certificates in a fully-automated way. The service also works with all major third-party ACME integrations as well. Either way, it’s completely free to use.

Already a Let’s Encrypt user? You’ll also be able to use ZeroSSL’s ACME Certbot to renew your existing certificates!

ZeroSSL REST API
The Zero SSL REST API offers a straightforward solution to automating certificate management. This well-documented API lets you create, renew and validate your certificates. It also includes automated status webhooks that help to ensure everything is running smoothly.

ACME Automation and SSL REST API

One-Step Domain Validation

Unlike Let’s Encrypt, ZeroSSL provides you with the ability to validate domain ownership via email. This greatly improves both the speed and efficiency of issuing certificates. Other validation methods include CNAME and HTTP file upload.

A Certificate Authority

ZeroSSL will be listed as the official certificate authority for any and all certificates you purchase through them. And, it’s a name you and your visitors can trust. ZeroSSL certificates are used by thousands of companies worldwide and are supported by 99.9% of servers, browsers and platforms.

ZeroSSL Feature List

A Better Way to Do Free SSL

ZeroSSL has become the better alternative for SSL certificates. They offer powerful features and unparalleled flexibility on a platform that has been built with developers in mind. Manage your certificates manually or with total automation, thanks to ACME integrations and a REST API.

The system is scalable, secure and incredibly easy to use. Sign up for your free SSL certificate, then validate and install it within mere minutes.

Plus, ZeroSSL offers more robust products such as multi-domain and wildcard certificates – both of which are included in the free plan. And, with an affordable monthly or yearly plan, you can get certificates on a 1-year renewal term along with access to the REST API.

So, what are you waiting for? Sign up with ZeroSSL and get your free SSL certificates today!

The post ZeroSSL Offers Free, Easy-To-Use SSL Certificates <span class="sponsored_text">Sponsored</span> appeared first on Speckyboy Design Magazine.

Powered by Gewgley