Jeśli jesteś właścicielem tej strony, możesz wyłączyć reklamę poniżej zmieniając pakiet na PRO lub VIP w panelu naszego hostingu już od 4zł!

Archive for Marzec, 2017

Hackernoon.com: How to Use Queue in Laravel 5.4 For Email Verification

Hackernoon.com: How to Use Queue in Laravel 5.4 For Email Verification

The Hackernoon.com site has a tutorial posted from Cloudways showing you how to use the queue handling for email verification in a Laravel 5.4 application. The tutorial walks you through the updates and additions you’ll need to make to the user signup process to verify their email.

Today, I will demonstrate how you can use Queue in Laravel 5.4 for email verification by using integrated auth RegisterController. In addition, I will also show you how to add the email sending process to a queue to make your app processes faster.

In this article, I am going to use a database for the queue jobs. However, you can use Redis or any other drivers, as defined in the official docs.

The updates assume you’ve created the authentication/authorization system with Laravel’s make:auth command. Once you’ve run that and the code is generated you can then make the changes:

  • updating the users table to store the email token
  • adding a table for the queue records
  • migrating the tables
  • updating the .env file with queue and mail information

They then go through the functionality to add to the app including the EmailVerification class, the email template and a SendVerficationEmail queue job. The last updates are to the auth registration process to push the sending of the verification email to the background and send another email when the email is confirmed.

Source: http://www.phpdeveloper.org/news/25053

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Hackernoon.com: How to Use Queue in Laravel 5.4 For Email Verification

Hackernoon.com: How to Use Queue in Laravel 5.4 For Email Verification

The Hackernoon.com site has a tutorial posted from Cloudways showing you how to use the queue handling for email verification in a Laravel 5.4 application. The tutorial walks you through the updates and additions you’ll need to make to the user signup process to verify their email.

Today, I will demonstrate how you can use Queue in Laravel 5.4 for email verification by using integrated auth RegisterController. In addition, I will also show you how to add the email sending process to a queue to make your app processes faster.

In this article, I am going to use a database for the queue jobs. However, you can use Redis or any other drivers, as defined in the official docs.

The updates assume you’ve created the authentication/authorization system with Laravel’s make:auth command. Once you’ve run that and the code is generated you can then make the changes:

  • updating the users table to store the email token
  • adding a table for the queue records
  • migrating the tables
  • updating the .env file with queue and mail information

They then go through the functionality to add to the app including the EmailVerification class, the email template and a SendVerficationEmail queue job. The last updates are to the auth registration process to push the sending of the verification email to the background and send another email when the email is confirmed.

Source: http://www.phpdeveloper.org/news/25053

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

SitePoint PHP Blog: Upgrading from PThreads v2 to V3: What to Look out For

SitePoint PHP Blog: Upgrading from PThreads v2 to V3: What to Look out For

On the SitePoint PHP blog Thomas Punt has returned with more pthreads knowledge and shows you a few things to watch out for when upgrading from pthreads v2 to v3. pthreads is a PHP extension that allows for better process handling directly from PHP than just the built in proc_* functions.

A fair amount has changed for the pthreads extension with the release of pthreads v3. This article aims to cover the necessary information for those who are looking to upgrade their applications from pthreads v2 to v3.

If you’re unfamiliar with pthreads, check out my introduction to pthreads instead!

He starts with some of the more generic changes in this latest version with the most major being that it can now only be used in the command-line environment. Other changes were made to workers, method modifiers and the removal of some classes and methods. He also mentions some of the methods that were changed and some new classes/methods that were added. Overall he’s of the opinion that, while some of the changes could make for headaches in the transition, v3 of the extension has "received a nice cleanup and is looking ever better."

Source: http://www.phpdeveloper.org/news/25052

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

SitePoint PHP Blog: Upgrading from PThreads v2 to V3: What to Look out For

SitePoint PHP Blog: Upgrading from PThreads v2 to V3: What to Look out For

On the SitePoint PHP blog Thomas Punt has returned with more pthreads knowledge and shows you a few things to watch out for when upgrading from pthreads v2 to v3. pthreads is a PHP extension that allows for better process handling directly from PHP than just the built in proc_* functions.

