PHP Directory

Blogs

  • PHP Articles Report February 2017 Edition

    By Manuel Lemos
    This is the February 2017 edition of the podcast hangout recorded by Manuel Lemos and Arturs Sosins to comment on the latest outstanding PHP articles published recently.

    In this edition they discuss articles about the fastest method to evaluate the performance of a PHP Web application hire a server that can handle its needs in terms of CPU, RAM and disk, sending postal mail and cheques using an API, gamify a site the site link secret path, parsing and converting text with an amount in English to the respective number, and a simple tutorial on how to use MySQL with PDO in PHP 7.

    Listen to the podcast, or watch the hangout video to learn more about these PHP articles.
  • The Best WordPress Security Plugins and Support Services of 2017 and 2016 Comparison of Free and Commercial Versions

    By Haseeb Ahmad Basil
    WordPress is the most popular Web publishing platform. Since it is used by many Web site owners, it is also a target of many security exploits.

    Many WordPress site owners do not know enough about security to protect their sites from being abused. Therefore they need to use plugins and tools to help them prevent and eventually fix security issues.

    Read this this article to compare the features of the most recommended WordPress security plugins so you can pick one that addresses your needs.
  • 7 PHP UK 2017’s talks you must see

    phpukPhpUK is a conference I have wanted to attend for a long long time. I had watched all the videos on youtube really carefully for the last few years and always got this weird feeling this might be one of the best and most important conferences in Europe. So, here I am. 3 totally different […]
  • Sourcehunt: Idea of the Month and 6 Interesting Repos!

    It's time for our monthly hunt for new open source libraries to use and contribute to!

    If you're new to Sourcehunt, it's our monthly post for promoting open source projects that seem interesting or promising and could use help in terms of Github stars or pull requests.

    It's our way of giving back - promoting projects that we use (or could use) so that they gain enough exposure to attract a wider audience, a powerful community and, possibly, new contributors or sponsors.

    Sourcehunt logo


    genkgo/archive-stream [5 ★]

    We stumbled upon this package following this very interesting read about streamed file zipping and downloading in PHP.

    This package provides a memory efficient API for streaming ZIP files as PSR 7 messages. It comes with certain limitations, namely that only the Zip64 (version 4.5 of the Zip specification) format is supported, and files cannot be resumed if a download fails before finishing, but apart from that, using it is incredibly straightforward if you're already wading through the PSR-7 waters:

    $archive = (new Archive())
        ->withContent(new CallbackStringContent('callback.txt', function () {
            return 'data';
        }))
        ->withContent(new StringContent('string.txt', 'data'))
        ->withContent(new FileContent('file.txt', 'local/file/name.txt'))
        ->withContent(new EmptyDirectory('directory'));
    
    $response = $response->withBody(
        new Psr7Stream(new ZipReader($archive))
    );
    

    The library, while having many contributors who have done a professional job of fool-proofing it, and being over 8 months old, lacks exposure. Oddly enough, there are no issues (the issues feature itself is disabled) and no PRs to review, but the authors could always use more testers, tech writers to present the lib in blogs, and maintainers.

    How do you usually send ZIPs, if at all? Why not give this a go?

    Continue reading %Sourcehunt: Idea of the Month and 6 Interesting Repos!%

  • Setting up local step debugging with Zend Studio

    Setting up debugging in an IDE with a local PHP development environment has gotten so easy it can be done in a couple automated steps. In this post I will demonstrate how to get step debugging functioning with Zend Studio and Zend Debugger when the server is set up on a local environment. To begin with, I … Continue reading Setting up local step debugging with Zend Studio
  • WikiMedia, Clean Architecture, and ADR

    tl;dr: Action-Domain-Responder is a natural fit for the HTTP user-interface portions of Clean Architecture (or Hexagonal), especially with Domain Driven Design. Just be sure to remember to separate the HTTP response presentation from the action code. I. Jeroen de Dauw has a fantastic post on Implementing the Clean Architecture in PHP, with Domain Driven Design […]
  • Interview with Chris Hartjes

    The post Interview with Chris Hartjes appeared first on Voices of the ElePHPant.

  • Duck-typing in PHP

  • Extended Definition Of Done

    When software projects grow it is considered helpful if the software follows an established structure so that every developer finds their way easily. If the used structures and patterns change per developer or even every couple of months or years it will get really hard to maintain the software. Let's discuss the reason for this and possible fixes.
  • Simple PHP queue worker

    During development, restarting the queue worker is tedious. Better separate worker and functionality by calling external scripts.

    My search engine's crawler puts URLs that should be crawled into a Gearman task queue. A worker script runs in the background and listens for new URLs in the queue, starting the crawler whenever one is coming.

    The classic worker process has two jobs: Listen at the queue and running the tasks.

    During development crawler and indexer code always changes. A classic worker needs to be restarted whenever the code changes, which is tedious and annoying.

    For phinde I separated queue listener and task processing:

    • The worker listens to the Gearman queue. Whenever a task is available, it starts an external script that does task processing instead of doing it itself.
    • The task processor is a command line script that does crawling and indexing.

    Separating those two gave me a couple of benefits:

    1. The worker neither has to be restarted during development nor after deployment because it almost never changes.
    2. Task processing can crash hard without taking the whole queue processing down.
    3. Tasks can be started from command line, which makes development very enjoyable.

    You have to decide if the payload that is passed to the workers is small enough to be transmitted as command line parameters.

    Another issue is the overhead of starting new processes and their setup (database connection etc.), which might be too much if you have tiny but numerous tasks.

:: Our Favorites

Featured Sites Using PHP

>Atlanta Real Estate