Ilia AlshanetskyMadison PHP Conference - Application Security Nuts to Bolts (30.9.2016, 21:57 UTC)

My slides from the Madison PHP Conference on the topic of "Application Security Nuts to Bolts" are now available for download here:
madison-security-tutorial.pdf
Link
SitePoint PHPSourcehunt September – Hacktoberfest Edition (30.9.2016, 16:00 UTC)

It's that time of year again - DigitalOcean's Hacktoberfest is starting!

It's a month-long open source effort when people are encouraged to contribute to various open source projects (not their own!). Anyone who opens 4 pull requests (even documentation fixes count!) gets a T-shirt at the end of the month, symbolizing their engagement in the open source community.

Of course, open source is much more than just a single month, but for people who don't generally take the time to contribute to other developers' projects, it's more than a good start.

If you'd like to participate, why not pick some of the projects from the list we've compiled this month? And if these don't tickle your fancy, why not visit the sourcehunt PHP tag and see if you can find something more interesting?

Let's dive in!

Sourcehunt logo


kodus/mail [3 ★]

Just as we published our Fighting Recruiter Spam with PHP post, using Swiftmailer to send replies, Kodus got submitted to Sourcehunt.

Kodus is a brand new alpha-level package designed to make sending UTF-8 email even simpler, while at the same time skipping all the legacy baggage Swiftmailer drags along with it (old school autoloading, naming conventions, etc.). As the author says, the aim is to "start over with modern PHP and a limited scope in terms of features, for the sake of simplicity."

Here's your chance to get in on the ground floor of a very promising project!


Continue reading %Sourcehunt September – Hacktoberfest Edition%

Link
Voices of the ElePHPantInterview with Jeremy Mikola (30.9.2016, 10:00 UTC)
Jeremy Mikola
@jmikola

Show Notes

More from this guest

See Jeremy’s talk, Async PHP with React, on Nomad PHP

The post Interview with Jeremy Mikola appeared first on Voices of the ElePHPant.

Link
PHP ClassesLately in PHP in Livecoding.tv - Lately in PHP podcast episode 75 (30.9.2016, 06:33 UTC)
By Manuel Lemos
Livecoding.tv is a live streaming site that allows developers to stream themselves working on code of their projects. The episode 75 of the Lately in PHP podcast 75 is the first episode to be streamed using livecoding.tv presented by Manuel Lemos and Arturs Sosins as always.

In this episode thei also talked about the PHP proposals for immutable objects, searching for text on the beginning and end of strings, disallowing null object parameters in the get_class call, removing UTF-8 to ISO Latin 1 conversion functions and deprecate bundling PEAR/PECL and replace with composer/pickle.

Listen to the podcast, or watch the hangout video to learn more about these interesting PHP topics.
Link
SitePoint PHPFighting Recruiter Spam with PHP – Proof of Concept (29.9.2016, 17:00 UTC)

Ever since I moved off of Google services (due to quality, not privacy concerns), I'd been looking for the perfect email service. Having tried several, and having been with FastMail for a while now, I came to the realization that there's no such thing. The biggest concern I have with modern email providers, is the fact that they are all quite bad at spam control.

I don't mean the "Nigerian prince" type of spam, which is mostly blocked successfully (unless you're using FastMail - they can't even recognize those) but stuff that I'm really, really not interested in getting. Case in point, recruiter spam.

Illustration of blocked email

In this tutorial, we'll get started with building a custom email processor which can read individual emails, run them through some predefined rules, and act on them. The end result will be very similar to what many providers offer out of the box, but it'll lay the groundwork for more advanced aspects in future posts. Example uses of our app:

  • when recruiter-type keywords are detected, reply to the email with a template response and delete it. This is possible to some extent with rules that most email providers offer, but those aren't very detailed, and usually don't support variables.
  • when companies keep sending you emails even after you unsubscribe or report them for spam (e.g. Ello), the engine should remember these and in the future purge them automatically. Some providers (e.g. FastMail), won't stop a sender from getting into your inbox even after hundreds of spam reports.

This way, we can keep the provider we're used to, but also do some manual improvements their team just didn't know how to do.

In this post, we'll focus on the first use case.

Continue reading %Fighting Recruiter Spam with PHP – Proof of Concept%

Link
PHP: Hypertext PreprocessorPHP 7.1.0 Release Candidate 3 Released (29.9.2016, 00:00 UTC)
The PHP development team announces the immediate availability of PHP 7.1.0 Release Candidate 3. This release is the third release candidate for 7.1.0. All users of PHP are encouraged to test this version carefully, and report any bugs and incompatibilities in the bug tracking system. THIS IS A DEVELOPMENT PREVIEW - DO NOT USE IT IN PRODUCTION! For more information on the new features and other changes, you can read the NEWS file, or the UPGRADING file for a complete list of upgrading notes. These files can also be found in the release archive. For source downloads of PHP 7.1.0 Release Candidate 3 please visit the download page, Windows sources and binaries can be found on windows.php.net/qa/. The fourth release candidate will be released on the 13th of October. You can also read the full list of planned releases on our wiki. Thank you for helping us make PHP better.
Link
SitePoint PHP9 Hot Tips to Enhance Your Spark Experience (28.9.2016, 16:00 UTC)

