News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Popular Users per Language and Region with Silex and Github
June 18, 2015 @ 11:53:49

The SitePoint PHP blog has a new tutorial posted showing you how to use the data the GitHub API provides to find popular users, per language, in an area. His sample example is a simple Silex framework based application and uses the KNPLabs GitHub library to interface with the API.

The data you can get through the GitHub API V3 is mostly what you can see on the GitHub web interface, except you can use the data in your application to come to interesting conclusions. That is what we are going to do in this article. [...] Now, what if there was a web service in which we could specify a location and a language (e.g. PHP) and get a sorted list of contributors to open-source? [...] In our web service, we will have one endpoint (i.e. action, URL) that shows the most popular ten creators. The most popular creators are the people in a location who have the largest number of stargazers. For this, we will retrieve each person's repositories and add up the number of times each one has been starred.

He steps you through getting a Homestead Improved VM up and running (via Vagrant) and a basic Silex application up and running inside. He then pulls in the KNPLabs GitHub library via Composer and sets up a new client in the default route (and grabs the public user data for a user). He then shows how to change it up and use the Search API and some special queries to locate users by a given location. He adds another class, a "StarGazerCalculator", that's given the users returned, filters out the forks in the list and calculates the total "stargazer" count for the user. He does the same with the "top creators" list and sets it up as a service provider, fetches the data and returns the results as a JSON document.

0 comments voice your opinion now!
popular user language region github api silex tutorial

Link: http://www.sitepoint.com/popular-users-per-language-region-silex-github/

Scotch.io:
Deploy PHP Apps Easily with Laravel Forge
June 18, 2015 @ 08:27:04

The Scotch.io site has a new post that wants to help make your Laravel deployments on Forge a simple thing. Forge is a "frontend" to make deployment on the hosting platform of your choice simpler with features for configuring the server, application deployment and automation (like push to deploy).

Forge is an incredible tool in the family of Laravel products that helps developers focus on developing, not deploying and hosting. I personally use it when deploying Laravel applications and it does make life much easier. Many of the pain points of hosting are taken care of for you so you can get right back to developing. [...] We'll be diving into how we can deploy a Laravel application to Forge using Digital Ocean and GitHub.

He starts with a brief introduction to how Forge works and cooperates with the Digital Ocean stack to create the server and deploy the application. He answers a few questions about "why should you use Forge" and then gets into the actual setup of the server. He walks you through:

  • Linking the project to a GitHub or BitBucket repository
  • Adding SSH keys to connect to use for connecting to the server
  • Creating a server

He also goes through some of the server management features Forge offers in its dashboard including monitoring services, server tools and basic site management controls. Once everything is set up, he shows how to deploy from the GitHub repository and how to use third-party integrations (like Slack or HipChat) and the use of environment variables.

0 comments voice your opinion now!
tutorial deploy application laravel forge github digitalocean

Link: https://scotch.io/tutorials/deploy-php-apps-easily-with-laravel-forge

SitePoint PHP Blog:
Exploring Github's Public Events with PHP and Google BigQuery
June 15, 2015 @ 13:10:14

The SitePoint PHP blog has a new tutorial posted showing you how to explore GitHubs public events through the GitHub API and handled via the Google BigQuery infrastructure taking the burden off your own systems.

If you've been following along with my previous articles about Github's API, you know that Github's developers are doing their best to ease the pain of interacting with Github data. In this article, we're going to take a look at the Github public events API and we will build a small demo along the way.

They start off with a brief introduction to both GiHub events (like pushes, merges, etc) and the BigQuery system and the problem it solves. They use a stock Laravel framework-based application (on a Homestead Improved VM) and add in the Google API credentials and a BigQueryServiceProvider using Google's own client to make the connection. They also set up a middleware authentication mechanism to redirect the user if they're not authenticated. They then move over to the BigQuery side and show how to use it's web-based console to perform queries and view results. They then translate this over to a simple "top ten" query, listing the top repositories ordered by number of forks. Building on this, they add in a simple form that allows the user to specify the language to search for (PHP, Javascript, etc) and outputs the results via a Blade template.

0 comments voice your opinion now!
google bigquery github event api tutorial topten forks

Link: http://www.sitepoint.com/exploring-githubs-public-events-php-google-bigquery/

