AddHandler application/x-httpd-php53 .php
Add that to the top, and now if you do a quick phpinfo(), you'll see that your site is using PHP 5.3.
AddHandler application/x-httpd-php53 .php
Add that to the top, and now if you do a quick phpinfo(), you'll see that your site is using PHP 5.3.
error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE);
That said, I'm able to get a workflow going with Skitch that might work well. Just do the typical shortcut key, paste into Skitch, add any markup, then drag the corner to resize 50%, copy and paste.
So instead of seeing something like this:
You can have something like this:
So, easy enough, right? Just install the thing. Apparently the correct thing to do is open up Terminal and type:
pecl install oauth
But when I did that, I got the error pecl: command not found. Because I'm using MAMP, though, I actually do have Pecl, it's just hidden in MAMP. So, I had to add the following to my ~./.bash_profile file:
Okay, cool. So now I can run Pecl. But, when I attempt the Oauth install, I get more errors including C compiler cannot create executables and ERROR: '/private/tmp/pear/temp/oauth/configure' failed.
Apparently, there's this application called gcc that does compiling, and at least in Mountain Lion on OSX, it doesn't come with the whole Xcode package like it used to. So, I set about trying to figure out the best way to get this back, and came upon this project on Github which is a nice pkg installer (for the technically slow like myself). This is a link to the PKG installer itself.
Then I ran the original command again (but I had to add sudo in order for it to work):
sudo pecl install oauth
And it worked! Holy s***! Now to get it registered with PHP, it says I need to add it to php.ini:
You should add "extension=oauth.so" to php.ini
So, I found my php.ini file by typing the following into the command line:
And then did a search in the terminal window for php.ini. In MAMP, it's apparently in /Applications/MAMP/bin/php/php5.3.6/conf. So I added the extension line to that.
Then I restarted MAMP to register the addition to php.ini.
And what do I get when I refresh my sample page?
Okay, so now I need to make sure that the php.ini file I just edited was the actual one that my site is using. So I opened up the index.php file in the Evernote example folder (/sample/oauth/index.php) and put in a little phpinfo(); at the top, then did a browser search for php.ini.
What's this? The php.ini file this is looking for is actually in /Library/Application Support/appsolute/MAMP PRO/conf/php.ini. Oh that's right! MAMP PRO has you edit the php.ini file right in the application.
So, now I go to File > Edit Template > PHP > PHP 5.3.6 php.ini because that's where I intuitively thought it might be. Who wouldn't? I pasted the little extension line in there (after doing a search for extension= to find out where the other extensions were added), saved it, restarted MAMP (PRO), removed my phpinfo() from the example page, refreshed, and…
Bam! I get some other error that lets me know that Oauth is actually functional. Sweet!
If you or your staff need to learn Drupal or pick up some new Drupal skills, come to our nearly free all-day Drupal Immersion training on July 14th! During the training you'll have access to a number of highly skilled, experienced Drupalists to help you with any questions you might have.
Sign up for the Drupal Immersion Training (seats are limited).
This training will be held at BSU in the Micron Engineering Center (MEC), room 114 (click for map).
Drupal is a free, open source and fantastic piece of software that drives both incredibly popular websites like The White House and the Grammys, as well as tons of smaller, local web sites. Drupal skills are in high demand, and there's just not enough people to fill the current need. In Boise, several web shops are using Drupal exclusively to build local, national and international web sites, and many of them are growing fast and looking for talent.
Plus, Drupal is a lot of fun. It's feels amazing to be able to build powerful web sites for your own projects and organizations. We want to share that power with you.
This particular training has been used across the world to train hundreds of people. Instead of a traditional, lecture based training, we use a curated set of videos from BuildAModule (a Boise-based company) to allow students to work through a series lectures at their own pace. This also frees up the trainers to help students one-on-one the entire time.
What this also means is that you get to focus on whatever aspect of Drupal would be most helpful to you. If you're just beginning, we'll guide you through the process of setting up your first Drupal site and learning basic terminology and concepts. If you're a developer, you can dive into Drupal's fantastic APIs. If you're a designer, you can dig into Drupal theming. There are video lectures available that cover nearly all of the fundamentals of using Drupal in practical projects.
My name is Chris Shattuck, I'm the creator of BuildAModule and am organizing this training. I've become passionate about education over the last several years and am excited to be in the position to leverage powerful strategies to help develop Drupal talent around the world. This particular training has been held in several countries, and was the most-attended training at the annual DrupalCon in 2012.
The videos on BuildAModule have helped thousands of people learn Drupal, and the ability to interact one-on-one with experienced Drupalists at trainings like these is a way to really help accelerate the learning process. I've seen numerous students land fantastic jobs after working through the BuildAModule curriculum. Others have been able to pull of complicated projects relatively quickly, starting from scratch. This is really exciting to see, the process has been proven, and I'm glad to finally be able to reach out locally and help develop our local Drupal talent pool.
Zerrtech is generously supporting this training by giving away 5 3-month memberships (valued at $87 each, thank you!). We'll be doing the giveaway during the lunch break.
We have several experienced mentors who will be ready to help you questions or trouble spots throughout the day.
CHRIS SHATTUCK - Chris is the creator of BuildAModule.com and has recorded nearly 700 focused Drupal tutorials. He has also done extensive in-person Drupal training, including the largest training at DrupalCon 2012, and has spoken at numerous Drupal events. You can learn more about Chris at http://chrisshattuck.com.
JEREMY ZERR - Jeremy has a diverse skillset, and has been using Drupal for several years. He's been responsible for large implementations for some of the largest companies in Idaho. You can learn more about Jeremy at http://www.zerrtech.com.
CAMERON EAGANS - Cameron is a software developer living in Meridian, Idaho. He works at Balihoo and goes to school at Boise State University. He has building sites and applications with Drupal almost exclusively since 2008. You can learn more about Cameron at http://cweagans.net.
ANDY HARL - Andy is a web designer and front end developer in Meridian, Idaho. He is currently working as a web designer for http://www.bluesharmonica.com. You can learn more about Andy at http://andyharl.com.
This training is nearly free, but we're collecting a small token fee to pay for lunch and power cords. Regular tickets are $25, and student tickets are $10.
So far we've looked at a number of built-in functions for PHP, but this week we're going to start writing our own! Functions are a great way to create reusable code snippets, and as we'll see in upcoming videos, they also give us some flexibility in how the code gets executed.
This week we start digging into creating our own custom functions. Functions give us the freedom to execute code snippets wherever we need to without copying and pasting existing code. Logically, functions help us organize functionality into reasonable pieces that will help us understand our code later, or will help other team members get a sense of what certain code is for. From this point forward, functions will form a large part of how we structure our code, so it's good to make sure you have a solid grasp of what's going on.
Now that you know how to create a function, we'll look at how to pass data to it in the form of a parameter. Parameters are just variables we can use within our functions, but being able to use them packs a lot of power when it comes to writing code.
In this video we walk through creating a classic dice roller application using a custom function. We also explore the idea of optional parameters to allow flexibility but simplify code when possible.
In this brief video, we explain how custom functions can evolve and become more powerful than using loops or copying and pasting code to get the same logic to run.
You'll probably run across references in Drupal's code before you actually have a need to use them yourself, so it's good to get a sense for what they do and how they work. References are basically variables that get passed into a function as a pointer to existing variable data. And if that doesn't make any sense, check out the video and it will soon!
And just in case you're in the Chicago area, this next Thursday (May 10th)I'll be speaking at the famous Chicagoan CMS Expo on Powering a Lean Startup With Drupal. If you have an idea you've been trying to get off the ground, this talk will be all about how to free up the time and build the resources you need to make it happen.
And of course, we have some new PHP videos rolling out this week on a fun and powerful subject:
Last week we explored some basic control structures like 'if' and 'elseif'. This week, we keep building the logical tools you'll need to build powerful PHP-based applications by exploring looping. As we've alluded to in previous videos, whenever you find yourself repeating the same kind of code over and over again, you can probably save some space in your code - and some sanity later if you need to update the code - by using loops.
One common use of a loop is to generate HTML content based off of data in an array. In this video, we generate an HTML table (you'll do this at some point in your development life, I guarantee it!)
How to use a "while" loop - 4:37
Sometimes you need to run a loop a number of times, but not based off of an array. We explore the 'while' looping construct in this video, where we test against a particular condition to decide whether to continue or cut out.
The 'for' loop is pretty si mi liar to 'while', but is a little more compact (and maybe a little more challenging to read). In this video, you can take a gander at 'while' and 'for' side by side.
Now that we're playing with loops, it's important to know how to stop one if we accidentally set one up to run forever (oops!). In this video we look at modifying some core PHP settings in the php.ini file, and what happens to those infinite loops if we do let them run wild for a while.
How to use a "foreach" loop - 3:36
A hugely powerful, but sometimes difficult-to-wrap-your-mind-around-concept is "looping." In this video, we look at one control structure called 'foreach', which will allow us to loop through each item in an array and run some code each time. We'll spend a bit of time on loops since they're so important to coding, but our journey starts here!
This week only you can get 20% off of your initial purchase of a 1- 6- or 12-month membership. Just use the code GETITALL when checking out. Now's your chance to get access to over 650 perfectly paced Drupal training videos, 24 /7. (Note that membership renewals will revert back to the original amount).
This week we begin looking at the logical side of PHP. Now that you're comfortable with strings and arrays, we can start programming PHP to accomplish tasks - which is really what logic is all about. In the first video we give you a sense of what we mean by 'logic', and then we dive right into something called 'control structures', which are PHP constructs that direct PHP in some way. Specifically, we explore how to tell PHP to run certain code only in certain conditions with 'if' and 'if...elseif' statements.
Before we jump into working logic, we take a birds-eye view of what logic actually is and how we're going to go about learning it. If you're new to coding in general, this will be a good one to watch.
We can also extend an 'if' control structure to include other criteria, and in this video we explain how to do this with 'if...elseif'.
In this video we start applying what we've learned about control structures and working with arrays to create a fun random text generation script.
Never one to leave good enough alone, in this video we make our random generation script even more fun and flexible by adding additional random elements to it.
In this video we walk through a commonly used control where we build code to tell PHP to make a choice based on certain criteria. We'll be using 'if' statements a lot in upcoming code, so getting a sense of the different parts of the structure will pay off down the road.
In under 2 weeks we've had some incredible contributions to the BuildAModule.com translation effort. Over 70 videos have been translated into Spanish, and several have been translated into French, Dutch and Hebrew. We're excited that native speakers of these languages will get to enjoy the contributions made my numerous volunteers.
Thank you to everyone who has contributed so far, and if you yourself are interested in assisting with the translations, take a look at the translate page on BuildAModule.com.
Over the last year, numerous Mentored Trainings have helped build Drupal resources worldwide. Coming up, we have:
DrupalCamp Twin Cities, May 17: Organized by the amazing Advantage Labs folks, this Mentored Training is geared towards those just starting out with Drupal.
DrupalCamp Scotland, May 25: This full-day Mentored Training is currently at capacity, but you can be put on a waiting list in case they're able to expand the venue.
DrupalCamp Sacramento, June 8: I (Chris Shattuck) will be hosting a Mentored Training, and while the focus will be on Drupal basics, you're welcome to come at any experience level.
There are also proposals in the works for DrupalCon Munich, DrupalCamp Salt Lake City, the Pacific Northwest Drupal Summit and more.
If you're interested in hosting a Mentored Training for your DrupalCamp, it's easy to do and it's a great way to offer affordable, effective training to large groups of people. You can check out the training page for more information, or send us an email with any questions.
Continuing from last week where we started digging into arrays - one of the most commonly used data structures in Drupal - in this video we explore associative arrays, where we can assign strings as keys.
Once you have your data in an array, there's all kinds of native PHP functions that will allow you to manipulate and sort that data. In this video we walk through some of the most common array functions and ways that you might apply them in the real world.
In Drupal, there are a number of objects like $user and $node that are simply multi-dimensional arrays wrapped in the slightly different object syntax. In this video we show you how to create these objects, and manipulate data inside of them.
Array function challenges - 1:19
Now that you've got a solid grasp of arrays, this video poses some challenges to help you test your new knowledge and apply it in practical situations.
In this video arrays start to get really interesting. Not only can arrays store data like strings and numbers, but arrays can also include other arrays. And those arrays can store arrays. Before your mind explodes over the implications, we'll spend some time in this video explaining these unique arrays in a way that makes them manageable.
I get requests for consulting and freelance work on a regular basis, but I currently don't take on any consulting. But the requests often come from people I know and would really like to help in some way. So, I'm reaching out to generate a list of individuals I know or have met who also freelance. If you're one of those people, please send me an email that includes the following info:
I'm limiting this for now to folks I've met, since it's a lot easier to get a sense of someone's overall attitude and such that way. It's also because I want to be able to tell the people I'm passing your names onto that I actually know you to some degree. If we haven't met and you'd like to be on this list, find a way to meet me!