Skip to content

7 Days of PHP 7 – The Complete Collection

Dear Reader,

PHP 7 was originally supposed to be released today, November 12th, 2015. The Core developers weren’t comfortable releasing it just yet so they pushed the date back to November 26th, 2015. That’s fine, we all appreciate their diligence.

Still, I had already started my “7 Days of PHP 7” countdown when they made the announcement. Because the actual release date isn’t important to spreading the word about PHP 7, I decided to continue on with the countdown.

So here it is, the complete “7 Days of PHP 7”. Since we’ve still got a little time, use it wisely. Review all of the articles and media I’ve shared with you. Then use what you’ve learned to get your application ready for PHP 7.

 

Until next time,
I <3 |<
=C=

The EICC Report for PHP User Group Leaders

Dear Reader,

Hi all!

Ok, I’ve got new news, old news, and freebies.

[I originally tried to post this to the UG Amins list but because of the restrictions put on any list hosted at php.net, I could not. I tried 4 times, the last time with nothing that looked like a domain name. So instead of fighting with it anymore, I’m just posting it here. We REALLY need to move the UG Admins list off of that domain.]

 

Nomad PHP (https://nomadphp.com ) FREEBIE
As a PUG leader, you are always welcome to attend any Nomad PHP meeting for free. Go to the website, scroll to the bottom, there is a link just for you. :) Just pick the meeting you want to attend, and submit the form. Want to attend more than one, submit more than once. Want to attend them all, submit once for each time. We won’t turn you down. it is our small way of saying thank you for the hard work you put into Nomad PHP.
Day Camp 4 Developers (http://daycamp4developers.com ) STRINGS ATTACHED
The next DC4D is now public and we need your help getting the word out. If you would please send an email to your list letting them know that tickets are now available for “Day Camp 4 Developers:Public Speaking for Developers II” we would appreciate it. Once you have sent the email to your list, forward me a copy of the email and I’ll send you a coupon for a free ticket to the event. You can use it yourself or raffle it off to your group.
Raffle Items FREEBIE
Do you need things to raffle off to your user group? Let me know. I will give you coupons to any of my e-books (http://leanpub.com/u/calevans) if it will help. Also, I’m happy to give you a ticket or two to Nomad PHP to give away as well.
The CFP Report (https://thecfpreport.com) I NEED HELP
Ok, this request is in two parts.

PUG leaders
Would you please include a notice about The CFP Report in your next newsletter? (thecfpreport [dot] com ) Let your members who are interested in speaking know about it. There is no charge for The CFP Report and I don’t ever intend for there to be one. it is just my way of helping to increase the speaker pool.

Conf Organisers
If you run a conference, I would appreciate it if you would include a short paragraph in your rejection letters. Nobody likes to get rejection letters but if you offer people a ray of hope, they dislike it a bit less. This is something I’ve tried to do for the past 10 years. So if you could include something like this sample paragraph in your rejection letters, you could help them and me. (win-win-win) :)

Sample Paragraph
There are several things you can do to increase the odds of you being selected as a speaker, one of them is to keep applying and not get discouraged. To help you do this, our friend Cal Evans has setup a free service called “The CFP Report” (https://thecfpreport.com). Each week you will get an email with all the CFPs that are open, along with important information about the conference to help you decide if you should apply or not. We encourage you to subscribe to The CFP Report, find other CFPs to submit to, and next year when you see ours pop up, submit again. Remember, this email isn’t a “NO”, it’s a “not now”.

 

 

Ok, that’s all I’ve got for you this time. As always, if there is anything I can do to help you or your PUG, please don’t hesitate to ask. :)

If you haven’t yet, make sure you register your group with http://php.ug! Every PUG should be on that list.

Cheers!

Until next time
I <3 |<
=C=

Mailchimp API v3 and Address fields

Freddie_OGDear Reader,

I love MailChimp. I mean I seriously love it. I’m not a big fan of SaaS vendors. I think that most of them are just obvious ideas that someone found a way to shove behind a paywall. But I love MailChimp.

One of the reasons I love it is that it seems to have been built for developers. Everything about it seems to be geared towards developers. This includes their API. I’ve been using v2 of their API in scrips for a few years now and it was just so easy to work with. Their PHP wrapper for it was one of the easiest to use API wrappers I’ve used.

Enter API V3

Recently, (March is recently, right?) they announced v3 of their API. It was “RESTful”. What used to be an absolute breeze to use in v2 has now become a laborious chore to use. It doesn’t help that they don’t bother to release sample code in PHP, if you aren’t a Python or Ruby developer, you have to figure it out on your own.

So that is what I did. I sat down with Guzzle and beat it into submission. While you can still do everything you could do before, to blindly adhere to the principals of REST, they have made retrieving something as simple as all of the information about a single email address 3-4 calls. Complexity for the sake of “doing it right”. (Because there is no way this is actually easier to use, but REST purists will love it.)

Address the issue

One area of change was how the merge fields work. Now this isn’t actually harder than v2, because this was the weak point in v2. However, using their ADDRESS type merge field, I found something very interesting.

The MailChimp Address field is actually made up of 6 different properties.

  • Address Line 1 (addr1)
  • Address Line 2 (addr2)
  • City (city)
  • State (state)
  • Zip Code (zipcode)
  • Country (country)

It’s not terribly difficult to work with from the API…unless. I found an interesting anomaly in the API. Your address lines cannot contain 2 consecutive spaces. Dang near drove me up the wall because it doesn’t tell you that this is a problem, or even which line in the address field has a problem. The error message that comes back simply tells you to enter a valid address.

Conclusion

Ok, if you are using the MailChimp API v3 and you are using PHP, Guzzle is your friend. Also, make sure you strip out any double spaces. Here is how I did it.


$addr1 = filter_var($payload["addr1"],FILTER_SANITIZE_STRING);
$mcRecord->merge_fields->ADDRESS->addr1 = strtr($addr1,['  '=>' ']);

Personally, I believe that this behavior is an artifact of how Mailchimp’s importer works. If you read the docs, they use double spaces to split apart the pieces of an address. Since I was assigning a string with double spaces to a single field. I think the API was choking on that and that is why it spit it back out at me. Of course a helpful error message or even a blog post mentioning this rule would have saved me some frustration.

Still, Mailchimp beats everything else, hands down. Still a fan, even if a bit frustrated.

UPDATE: See the comment below, Pete addresses the issues. (Thank you Pete!) :)

Until next time,
I<3|<
=C=

Celebrating 20 years of PHP

elephpants-512

Dear Reader,

Here is my PHP story.

In 1997, I built my first web based application. When completed it was running on 2 Microsoft Windows servers and powered by ASP (Classic) and SQL Server 6.5. It was around this time that Microsoft decided that if you wanted to use SQL Server on the web, you have to purchase a special web license that was very expensive. This actually was a concession for them because originally they stated that you have to have a license for each person who used your website.  I’m pretty sure they didn’t think that one through, thus the back-peddling and the new Microsoft tax on the web.

I had already purchased 2 licenses for Windows Server and one license for SQL Server and the little company I was building this for could not afford the $15,000 for the new licenses and upgrades. No new hardware and no new functionality, just Microsoft sticking a spigot into our bank account and opening it.

So in 1999, I started looking around for alternatives. I had heard of this new language called PHP and that it was open source. I wasn’t really sure what that meant at the time but figured that it couldn’t cost any MORE than Microsoft, so I started investigating. It turns out that it was gonna cost me a LOT less. No, things weren’t free, but with a little creativity and with the help of a lot of open source software, I was able to rebuild the entire application using PHP.

Not counting what they paid me as a programmer, the new system cost $4,500, that was the price of a shiny new server. All of the software I used was open source.

  • RedHat Linux (Remember RPM hell?) :)
  • Apache
  • PHP
  • MySQL (back when it WAS MySQL)
  • Shoutcast (I has streaming audio way back then)
  •  and a few dozen other packages I can’t recall now

