PHP Directory

Blogs

  • PHP file_get_contents() HTTPS/SSL error on Mac OS

    Problem on Mac OS Sierra (10.12.x): Using file_get_contents() for an https resource fails with error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed.

    This solution appears to be legit, although I am not primarily a security guy, so real security folks should chime in if they seem something untoward:

    % sudo mkdir -p /usr/local/libressl/etc/ssl/certs
    % sudo curl -o /usr/local/libressl/etc/ssl/cert.pem https://curl.haxx.se/ca/cacert.pem

    This creates the default_cert_file directories and imports the latest certificate store from curl.haxx.se.

    Source: PHP on macOS Sierra can’t access SSL data – andrewyager.com

  • PHP Performance Evolution 2016 from PHP 5, PHP 7.0, PHP 7.1 and PHP 8/Next

    By Christian Vigh
    Since its creation in 1994 by Rasmus Lerdorf, the PHP language has gone through many improvements. Performance is one of the main criteria developers consider when they evaluate upgrading to a newer version.

    Read this article to learn how performance improved across the latest PHP versions starting from PHP 5 up to the latest developments, including the recent version 7.1, as well as the experimental JIT branch that will be become part of PHP 8 or the next version.
  • Independent Packages and Subtree Splits

    You’ll sometimes see a PHP package hosted in a Github repository with the heading or subtitle “[READ ONLY] Subtree Split”. This indicates that the package is actually copied from another codebase (usually a framework) and is not intended to be worked on separately from that other codebase.

    As such, a “subtree split” is not necessarily a sign of an independent package. Using a subtree split to publish a package says to me that the authors’ concentration is on the framework-as-a-whole, not on the package in-and-of- itself.

    For example, Symfony does subtree splits for its components, as does Laravel for its Illuminate components. Those packages from the frameworks are not developed independently; they only move forward as part of the whole framework.

    In these cases, you often end up with composer.json in the framework origin directories, which is not something I generally expect. Further, the framework subdirectories may have their own src/tests/docs/etc. directories. They are there so that the subtree split can have them available at their own top level, but in the origin framework, it is again something I find unexpected.

    I say: if you’re going to advertise independent packages, actually write them independently. Let them be their own thing. Aura has done it that way since its beginning, and Zend Framework converted to that approach in version 3. Then you can compose the truly independent packages into a framework, instead of subtree-splitting your framework into pseudo-independent packages that are still bound to the origin framework development and release process.

  • The Delicious Evils of PHP

  • Building Websites with concrete5 Express

    Express offers a data-first approach to concrete5 website development.
  • Building PHP Projects on AWS CodeBuild

  • Using GDELT 2 with PHP to Analyze the World!

    Are you interested in political world events? Do you want to play with one of the world's largest databases? If you answered either of those questions with a yes, keep reading - this will interest you!

    This article follows up on the promise to use GDELT with PHP.

    I will show you a simple example of how to use GDELT through BigQuery with PHP, and how to visualize the results on a web page. Along the way, I will tell you some more about GDELT.

    Vector illustration of abstract world map

    GDELT

    GDelt (the "Global Database of Events, Language and Tone") is the biggest Open Data database of political events in the world. It was developed by Kalev Leetaru (personal website), based on the work of Philip A. Schrodt and others in 2011. The data is available for download via zip files and, since 2014, is query-able via Google's BigQuery web interface and through its API, and with the GDELT Analysis Service.
    The GDELT Project:

    monitors the world's broadcast, print, and web news from nearly every corner of every country in over 100 languages and identifies the people, locations, organizations, counts, themes, sources, emotions, quotes, images and events driving our global society every second of every day, creating a free open platform for computing on the entire world.

    In order to experiment with the GDELT dataset online, you need to have a Google account. Go to the BigQuery dashboard.

    If you don't have a Google Cloud project yet, you will be prompted to create one. This is required. This project will be your working environment, so you may as well choose a proper name for it.

    You can create your own queries via "Compose query". This one, for example:

    SELECT EventCode, Actor1Name, Actor2Name, SOURCEURL, SqlDate
    FROM [gdelt-bq:gdeltv2.events]
    WHERE Year = 2016
    LIMIT 20
    

    Continue reading %Using GDELT 2 with PHP to Analyze the World!%

  • 24PullRequests 2016

    Last year I already wrote about different initiatives in the period leading up to Christmas. In one of my talks this year, Level Up Your Team I've been discussing many ways of learning, and for this year I want to highlight one of the initiatives that I participated in last year, and again am trying again this year: 24 Pull Requests.

    What is it?

    The idea is that you send (at least) one pull request to an open source project in the days leading up to Christmas, starting on December 1st. The website will keep track of your progress and give you a list of suggested projects.

    Why would you do it?

    The most obvious reason is to contribute something to open source. If you, like me, earn most of your income by using open source code in your projects, this is most certainly a good reason to contribute to open source. But there's more...

    When do you learn most? I learn most when I am challenged, when I am pushed out of my comfort zone. This is one of the reasons we get so much positive feedback for WeCamp, because we push people out of their comfort zone in every possible way. That same thing applies with 24 Pull Requests: You are forced to send a pull request to an open source project 24 days in a row. While they can be 24 PRs to the same project, it works better to have a look at the suggested projects and try to contribute to multiple projects, preferably ones that you don't know (that well).

    Is it easy?

    No. Not every project has a low hanging fruit or easy pick tag, and even if they have them, it may not be easy for someone new to the project/codebase. Also: Actually writing a PR every single day for 24 days is not easy. At least if your calendar is as busy as mine, it's not easy.

    Actually last year, I completely failed. I can't find the actual stats anymore on the 24PullRequests website, but I think I sent maybe 5 or 6 pull requests. Time was mostly the reason for this failure, but I tried. And even though I didn't succeed in sending 24 pull requests, I did push myself to contribute to open source, and I did learn about some projects. For instance, I had not looked at Disco until last year. And this year, I've already contributed a simple typo to RMT, which I did not know until yesterday, and I've contributed a bugfix to Bolt, a CMS that I've been using a lot in the past year.

    Join in!

    So go ahead, start contributing!

  • PHP version 7.1.0 is released!

  • PHP 7.1.0 Released

    The PHP development team announces the immediate availability of PHP 7.1.0. This release is the first point release in the 7.x series.PHP 7.1.0 comes with numerous improvements and new features such asNullable typesVoid return typeIterable pseudo-typeClass constant visiblity modifiersSquare bracket syntax for list() and the ability to specify keys in list()Catching multiple exceptions typesMany more features and changes…For source downloads of PHP 7.1.0 please visit our downloads page, Windows binaries can be found on the PHP for Windows site. The list of changes is recorded in the ChangeLog.The migration guide is available in the PHP Manual. Please consult it for the detailed list of new features and backward incompatible changes.Many thanks to all the contributors and supporters!

:: Our Favorites

Featured Sites Using PHP

>Atlanta Real Estate