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:
Building an Ad Manager in Symfony 2
October 28, 2014 @ 13:29:31

In a recent post to the SitePoint PHP blog Hugo Giraudel shows you how to create an ad manager as a Symfony-based application. His ad manager allows you to use videos, images or HTML content to create and cache advertisements to add to any application.

The main idea was to build an ad manager. What the hell is an ad manager you say? Let's say you have some places on your site/application to display ads. We do have things like this on our site, and one of our teams is (partially) dedicated to bringing those places to life with content. Now for some boring reasons I won't list here, we couldn't use an existing tool, so we were doomed to build something from scratch. As usual, we wanted to do a lot without much coding, while keeping an overall simplicity for the end user (who is not a developer). I think we came up with a fairly decent solution for our little project.

He uses ESI rendering with Twig templates to identify the ad to return, grab its configuration and render it back to the requesting client. He includes a global configuration (URI and allowed types) an an example of a per-ad configuration file that includes the cace settings, data type and link. The code is also included to consume the request for the ad and render the result. There's also a "randomize" method that picks a random item from the array by weight. Finally, he includes the view templates that can be used to render the results - one for the main ad layout and a few for each type (video, image or HTML).

0 comments voice your opinion now!
advertisement manager symfony2 application tutorial

Link: http://www.sitepoint.com/building-ad-manager-symfony-2/

Angular Tips:
Working With a Laravel 4 + Angular Application
October 28, 2014 @ 09:11:31

On the Angular Tips site today they have a tutorial posted showing you how to combine the power of the Angular JS frontend framework with a Laravel backend. They walk you through the full process of getting an application up and running, including a bit of actually functionality (not just a "Hello World").

So you decided that Laravel is a great choice for a backend and that Angular is going to fit perfectly as the framework of choice for the frontend. Yeah! That is correct and I am starting to like you. How to start? So many question, so little time.

They start by getting everything you'll need installed, both on the Laravel and Angular sides. Then it gets into the actual development of the application, changing up the default Laravel page to include Angular and a little test to be sure it's working correctly. With this working correctly (after a little route updating too) they get to the more real-world application: a listing of TV shows generated from a dataset on the Laravel backend. They include all the code you'll need to create the frontend app and display the results.

0 comments voice your opinion now!
laravel tutorial angularjs application frontend framework

Link: http://angular-tips.com/blog/2014/10/working-with-a-laravel-4-plus-angular-application/

SitePoint PHP Blog:
Bitcoin and PHP with Coinbase's API - Demo App
October 09, 2014 @ 09:25:51

The SitePoint PHP blog has posted the second part of their series about using the CoinBase API through PHP. In this new tutorial they use the API connection made in the first part via the Coinbase SDK.

In part 1, we covered basic installation and usage of Coinbase's Bitcoin PHP API and the accompanying SDK. In this second and final part, we'll be building our sample application.

He briefly shows how to send and receive bitcoins before diving into the application. His simple application includes a basic welcome page, a payment page, thanks page and a cancel page (in case of errors). Complete code for the HTML, CSS, and PHP (API calls) is included in the post. He shows how to create the button to start the payment process and add it to the page.

0 comments voice your opinion now!
coinbase bitcoin series tutorial part2 demo application

Link: http://www.sitepoint.com/bitcoin-php-coinbases-api-demo-app/

Sameer Borate:
Creating Twitter Apps in PHP
September 29, 2014 @ 09:28:42

Sameer Borate has a post today showing how you can create a simple Twitter application in PHP making use of their REST API and the twitter-api-php library.

In this post we will look into accessing Twitter REST API in PHP. This can be useful if you need to post Tweets from your PHP application or anaylze, search Tweets. In the following examples we will use the twitter-api-php PHP wrapper for Twitter v1.1 API. Although there are a few wrappers around, this one I like for its simplicity.

He helps you get the library installed (via Composer) and create an application on the Twitter side at apps.twitter.com. Sample code is included showing how to connect to the API with your credentials, including handling the OAuth authorization piece. From there he shows two examples of action to make on the API: posting a new tweet and searching for new tweets based on a query string.

0 comments voice your opinion now!
twitter application tutorial introduction library oauth search post tweet

Link: http://www.codediesel.com/social/creating-twitter-apps-in-php/

NetTuts.com:
How to Build Rate Limiting into Your Web App Login
September 22, 2014 @ 11:12:14

In this new tutorial on NetTuts.com, Jeff Reifman shows you how to build rate limiting into your application to help with issues on your login caused by possible brute force attacks.

Since one of the wealthiest corporations in the world [Apple] didn't allocate the resources to rate limit all of their authentication points, it's likely that some of your web apps don't include rate limiting. In this tutorial, I'll walk through some of the basic concepts of rate limiting and a simple implementation for your PHP-based web application.

He starts with a brief look at how (brute force) login attacks actually work and how that relates to the most common passwords used. He splits out the two main approaches to rate limiting in applications: limit based on failures by username or limiting by IP address. He then gets into the actual code examples, choosing a Yii framework-based application for his illustration. He creates a simple "failed login" database table, shows how to log the attempts and includes a snippet to purge items older than (by default) 120 minutes ago. Finally, he includes the code to check the table and see if the username has too many failures listen and, if so, denies them access.

0 comments voice your opinion now!
rate limiting login application tutorial mysql database

Link: http://code.tutsplus.com/tutorials/how-to-build-rate-limiting-into-your-web-app-login--cms-22133

SitePoint PHP Blog:
Build a New App with Laravel and EmberJS in Vagrant
August 25, 2014 @ 11:31:58

The SitePoint PHP blog has kicked off another series of posts today with part one of a series looking at building an application based on the Laravel PHP framework and EmberJS.

