Feed aggregator

PHP Conference Argentina

PHP Conferences - Mon, 06/05/2013 - 00:00
4-5 OCTOBER 2013, Buenos Aires, ARGENTINA This year we gathered the best of the programming world. With several talks that cover a wide range of topics related to web development, PHP Conference Argentina is a conference no programmer wishes to miss (whether or not they use PHP.)
Categories: PHP.net

What is needed to REST in Symfony2

Planet-PHP - Sun, 05/05/2013 - 22:40

I think we already have quite a nice toolchain for REST in Symfony2 with Bundles like FOSRestBundle, JMSSerializerBundle, NelmioApiDocBundle, FSCHateoasBundle and HautelookTemplatedUriBundle. What is great about these Bundles is that they are all nicely integrated with each other. But there are still some limitations which should be addressed. The following is not an exhaustive unordered list and also not detailed enough but just something to illustrate where I feel there is still work left:

1) Content type negotiation inside the Routing layer
2) Dynamic content in NelmioApiDocBundle and/or some way to integrate with JMSSerializer exclusion strategies (f.e. so that I can version my API docs together with my API)
3) Dynamic content in FSCHateoasBundle like being able to add Request data into URL patterns or being able to set URLs based on model data etc.
4) Behat Context for testing REST APIs (specifically Context for JSON/XML "assertions)
5) Integrate Behat test reports with NelmioApiDocBundle
6) Wrap up JSONP support
7) Fix open FOSRestBundle issues, especially edge cases in the Routing loader
8) Provide a simple solution to offer token based authentication including API throttling
9) Integrate with the SensioGeneratorBundle (and other RAD solutions like KnpRadBundle)
10) Better support for XML responses in NelmioApiDocBundle when using the "output" support together with JMSSerializer (right now it basically shows you can array like structure which makes sense for JSON only)
11) ..

What I would like is for us to work on creating a prioritized product backlog of all of these features and then do a kickstarter project (anyone used catincan.com yet?) to get funding for this. Ideal candidates for implementing this would imho be Adrien and William but there would be of course also others that could step up here. I imagine with budget for about 3 man months we could provide and incredible experience for the Symfony2 community. If we get 100 companies/people to donate 100 Euros each we would have a very good funding basis for this. I know bringing money into open source is tricky but there are lots of people who we know and trust to produce awesome stuff if they get some time to focus on open source. WDYT?

To put a bit of money where my mouth is .. I would donate 250 Euros for this out of my own pocket ..

Categories: Open Source, PHP Community

Community News: Packagist Latest Releases for 05.05.2013

PHPDeveloper.org - Sun, 05/05/2013 - 15:09
Recent releases from the Packagist:

Jackalope-jackrabbit 1.0.0 Beta 1 released

Planet-PHP - Sun, 05/05/2013 - 10:33

Yesterday i tagged version Beta 1 of jackalope-jackrabbit, our PHP Content Repository (PHPCR) implementation. PHPCR is an API to manage tree-structured data, modelled after the Java Content Repository JCR specification. Time to summarize what jackalope can do today. For people already familiar with Jackalope, I summarize the recent changes at the bottom.

State of Jackalope-Jackrabbit

The basic node API is implemented and working fully. You can do direct access to paths and walk the tree hierarchy and read and write data. All data types including binary streams are supported.
We do support the workspace and session write operations including cross-workspace synchronization of nodes.

Queries can be expressed in the JCR-SQL2 language as well as the query object model. Additionally, jackalope provides a fluent query builder on top of the query object model. Most features of query are supported, the exceptions being query parameters and storing a query as stored query.

Exporting the repository to the standard "system" format and also the "document" format works, as does re-importing any repository dump (including those generated by Java JCR implementations).

Node type definitions can be inspected and are used to restrict allowed data when used. Both the CND file format and the object model to define custom node types are supported.

The observation journal is a log of everything that happened in the repository since a specified timestamp. It can be filtered to just see events an application is interested in. Filtering is for example done by repository path and by type of event like adding, changing, moving or removing.

Versioning is implemented and working. You can make nodes versionable, create new versions, inspect the version history to see old versions and restore old versions. Activities and version labels however are not yet implemented.

