Categories ArchivesDevelopment

Zend\Feed\Reader, Guzzle and PSR-7 image

Zend\Feed is a powerful library for discovering, reading and writing RSS feeds in various formats (we're only interested in discovery and reading here). By default Zend\Feed\Reader\Reader, which is a collection of static methods to access feed reading and discovery functionality, uses a Zend\Http\Client to handle HTTP communication. Unfortunately Zend\Http\Client has some issues when being used in the wild, such as: "Incorrect handling of negative MaxAge cookie attribute" or "ChunkedBody decoding with Curl Adapter" or some others. That's why we tried to integrate Zend\Feed\Reader\Reader with a different HTTP client library that was already part of the project: Guzzle. Guzzle is a powerful HTTP client and it supports PSR-7 - the PHP-FIG standard for HTTP message interfaces. Based on this standard integration ...

Continue Reading

Sencha Ext.direct meets Symfony image

This is a follow-up on "Sencha Ext JS meets Symfony". To follow the step-by-step walkthrough you need to complete the walkthrough shown there. Sencha Ext.direct is a platform and language agnostic remote procedure call (RPC) protocol. Ext.direct allows for communication between the client side of an Ext JS application and any server platform that conforms to the specification. Because Ext.direct is handy tool for communicating between an Ext JS application and a server-side backend, and because it can easily be used from classic  (formerly known as Ext JS) and modern (formerly known as Sencha Touch) applications, we found it a perfect fit for our applications. To make this usable from a Symfony based backend we created teqneers/ext-direct-bundle and teqneers/ext-direct to provide a specification compliant PHP Ext.direct ...

Continue Reading

Sencha Ext JS meets Symfony image

Sencha Ext JS is a MVC/MVVM JavaScript framework for building cross-platform web applications targeting desktops and tablets, and smartphones. With its version 6 (released in July 2015) Sencha merged their mobile-specific Sencha Touch framework and desktop counterpart Ext JS into a single framework keeping view-related code separate on top of a unified core that provides common framework functionality. Together with Ext JS 6 comes a complete application toolchain called Sencha Cmd - a Java- and Javascript based command line tool that serves as CSS compiler (using SASS), Javascript compiler, package manager and compressor and resource manager. Even though the whole build process is highly configurable (down to custom Ant-based tasks), integrating an application built on top of Sencha Cmd ...

Continue Reading

Share your secrets 1.0 for PHP image

When I read about this the first time, I was really impressed how easy and secure it is. But what is this all about? Sometimes you may want to share a secret among others in a special way. Imagine you have five administrators in your company. They will need to have access to most of your hardware and applications somehow. So you will have to give them e.g. root access on your Unix servers so they can maintain them. Let's assume you have a special server, where your LDAP is running or your company's private keys are stored and you don't like any of your administrator to have "unlimited" access to it. What do you do? Even this server ...

Continue Reading

Sharing secrets passwords image

Concept Shamir’s Secret Sharing more than one party to recover it again. The famous crypto expert Adi Shamir created this al Rivest-Shamir-Adleman (RSA) algorithm widely used in the Internet today. Motivation If you compare this algorithm with most oftther cryptographic algorith public-key cryptosystems, where you need one key to encrypt and another one to decrypt the message. Secret Sharing is about creating many keys,has to be defined during key generation. Here are some “real-world” examples: Four-eyes principle: if you have 10 administrators, but you want them to do certain tasks only in the present of another one, you could set the threshold to 2 Tethered spies: the NSA wants to have access to all mobile devices (again), but with this algorithm they would need another ...

Continue Reading

Git Stream Wrapper for PHP 1.0.0-beta released image

On Sunday we released Git Stream Wrapper for PHP 1.0.0-beta with three interesting new features following extensive refactoring. The component is still public API compatible to the old 0.* releases but the internals have been changed drastically so custom extensions might be broken now. The first new feature allows you to register repository paths on the stream wrapper to shorten the paths required to access files in these repositories. That's especially useful if you only use one or two different repositories. <?php use TQGitStreamWrapperStreamWrapper; use TQGitRepositoryRepository; StreamWrapper::register('git', '/usr/bin/git'); StreamWrapper::getRepositoryRegistry()->addRepositories( array( 'repo1' => Repository::open('/path/to/repository/1', '/usr/bin/git', false), 'repo2' => Repository::open('/path/to/repository/2', '/usr/bin/git', false), ) ); $content1 = file_get_contents('git://repo1/file_0.txt'); $content2 = file_get_contents('git://repo2/file_0.txt'); Instead ...

Continue Reading

Spawn RabbitMQ consumers with PHP image

Using message queues like RabbitMQ is a nice and easy way to bring PHP processes into the background. Instead of running a time consuming task inside a web request, just push a message to a queue and grab the result later. Sounds easy in the first step. But when it comes to keep PHP processes running in the background to consume those messages on a queue it can get dirty. Running on a dedicated Linux machine will make life easy. But what would you do, if it is not like this. On Linux you can simply use things like supervisord to control it. But what would you do if you have to run in shared hosting (for sure the rabbit must then ...

Continue Reading

Closures are functions with state image

A closure is a programming language concept that combines a function with a reference to an environment during creation time of the function - or simply put: a function combined with some state. But we've heard something similar when people talk about objects in programming languages, haven't we? An object is state combined with functions. So are they interchangeable? Well, up to a certain degree, I'd say, yes. There are use-cases where closures and objects can be used interchangeably and we'll look into one of them. Take a simple example. We have a simple list of employees together with their salary: $list = array( array('name' => 'Blake', 'salary' => 35000), array('name' => 'Sakic', 'salary' => ...

Continue Reading

When could you drop IE8 support image

Sencha provides a new blog post about a browser survey the did lately. They asked more then 400 developers when to drop IE8 support. Their conclusion is truly disappointing. It looks like enterprise developers  have to support IE8 at least until end of 2015. Which is quite a long time. Then we still have IE9 to live with. Luckily Sencha will help us doing so. This survey was made to know, how long Ext JS has to support IE8 too. Because we are doing SaaS for some of our customers, I analyzed our server statistics within the last three month to see, what is used by our customers most. All users are in companies > 10k employees up to the ...

Continue Reading

Limits of img data URI image

data URIs (RFC 2397) are a great way to embed external content into an HTML document (or a CSS stylesheet). On the one hand they circumvent a secondary HTTP request to fetch the external content but on the other hand they also make storing full HTML documents so much easier - just one file including all the external content such as stylesheets and images. That's the theory and that has been discussed in detail already. Problematic is, again, our lovely Internet Explorer 8 - I'm not talking about IE 7 and earlier here... Microsoft somewhen decided that: Data URIs cannot be larger than 32,768 characters. A requirement that has been loosened with one IE9 beta late 2010, by the way. So far so ...

Continue Reading

This is a unique website which will require a more modern browser to work!

Please upgrade today!