PHP was the catalyst. Since I built that system, I’ve toyed with other languages. I’ve even become proficient enough with JavaScript to get web pages working. However, I’ve never seen the appeal of JavaScript on the server. PHP does the tasks I need done without an issue. (FTR, I felt the same way about Server Side JS the first time I saw it back in ’97ish? What? You thought this was a NEW idea? :) )

PHP is a solid language, it has a great manual, and an awesome community. Those three things raise the bar for switching pretty high.

Thank you to everyone who has contributed to PHP

  • Thank you to all of the core contributors
  • Thank you to all the people who work on the manual
  • Thank you to everyone who runs a PHP User Group
  •  Thank you to everyone who contributes to the PHP community

I owe so many people so much that I can’t even begin to start naming names. In the spirit of the PHP community, I am now, and will continue to, pay it forward each and every day.

Until next time,
I <3 |<
=C=

Wisdom of the ElePHPant

Dear Reader,Wisdom of the ElePHPant book cover

At long last it is time to reveal my “secret project”, Wisdom of the ElePHPant. (WotE)

We have a LOT of smart people in the PHP community. I love going to conferences, not to hear the sessions, but to sit in on conversations. People like Larry (@crell) Garfield, Daniel (@dcousineau) and Laura (@lxt) Thomson, are thought leaders in our community.

Over the holidays, I contacted a bunch of people like those listed above, and asked them to take part in a special project. I asked each of them to contribute a nugget of wisdom. The resulting collection is called “Wisdom of the ElePHPant”. Each week on the website we will release a single nugget of wisdom. The first two are already released. We have them scheduled through January of 2016. (Seriously, there are a LOT of smart people in the PHP community) :)

In addition to the website, we selected 31 of the nuggets of wisdom and the lovely and talented Kathy  bound them into a book. We did a single print run of the book. Each contributor was given the chance to order books to hand out at events they attend.

There are only two ways to get a copy of the book.

  1. See one of the contributors, including myself at a conference or event and ask for one.
  2. Attend either Sunshine PHP or LoneStar PHP. Attendees of both conferences get them in their swag bags.

There will only ever be this one run of these books. We won’t be reprinting them.

This was a fun little project.  The contributors all did a wonderful job and I can’t say thank you enough to them. We have a wonderful community around PHP and the point of this project was to celebrate it.

Until next time,
I <3 |<
=C=

Posted in PHP