Session scoped locks are implemented. They allow to block a node, and optionally its subtree, to synchronize operations.
We did not yet implement open scoped locks, but that should not be too hard to do.

Besides building PHP content management, Jackalope-Jackrabbit can also be used to connect PHP applications to the Java jackrabbit based systems Magnolia CMS and Adobe CQ (currently called Adobe Experience Manager)

A couple of optional PHPCR features are not (yet) implemented:

  • Permissions and capabilities: Checks whether the current user is allowed to do an operation
  • Same Name Siblings: multiple children of the same node each having the same name
  • Shareable nodes: would allow a node to have more than one parent
  • Access Control Lists (ACL), because Jackrabbit does not expose this feature over the remoting protocol jackalope uses
  • Lifecycle mmanagement
  • Retention and Hold
  • Transactions, because Jackrabbit does not expose this feature.

It is not a design decision not to support those features. We would be happy about contributions to those features, though right now we focus on stabilizing and improving the features already supported.

Changes Bootstrapping

The RepositoryFactoryInterface was defining static methods. This is not legal PHP but the interpreter accepted it. We changed them to class methods and require the factory to have a no-argument constructor. Instead of

Jackalope\RepositoryFactoryJackrabbit::getRepository()

you now need to do

$factory = new Jackalope\RepositoryFactoryJackrabbit; $factory->getRepository();

Workflows

Jackalope now supports the SessionInterface::cloneFrom method and NodeInterface::update methods. This allows to copy a node into a different namespace, modify it there and then synchronize the changes back. With this, you can build workflow concepts.

Observation

The observation journal now is now usable. We figured out how to only get the events you actually care about when using the skipTo method. You can now use jackalope-jackrabbit as a message queue.

CLI commands

You have now commands to move a node, to touch (= create) a node and properties and to list the node types present in your repository.
The CLI commands are reorganized to a logical naming schema. We grouped them by what they affect: phpcr:node:*, phpcr:workspace:* and phpcr:node-type:*. We now differentiate between workspace:purge that deletes the whole repository and node:remove that can only delete a subtree but never "/".

Truncated by Planet PHP, read more at the original (another 1251 bytes)

Categories: Open Source, PHP Community

Database .NET 8.4 released

Postgresql.org - Sun, 05/05/2013 - 02:00

Database .NET is an innovative, powerful and intuitive multiple database management tool. With it you can Browse objects, Design tables, Edit rows, Export data and run Queries with a consistent interface.

Supported Features:

  • Support for PostgreSQL 8.x/9.x
  • Browsing and Search All Objects
  • Table, Constraint and Index Editor
  • Data, Cell, Form and XML Editor
  • SQL Editor (AutoComplete/Syntax Highlighting)
  • Generating scripts: DDL, SCRIPT AS, All Objects
  • Data Visualization and Database Diagram
  • Connection Profile and Manager
  • Export to CSV/XML/TXT/XLS/XLSX/SQL/HTM/JSON
  • Print SQL statements and query results
  • Free, Portable, All-In-One, Easy to Use and Multlanguage.
  • ...and more: http://fishcodelib.com/Database.htm
Categories: PHP Community

Community News: Packagist Latest Releases for 05.04.2013

PHPDeveloper.org - Sat, 04/05/2013 - 15:08
Recent releases from the Packagist:

Development Security isn’t an Add-on

Planet-PHP - Sat, 04/05/2013 - 14:48

Thanks to O’Reilly’s “DRM Day” promotion yesterday, I picked up a copy of a book I’ve been meaning to but could justify because a) full price of the ebook is around $25 USD and b) it was written back in 2003 – almost ten years old! The book, “Secure Coding: Principles and Practice” is more of an overview of things to think about when it comes to secure development and less about specific language-related tips. What’s interesting to me is that, despite the book being 10 years old, it seems like the same challenges they were facing then, we’re still facing now.

Even the introduction reinforces something I’ve been trying to advocate in the PHP community for a while now – security is not an “add on” that you can drop in at the end of the development process. Security must be a part of the planning and architecture of your applications from the beginning. If you “go back and secure things” you’re doing it wrong. Now, this doesn’t mean you have to have some kind of security review process retrofitted into your SDLC. I know of lots of teams that have their workflow down and are cranking out the code and features like there’s no tomorrow. How does a team like this start “thinking secure” without having to add a lot of extra overhead? It’s pretty easy really – all it really takes is a shift in mindset.

