News Feed
Jobs Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

ServerGrove Blog:
Symfony2 components overview Finder
March 26, 2014 @ 12:12:36

The ServerGrove blog has posted the latest in their series focusing in on the components in the Symfony2 framework. In this new post they look at the Finder component, used to locate files or directories in your project.

This is the 9th post in this series about the Symfony2 components. Today's post covers one of the most popular PHP packages: the Finder component. According to Packagist it is the 14th most used PHP package, and the 3rd Symfony2 component, only after the EventDispatcher and Console ones.

They walk you through the installation (via Composer) and show some code examples of it in use, including the output. They list out some of the options you can specify when using the component and go "under the hood" to detail the interfaces, adapters and objects that make it all work. There's also a list of other applications (outside of the Symfony2 framework) that use it as an independent package.

0 comments voice your opinion now!
symfony2 component finder tutorial

Link: http://blog.servergrove.com/2014/03/26/symfony2-components-overview-finder/

Michael Nitschinger's Blog:
Custom Finders with Lithium
June 03, 2011 @ 09:03:25

Michael Nitschinger has another post that'll interest the Lithium framework users out there - how to create custom finders to help in code reuse for database requests.

Finders assist you with often-used database queries so you don't have to write them over and over again. Out of the box, Lithium provides you with a bunch of them: all, first, count list and "magic finders like" findById or findFirstById. How these are constructed in the core is not relevant for now, but Lithium provides you with a mechanism to write your own finders easily.

He starts with a look at the bundled finder, showing how it uses a _findFilters method to create the default filter and pass it into your configuration. He covers the parameters you'll need to define and an example of making a Task to create a new one. His example sets a limit of five results on the response. He also mentions the ability to add a custom finder to your model, loaded in the _init() automatically.

0 comments voice your opinion now!
custom finder lithium tutorial database


Fabien Potencier's Blog:
Find your Files
April 22, 2010 @ 14:45:09

Fabien Potencier has a new post today about an update he's made to an aging bit of code for the Symfony framework to find files on the local filesystem - sfFinder.

I used the opendir, readdir, and closedir native PHP functions, and it did the job quite well. The PHP class was named sfFinder, and it can still be found in all symfony versions. Even if the class is bundled with symfony, I know that a few people use it for all kind of stuff, not necessarily related to symfony. But the code starts to show its age; first because I learned a lot since then about PHP, and also because there is a better way now. Enter iterators!

He shows an example of how to use Iterators to search through directories recursively (RecursiveDirectoryIterator) and locate a certain filename. He also looks at making it more OOP and including filtering to remove files from the search. He's packaged up some of this logic into a new Symfony component - the Finder component - that can be used to locate files in a path, be restricted to a depth for the search, match regular expressions file names, filter by file size and much more.

If you'd like to dig into the code, check out this page on github for this new component (PHP 5.3 only).

1 comment voice your opinion now!
find file symfony component finder iterator


Federico Cargnelutti's Blog:
Implementing Dynamic Finders and Parsing Method Expressions
March 23, 2010 @ 13:07:47

In a new post to his blog Federico Cargnelutti takes a look at features available in Ruby and Grails - dynamic finders and method expressions and introduces a PHP library that can parse them.

A dynamic finder method looks like a normal method invocation, but the method itself doesn't exist, instead, the method is generated dynamically and processed via another method at runtime. [...] A method expression is made up of the prefix such as "findBy" followed by an expression that combines one or more properties.

He includes a few examples of each, the finders and expressions, and talks about the class he's developed to handle the method expressions in PHP. It's based on a simple format defining the method, attribute, expression and operator. Code snippet examples are included for SQL statement generation and object parsing. The code for the class is included in the post.

0 comments voice your opinion now!
finder method expression dynamic tutorial


Community News:
Zipline Interactive Updates PHP Function Finder (Windows Gadget)
February 15, 2008 @ 12:59:00

Ryan from Zipline Interactive submitted an update about the latest version of their "Function Finder" they've created for Windows (and is mentioned here):

Zipline Interactive has released the second version of their free PHP Function Finder Gadget for Windows Vista. The tool can be downloaded directly from the Zipline Interactive website at: http://www.gozipline.com/23,phpfunctionfindergadget. You can also download the latest version by going to the PHP.net website sidebar page located at: http://www.php.net/sidebars.

This new version is quite a bit smaller (physically) than its predecessors and is rectangular so it fits a bit better alongside other gadgets. They also fixed a bug that was causing a blink to happen when the search was performed.

Grab this latest download here.

0 comments voice your opinion now!
zipline interactive function finder gadget windowsvista


SitePoint PHP Blog:
Wide Finder in...errr...PHP
November 01, 2007 @ 08:24:00

In a new post on the SitePoint PHP blog today, Harry Fuecks has created a "wide finder" based on a project put together by Tim Bray.

Tim set a simple, but very much real-world challenge; write an app that determines the top 10 most popular blogs from his Apache access log. It should be fast and readable, with a subtext of illustrating how "language X" copes in terms of parallel processing and utilizing "wider" (many processor) systems.

Since PHP natively doesn't support multi-threading (well), Harry opted to go with an approach using curl_multi_exec instead. There's two pieces to the puzzle - the mapper to grab the information and extract the data and the reducer that makes the calls to grab the information from the log files.

1 comment voice your opinion now!
wide finder timbray apache log popular reducer mapper wide finder timbray apache log popular reducer mapper



Community Events











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


opinion symfony2 hhvm facebook podcast release introduction application overview code unittest hack package series security composer framework install language component

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