Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  PHP to get access token for Facebook app

Since Facebook is now using OAuth 2.0 to authenticate apps to access user information. the SDK of Facebook has provided developers some useful functions to get authentication done. For example, in PHP SDK, there are getAccessToken(), getLoginUrl() etc. But unfortunately, for me I cannot use getAccessToken() method to get the user access token, it only returns me the app access token. Finally I gave up this approach to get access token for the time being. I may later retry this approach if I have time.Today I show you another way to get the access token, which is explained on Facebook's develop...

29,142 4       PHP ACCESS TOKEN FACEOOK SIGNED REQUEST


  Understanding PHP's internal function definitions

Welcome to the second part of the “PHP’s Source Code For PHP Developers” series.In the previous part ircmaxell explained where you can find the PHP source code and how it is basically structured and also gave a small introduction to C (as that’s the language PHP is written in). If you missed that post, you probably should read it before starting with this one.What we’ll cover in this article is locating the definitions of internal functions in the PHP codebase, as well as understanding them.How to find function definitionsFor a start, let’s try t...

14,213 0       PHP DEFINITION INTERNAL FUNCTION RATIONALE


  API Design is UI for Developers

I’ve been thinking a lot about APIs and their design recently.I stumbled on this fantastic quote from Greg Parker: A programming language is a user interface for developers. Language authors should learn from HCI principles.22/02/2012 19:10 via webReplyRetweetFavorite@gparkerGreg ParkerWhen I first started learning C++ (back in the bad old days) I was convinced that any 1st year student could design a better programming language. One which behaved in a sane fashion without a lot of legacy cruft. In many ways, PHP is that programming language. It’s simple, logical, and works wi...

2,058 0       PHP UI API DESIGN DEVELOPERS


  Handling Plugins In PHP

A common problem that developers face when building applications is how to allow the application to be "plug-able" at runtime.  Meaning, to allow non-core code to modify the way an application is processed at runtime.  There are a lot of different ways that this can be done, and lots of examples of it in real life.  Over a year ago, I wrote a StackOverflow Answer on this topic.  However, I think it deserves another look.  So let's look at some patterns and common implementations.Communication HandlersThese patterns are designed to handle communication between disjoint ...

2,346 1       PHP PLUGIN HANDLING


  What kind of automated testing does Facebook do?

We do several kinds of testing. Some specifics:For our PHP code, we have a suite of a few thousand test classes using the PHPUnit framework. They range in complexity from simple true unit tests to large-scale integration tests that hit our production backend services. The PHPUnit tests are run both by developers as part of their workflow and continuously by an automated test runner on dedicated hardware. Our developer tools automatically use code coverage data to run tests that cover the outstanding edits in a developer sandbox, and a report of test results is automatically included in our cod...

3,745 0       PHP TESTING FACEBOOK AUTOMATED TESTING


  Automatically post to Facebook from PHP script

Facebook is currently on of the most important publishing and traffic generating sources for many websites. Manually Cross publishing content on your own site and Facebook seems like a lot of extra work.This post guides you through the creation of a Facebook application that can automatically post messages and other types of content on your Facebook wall.Getting startedBuilding a php script that automatically posts status updates on your wall requires the following steps:Download Facebook APIRegister a Facebook appGive the app rights to post on your wallBuild the post to Facebook scriptGet the...

24,983 2       PHP FACEBOOK API OAUTH AUTO POST


  Twitter OAuth the easy way – simple post to twitter script

After Twitter introduced mandatory authentication with OAuth, many of the current scripts for posting content to Twitter don’t work anymore.OAuth can be great for more advanced authentication, but for a simple post to twitter script, it seems like a little overkill.In this post you’ll learn how to create a simple script that uses a quick and dirty version of OAuth for posting new tweets to Twitter.How to create a simple scriptSimplified, Twitter OAuth involves sending both application tokens and user tokens back and forth between your site and Twitter.If you want to authenticate ...

10,627 0       PHP TWITTER OAUTH AUTO TWEET


  Why hasn't Facebook migrated away from PHP?

The reason Facebook hasn't migrated away from PHP is because it has incumbent inertia (it's what's there) and Facebook's engineers have managed to work around many of its flaws through a combination of patches at all levels of the stack and excellent internal discipline via code convention and style - the worst attributes of the language are avoided and coding style is rigidly enforced through a fairly tight culture of code review (failing to adhere to the style and "going cowboy" by writing sloppy code results in pitiless mockery by one's peers).  Engineering management has never had to ...

7,356 0       PHP FACEBOOK MIGRATION BAD FEATURE CODEBASE