Feed aggregator
PHPMaster.com: Extract Objects from an Access Database with PHP, Part 2
PHPMaster.com has posted the second part of their series covering connecting PHP to a legacy Access database. In part one they introduced you to working with the data and how to extract the object. In this new part they look at specific file types and how to pull out their data.
In this second part we'll learn how to extract Acrobat PDF documents and take a brief look at a selection of image formats. The only similarity that PDF, GIF, PNG, etc., have when stored in an Access database is that they are all wrapped in an OLE container consisting of a variable length header and trailer. As we shall see, the trailer can be ignored as it was with the package discussed in Part 1. The header is more useful, but doesn't contain all the information we need.They get into the details of the headers for each type of object and include screenshots of what they look like in a hex viewer. The code for the complete class is included in the post, making it easy to drop in and get started with your transition from database object to external file.
Link: http://phpmaster.com/extract-ole-objects-from-an-access-database-using-php-2Community News: Peers Conference 2013
There's a conference coming up at the end of this month (tickets still available) that focuses on "people, not plugins and solutions, not software" - the Peers Conference.
Peers is a tech conference for web designers, PHP developers and web business owners. Love ExpressionEngine? Curious about Craft? Learning all about Laravel? Whether you're a pixel-pusher, an artisan or a maker, Peers is for you.
At Peers conference, you'll hear from a variety of voices. We've engaged some of the top people within our community to come and share their wisdom. Because running a business and keeping up with the latest trends is daunting. Who better to help than your peers?
The event is being held in Chicago on June 26th through the 28th and has lots of great speakers and sessions planned for this year. You can still get the Early Bird price of $299 USD that includes admittance into the conference, event attendance and meals.
Link: http://peersconf.comCommunity News: Packagist Latest Releases for 06.03.2013
- zizaco/confide (v0.11beta)
Confide is an authentication solution for Laravel 4
- zizaco/confide-mongo (v0.11beta)
Confide Mongo is a authentication solution for Laravel 4 that uses mongolid-laravel
- zizaco/mongolid-laravel (v0.1beta)
Easy, powerful and ultrafast MongoDB ODM for Laravel.
- yosymfony/toml (v0.1.0)
A PHP parser for TOML compatible with TOML v0.1.0
- desmondmorris/nike-php (1.0.0)
An un-official NIke API wrapper written in PHP
- ner0tic/php-instagram-api (2.0.3)
Instagram API client
- laravel/framework (v4.0.1)
The Laravel Framework.
- king23/king23 (0.1.7)
the King23 Framework
- king23/project_template (0.1.7)
the King23 Framework // project template
- razielanarki/hyperlight (v0.1.2)
Hyperlight Server-Side syntax highlighter for PHP
- sensio/framework-extra-bundle (v2.2.2)
This bundle provides a way to configure your controllers with annotations
- symfony/symfony (v2.2.2, v2.1.11)
The Symfony PHP framework
- league/oauth2-server (2.1.1)
A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.
- mauserrifle/simresults (v0.1)
Simrace result reader for PHP
- mikehaertl/localeurls (1.1.6)
localeurls is a Yii extension for automatic locale/language management through URLs.
- turnaev/mysql-workbench-schema-exporter-symfony2-bundle (v1.0.2)
MySQL Workbench Schema Exporter bundle for Symfony 2.2+
- intervention/validation (1.0.2)
Additional Validator Functions for the Laravel 4 Framework
- fpn/thetvdb (1.0.6)
API client library for TheTVDB.com
- skymeyer/vatsimphp (1.0.0-beta1)
PHP library for VATSIM.net
- tobiassjosten/thetvdb-bundle (1.0.2)
Symfony2 bundle for the TheTVDB.com API library
Community News: Latest PEAR Releases for 06.03.2013
Community News: Packagist Latest Releases for 06.02.2013
- razielanarki/hyperlight (v0.1.1, v0.1.0)
Hyperlight Server-Side syntax highlighter for PHP
- monochromegane/query-builder (1.0.1, 1.0.0)
Simple query builder
- cboden/ratchet (v0.2.6)
PHP WebSocket library
- phly/phly-restfully (2.1.1, 2.1.0, 2.0.1)
ZF2 Module providing structure for RESTful resources
- king23/king23 (0.1.6, 0.1.5)
the King23 Framework
- kriswallsmith/assetic (v1.1.1)
Asset Management for PHP
- eld/bridgevb (v1.01, v1.0)
Laravel 4 and vBulletin 4 bridge for authentication services.
- enygma/expose (1.1, 1.0, 0.2)
An intrusion detection library based on PHPIDS
- jenwachter/router-exchange (0.2)
A collection of PHP interfaces and adapters to make swapping out router library dependencies quick and easy.
- zfr/zfr-pusher (1.0.1)
PHP library for interacting with the Pusher REST API
- intervention/helper (1.0.3)
Easier handling and formating of strings and dates
- sammaye/mongoyii (1.2.65, 1.2.6)
A Yii MongoDB ORM
- sonata-project/notification-bundle (2.2.0)
Symfony SonataNotificationBundle
- klaussilveira/gitter (0.2.0)
Gitter allows you to interact in an object oriented manner with Git repositories.
- phpunit/phpunit-selenium (1.3.1)
Selenium Server integration for PHPUnit
Drupal Hackday - Writing DRUSH extentions
Today Patrick Jezek and I sat together to get a grip on one of the major problems we have when using Drupal in a continuous integration environment - module updates involving major updates on configuration settings and database content.
Problem descriptionImagine a usual Drupal installation already deployed on a live server. Imagine further that there is a demand to update at least one module of this installation without human interaction, any downtime, and data loss. The default work flow when updating configuration information would either demand human interaction and/or the complete deinstallation and reinstallation of the module which, when the hook_uninstall() correctly implemented, will cause data loss. A third option is to write a script to setup the new module after the installation process is done but this would challenge the deployment system to support some kind of a post_deployment process.
The goal of this hackday was to propose a solution which enables a development team to continuously deploy and maintain a Drupal installation without being forced to uninstall modules to do a major update. Further more there should be some kind of a mechanism making it possible to update modules without human interaction when deploying the modifications.
Solution proposalOne of the most beneficial Drupal extensions is the Drupal shell (short: drush). It provides an extensive variety of commands to maintain Drupal (e.g. managing modules, users, and basic drupal configuration). The nice thing about drush it can be handled by any shell script just calling the specific commands and processing their outcome. Extending drush was therefore the most natural thing we could think about when we were confronted by this task.
So we came up with a drush extension providing a new Drupal hook hook_vm_update().
Located in the *.install files the hook_vm_update() will be invoked by the drush extension. Further does the extension detect the existence of the custom hook and indicates this on the command line.
$drush vm-update "myCustomModule, myOtherModule"
Updating myCustomModule ... no »vm_update« hook available [warning]
Nothing to update for module »myOtherModule« [warning]
Custom scripts
In order to keep track of previous installed module versions we wrote two scripts. One does write down the currently installed version into a text file. The other one invokes drush to for modules which got changed since last deployment.
Further ideas Add version information to hook_vm_updateCurrently the update hook will always be called when the drush command is invoked and the previous installed version is smaller then the just installed one. Having only one hook implies that this hook knows which steps needed to upgrade from one version to another (including steps in between). What about a naming convention for hooks combined with version number and a logic to call them in chronological order, up to the target version (like Drupal core updates use schema update hooks).
Since the hook should not invoke actions potentially dangerous or harmful in terms of data loss et. al. this should not be much of a problem. But since we can already imagine situations where it is useful to either step through past updates or make the hook decide whether it an update is to be invoked or not one of the next steps for this drush extension will be to provide version information for an update.
Persist version information into the databaseThe versions.json file resists on the file system and could be potentially overwritten by a new installed package. An alternative could store the version information into the database (e.g. by using the Drupal configuration with variable_set() ?).
We had some fun working on a solution for this given problem. We had the chance to look deeper into drush. We learned yet some php functionality we never used before. Unfortunately the weather was not nice and we could not fire up the grate for lunch.
Last but not least thanks L//p for this opportunity!
Community News: Packagist Latest Releases for 06.01.2013
- cyberspectrum/contao-toolbox (0.5.0)
Contao ToolBox
- marcj/php-rest-service (0.1.2)
PHPRestService is a simple and fast PHP class for server side RESTful APIs.
- sammaye/mongoyii (1.2.5)
A Yii MongoDB ORM
- herrera-io/silex-pdo (1.0.0)
A simple PDO service provider.
- happydemon/arr (0.2)
A Kohana module that adds extra methods for dealing with arrays and configuration files
- mjohnson/admin (0.21.0)
A CakePHP admin plugin.
- herrera-io/wise (1.3.0)
Symfony Config for everyone else.
- sabberworm/php-css-parser (5.0.6)
Parser for CSS Files written in PHP
- sabre/vobject (3.0.0-alpha4)
The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects
- igorw/config-service-provider (v1.2.1)
A config ServiceProvider for Silex with support for php, json and yaml.
- zenstruck/content-bundle (v1.3.4)
Simple CMS for Symfony2 using Doctrine2 Class Table Inheritance
- lamina/formbundle (1.2-RC2)
Forms management for Symfony 2
- stefano/stefano-tree (1.0.1)
Library for managing tree structures
- ruler/ruler (v0.2.0)
A simple stateless production rules engine for PHP 5.3.
- stefano/stefano-db (1.0.1)
Modul for Zend Framework 2
- rodgermd/janrain-bundle (v1.0.1)
Integrates Janrain into Symfony. Fork of https://github.com/evario/JanrainBundle
- 2amigos/yii-aws (v1.0)
Amazon Web Services SDK PHP 2 Wrapper.
- codeblanche/depend (v1.0.0-RC1)
Less Configuration, More Injection
- slm/mail (v1.0.0)
Integration of various email service providers in the Zend Framework ZendMail
- turnaev/mysql-workbench-schema-exporter-symfony2-bundle (v1.0.1)
MySQL Workbench Schema Exporter bundle for Symfony 2.2+
- bento/bento (0.4.3)
Simple micro-framework
- barryvdh/laravel-vendor-cleanup (v1.1)
A vendor cleanup package, to remove tests and documentation to save space
- kbsali/redmine-api (0.4.8)
Redmine API client
- turnaev/mysql-workbench-schema-exporter (v1.0.0)
MySQL Workbench Schema Exporter
Rasmus Larsson: Building a template engine in PHP
Rasmus Larsson has a recent post to his site showing how to build a basic templating engine in PHP that uses the "__toString" to help render the result.
Possibly the most common sign of bad code is tight coupling, especially between logic and presentation. It might seem like a good idea to print out the HTML while the data is being generated, but it more often than not leads to a big incoherent mess of tangled code. [...] While PHP makes it unnecessarily easy to write shitty code it also provides a lot of ways to avoid it. I'll use this post to show you how ridiculously easy it is to create a template engine in PHP in three easy steps.He includes the sample code for a "Template" class and shows the combination of exporting variables and output buffering to return the resulting template populated with values. The "__toString" method makes it so that you can just echo out the object and get the results.
Link: http://www.rasmuslarsson.se/2013/05/a-template-engine-in-phpStoryplayer Slides From PHP London Talk
Storyplayer is DataSift’s test tool for functional and non-functional testing of software and services, built to test at the firehose scale. It sits nicely between PHPUnit for unit testing by developers, and Behat for acceptance testing by product managers.
Earlier this month, I spoke to a packed audience at the PHP London user group meetup about Storyplayer, a test tool that we’ve open-sourced here at DataSift.
Here are the slides from that talk, for everyone who hasn’t yet seen them via Twitter:
<script async class="speakerdeck-embed" data-id="bfdba98095f10130d49d4a0bed3063c9" data-ratio="1.2994923857868" src="//speakerdeck.com/assets/embed.js">
If you can’t see the embedded slides in this blog post, they’re available over on SpeakerDeck.
Right now, I’m focused on completing the online documentation (which is very much a work in progress), and preparing v1.1.0 with further improvements.
Consuming RabbitMQ messages with PHP
Publishing messages to RabbitMQ with PHP
10 Steps to properly do PHP Bug Tracking and Fixing as Fast as possible
Some of those bugs will be very serious and need to be fixed before they cause greater damages to your application data that may be too hard to recover.
Read this article to learn about a several good practices that you can apply to track bugs in production code, so you can fix them before it is too late.
Queuing with RabbitMQ and PHP
Universal Database Tools - DtSQL 2.5.1 is released (FREE)
DtSQL is a FREE universal database query and editor tools for developers and database administrators to Query, Edit, Browse, and Manage Database objects such as tables, views, indexes, procedures, functions, triggers, contraints and sequences. It can access most databases and can be used on all major operating systems.
- Supported databases : Cache, DB2, Derby, Firebird, FrontBase, H2, HSQLDB, Informix, Ingres, JDatastore, MaxDB, Mckoi, Mimer, MySQL, Oracle, PointBase, PostgreSQL, Solid, SQLite, SQL Server, SQL Anywhere, Sybase (ASE).
- Support Operation Systems : Windows, Linux and Mac OS. Database Browser Tools : browse schemas, tables, columns, primary and foreign keys, constraints, views, indexes, triggers, stored procedures, functions, sequences, and so on.
- Database Tools : create, alter, view and drop database tables, views, indexes, constraints, stored procedures, functions, triggers, sequences, and so on.
- Database Management Tools : edit database table data including binary/BLOB and CLOB data types. Filter, sort and search query result. Insert, duplicate, update, and delete database table data. Find and replace database data, preview generated SQL. Redo or undo last table data change before update is commit.
- SQL Tools : tools to edit, format and execute SQL scripts.
SQL Builder : help tools to build database select, insert, update, delete SQL scripts.
- Import Data : tools to import data from various formats such as CSV files, Excel files, and fixed-width files. Parse import data according to integer, date, time, timestamp, and boolean pattern.
- Export Data : tools to export database data (single table/multiple tables/query result) in various formats such as CSV files, Excel files, XML, HTML, SQL insert statements and fixed width files. Format export data according to applied integer, date, time, timestamp, and boolean pattern. Built in database
FREE to use.
Home: http://www.dtsql.com
My contribution to Mentoring in the PHP Community
After the awesome mentorship summit at php[tek] 2013 a little over a week ago, I decided that as part of my contributions to mentoring in the community I would put out a call:
Anyone and everyone who would like to speak at a conference, I want to review and critique your talk submissions.
As part of this, I’d like to offer an opportunity for to you bounce ideas for talks off me, to work with you on tightening up your title/abstract, and if I have time, to review slides and/or do a google hangout run through prior to you speaking.
To make this process as easy and efficient as possible:
- If you want to bounce ideas off me, you can find me on #phpmentoring on Freenode IRC, or ping me via Twitter for IM details.
- For proposal review, please put them in a gist and we can work from there — just ping me on Twitter beforehand, and then once I get back to you I’ll ask for the gist link.
- For slide review, ask on Twitter/IRC — and don’t be upset if I say no. This is a much more time consuming thing.
- For hangouts, do one of the first two things and if it’s something I’d like to see, I’ll probably suggest it
I hope in this way I can help a bunch of people in a fairly informal way, and we can bring a bunch of new blood to the speaking circuit.
Also: please don’t limit this to just PHP-related topics. I’m happy to give advice on many more things (that I feel qualified for), soft and hard topics.
Community News: Packagist Latest Releases for 05.25.2013
- mandrill/mandrill (1.0.30)
API client library for the Mandrill email as a service platform
- sabre/vobject (3.0.0-alpha3)
The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects
- pinano/datatables-bundle (1.9.4)
Symfony2 bundle for wrapping the famous dataTables jquery plugin by SpryMedia
- pinano/select2-bundle (3.4.0)
Symfony2 bundle for wrapping the famous select2 jquery plugin by @ivaynberg
- phundament/p3widgets (0.11.8)
Widget Manager
- simplon/db (1.2.3)
Simplon DB Libraries
- kr4y/profiler (1.0.2)
Profiler for Laravel 4
- zweifisch/zf (v0.2.9)
a micro php web/cli framework/router
- phundament/p3pages (0.11.8)
Page Manager
- patchwork/utf8 (v1.1.8)
UTF-8 strings handling for PHP 5.3: portable, performant and extended
- piwik/piwik (1.12-b19)
Open Source Real Time Web Analytics Platform
- gocardless/gocardless (0.4.1)
The PHP client library for the GoCardless API
- hostnet/form-twig-bridge (0.5)
Allows usage of the Symfony 2 form framework, rendered in twig, without using all of Symfony 2!
- simplon/helper (0.6.0, 0.5.11)
General helpers which come-in helpful.
- gabriel403/g403-session-db (1.0.2)
Extension to ZF2 to allow sessions to be stored in the database.
- willdurand/expose-translation-bundle (0.3.0)
A pretty nice way to expose your translation messages to your JavaScript.
- vojtech-dobes/nette-forms-gpspicker (v1.0.7)
Google Maps based picker of coordinates for Nette Framework.
- mjohnson/uploader (4.0.15)
File uploader and validation plugin for CakePHP.
PHP Subconference at FrOSCon 2013
XPath expert needed
In the PHPCR implementation using Doctrine DBAL we support search queries by converting the SQL2/QOM statements into XPath queries that we run on the XML stored in an RDBMS. Sounds insane, yes .. but it works pretty well .. obviously will not scale very well .. but it works for smaller data sets and there will be ways to improve performance later. In terms of functionality we have everything working quite well including JOIN support that was added recently.
However we are stuck with multivalue queries. What makes it particularly tricky is that we do not know which properties are multivalue and which are not as illustrated by these tests.
As you can see in the test we have a multivalue property "tags" and in the SQL2 statement we want to test if that multivalue property contains both "foo" and "bar". However inside the query engine we do not know that this property is multivalued or not.
The relevant code is in QOMWalker:: sqlXpathValueExists() and QOMWalker:: sqlXpathExtractValue(). As you can see it currently only looks at "sv:value[1]".
You can find some more information here:
https://github.com/jackalope/jackalope-doctrine-dbal/issues/88
Adam Culp: PHP usage statistics
Adam Culp has posted his own look at some of the PHP usage statistics that are out there and how they can be interpreted.
Every once in awhile I stumble across someone who is trying to find their way and decide what they will do in their career. As the organizer of a PHP user group I see many new developers passing through. Of course I always speak of how strong PHP is in the web markets, and encourage new web developers to pursue PHP as a tool in their box of goodies. Because as a web developer it would be a career limiting move to not have any knowledge of PHP. Here is why...He shares a few different sources including w3tech's overall and PHP-specific information (PHP5 specific here) and the current results of the TIOBE index showing language popularity. For each he talks some about what the results mean (and don't mean) and how, if you're a "professional developer" you should, at the least, know PHP - the most dominant language in the web space.
Link: http://www.geekyboy.com/archives/672Michelangelo van Dam: UA Testing with Selenium and PHPUnit
In this new post to his site Michaelangelo van Dam looks at user acceptance testing with PHPUnit and Selenium.
Last week I spoke at php[tek] 2013 where I explained to people how to get started with Selenium IDE to record user interaction with the web interface, convert them to PHPUnit testcases and automatically execute them on multiple browsers on multiple platforms. The feedback I got was awesome, you're all a great crowd! But on twitter I also received a bunch of questions regarding how to set up multiple platforms and why I used Windows in my presentation to deploy to. So today I deceided it was time to write a full article on this subject.He introduces Selenium and what kinds of things it can be used to test. He also defines "user acceptance testing" and talks about why they're an important part of the testing ecosystem. He then walks you through the process of getting the testing environment set up, creating a few tests and how to convert them over to PHPUnit tests (using a built-in tool). Screencasts show you each step of the way. He includes a little tweaking you'll need to do to to the test code to get it working with your own Selenium server
Link: http://www.dragonbe.com/2013/05/ua-testing-with-selenium-and-phpunit.html