Christopher Pitt:
Making Dependable #2 (Series)
May 27, 2015 @ 09:25:01

Christopher Pitt has posted the second part of his series about creating "Dependable", a Laravel-based application with a focus on Composer use and customization. In part one he laid the foundation, creating a new project, database and setting up migrations to create the tables. In part two he builds on this and creates additional functionality to store a GitHub user's repositories.

One of the ideas we've had is to create an application; which can build a custom Composer dependency map, and deploy that to a new server. It would also be great if there was an interface for deciding which dependencies are included, and a unique URL for each installation.

He starts with a brief mention of testing and why he hasn't included that in his current work. Then he gets into the new models for storing repositories and the migration to create the matching table. He also includes the code that will be needed to link a Developer to a Repository. He finishes the post with an endpoint that can be called to refresh the data from GitHub and pull the repository information down and populate it into the database.

0 comments voice your opinion now!
tutorial series part2 dependable laravel github repositories developer

Link: https://medium.com/laravel-5-tutorials/making-dependable-2-36411b64b958

NetTuts.com:
E-mail List Alternatives With PHP Using Mailgun's List API
May 25, 2015 @ 08:12:15

In a new tutorial posted to the NetTuts.com site they show you an alternative method for sending emails from your PHP application: using the Mailgun API. This API provides an interface into the Mailgun service, specifically made for sending emails without the hassles of hosting your own email server.

Over the past couple years I've run into various frustrations with both open source email list applications and paid cloud-based providers. In this tutorial, I'll guide you through my adoption of Mailgun.com, an economical solution I've been using successfully now for two years. [...] Mailgun is a cloud-based SaaS email cannon, like SendGrid. It's actually free for up to 10,000 emails per month. Mailgun is incredibly powerful and offers a well-documented API in a variety of popular languages. It provides for both send and receive capabilities, the latter of which can be quite difficult to develop from scratch. While Mailgun doesn't provide templates for rich HTML newsletters, it provides a platform upon which you can build anything.

He shows you how to use the service using a simple "ListApp" application (found on GitHub here) that provides some of the most common email list management functionality. He shows you how to set up a free Mailgun account and where to find their PHP SDK for the PHP integration. He then gets into the code examples, showing how to connect to the API via the SDK and doing tasks such as:

  • Creating and update a mailing list
  • Importing members to a list
  • Showing a list of current list subscribers
  • Send a new message
  • Synchronizing lists and members

He ends the post with a quick section about extending the ListApp application (or the PHP SDK) with a suggestion to add better error reporting or a queue system to manage the remote API requests more efficiently.

0 comments voice your opinion now!
tutorial email list alternative mailgun api sdk listapp github

Link: http://code.tutsplus.com/tutorials/e-mail-list-alternatives-with-php-using-mailguns-list-api--cms-22824

Propser Otemuyiwa:
Developing a Micro-Service with Lumen
May 07, 2015 @ 09:55:57

Propser Otemuyiwa has a quick new post to his site showing you how to make a micro-service with Lumen, the recently introduced microframework from the creators of Laravel.

I introduced Lumen to you all in my previous post. Today we'll be creating a simple microservice with Lumen. [...] So, the idea is to build a microservice that showcases your Developer Evangelist status based on the number of public repos you have on Github. The assumption here is that the more publicly available repos you have on github, the more you support the idea of Open source..giving back to the community.

He walks you through the full process:

  • Creating the Lumen project
  • Serving up the new application
  • Enabling Eloquent and the .env handling
  • Adding a single index route

He then fills in the route handling with a bit of code to pull from GitHub and get the number of public repositories a user has and assigns them a "rank" based on that.

0 comments voice your opinion now!
microservice microframework lumen tutorial github example introduction project

Link: http://prosperotemuyiwa.com/developing-a-micro-service-with-lumen/

SitePoint PHP Blog:
Using Github Webhooks with PHP
April 08, 2015 @ 10:16:21

The SitePoint PHP blog has a new tutorial posted from Younes Rafie continuing their series about using the GitHub API from PHP. In this second part of the series he shows how to integrate the GitHub Webhooks with your applications.

In the first part of our series, we talked about the Github API and built a demo in the process. In this part we are going to explore the Webhooks API, and we will build a demo to showcase the API usage.