Nowadays, everything is turning into a web application. Even simple websites have a mobile app relying on a REST Api. Web applications are accessible everywhere - on a laptop, desktop, tablet, mobile, and recently on wearable devices like smartwatches. Everything is becoming smaller and faster - front ends are becoming separated from back ends, and only communicate with the server through APIs. In this series, we are going to create a photo uploading app. For the front-end, we will use EmberJs and Foundation 5. [...] For the back-end, we will use Laravel. The source code will be available per-part, and in final shape in the final part of this series.

They go with the Laravel Homestead virtual machine (and Vagrant) to make for a quick setup and stable environment. They help you get it all set up to push up to Heroku and get all needed dependencies, both frontend and backend, installed. They also walk you through the setup of the database, configuring the connection and deploying the application to production.

0 comments voice your opinion now!
tutorial emberjs vagrant laravel homestead application series part1

Link: http://www.sitepoint.com/build-new-app-laravel-emberjs-vagrant/

SitePoint PHP Blog:
APIfy Your Legacy App with Toro
August 19, 2014 @ 12:09:39

The SitePoint PHP blog has a new post that wants to help you API-ify your legacy application with ToroPHP, a router that's "designed for minimalists" to make routing and handling RESTful requests easier.

For the Google Summer of Code 2014, I was selected for a project to create a REST API for ATutor. ATutor has hundreds of thousands of lines of code, yet is written in core PHP. Introducing a PHP router class for the API was necessary, but we needed something unintrusive.

The result was the ToroPHP library. He introduces the library with some background about why it was created and some of the goals it was trying to achieve. Next he shows you how to create a simple "Hello World" endpoint that just defines the endpoint and echoes back the string. He shows how to separate out the logic from the route handling via the "urls.php" definition file. He also shows the handling of URL prefixes and mentions user authentication, making a "backbone" for the API and reuse of classes for similar objects.

0 comments voice your opinion now!
tutorial legacy application torophp library api rest

Link: http://www.sitepoint.com/apify-legacy-app-toro/

AboutPerformance Blog:
How to Spruce up your Evolved PHP Application - Part 2
August 08, 2014 @ 10:57:51

On the About:Performance site today there's a new post (part two in the series, part one is here) about increasing the performance in your PHP application. In this new post he talks about a few other updates that can be made to make your app fly.

In the first part of my blog I covered the data side of the tuning process on my homegrown PHP application Spelix: database issues, caching on both the server and the client. [...] In this part, I will concentrate more on technical topics: network traffic, code caching and session handling.

The post shares helpful tips and code examples showing how to:

  • Reduce Network Traffic
  • Leverage Browser / CDN cache
  • Use Conditional and Non-Conditional Caching
  • Using the HTML5 Application Cache
  • Optimize Session Handling

He does suggest the use of a commercial tool for a more in-depth analysis, but there's nothing here that it's required for. A little poking around in your browser can yield most of the same results.

0 comments voice your opinion now!
application performance tips traffic cdn cache session optimize

Link: http://apmblog.compuware.com/2014/08/06/spruce-evolved-php-application-part-2/

Symfony Blog:
Push it to the limits - Symfony2 for High Performance needs
August 04, 2014 @ 13:51:48

On the Symfony blog today they've posted a use case that talks about Symfony meeting some high performance needs and some of the development that was done to make it happen.

For most people, using full-stack frameworks equals slowing down websites. At Octivi, we think that it depends on correctly choosing the right tools for specific projects. When we were asked to optimize a website for one of our clients, we analyzed their setup from the ground up. The result: migrate them toward Service Oriented Architecture and extract their core-business system as a separate service. In this Case Study, we'll reveal some architecture details of 1 Billion Symfony2 Application. We'll show you the project big-picture then focus on features we really like in Symfony2. Don't worry; we'll also talk about the things that we don't really use.

They start with some of the business requirements they needed to meet and how it influenced the overall architecture of the application. They cover some of the things they liked the most about using the framework including bundles and using the EventDispatcher component. Some example code is also included for the custom handling they created for routing, CLI commands and request handling. There's also a mention of using the Profiler, Stopwatch and Monolog trio to do some performance analysis on the resulting application. Finally, there's a brief mention of some of the tools they're not using and why (two of them): Doctrine and Twig.

0 comments voice your opinion now!
symfony usecase performance need application custom

Link: http://symfony.com/blog/push-it-to-the-limits-symfony2-for-high-performance-needs

PHPBuilder.com:
Creating Real Time Applications with PHP and WebSockets
July 29, 2014 @ 12:13:07

On PHPBuilder.com today there's a new tutorial introducing you to the combination of PHP and WebSockets to make real-time requests to fetch data in your application.

This article will explore the main PHP libraries used to create real time, bi-directional applications between clients and servers over WebSockets. WebSocket is full-duplex client/server communication over TCP. It is also a new feature available in browsers as a part of the HTML5 specs that allows JavaScript clients to open bi-directional socket connections to a server. [...] WebSocket connections are basically TCP socket connections that following the WebSocket rules to communicate. The WebSocket Protocol is an independent TCP-based protocol.

They introduce some of the basic concepts behind WebSockets (including an example URL) and show how to use the PHPWebSockets library to handle some sample requests. They also include some basic JavaScript to make the request to the backend PHP script and send or fetch content on the server. They also show you how to implement a simple chat server using a few other libraries like Ratchet, Elephpant.io and Socket.io.

0 comments voice your opinion now!
realtime application websockets tutorial introudction

Link: http://www.phpbuilder.com/articles/application-architecture/optimization/creating-real-time-applications-with-php-and-websockets.html


Community Events





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


symfony library framework deployment tips api opinion podcast introduction voicesoftheelephpant interview install laravel release package community series bugfix list language

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