A while ago, I wrote about a product I wanted to build, to allow easy remote backups for Pagekit sites. I've been working on it (periodically) since then, and have come across a few interesting bits of advice.

I decided to use Laravel Spark as the foundation for the product, and I thought it would be helpful to share the advice. Whether you're just starting your Spark app, or are in maintenance mode, I think you'll find some of these tips useful!

Laravel Spark Website Splash Screen

1. You don't have to keep all the base files

You may be worried about removing too many of the base files from the standard Spark installation. When I first started, I thought it vital not to change the auth controllers (in app/Http/Controllers/Auth), for fear that it'd break the registration and login system.

Turns out, these files aren't used by Spark. In fact, if you add routes to them, and you try to register/log in, you'll probably just encounter problems. These default auth controllers share the same auth guard (session driver), so logging in through one will make you authenticated through the other.

If, however, you try to register through the non-Spark controllers, your user and team accounts will be missing vital Spark information. It's cleaner and simpler to just delete these auxiliary auth controllers.

If you're unsure, make a full backup. Then you can roll back in case your tests pick up any regressions.

2. Use simple repositories

Spark includes a few simple repositories. These are like static config lists (for countries and other mostly-static data), but they can be loaded through the IoC container. They look like this:

namespace Laravel\Spark\Repositories\Geography;

use Laravel\Spark\Contracts\Repositories\↩
    Geography\CountryRepository as Contract;

class CountryRepository implements Contract
{
    /**
     * {@inheritdoc}
     */
    public function all()
    {
        return [
            'AF' => 'Afghanistan',
            'AX' => 'Åland Islands',
            'AL' => 'Albania',
            // ...snip
            'YE' => 'Yemen',
            'ZM' => 'Zambia',
            'ZW' => 'Zimbabwe',
        ];
    }
}

This is from vendor/bin/laravel/spark/src/Repositories/Geography/CountryRepository.php

We can see instances of this being used in some of the registration views:



This is from resources/views/vendor/spark/auth/register-address.blade.php

I highly recommend you use these repositories for country and state data. I also recommend you use this repository style for your own lists:

namespace App\Repositories;

use DateTimeZone;

class TimezoneRepository
{
    /**
     * @return array
     */
    public function get()
    {
        $identifiers = DateTimeZone::listIdentifiers(DateTimeZone::ALL);

        return array_combine(
            $identifiers,
            array_map(function ($identifier) {
                return str_replace("_", " ", $identifier);
            }, $identifiers)
        );
    }
}

You don't have to make an interface for each repository. In fact, I think that's a bit of an overkill. But I think these tiny repositories are much cleaner and easier to use than the alternatives.

In addition, you can alias these in an application service provider:

Continue reading %9 Hot Tips to Enhance Your Spark Experience%

Link
Nomad PHPRFCs of the Future: Tick Talk (28.9.2016, 14:42 UTC)

Speaker: Cal Evans @calevans Signal handling in PHP is one of those things that not a lot of people understand, so they don’t bother with. However, if you are writing command line scripts, signal handing is your friend. In PHP 7.1, it gets even easier thanks to changes made in the engine. This short video …

The post RFCs of the Future: Tick Talk appeared first on Nomad PHP.

Link
Nomad PHPBuilding for the PHP Command LineInterface (28.9.2016, 13:46 UTC)

December 2016 - EU
Presented By

Steve Grunwell
December 15, 2016
20:00 CET

The post Building for the PHP Command Line
Interface
appeared first on Nomad PHP.

Link
PHP ClassesHow to Calculate VAT in PHP for any EU Country (28.9.2016, 06:36 UTC)
By Dave Smith
As you may know, VAT is a tax used in European Union countries. It is added to the price of products and services, but the actual percentage of the tax varies from country to country, as well from product to product or service to service.

If you or your clients need to add value-added taxes (VAT) within the European Union or validate VAT numbers, then there is a service available to get the latest rates for each country including rates within reduced rate categories.

You can also use the service to calculate VAT compliant prices for you, or reverse the calculation to get an amount without VAT if it has already been included.

Read this article to learn more about how you can use this service to help determine the VAT taxes to use on different purchases using PHP applications.
Link
LinksRSS 0.92   RDF 1.
Atom Feed   100% Popoon
PHP5 powered   PEAR
ButtonsPlanet PHP   Planet PHP
Planet PHP