A fair amount has changed for the pthreads extension with the release of pthreads v3. This article aims to cover the necessary information for those who are looking to upgrade their applications from pthreads v2 to v3.

If you’re unfamiliar with pthreads, check out my introduction to pthreads instead!

He starts with some of the more generic changes in this latest version with the most major being that it can now only be used in the command-line environment. Other changes were made to workers, method modifiers and the removal of some classes and methods. He also mentions some of the methods that were changed and some new classes/methods that were added. Overall he’s of the opinion that, while some of the changes could make for headaches in the transition, v3 of the extension has "received a nice cleanup and is looking ever better."

Source: http://www.phpdeveloper.org/news/25052

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

SitePoint PHP Blog: Upgrading from PThreads v2 to V3: What to Look out For

SitePoint PHP Blog: Upgrading from PThreads v2 to V3: What to Look out For

On the SitePoint PHP blog Thomas Punt has returned with more pthreads knowledge and shows you a few things to watch out for when upgrading from pthreads v2 to v3. pthreads is a PHP extension that allows for better process handling directly from PHP than just the built in proc_* functions.

A fair amount has changed for the pthreads extension with the release of pthreads v3. This article aims to cover the necessary information for those who are looking to upgrade their applications from pthreads v2 to v3.

If you’re unfamiliar with pthreads, check out my introduction to pthreads instead!

He starts with some of the more generic changes in this latest version with the most major being that it can now only be used in the command-line environment. Other changes were made to workers, method modifiers and the removal of some classes and methods. He also mentions some of the methods that were changed and some new classes/methods that were added. Overall he’s of the opinion that, while some of the changes could make for headaches in the transition, v3 of the extension has "received a nice cleanup and is looking ever better."

Source: http://www.phpdeveloper.org/news/25052

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

TutsPlus.com: How to Program With Yii2: Running Cron Services

TutsPlus.com: How to Program With Yii2: Running Cron Services

TutsPlus.com has posted the latest tutorial in their "Programming with Yii2" series showing you how to work with cron services to periodically run scripts in your application.

In this Programming With Yii2 series, I’m guiding readers in use of the Yii2 Framework for PHP. In today’s tutorial, I’ll share with you how to take advantage of Yii’s console capacity to run cron jobs.

In the past, I’ve used wget in my cron jobs—a web accessible URL would run my background tasks. This raised security issues and has some performance problems. While I addressed some ways to mitigate risks in our startup series’ episodes on security, I had hoped to transition to console-driven commands. And with Yii2 it’s fairly straightforward.

He starts with a brief look at what a "cron" is for those that may not be familiar and how it works on linux-based systems. He then gets into the use of console "cron" commands using the Yii2 framework’s own functionality to create a "cron controller" that performs Twitter operations on "frequent", "quarter" and hourly measurements. He shows how to update the crontab file to call the commands instead of making the web requests. He ends this tutorial with an issue to consider regarding different namespaces when using the commands versus web requests.

Source: http://www.phpdeveloper.org/news/25051

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Delicious Brains Blog: PHP and cURL: How WordPress makes HTTP requests

Delicious Brains Blog: PHP and cURL: How WordPress makes HTTP requests

In a new post from the Delicious Brains site Peter Tasker looks at how WordPress makes HTTP requests with the help of the cURL functionality in PHP.

cURL is the workhorse of the modern internet. As its tagline says, cURL is a utility piece of software used to ‘transfer data with urls‘. According to the cURL website, the library is used by billions of people daily in everything from cars and television sets, to mobile phones. It’s the networking backbone of thousands of applications and services. Unsurprisingly, it’s also a core utility used by WordPress’ own Requests API as well as our own WP Migrate DB Pro.

If you’re curious about the power of the cURL library, how it works with WordPress and what to watch out for (especially on macOS), then you’re in the right place.

He starts by giving a bit of background on what cURL is and some examples of how its used to make requests. He then talks about the cURL integration with PHP via an extension and provides a simple code example fetching an endpoint from the httpbin.org site. With that background defined he moves into the main focus of the article – how cURL and PHP combine in the WordPress WP_Http class and Requests handling to make HTTP requests to remote (or local) resources. Code examples are included showing how to put these pieces to work in a custom script and includes some common issues you might see during your HTTP request development.

