thePHP.ccQuestioning PHPUnit Best Practices (4.2.2016, 22:36 UTC)
Link
SitePoint PHPQuick Tip: How to Permanently Change SQL Mode in MySQL (4.2.2016, 17:00 UTC)

I was working on a legacy project recently and needed to import some data from MySQL 5.5. All the queries in the code worked perfectly in MySQL 5.5, so I assumed an upgrade to 5.7 would be seamless. Not so.

MySQL logo

First I got errors due to DateTime columns being populated with zeros during import, then when running this query:

select * from ebay_order_items where z_shipmentno is null and ExternalTransactionID is not null and orderstatus = 'Completed' and timestamp > '2015-02-25' group by ExternalTransactionID order by timestamp desc

I got this:

Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column '1066export.ebay_order_items.TransactionID' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

Continue reading %Quick Tip: How to Permanently Change SQL Mode in MySQL%

Link
PHP Scripts – Web Development BlogParse html with preg_match and preg_match_all (4.2.2016, 06:40 UTC)
For the most of the web developer which are using the function preg_match, is the function preg_match_all a smaller advantage, but for all others it’s maybe hard to understand. The biggest difference between preg_match_all and the regular preg_match is that all matched values are stored inside a multi-dimensional array to store an unlimited number of matches. […]
Link
PHP: Hypertext PreprocessorPHP 5.5.32 is available (4.2.2016, 00:00 UTC)
The PHP development team announces the immediate availability of PHP 5.5.32. This is a security release. Several security bugs were fixed in this release. All PHP 5.5 users are encouraged to upgrade to this version. For source downloads of PHP 5.5.32 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.18 is available (4.2.2016, 00:00 UTC)
The PHP development team announces the immediate availability of PHP 5.6.18. This is a security release. Several security bugs were fixed in this release. All PHP 5.6 users are encouraged to upgrade to this version. For source downloads of PHP 5.6.18 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 PHP9 Development Workflow Upgrades You Should Know About (3.2.2016, 17:00 UTC)

Every once in a while I run into a tool or plugin so useful I can’t not add it to my arsenal. I usually shout out tweets and try to spread the word that way, but this time I believe I’ve got such a neat (and somewhat random) collection of productivity boosting entries, they deserve a collective article.

Tips and Tricks intro image

Here are 9 new upgrades to your development workflow:

1. git-fresh

git-freshkeeps your repo fresh”. It offers a super handy set of shortcuts for some very useful git commands and combinations - it’ll prune remote branches, rebase, do merges or resets of your workspace, even stash changes effectively so you can easily push or switch branches without committing the latest changes.

It only supports Linux and OS X but since we’re big on Homestead Improved anyway, it’s all Linux for us. In fact, we’re thinking about adding this to the default Homestead Improved installation, so it’s available out of the box. Thoughts?

2. git-extras

git-extras, owned by the mythical TJ Holowaychuk, similarly extends Git’s functionality with incredibly useful additional commands. It’s a pretty old addon, but I’ve only just discovered it and I’m sure there are more of you who might find it rather handy. Examples of new commands include:

  • git setup: initializes a repo and does the first commit of present files for you. A more “bootstrappy” start of a repo, in essence.
  • git ignore: a command line “ignore” so you can add files to .gitignore without leaving the terminal or entering a text editor
  • git summary: provides a neat summary of the repo, including its age, its most active contributors, and more
  • git undo: this one is a real lifesaver - it undoes the last commit, but still keeps the changes as uncommitted so you can safely call git reset --hard to discard them once you inspect the condition of the repo with git status
  • git changelog: automatically creates and populates a changelog file with a MarkDown list of all the commit messages since the last tag was created in the repo.
  • git release x.y.z: a shortcut for creating a release. This invokes a pre-release hook (for builds/tests), creates a release tag of the given version, pushes the tags and the repo to the remote, and everything else you might do on release day
  • git fork: command line forking!
  • git squash: easier squashing of commits!

See full list here.

Continue reading %9 Development Workflow Upgrades You Should Know About%

Link
PHP ClassesGetting User Input through SMS Text Messaging (3.2.2016, 08:33 UTC)
By Dave Smith
Setting up your Web site to interact with users through SMS text messages can be exciting. Users send their requests via SMS, your web site sends back responses, pretty cool right? Still, it is not really two-way communication until we can make requests to our users and get their responses.

Read this article to learn how to request users to input information via SMS messages, so your site can retrieve and process the information entered by the users.
Link
Voices of the ElePHPantInterview with Christopher Pitt (2.2.2016, 05:00 UTC) Link
Thijs FerynMichael Heap – Talking about PHPBenelux, Datasift, miles & points (1.2.2016, 22:51 UTC)

Michael Heap is a developer who works at Datasift. On Thursday January 28th 2016 Michael flew from London Heathrow to

The post Michael Heap – Talking about PHPBenelux, Datasift, miles & points appeared first on Thijs Feryn's blog.

Link
SitePoint PHPBuilding OctoberCMS Form Field Widgets like a Pro (1.2.2016, 17:00 UTC)

OctoberCMS logo

Creating your business website with any CMS requires you to make the back-end user friendly, and that means making the forms meaningful and accessible. In this article, we’re going to explore OctoberCMS form widgets and create a widget called UniqueValue, which helps the user enter a unique value. This could be useful for entering emails, usernames, post slugs, etc. Let’s get started.

Available Form Widgets

OctoberCMS provides a list of simple field types like email input, password, dropdown options, etc. The documentation has a list of all available fields. Moreover, the CMS provides some custom widgets like the media manager widget which lets you select an item from your media library or the WYSIWYG editor, Markdown editor, etc.

An interesting widget we should mention here is the repeater widget. Let’s say you have a recipes website. The cook will enter the recipe name and start filling in the ingredients. You might ask the user “how many ingredients do you need?” and based on that, you can generate the form fields. Another clean way to do it is to have a button at the bottom of the form that says Add new ingredient, which will generate the necessary fields for the cook when needed.

Here is an example configuration for the recipe form:

// models/recipe/fields.yaml

fields:
    name:
        label: Name
        type: text
        required: true
    ingredients:
        label: Ingredients
        type: repeater
        prompt: Add new ingredient
        form:
            fields:
                ingredient:
                    label: Ingredient
                    type: text
                how_much:
                    label: How much
                    type: number
                unit:
                    label: Unit
                    type: dropdown
                    options:
                        spoon: Spoon
                        ounce: Ounce
                        # etc

ingredients

Continue reading %Building OctoberCMS Form Field Widgets like a Pro%

Link
LinksRSS 0.92   RDF 1.
Atom Feed   100% Popoon
PHP5 powered   PEAR
ButtonsPlanet PHP   Planet PHP
Planet PHP