When most developers I know start out on problems, they ask themselves questions to figure out how to start in on their solution. They wonder about things like the “best way to do it” or “the most efficient way” to get the job done. Their minds start filling up with object structure and SOLID principles, trying to find the best solution (and maybe even technologies) for the job. To start thinking secure, all it takes is one more question:

How can I break this?

Easy, right? Well, like anything else in development, one question always leads to at least 10 more. This one simple question sets you down the right path, though. It’s too easy to get focused on making things work and writing up unit tests that pass when everything’s good. I want to challenge you as a developer to do one thing in your next project. I want you to take a step back from the code – maybe grab a fellow developer to help – and look at the application from the outside and determine what could be exploited and where (the “attack surface“). A lot of times this is easier when you’re not neck deep in the code, so if you have doubts, find an outsider.

Here’s some related websec.io articles I hope can help get you in the right state of mind as you work to integrate secure principles into your development. There’s lots of other topics in there that devs would find useful, but this will get you started:

Let’s all help make the integration of security and development a thing of the past. Then, ten years down the line, people wil be reading books from 2013 and wonder what it was like “before”. :)

Categories: Open Source, PHP Community

PHP Unconference Europe

Planet-PHP - Sat, 04/05/2013 - 09:00
Categories: Open Source, PHP Community

Reddit.com: Zend2 vs Symfony2

PHPDeveloper.org - Fri, 03/05/2013 - 19:57

On Reddit.com there's a discussion happening comparing two popular and prominent PHP frameworks - Zend Framework 2 and Symfony 2.

For those that have used both frameworks, what one do you feel is a better overall framework? I tried ZF2 in beta and it seemed overly complicated to symfony but I don't know if its gotten better since then.

Opinions shared in the comments of the post include things like:

  • "So if you are learning for job prospects, go Zend. I love Symfony 2 though, its a joy to work with."
  • "It doesn't matter. Each has a strength and a weakness, and neither will go away. Pick one and use it, you'll be fine."
  • "I don't think there is such thing as a best framework as you should use the best tool for the job. I don't think MVC is the solution to all problems."
  • "Both are quite bloated but they have to be considering their target markets."

On the whole, the views are of the "best tool for the job" mentality - a good sign for the community and these two frameworks.

Link: http://www.reddit.com/r/PHP/comments/1dcqst/zend2_vs_symfony2

Phil Sturgeon: Testing and Contributing with Composer Packages

PHPDeveloper.org - Fri, 03/05/2013 - 18:47

Phil Sturgeon has posted a guide to his site about running tests and contributing back to packages that live in Composer.

While Composer has been around for a while now, many packages are still in their infancy (< 1.0) or sometimes are just not as feature filled as they could be. To be fair there is always more to be done. It can always do more, or do the same thing more efficiently. Whatever the case, pull requests are going to be a common thing for the PHP community to be doing to these packages and this needs to be done safely, with unit-testing. So, how do you run their test suite and add your own tests?

He includes a step-by-step guide to getting the environment set up to run the package's tests and how to add some of your own. He includes the commands to send the pull request back up to Github (on your own fork, of course) and how to use that same fork as your package resource until the main project is updated.

Link: http://philsturgeon.co.uk/blog/2013/05/testing-contributing-composer-packages

Sameer Borate: Efficiently Replicating RETS data to MySQL

PHPDeveloper.org - Fri, 03/05/2013 - 17:26

Sameer Borate has a new post to his site that shares how he converted a RETS database to MySQL with the help of a PHP library, PHPRETS.

A recent project of mine entailed replicating a RETS database on a local MySQL database server. The client had a new real-estate mobile search app in development and wanted to have a local copy of the RETS database for search queries instead of a remote RETS server. [...] Replicating RETS data rather than using the live version is slightly complex, however. In order to replicate the RETS data into your own local database, a series of processes are needed in order to make sure the data you have is both updated and in sync with the server.

He breaks it down into three main steps with some sample code for each:

  • Grabbing the complete database once
  • Keeping the data in sync
  • Ensuring the cron job is executed on regular intervals
Link: http://www.codediesel.com/data/efficiently-replicating-rets-data-to-mysql