The demo application they set up gets a push request from the GitHub API and save the resulting data to a local database. They use Laravel 5 to build the application but it could easily be in any other framework (or just plain PHP). They're also deploying to Heroku, but again, you can use your own service. The article then shows you how to go and register a webhook in the repository on the GitHub site and create the "hooks" table to store the event name and contents of the request. He makes use of a JSON output route and the ChartsJs library to render a simple bar graph of the contributors to the repository based on the number of commits they've made.

0 comments voice your opinion now!
tutorial series part2 github webhooks api laravel5 chartsjs json

Link: http://www.sitepoint.com/using-github-webhooks-php/

SitePoint PHP Blog:
How to Use GitHub's API with PHP
March 17, 2015 @ 10:11:39

The SitePoint PHP blog has a new tutorial posted showing you how to interact with the GitHub API via PHP thanks to the KnpLabs library to create a simple automation system to perform some simple tasks.

Github is one of the best ways to share code and collaborate. In this article, we are going to learn how to consume their API and how we can use it to accomplish some of our daily tasks. We are going to explore some of the daily tasks that can be accomplished through the Github API and build a small app using Laravel to illustrate the use cases. You can check the final result on Github.

They walk you through the setup of an application on the GitHub side and how to configure the related settings in your Laravel application. He shows how to bind the GitHub library to the app, set up some sample routes and build out controllers to:

  • List repositories
  • View repository content
  • Editing files
  • Viewing commits

Each item includes the code you'll need to make it happen, an example of the output you'll get from the API and how to use the data on your side in your views.

0 comments voice your opinion now!
github api tutorial knplabs repository edit view content commits

Link: http://www.sitepoint.com/use-githubs-api-php/

NetTuts.com:
Protecting Your Keys From GitHub
March 05, 2015 @ 12:03:05

On the NetTuts.com site there's a new post talking about protecting your keys when using a public site like GitHub. This relates to an easy thing to forget - removing hard-coded credentials from code before pushing it public.

In December 2014, Slashdot ran an alarming story Bots Scanning GitHub To Steal Amazon EC2 Keys, based on developer and blogger Andrew Hoffman's experience trying out Ruby on Rails on Amazon with AWS S3. He inadvertently committed an application.yml file with his AWS keys. [...] It's an easy mistake and most of us have probably done a similar thing at one point or another. And it's not just AWS keys that are at risk. As our use of cloud-based services increases, the expanding use of a broad variety of service API keys can be leveraged by hackers and spammers alike.

He goes through a solution he's found to help protect those credentials, in this case working with the configuration of a Yii framework-based application. He starts with a mention of .gitignore but points out that it could have unexpected results from "quirks" in its handling. He suggests a different option - using a configuration file that lives someplace outside of the main git directory and can be referenced directly from inside the application. He provides two kinds of examples: one using a PHP-based configuration and another based on an INI file. He finishes the post with a mention about WordPress plugins and the fact that they're (usually) stored in a database and open to exposure if a SQL injection vulnerability is found.

0 comments voice your opinion now!
github protect keys commit public exposure configuration file gitignore

Link: http://code.tutsplus.com/tutorials/protecting-your-keys-from-github--cms-23002

Qandidate.com Blog:
Asynchronous fault tolerant programming with PHP
August 12, 2014 @ 12:17:20

On the Qandidate.com blog there's a new post looking at fault tolerant programming in PHP, a follow up to their previous post introducing the topic and creating a "circuit breaker" to prevent major issues when a problem pops up.

Now we will show you a running demo of the application where the circuit breaker library Phystrix is combined with asynchronous programming. The advantage of this approach is that it allows the querying of multiple backend services asynchronously. A timeout can be set for each of the calls and the circuit breaker will deal with failing services.

A screencast included in the post shows a script in action and how it reacts when the various services it needs fail. They've posted the code for the demo can be found over on GitHub and full instructions to run it are included in the post. Also included is some of the output from the test and a peek inside the logs showing where things were broken and if they were able to recover.

0 comments voice your opinion now!
asynchronous fault tolerant programming demo github screencast

Link: http://labs.qandidate.com/blog/2014/08/11/asynchronous-fault-tolerant-programming-in-php/


Community Events

Don't see your event here?
Let us know!


composer php7 framework application podcast list interview part2 example community laravel language introduction project conference yii2 series symfony opinion api

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework