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:
AngularJS in Drupal Apps
December 16, 2014 @ 12:23:31

On the SitePoint PHP blog there's a new tutorial posted (by Daniel Sipos) about combining Drupal and AngularJS to make for more front-end focused, responsive applications.

Angular.js is the hot new thing right now for designing applications in the client. Well, it's not so new anymore but is sure as hell still hot, especially now that it's being used and backed by Google. It takes the idea of a JavaScript framework to a whole new level and provides a great basis for developing rich and dynamic apps that can run in the browser or as hybrid mobile apps. In this article I am going to show you a neat little way of using some of its magic within a Drupal 7 site. A simple piece of functionality but one that is enough to demonstrate how powerful Angular.js is and the potential use cases even within heavy server-side PHP frameworks such as Drupal.

He walks you through the creation of a simple addition of a block that lists out the titles of some other nodes. You'll need an existing Drupal installation to follow along (no setup instructions here) as well as an Angular structure for a small application. He starts with the module configuration and creates custom handling to return the JSON result back to the waiting JS connection. Then he creates the custom template and block that the AngularJS will output the results too. Finally, with that rendering, he glues them both together in an Angular controller that loads the results when an "Open" button is clicked.

0 comments voice your opinion now!
angularjs tutorial drupal integrate introduction

Link: http://www.sitepoint.com/angularjs-drupal-apps/

SitePoint PHP Blog:
Using Traits in Doctrine Entities
December 09, 2014 @ 12:16:56

On the SitePoint PHP blog there's a recent post showing you how to use traits with Doctrine entities. PHP's traits allow for the inclusion of functionality into a class without having to extend another class or create an object to use it.

Since PHP 5.4.0, PHP supports a pretty way to reuse code called "Traits" - a set of methods that you can include within another class in order not to repeat yourself. You can read more about traits in previously published SitePoint posts: here, here and here. Today, I am going to show you how they can be used with Doctrine ORM in a Symfony Environment.

He shows how to create two basic Doctrine entities, in this case representing "Article" and "Comment" instances. He then creates the trait, a "TimestampableTrait" class that abstracts out the setting/updating of the create and updated date on the Doctrine record. He refactors the entities to use the trait and shows the results of the "schema create" command.

0 comments voice your opinion now!
traits doctrine entity tutorial introduction functionality

Link: http://www.sitepoint.com/using-traits-doctrine-entities/

Michael Dowling:
Transducers in PHP
December 08, 2014 @ 09:28:48

Michael Dowling has a new post to his site announcing a project he's recent released to try to bring some of the functionality of Clojure to PHP with the introduction of transducers.

Rich Hickey recently announced that transducers are going to be added to Clojure, and it prompted a bit brief announcement, Hickey followed up with a couple videos that describe transducers in much more detail: Transducers and Inside Transducers + more.async. Transducers are a very powerful concept that can be utilized in almost any language. In fact, they have been ported to various other languages including JavaScript (2), Python, Ruby, Java, and Go. And now…transducers are available in PHP via transducers.php!

He starts with an official definition of what a transducer is from the Clojure documentation then explains it in a bit more layman's terms as "a fancy way of saying that you can use functions like map and filter on basically any type of data source (not just sequences)" and can output any kind of structure as a result. He then gets into some code examples using his project showing eager and lazy evaluation, how they're composable and a list of the ones the library makes available (and what they do). He then gets into a more complete example of their application with a streams example, working with/modifying a string. He ends the post looking at how to create your own custom transducer and how they compare to generators.

0 comments voice your opinion now!
transducer conjure step data data structure introduction library

Link: http://mtdowling.com/blog/2014/12/04/transducers-php/

SitePoint PHP Blog:
How to Build an OctoberCMS Theme
December 03, 2014 @ 09:17:55

The SitePoint PHP blog has a new post in their series covering the OctoberCMS today, this time looking at how to create a custom theme. They walk you through the creation of a simple "blogging" theme type with posts, categories and home/about pages.

October CMS is the new star in the sky of CMSes. Built on top of Laravel, it promises joyful coding and a back to basics approach. Read our introduction here and find out how to build plugins for it here. In this article, we're going to see how we can build a theme.

Their theme makes use of the rainlab plugin allowing for the use of Markdown content in your posts. They start by adding in the directories and base files needed for the theme to the "themes" directory. With the plugin installed they start working through the configuration content and setup of the theme files including PHP and markup sections. He also shows how to use placeholders, partials and layouts in the content of the posts. Next is the static pages, About and Home, with a bit simpler configuration. The code is then included for the remainder of the pages: single posts, categories and the post listing.

0 comments voice your opinion now!
octobercms laravel tutorial theme introduction

Link: http://www.sitepoint.com/build-octobercms-theme/

Anthony Ferrara:
It's All About Time
December 01, 2014 @ 10:46:15

In his latest post Anthony Ferrara talks about a tricky subject in PHP - timing attacks. A timing attack has to do with vulnerabilities that can come up because of the differences in time it takes to perform cryptographic operations (like hashing or encrypting).
An interesting pull request has been opened against PHP to make bin2hex() constant time. This has lead to some interesting discussion on the mailing list (which even got me to reply :-X). There has been pretty good coverage over remote timing attacks in PHP, but they talk about string comparison. I'd like to talk about other types of timing attacks.

He starts with a definition of what a remote timing attack is and provides an example of a simple script showing the delay that's key to the attack. His script deals with string location but it gives you an idea of how the attack works and where the danger lies. He points out that even remotely attackers could determine the times to perform operations (down to the nanosecond) and use this to their advantage. He points out that both == and === are vulnerable to this type of attack because of how the comparison happens. He gives two options (one an internal function) to help protect your application and briefly covers a few other types of timing attacks: index lookup, cache-timing and branch-based timing attacks.

0 comments voice your opinion now!
timing attack comparison time example tutorial introduction prevent

Link: http://blog.ircmaxell.com/2014/11/its-all-about-time.html

php[architect]:
Build a VM for Drupal 8 with Vagrant
November 26, 2014 @ 10:22:22

A new tutorial has been posted on the php[architect] site today showing you how to build a VM for Drupal 8 with the help of Vagrant.

At this year's php[world] hackathon, I spent my time getting a Vagrant machine configured to run Drupal 8. I know there are other options, like Acquia's own Dev Desktop, or even Zend Server. However, I like using Vagrant to run my LAMP stacks, especially on OS X. I've never been able to easily run xAMP on non-Linux machines. Installing MySQL can be a pain, system updates can change the version of PHP you're running, and some PHP extensions are really difficult to build-even with Homebrew. Vagrant simplifies getting a working development environment running by automating the provision of a virtual machine for you, usually with a tool like Chef, Puppet, or Ansible.

Oscar (the author) took advantage of some time at the php[world] hackathon to create the necessary files for building this environment. He walks you through the steps to creating the basic vagrant file with "config" options (explaining each one) and walks through the setup of additional options, software like Apache and Drupal. He then sets up the Ansible configuration to create the box, run the provisioning and configuration of the resulting server. Finally, he shows the result of the install if everything was successful.

0 comments voice your opinion now!
drupal8 vagrant vm virtualmachine tutorial introduction configuration provision

Link: http://www.phparch.com/2014/11/build-a-vm-for-drupal-8-with-vagrant/

NetTuts.com:
Digging in to Laravel's IoC Container
November 25, 2014 @ 12:23:07

NetTuts.com has a new tutorial posted that digs into the Laravel IoC (Inversion of Control) container, one of the key features of the framework making it easy to create and use objects all around your applications.

Inversion of Control, or IoC, is a technique that allows control to be inverted when compared to classical procedural code. The most prominent form of IoC is, of course, Dependency Injection, or DI. Laravel's IoC container is one of the most used Laravel features, yet is probably the least understood.

He starts with an example of basic dependency injection (constructor injection) and how this relates to the Laravel framework's IoC handling (hint: it's all IoC). He includes examples of some built-in Laravel bindings and talks about the difference between shared and non-shared bindings. He also looks at conditional binding, how dependencies are resolved and how you can define your own custom binding implementations. Other topics mentioned include tagging, rebounds, rebinding and extending. He ends the article with a look at how you can use the IoC outside of Laravel too.

0 comments voice your opinion now!
laravel ioc container inversionofcontrol framework tutorial introduction detail

Link: http://code.tutsplus.com/tutorials/digging-in-to-laravels-ioc-container--cms-22167

Michelangelo van Dam:
Running Apigility on Azure
November 21, 2014 @ 11:55:15

Michelango van Dam has a new post on his site today walking you through the process of running Apigility on Windows Azure. Apigility is a project from Zend that makes creating and maintaining APIs much simpler (based on the Zend Framework).

Since a couple of years I've been a fan of Microsoft Azure, the cloud platform by Microsoft. It offers a platform as a service (PaaS) in the form of Azure Websites which makes it a great solution to prototype and to play with new stuff. Last year Matthew Weier O'Phinney announced Apigility at ZendCon, a manager for API design. It was immediately clear that it would revolutionise the way we would design and manage REST API's.

Michelangelo walks you through the entire process, starting locally. He shows you how to clone and set up the latest version of Apigility and create a basic endpoint named "demo". He adds in a bit of code to handle the API request (returning user data) and includes an example of what the REST request looks like. With that up and running, he moves on to the Azure side of things. He shows you how to create a "web.config" file to configure the Azure server and run Composer as the install is being processed. He helps you get an Azure account set up and shows how to set up the website instance where you'll deploy the application, pointing it to a GitHub repository as a deploy source.

0 comments voice your opinion now!
apigility windows azure deploy tutorial introduction rest api

Link: http://www.dragonbe.com/2014/11/running-apigility-on-azure.html

SitePoint PHP Blog:
Yii 2.0 ActiveRecord Explained
November 20, 2014 @ 09:08:31

The SitePoint PHP blog has a new tutorial posted introducing you to using ActiveRecord in the Yii2 framework to access the information in your databases. The Active Record design pattern where a single object corresponds to a record in the database (and can be manipulated as such).

The ActiveRecord class in Yii provides an object oriented interface (aka ORM) for accessing database stored data. Similar structures can be found in most modern frameworks like Laravel, CodeIgniter, Symfony and Ruby. Today, we'll go over the implementation in Yii 2.0 and I'll show you some of the more advanced features of it.

He introduces the "Model" class first, the based of the ActiveRecord handling, and its parts: attributes, validation and scenarios. He then gets into the creation of the a model instance based off of a table (SQL structure provided) around authors and articles. He includes the code showing how to create a simple model, add in relations and putting it to use. He also shows how to use the built in "find" handling to locate records. Finally he gets into some of the more advanced topics including checking if attributes are "dirty", the "arrayable" functionality and using events/behaviors/transactions on the models.

0 comments voice your opinion now!
yii2 framework activerecord tutorial introduction

Link: http://www.sitepoint.com/yii-2-0-activerecord-explained/

SitePoint PHP Blog:
Introducing OctoberCMS - a Laravel-based CMS
November 19, 2014 @ 09:22:00

On the SitePoint PHP blog there's a recent post taking a closer look at the OctoberCMS, a content management system based on the Laravel framework. In this new post they walk you through what the CMS is, the features it has to offer and help you understand (and add to) the different kinds of elements.

October CMS is a lightweight, back to basics content management system built on Laravel, and on a mission to make your web development workflow easy again. It boasts a very simple and fast learning curve, with a guarantee that you'll be off the ground and up and running in no time at all. It's scalable and extensible through the plugin system, is easily maintainable through its file-based system, and allows for the effortless creation of administrative back-end interfaces. Before we dig a bit deeper into this promising CMS, let's look at the foundation a bit.

They walk you through the install (from their GitHub repository) to get a sample site up and running. The tutorial then goes through each of the basic sections, explaining what they are and providing example code where appropriate:

  • Themes & Templates
  • Pages
  • Partials
  • Layouts
  • Content Blocks
  • the AJAX Module

They also talk about extensibility via plugins and components and link to more information for those looking for more detail.

0 comments voice your opinion now!
octobercms laravel introduction cms content management system

Link: http://www.sitepoint.com/introducing-octobercms-laravel-based-cms/


Community Events





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


version composer security library opinion release community artisanfiles laravel tool voicesoftheelephpant conference podcast introduction language framework series interview list symfony

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