Nomad PHPMarch 2015 – US (19.12.2014, 00:01 UTC)

Virtualization for Developers

Presented By
John Coggeshall
March 19, 2015 20:00 CDT

The post March 2015 – US appeared first on Nomad PHP.

Link
Nomad PHPMarch 2015 – EU (19.12.2014, 00:01 UTC)

Composer the Right Way

Presented By
Rafael Dohms
March 19, 2015 20:00 CET

The post March 2015 – EU appeared first on Nomad PHP.

Link
Evert PotTesting your composer dependencies with prefer-lowest (18.12.2014, 22:54 UTC)

A few days ago, a new feature landed in composer, the --prefer-lowest argument.

Normally, for any dependency, composer will attempt to always install the latest possible version.

For instance, if your composer.json looks like this:

"require" : {
    "vendor/package" : "~1.2.1"
}

Then you are telling composer effectively that it should install any version after 1.2.1, but before 1.3.

If version 1.2.5 is the latest, composer will always grab that version.

With the new --prefer-lowest setting, you can tell composer to install the oldest possible version of a package that still matches your requirement.

So if we run:

composer update --prefer-lowest

We should get version 1.2.1 for vendor/package and all its dependencies.

Why is this useful?

In some projects, there may be packages lying around that are not the latest version. This could be because it introduced some BC break, or introduced a bug.

If other packages also use the package that's being held back, they may get an older version as a dependency.

So for package maintainers, they will want to find out if their package correctly works with the oldest package they claim to support.

So for us to test this, we can simply run:

composer update --prefer-lowest
./bin/phpunit

If our unittests break with older dependencies, we know that we either need to increase the oldest supported version, or implement a workaround so it still works.

Automating this with Travis

If you are using Travis for automated testing, you can also tell travis to test with the oldest possible dependencies.

Travis allows you to add new lines to the build matrix with the env: setting, which makes this super easy to do.

If for instance your .travis.yml looks a bit like this:

language: php

php:
  - 5.4
  - 5.5
  - 5.6
  - hhmv

before_script:
  - composer update --prefer-source

script:
  - ./bin/phpunit

You can modify it to this, to allow Travis to do 1 build for the latest, and one build for the oldest possible depdendencies:

language: php

php:
  - 5.4
  - 5.5
  - 5.6
  - hhmv

env:
  matrix:
    - PREFER_LOWEST="--prefer-lowest"
    - PREFER_LOWEST=""

before_script:
  - composer update --prefer-source $PREFER_LOWEST 

script:
  - ./bin/phpunit

This would result in a total of 8 builds.

Depend on a wide ra

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

Link
Anthony FerraraStack Machines: Compilers (18.12.2014, 20:31 UTC)
I have the honor today of writing a guest blog post on Igor Wiedler's Blog about Compilers. If you don't know @igorwhiletrue, he's pretty much the craziest developer that I know. And crazy in that genious sort of way. He's been doing a series of blog posts about Stack Machines and building complex runtimes from simple components. Well, today I authored a guest post on compiling code to run on said runtime. The compiler only took about 100 lines of code!!!

Check it out!

Link
SitePoint PHPEfficient Chinese Search with Elasticsearch (18.12.2014, 17:00 UTC)

If you have played with Elasticsearch, you already know that analyzing and tokenization are the most important steps while indexing content, and without them your pertinency is going to be bad, your users unhappy and your results poorly sorted.

Even with English content you can lose pertinence with a bad stemming, miss some documents when not performing proper elision and so on. And that’s worse if you are indexing another language; the default analyzers are not all-purpose.

When dealing with Chinese documents, everything is even more complex, even by considering only Mandarin which is the official language in China and the most spoken worldwide. Let’s dig into Chinese content tokenization and expose the best ways of doing it with Elasticsearch.

Chinese characters are logograms, they represents a word or a morpheme (the smallest meaningful unit of language). Put together, their meaning can change and represent a whole new word. Another difficulty is that there is no space between words or sentences, making it very hard for a computer to know where a word starts or ends.

There are tens of thousands of Chinese characters, even if in practice, written Chinese requires a knowledge of between three and four thousand. Let’s see an example: the word “volcano” (火山) is in fact the combination of:

  • 火: fire
  • 山: mountainsky

Our tokenizer must be clever enough to avoid separating those two logograms, because the meaning is changed when they are not together.

Continue reading %Efficient Chinese Search with Elasticsearch%

Link
PHP: Hypertext PreprocessorPHP 5.4.36 Released (18.12.2014, 00:00 UTC)
The PHP development team announces the immediate availability of PHP 5.4.36. Two security-related bugs were fixed in this release, including the fix for CVE-2014-8142. All PHP 5.4 users are encouraged to upgrade to this version. For source downloads of PHP 5.4.36 please visit our downloads page, Windows binaries can be found on windows.php.net/download/. The list of changes is recorded in the ChangeLog.
Link
PHP: Hypertext PreprocessorPHP 5.6.4 is available (18.12.2014, 00:00 UTC)
The PHP development team announces the immediate availability of PHP 5.6.4. This release fixes several bugs and one CVE related to unserialization. All PHP 5.6 users are encouraged to upgrade to this version. For source downloads of PHP 5.6.4 please visit our downloads page, Windows binaries can be found on windows.php.net/download/. The list of changes is recorded in the ChangeLog.
Link
PHP: Hypertext PreprocessorPHP 5.5.20 is available (18.12.2014, 00:00 UTC)
The PHP development team announces the immediate availability of PHP 5.5.20. This release fixes several bugs and one CVE related to unserialization. All PHP 5.5 users are encouraged to upgrade to this version. For source downloads of PHP 5.5.20 please visit our downloads page, Windows binaries can be found on windows.php.net/download/. The list of changes is recorded in the ChangeLog.
Link
SitePoint PHPGetting Started with Medoo – Examples of Use (17.12.2014, 17:00 UTC)

In this article I’m going to walk you through Medoo, a lightweight database abstraction library for PHP. Its main features include:

  • Support for multiple databases - it supports MySQL, MariaDB, Sybase, MS SQL, PostgreSQL, and Oracle.
  • Secure - prevents SQL injection, it uses PDO.
  • Easy to use - its API is very intuitive.

While Medoo is nothing revolutionary, and the fact that it sports a very small filesize matters little to few, it’s still an interesting project that went from being outright dismissed to vaguely accepted, as evident in these threads. It’s on its way up, and that’s our reason for taking a look at it.

Installation

Even though the website recommends installing it by downloading a file and including it in your project, you should use Composer to do so.

Continue reading %Getting Started with Medoo – Examples of Use%

Link
PHP ClassesPHP and JavaScript Innovation Award Report December 2014 Edition - September 2014 nominees (17.12.2014, 05:13 UTC)
By Manuel Lemos
This is the December edition of the Innovation Award podcast hangout recorded by Manuel Lemos and Arturs Sosins to comment about the outstanding features of all the past month nominees and winners PHP and JavaScript packages, the prizes that the authors earned, starting with the nominees from the month of September 2014.

Listen to the podcast, or watch the hangout video, or read the transcript to learn why the nominated packages were considered to be innovative.
Link
LinksRSS 0.92   RDF 1.
Atom Feed   100% Popoon
PHP5 powered   PEAR
ButtonsPlanet PHP   Planet PHP
Planet PHP