Source: http://www.phpdeveloper.org/news/25050

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Matt Stauffer: How to set up your Laravel application for zero-downtime (Envoyer/Capistrano) deploys

Matt Stauffer: How to set up your Laravel application for zero-downtime (Envoyer/Capistrano) deploys

Matt Stauffer has a post to his site today sharing a step-by-step guide to setting up your Laravel application for zero downtime deploys when using the Envoyer/Capistrano combination.

The reason you’re getting zero-downtime deploy from these tools is because the entire deploy process—clone, composer install, etc.—doesn’t happen in the directory that is currently serving your site. Instead, each new release gets its own separate “release” directory, all while your site is still being served from its current “release” directory.

All of these release directories are just subdirectories of releases. Each directory here represents one of your deploys, and each directory individually has everything needed to serve your site. [...] So, once the build process is complete for each new release, your deploy tool will delete the current symlink and create a new current symlink that points to your latest release. Boom. Now that release is live.

He then relates this back to the deployment of a Laravel application with Envoyer which already follows this "symlink deploy" method. There’s a few caveats he mentions with this deploy, however, including information that shouldn’t be removed in each deploy (like caches or configuration files). He then provides the steps (commands) you can follow with the deploy to manually use the "symlink deploy" method in your own scripting.

Source: http://www.phpdeveloper.org/news/25049

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Matt Stauffer: How to set up your Laravel application for zero-downtime (Envoyer/Capistrano) deploys

Matt Stauffer: How to set up your Laravel application for zero-downtime (Envoyer/Capistrano) deploys

Matt Stauffer has a post to his site today sharing a step-by-step guide to setting up your Laravel application for zero downtime deploys when using the Envoyer/Capistrano combination.

The reason you’re getting zero-downtime deploy from these tools is because the entire deploy process—clone, composer install, etc.—doesn’t happen in the directory that is currently serving your site. Instead, each new release gets its own separate “release” directory, all while your site is still being served from its current “release” directory.

All of these release directories are just subdirectories of releases. Each directory here represents one of your deploys, and each directory individually has everything needed to serve your site. [...] So, once the build process is complete for each new release, your deploy tool will delete the current symlink and create a new current symlink that points to your latest release. Boom. Now that release is live.

He then relates this back to the deployment of a Laravel application with Envoyer which already follows this "symlink deploy" method. There’s a few caveats he mentions with this deploy, however, including information that shouldn’t be removed in each deploy (like caches or configuration files). He then provides the steps (commands) you can follow with the deploy to manually use the "symlink deploy" method in your own scripting.

Source: http://www.phpdeveloper.org/news/25049

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Matt Stauffer: How to set up your Laravel application for zero-downtime (Envoyer/Capistrano) deploys

Matt Stauffer: How to set up your Laravel application for zero-downtime (Envoyer/Capistrano) deploys

Matt Stauffer has a post to his site today sharing a step-by-step guide to setting up your Laravel application for zero downtime deploys when using the Envoyer/Capistrano combination.

The reason you’re getting zero-downtime deploy from these tools is because the entire deploy process—clone, composer install, etc.—doesn’t happen in the directory that is currently serving your site. Instead, each new release gets its own separate “release” directory, all while your site is still being served from its current “release” directory.

All of these release directories are just subdirectories of releases. Each directory here represents one of your deploys, and each directory individually has everything needed to serve your site. [...] So, once the build process is complete for each new release, your deploy tool will delete the current symlink and create a new current symlink that points to your latest release. Boom. Now that release is live.

He then relates this back to the deployment of a Laravel application with Envoyer which already follows this "symlink deploy" method. There’s a few caveats he mentions with this deploy, however, including information that shouldn’t be removed in each deploy (like caches or configuration files). He then provides the steps (commands) you can follow with the deploy to manually use the "symlink deploy" method in your own scripting.

Source: http://www.phpdeveloper.org/news/25049

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>