Francesca Krihely: On the Developer Experience

PHPDeveloper.org - Fri, 03/05/2013 - 16:22

In a new post to her site Francesca Krihely starts looking at the developer experience - how developers relate to your service and product and what kinds of things you need to be doing to help engage them.

I had a great brainstorm a few weeks back with the members of the Developer Evangelists meetup on the topic of the User Journey, or as I'll call it now, the Developer Experience. The main problem we wanted to solve was how we convert new users into experts or awesoms users. In many ways, a Community Manager and/or Developer Evangelist is responsible for driving user adoption and making users successful, so this is a topic near and dear to all of our hearts. I walked away with three key things that help improve the developer experience: Great Product, Great Support and Empowerment.

This post talks about the first point - the "great product" - and notes that, if the product isn't useful and enjoyable to use, even developers won't bother with it. She also talks some about the need for quality documentation and how it can be seen as a sort of "marketing" to developers.

Work on making your product fit for an awesome developer experience. If you build it, they will come. Link: http://francescak.me/blog/2013/05/02/on-the-developer-experience

Community News: Packagist Latest Releases for 05.03.2013

PHPDeveloper.org - Fri, 03/05/2013 - 15:04
Recent releases from the Packagist:

Inviqa techPortal: Functionally Testing You Application Using Mink

PHPDeveloper.org - Thu, 02/05/2013 - 20:50

On the Inviqa TechPortal today there'a a new post from Konstantin Kudryashov showing you how to use Mink for functional testing (an extension of Behat) of you web application.

Automated testing is big news these days. There's hardly a PHP conference happening without a talk on testing automation or derivative methodologies. TDD (Test-Driven Development) and BDD (Behaviour Driven Development) are all around us. So why should you care about all this? [...] The more complex an application becomes, the harder it is to be sure that each new feature or bug fix won't break the system, and that decreases your overall confidence in your work as developer. That's exactly the reason why you need automated testing - to be confident that you're not breaking important parts of an application.

For his examples he uses a simple Silex-based application (found here on github) that just shows a main page and an "add article" page that returns a preview when submitted. He shows how to get Behat/Mink installed and how to bootstrap PHPUnit to allow you to execute your tests. Also included is a sample test that clicks the "Add Article" link, runs a few checks and fills in some data. The form is submitted and the "preview" page is checked for valid results.

Link: http://techportal.inviqa.com/2013/05/02/functionally-testing-your-application-using-mink

PHPMaster.com: Crop and Resize Images with ImageMagick

PHPDeveloper.org - Thu, 02/05/2013 - 19:14

PHPMaster.com has a new tutorial posted showing you how to crop and resize images with the help of the ImageMagick functionality that can be added to PHP (via this extension).

If your website allows users to upload photos, image cropping/resizing functionality certainly comes in handy. But users might not have access to image manipulation tools like Photoshop, so by providing a cropping/resizing feature you can allow users to upload photos from any device (e.g. tablets or phones) without them having to worry about the the final size. Furthermore, you can create different versions of the same image and also allow users to crop specific portions of uploaded picture. In this article I'll show you how to create an image cropping tool with the help of the ImageMagick PHP extension.

The post shows the use of the "cropimage" function to trim down an image from its original size and "thumbnailImage" to shrink down the image to make a thumbnail. Also included is the code (both the PHP and the HTML form) to handle file uploads and automatically create a thumbnail image. It outputs the image to the browser and asks the user to select the portion they want thumbnailed (with this jQuery plugin helping).

Link: http://phpmaster.com/crop-and-resize-images-with-imagemagick

MaltBlue.com: Use RouteMatch in Zend Framework 2 For Easy Routing

PHPDeveloper.org - Thu, 02/05/2013 - 18:14

In the latest to his site Matthew Setter takes a look at easy routing with RouteMatch in Zend Framework 2 applications. The RouteMatch component gives you better control over your routing and lets you define "match paths" for URL to Controller mappings.

Today using Zend Framework 2 RouteMatch, Router and Request objects, I show you an easy way to dynamically update the current route. It's almost painlessly simple. [...] Well, like most things in web application development, what starts out simply in the beginner often grows more complex over time. So too is my once simple route.

