Entries tagged as phpRelated tags ant arbit bug fix continuous integration cruisecontrol git github lint phpmd phpundercontrol phpunit release announcement sebastian marek book ezcomponents phpugdo cli npath complexity php5 php_depend pmd software metrics static code analysis tokenizer changes company consulting quality support training checkstyle cyclomatic complexity design quality php_codesniffer quality assurance conference hamburg unconference apache software foundation kore qafoo toby zeta components css customization dashboard java server pages layout phpdoc testing tutorial crazy customer usability torii portal overview pyramid software architecture software design dortmund phpbbq talks elephpant ext/filter phpt unit test fabien potencier pirum fun dbus derick logger optimization performance static_reflection zce zend certified engineer annotations cbo rule set phpug cologne thinkpad sylvester 2007 elger mayflower php_codebrowser thorsten class interface size coupling between objects xml xpath article ipc karlsruhe php-magazin tools xslThursday, April 29. 2010Goodbye CologneAs many of you may already have noticed, there will be a big change in my career as a professional software engineer and architect this summer. Together with Kore and Toby I am in the process of founding a company. The focus of this company will be on services all around the whole quality life cycle in PHP projects. Under the hood of our company we will also offer support, trainings and consulting for several quality assurance tools, like pdepend, phpmd and phpUnderControl. For you, this opens a great opportunity. You can use the tools and the documentation, as well as participate in the community, as usual. But from now on you can also purchase professional support, if you get stuck or need general assitance. And when you miss a feature or need an individual extension for one of these tools, don't hesitate to contact us. I am really excited what cool things will happen in the next couple of years and I am looking forward to cowork with professionals like Toby and Kore. To finalize the little marketing for the company and its services
Posted by Manuel Pichler
in php, php_depend, phpmd, phpugdo, phpundercontrol, planet-php
at
13:20
| Comments (3)
| Trackbacks (0)
Defined tags for this entry: changes, company, consulting, php, phpmd, phpundercontrol, php_depend, quality, support, training
Tuesday, February 23. 2010PHP_Depend-0.9.10 releasedI have just released the bug fix version 0.9.10 of PHP_Depend. This release contains several bug fixes and improvements for PHP_Depend.
As always, you can get the latest PHP_Depend version from its PEAR channel: pear.pdepend.org: mapi@arwen ~ $ pear channel-discover pear.pdepend.org mapi@arwen ~ $ pear install pdepend/PHP_Depend-beta Or you can fetch the sources from the subversion reposition: mapi@arwen ~ $ svn co http://svn.pdepend.org/branches/0.9.0/ And additionally you can find a repository mirror on github: mapi@arwen ~ $ git clone git://github.com/manuelpichler/pdepend.git
Posted by Manuel Pichler
in php, php_depend, phpugdo, planet-php, projects
at
20:36
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: php, php5, php_depend, quality assurance, release announcement, software metrics, static code analysis
Sunday, November 29. 2009First release of the staticReflection component.Today I have released the first version of the staticReflection component. This component parses the source files of a project to provide reflection information identical to that provided by PHP's build in API, without loading the class declaration into the PHP runtime context. Due to the API compatibility the staticReflection component can simply be used as a drop-in replacement for the reflection extension. A few weeks ago I started just another script that utilized the tokenizer extension to extract some information from source code files. At that point I thought that the time had come to realize a project that was on my todo for a very long time. And here is the result of the first iteration, a userland reflection implementation that is api compatible with PHP's internal reflection extension. Beside the source parser and the reflection ast this component provides a unified interface to both reflection versions, which makes it easy to switch between different implementations. As a first use case for this component I have choosen autoload files, as they are used by the eZ Components. The generation of those files is really easy, simply parse a directory with source files and dump the result into a file.
<?php
use org\pdepend\reflection\Autoloader;
use org\pdepend\reflection\ReflectionSession;
// Include the bundled autoloader
include_once 'staticReflection/Autoloader.php';
// Register the autoload function
spl_autoload_register( array( new Autoloader(), 'autoload' ) );
// Create a new session
$session = new ReflectionSession();
// Create a directory query
$query = $session->createDirectoryQuery( );
$autoload = array();
foreach ( $query->find( __DIR__ . '/../../source/' ) as $class )
{
$autoload[$class->getName()] = $class->getFileName();
}
var_export( $autoload );
You can also use the static reflection implementation to analyze different versions of the same class in the same process, which is not possible with the build-in reflection API, because you cannot load multiple classes with the same name into the current runtime context. Beside parsing of a given directory or file the staticReflection component also supports direct access to a concrete class or interface through the name. Therefor it uses so called source resolvers, that perform a mapping between class names and the associated source files. The current release has two build-in resolvers, one using autoload arrays as they are used by the eZ Components and the other one uses the PEAR naming conventions and the configured include_paths to determine the source file for a given class name. The following example illustrates the usage of the PEAR source resolver.
<?php
use org\pdepend\reflection\Autoloader;
use org\pdepend\reflection\ReflectionSession;
use org\pdepend\reflection\factories\StaticReflectionClassFactory;
use org\pdepend\reflection\resolvers\PearNamingResolver;
include_once 'staticReflection/Autoloader.php';
spl_autoload_register( array( new Autoloader(), 'autoload' ) );
$session = ReflectionSession::createStaticSession(
new PearNamingResolver()
);
$class = $session->getClass( 'PEAR_Frontend' );
echo '- ', $class->getName(), PHP_EOL,
' ', $class->getFileName(), PHP_EOL;
This concept makes the component extremly flexible, because you can write your own source resolver that fulfills the requirements for your application.
Beside the source resolver concept the ReflectionSession can also be configured with a custom stack of ReflectionClassFactory objects that are used to retrieve a reflection class instance for a given class/interface name. To minimize the configuration overhead for common use cases the
But you can always build your own session configuration with a custom factory stack, by calling the <?php use org\pdepend\reflection\Autoloader; use org\pdepend\reflection\ReflectionSession; include_once 'staticReflection/Autoloader.php'; spl_autoload_register( array( new Autoloader(), 'autoload' ) ); $session = new ReflectionSession(); $session->addClassFactory( new MyFooFactory() ); $session->addClassFactory( new MyBarFactory() );
So how can you use this cool component in your application? This is really simple, just replace all <?php // ... // Previous instantiation // $ref = new ReflectionClass( 'Foo_Bar_Baz' ); // New cool solution $ref = ReflectionSessionInstance::get()->getClass( 'Foo_Bar_Baz' ); And add the following code to your bootstrap file:
<?php
// ...
ReflectionSessionInstance::set(
ReflectionSession::createInternalSession()
);
Finally some words to the requirements and the installation of this component. This component requires PHP in a version greater or equal 5.3.0. For installation you can use PHP_Depend's PEAR channel: mapi@arwen ~ $ pear channel-discover pear.pdepend.org mapi@arwen ~ $ pear install pdepend/staticReflection-alpha or you can download the latest version from the staticReflection svn respository:
mapi@arwen ~ $ svn co http://svn.reflection.pdepend.org/trunk \
staticReflection
Feel free to test this component and file bug-reports and/or feature-requests in the project issue tracker.
Posted by Manuel Pichler
in php, phpugdo, planet-php, projects, staticReflection
at
21:45
| Comments (2)
| Trackbacks (0)
Saturday, November 28. 2009PHP_Depend PEAR Channel switched to Pirum
Today Fabien Potencier announced the first relase of the PEAR Channel server Pirum. The great benefit of this Channel server is that it provides a simple shell script to publish new PEAR package releases, a feature that I missed in the previously used Chiara PEAR Server. Pirum will make it really easy to publish new package versions through a simple build script
The setup was quick done, following the instructions on the pirum website, and importing the existing package files worked like a charm. The only problem I encountered was that both channel server implementations use a different directory structure. Pirum stores all the XML descriptors under a directory named /rest, while my Chiara Server installation has used /Chiara_PEAR_Server_REST, so that a first call to manu@arwen ~ $ pear upgrade Error getting channel info from pear.pdepend.org: \ File http://pear.pdepend.org:80/Chiara_PEAR_Server_REST/p/packages.xml \ not valid (received: HTTP/1.1 404 Not Found) But a simple 301 redirect makes this software transition transparent for the PHP_Depend users. So when you will also switch to Pirum you should keep this in mind and test your channel server with an existing/configured local pear installation. Finally, thanks to Fabien for this nitty-gritty tool, which will speed up the deployment process of PEAR packages, at least for me.
Posted by Manuel Pichler
in php, php_depend, phpugdo, planet-php
at
14:00
| Comments (3)
| Trackbacks (0)
Wednesday, September 16. 2009My Slides from the PHP Unconference Hamburg 2009
Ok, it's day three after the famous PHP-Unconference-Hamburg and I still haven't found the time to write a review So lets start with the slides (german) from my talk Softwaremetriken verstehen und nutzen. Friday, August 7. 2009PHP_Depend-0.9.7 Bugfix releaseThe NPath complexity calculation was broken in PHP_Depend 0.9.6. This bug was fixed in PHP_Depend 0.9.7.
Posted by Manuel Pichler
in php, php_depend, phpugdo, projects
at
23:24
| Comments (0)
| Trackbacks (0)
Thursday, July 23. 2009Why I love PHPWhile working on PHP_Depend's parser I realized one major reason Why I love PHP, it's the flexibility of language. Even if you think you now know all ways to solve a problem, there is always one more way to solve it.
But to be serious, don't be worried, if you don't get it.
Posted by Manuel Pichler
in fun, php, php_depend, phpugdo, planet-php
at
19:22
| Comments (17)
| Trackbacks (0)
Friday, June 19. 2009PHP BBQ DortmundNow after a few beers and some grilled stuff I have the opportunity to hear the talk of Benjamin Eberlei on "Framework Quality" which contains some really nice details on that topic I have ignored or not thought about. I am looking forward to a nice evening and drinks, talks, hacking and many informative discussions with Ulf from MySQL, Bastian and Thomas from Papaya, Tobias and Kore from eZ Systems and many others. Friday, December 12. 2008Discover the diversityAre you also tired of all those monotonous and boring source code you read or write every day? No new challenges, always the same constructs and expression, must that really be so?
Fortunately do you use a programming language that comes with a wide range of opportunities to solve identical tasks in various ways. And here is a simple tip how you can bring variety in your source code with a single expression. Just use the whole range of valid
You should also vary the embedded expression which increases the number of possible solutions
In this sense, a lot of fun and a nice weekend... Friday, November 21. 2008Arrived at home :-)
Yesterday the ElePHPant pride arrived and now the kingpin has ten brothers and sisters Wednesday, August 20. 2008Things go onEven if there is not much noise around phpUnderControl and PHP_Depend at the moment, the development of both projects still goes on. Due to the fact that there are some personal movements in these days I have modified my priorities and everything evolves slower, but I plan to spend more time on these projects, at least from the last quarter of this year. To put your minds on rest, the next release of phpUnderControl is nearly finished, so stay tuned. Greetings Manuel
Posted by Manuel Pichler
in php, php_depend, phpugdo, phpundercontrol, projects
at
21:26
| Comment (1)
| Trackbacks (0)
Monday, July 21. 2008New PHP_Depend release 0.8.0beta4This should be the final beta release for PHP_Depend 0.8.0. Beside some minor bugfixes, it contains a last API change for the log sub component. This change removes constraints to the ctor signature of a logger implementation, which is now part of a separate interface. The following list shows all changes in this version. A detailed description of all issues can be found in the PHP_Depend issue tracker!
As always you can use PHP_Depend's pear channel or its svn repository, to check out this new version. And feel free to discuss and follow the PHP_Depend development on its dedicated mailing list.
Posted by Manuel Pichler
in php, php_depend, phpugdo, phpundercontrol, projects
at
20:47
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: design quality, php, php_depend, quality assurance, release announcement, software metrics
Wednesday, June 18. 2008PHP_Depend-0.8.0beta1 releasedThis new release of PHP_Depend took some time to be finished. This is because the initial idea of a simple adaption of JDepend evolved (supported thru this blog-post by Sebastian), and so PHP_Depend has become a complete software metric application. Many new features and enhancements have found their way into this version. One of the key features is the pluggable architecture for custom Loggers and Metric-Analyzers. This opens the possibility to hook own Logger- and Analyzer-implementations into the execution chain of PHP_Depend. Beside these architectural changes this PHP_Depend version is shipped with a large set of implemented software metrics. ClassLevel (Class)
CodeRank (Class, Package)An adaption of google's PageRank algorithm for classes and packages.
Coupling (Project)
Cyclomatic Complexity (Project, Method, Function)
Dependency (Package)For details see the following entry.
Hierarchy (Project)
Inheritance (Project)
NodeCount (Project, Package, Class, Interface)
NodeLOC (Project, Package, Class, Interface, Method, Function)
Due to the fact that PHP is a loosely typed programming language, PHP_Depend can only approximate some values. But the measured results can be improved with a good and complete source code documentation, because PHP_Depend takes advantage of different doc comment annotations ( Beside all these metrics, PHP_Depend also provides a new chart type, the "Overview Pyramid". The Overview Pyramid can be a handy tool to analyze legacy code. If you have read the book Object-Oriented Metrics in Practice you should know howto interpret the Overview Pyramid, all others have to wait for a detailed description. ![]() PHP_Depend Overview Pyramid for PHP_Depend This new version can be installed with the PEAR-Installer. Just discover the pear.xplib.de channel and install the latest PHP_Depend release. After PHP_Depend has been installed successfully, the new command line tool pdepend should exist.
mapi@arwen ~ $ pear channel-discover pear.xplib.de
mapi@arwen ~ $ pear install xplib/PHP_Depend-beta
mapi@arwen ~ $ pdepend --help
PHP_Depend 0.8.0beta1 by Manuel Pichler
Usage: pdepend [options] [logger] <dir[,dir[,...]]>
--jdepend-chart=<file> Generates a diagram of the analyzed packages.
--jdepend-xml=<file> Generates the package dependency log.
--overview-pyramid=<file> Generates a chart with an Overview Pyramid for the
analyzed project.
--summary-xml=<file> Generates a xml log with all metrics.
--coderank-mode=<*[,...]> Used CodeRank strategies. Comma separated list of
'inheritance'(default), 'property' and 'method'.
--suffix=<ext[,...]> List of valid PHP file extensions.
--ignore=<dir[,...]> List of exclude directories.
--exclude=<pkg[,...]> List of exclude packages.
--without-annotations Do not parse doc comment annotations.
--help Print this help text.
--version Print the current PHP_Depend version.
There is also a Subversion repository at http://svn.pdepend.org/, where the latest development version can be found. Please test this beta release and file bug-reports and feature-requests in the PHP_Depend bug tracker.
Posted by Manuel Pichler
in php, php_depend, phpugdo, planet-php, projects
at
16:39
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: php, php_depend, quality assurance, release announcement, software architecture, software metrics
Monday, April 14. 2008Yeah, I got itTuesday, March 18. 2008Integrate php lint syntax checks in your build processHere is a small code snippet that can be used to integrate php's internal lint syntax check into your build process. The ant task apply behaves like the exec task, but it accepts a nested fileset element. This allows to process a set of input files thru a single command. <?xml version="1.0" encoding="UTF-8"?> <project name="phpUnderControl" basedir="." default="build"> ... <target name="checkphp"> <apply executable="php" failonerror="true"> <arg value="-l" /> <fileset dir="source/src"> <include name="**/*.php" /> </fileset> </apply> </target> <target name="build" depends="checkphp,php-codesniffer,phpdoc,phpunit" /> ... </project> This can also be used as an addition in your phpunit target or any other command which executes code during the build-process, when the command would quit due to a syntax error.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, projects
at
21:05
| Comments (4)
| Trackbacks (0)
(Page 1 of 2, totaling 25 entries)
» next page
|
ProjectsFurther stuffCategories |