His "simple" route started getting a bit out of control when he added in some pagination to the page (and query for the path match). He wanted to figure out how to re-render data with the same filters but show the next page of data. He shows how to use the RouteMatch component to achieve just this. He creates a custom module with a "listViewToolbar" helper that lets you read the router, request and handle the parameters sent via the URL. The "invoke" method is called to render the toolbar in the page, complete with the new settings.

Link: http://www.maltblue.com/tutorial/use-zend-framework-2-routematch-for-dynamic-routing

SabreDAV acquired by fruux

Planet-PHP - Thu, 02/05/2013 - 17:58

Last week we have finished the talks to transfer ownership of the SabreDAV project to fruux.

I've been working at fruux as a lead-dev for some time now, and SabreDAV is really at the core of everything we do, so this was a logical and inevitable choice.

To me it's an important step. SabreDAV has been one of the very little things that have remained consistent in my life. This validates my work from the last 6 years a bit. In another way it feels a bit like I'm letting go something that's very important and personal.

However, I'll still be running the project so in reality the change for me personally is not that big :).

What's SabreDAV?

SabreDAV is an open-source project that I've started all the way 2007. It allows you to write WebDAV, CalDAV and CardDAV servers in PHP. These three technologies allow you to do file, calendar and addressbook syncing.

A few years ago steam really picked up, and it changed from the hobby project that it was back then, to something I could actually make a living off by doing consulting.

In 2012 I've took it one step further, and teamed up with fruux to build a commercial product around SabreDAV.

What will change?

Small stuff really. The GitHub urls have changed. The new project pages are:

A bigger change is that fruux will now be the official go-to place for commercial support. I feel this will strengthen the SabreDAV project, especially for the potential users that are into that sort of thing.

It also means that getting a new website is in the cards :). The current one has passed it's expiry date.

Does this mean SabreDAV will go closed-source?

No. I would never let this happen. SabreDAV will remain as open source as it has always been, and we also don't intend on making it crippleware.

The BSD license in place today is very liberal, and I feel that it's exactly this that has allowed many projects and businesses to adopt it. Taking that away would not only damage the project, it would also feel ethically wrong.

However, SabreDAV is primarily a library, suitable for integration into other systems. We're definitely looking into the possibility of offering a more complete package, such as a standalone server with solid management interfaces.

Thanks!

Thanks everyone for your continued support, pull requests and relying on SabreDAV for your projects :). It's the best reward, really.

If you're interested, also check out the announcement on the fruux blog

Categories: Open Source, PHP Community

Dougal Campbell: WordPress 10th Anniversary Blogging Project

PHPDeveloper.org - Thu, 02/05/2013 - 17:22

Dougal Campbell has a new post to his site with his own contribution to the "WordPress 10th Anniversary Blogging Project" - a remembrance of his history with the tool and where/when he first started using it.

The official 10th anniversary of the release of WordPress is May 27, 2013. It has been an amazing 10 years, during which WordPress evolved from a simple blogware to a very full-featured CMS (Content Management System), used to power some of the biggest and most popular web sites on the internet. All over the world, people are planning celebrations. As much as I like a good party, I thought this would also be a good time to celebrate WordPress by actually using WordPress - for blogging.

He talks some about when he got started with WordPress (2003) and what's happened since. He suggests that others follow suit and use the "#wp10" hashtag on Twitter to share their own posts.

Link: http://dougal.gunters.org/blog/2013/05/01/wordpress-10th-anniversary-blogging-project

Josh Adell: Serializing Data Like a PHP Session

PHPDeveloper.org - Thu, 02/05/2013 - 16:11

In this new post Josh Adell looks at working with PHP sessions and how you can manually encode data to look as if it came from the normal session handling.

If you have ever popped open a PHP session file, or stored session data in a database, you may have noticed that this serialization looks very similar to the serialize function's output, but it is not the same. Recently, I needed to serialize data so that it looked like PHP session data (don't ask why; I highly suggest not doing this if it can be avoided.) It turns out, PHP has a function that encodes data in this format: session_encode.

Unfortunately, this method doesn't take arguments - it just outputs the encoded version of the current session data. So, he came up with his own encode/decode methods that use the PHP session, extract the serialized string and return it.

Link: http://blog.everymansoftware.com/2013/05/serializing-data-like-php-session.html
Syndicate content