Skip to content

Feed aggregator

Daily Dose - Clojure 1.2 Moves Quickly Towards GA

Project committer Stuart Halloway just announced the launch of the first release candidate for Clojure 1.2.  Although there have been few changes between this release and the last, the news is significant because the first beta of Clojure 1.2 went live only two weeks ago.  They only had one beta release and they may only have one release candidate as well.  Expect the GA very soon.JBoss...
Categories: Communities

NETTUTS.com: How to Use CakePHP's Access Control Lists

PHPDeveloper.org - Fri, 07/30/2010 - 21:13

On NETTUTS.com today there's a new detailed tutorial on how to use the access control list functionality that comes with the CakePHP framework.

If you're building a CMS, you'll probably need different user roles'"superusers, admins, users - with different permission levels. Too complicated to code? Enter CakePHP's ACL (Access Control Lists). With the right setup, you'll be checking user permissions with just one line.

They talk about what "access control lists" are but shows you an example of one including the database tables and the full scripts for the Users controller, a model to hook into the database and the view for output to the user. They include methods for denying access, checking permissions, and modifying a user's permissions.

Categories: Blogs

Developer.com: 10 Experimental PHP Projects Pushing the Envelope

PHPDeveloper.org - Fri, 07/30/2010 - 20:41

On Developer.com today there's a new post listing ten experimental projects that are "pushing the envelope" in the PHP languages:

As the saying goes, "Just because you can do something doesn't mean you should." But in the world of programming, stretching boundaries is just part of the fun. The PHP community has never been one to shy away from bending their favorite language more ways than a shopping mall pretzel, and as the ten wild projects introduced in this article indicate, the fervor for experimentation is as strong as ever!

Here's their list of the ten projects they see as trying to stretch the language to its limits:

Categories: Blogs

Ask About PHP: Codeigniter: Creating dynamic graphs using JQuery and FusionCharts

PHPDeveloper.org - Fri, 07/30/2010 - 19:11

On the Ask About PHP blog today there's a new tutorial about integrating the OpenFlashCharts tool into a CodeIgniter application to display data.

I recently upgraded some of my Codeigniter applications that used OpenFlashCharts to using FusionCharts Free, and at the same time incorporated some javascript to allow me to change the graphs dynamically at the client-side. This has greatly improved the usability of my charts and graphs that I pump out. As such, I thought I would share how I did this and hopefully someone will find it useful as well.

He walks you through the steps needed to install - putting all of the files in the right places, creating a controller to use the scripts and a view to output the finished chart. A demo of the end result is also included.

Categories: Blogs

Zend Framework 1.10.7 Released

Zend Developer Zone - Fri, 07/30/2010 - 18:52
The Zend Framework team announces the immediate availability of Zend Framework 1.10.7, our seventh maintenance release in the 1.10 series. This release includes around 60 bug fixes. For those uses of Zend_Service_Twitter , please ensure you upgrade to 1.10.6 or 1.10.7 ASAP. These releases introduce a change in the Zend_Service_TWitter API that enforces the use of OAuth by default when using methods that require authentication. The change was introduced to help prepare Zend Framework users for the Twitter OAuthcalypse in mid-August. (If you cannot upgrade, there are other ways to integrate Zend_Oauth with Zend_Service_Twitter .)
Categories: Communities

Doctrine MongoDB ODM 1.0.0ALPHA2 Released

Doctrine Blog - Fri, 07/30/2010 - 18:12
Today I am happy to bring you the second alpha release of the brand new Doctrine MongoDB Object Docu[...]
Categories: Open Source

Chris Hartjes' Blog: Snakes and Elephants Playing Nice Together: PHPUnit and py.test with Hudson

PHPDeveloper.org - Fri, 07/30/2010 - 18:03

In the latest post to his blog Chris Hartjes talks about how he got python and PHP working together as a part of his testing with Hudson.

These days, it's becoming increasingly harder to find web applications that are homogenous in terms of the tools they use to Get Things Done. [...] Loosely coupled components, passing messages to each other, is great architecture to try and build if you have both the skills and patience to make it work.

His technique combines the testing of PHPUnit for PHP with the Py.test functionality for Python with the continuous integration tool Hudson to run them both as a part of the same build process.

Categories: Blogs

Drupal 7 and Drupal Gardens are on the Way

The new hosted Drupal service called Drupal Gardens, was recently given beta status.  This announcement means that anyone can now go to the site and start using the beta for free.  The leaders of the Drupal community have also announced that the next version of Drupal should have its beta release sometime in August.  However, they're going to need plenty of help from the community to fix the...
Categories: Communities

Symfony Project Blog: Translations (Documentation)

PHPDeveloper.org - Fri, 07/30/2010 - 16:19

Have a flair for translation and want to help out an open source project in need? Consider helping the Symfony Project with their translation efforts for their manual.

The Symfony2 documentation is written in English and many people are involved in the translation process. First, become familiar with the markup language used by the documentation. Then, subscribe to the Symfony docs mailing-list, as collaboration happens there. Finally, find the master repository for the language you want to contribute for.

Full details on what they need help on and where/how to get involved are on the documentation page of the new Symfony 2 website.

Categories: Blogs

PHPBuilder.com: The PHP Content Management/Framework Upgrades in ExpressionEngine 2

PHPDeveloper.org - Fri, 07/30/2010 - 14:31

On PHPBuilder.com there's a recent article detailing some of the updates in the latest version of the ExpressionEngine product (CMS) from EllisLab.

This popular Web development solution recently took another major step forward with the July 12 release of ExpressionEngine 2.1, the product's first major upgrade in several years. Version 2 sports a number of new features and significant improvements over its predecessor, many of which I'll highlight in this article.

He touches on a few of the updates in this latest revision:

  • CodeIgniter Integration
  • Redesigned Control Panel
  • Improved Template Management
  • Integrated File Manager and Image Editor
  • Accessories (a sort of add-on feature)

You can find out more about ExpressionEngine on its site.

Categories: Blogs

Daily Dose - Check Out the EJB on That JBoss AS

The fourth JBoss Application Server 6.0 milestone was released this week.  It is the first to include support for EJB 3.1 Timer Service and EJB 3.1 Asynchronous invocations. M4 also comes with a different default JBossWS stack that uses Apache CXF.  With this support, users will immediately get better performance for WS-*.Objectivity Ships its New GraphDB
Categories: Communities

Snakes and Elephants Playing Nice Together: PHPUnit and py.test with Hudson

@TheKeyboard - Chris Hartjes - Thu, 07/29/2010 - 21:05

These days, it's becoming increasingly harder to find web applications that are homogenous in terms of the tools they use to Get Things Done. The ability to build the web front-end of your site using PHP but a critical part that requires asynchronous processing using Node.js is something that is both exciting and, well, practical. Loosely coupled components, passing messages to each other, is great architecture to try and build if you have both the skills and patience to make it work.

For a project at work, I am using PHP (specifically Zend Framework) for the front-end but are using Python scripts run as a cron-job (and also on-demand when statistical corrections occur) to collect raw stats for a variety of sports, and then generate fantasy point totals for the games we run. I'm already using PHPUnit for tests of the front end, and I decided to to use py.test to test my Python scripts.

Setting up tests in Python was pretty simple. Here's one of my test scripts:

PLAIN TEXT PYTHON:
  1. import py
  2. import baseball_scoring
  3.  
  4. def test_batter_empty_data_set():
  5.     expected_points = 0
  6.     test_data = dict()
  7.     test_points = baseball_scoring.batter_points(test_data)
  8.     assert expected_points == test_points
  9.  
  10. def test_batter_simple():
  11.     test_data = {
  12.         'hits': 4,
  13.         'doubles': 1,
  14.         'triples': 1,
  15.         'home_runs': 1,
  16.         'runs_scored': 1,
  17.         'rbi': 1,
  18.         'stolen_bases': 1,
  19.         'league': 'bluejays2010'
  20.     }
  21.     expected_points = 11
  22.     test_points = baseball_scoring.batter_points(test_data)
  23.     assert expected_points == test_points
  24.  
  25. def test_pitcher_empty_data_set():
  26.     expected_points = 0
  27.     test_data = dict()
  28.     test_points = baseball_scoring.pitcher_points(test_data)
  29.     assert expected_points == test_points
  30.  
  31. def test_pitcher_simple():
  32.     test_data = {
  33.         'wins': 1,
  34.         'losses': 0,
  35.         'saves': 0,
  36.         'strikeouts': 7,
  37.         'complete_games': 1,
  38.         'shutouts': 1,
  39.         'league': 'bluejays2010'
  40.     }
  41.     expected_points = 25
  42.     test_points = baseball_scoring.pitcher_points(test_data)
  43.     assert expected_points == test_points

Very similar to tests with PHPUnit, right? So now that I had both PHPUnit tests and py.tests tests (hrm, is there are better way to say that?) to run, I had to figure out how to automatically run them. More specifically, how to get our installation of Hudson to run them.

Getting PHPUnit to play nice with Hudson was relatively easy. I installed the NUnit plugin for Hudson, made sure I installed phpunit, and then I added it's use to my build scripts. However, the strength of Hudson is that with the use of another plugin I could read reports of all those tests. So when things failed, I would not have to look at the console output to figure things out. There's a place in the Hudson config where you can configure this:
PHPUnit configuration in Hudson

Now, I figured that the same thing could be done with py.test. It had an option so that at run-time you could tell it where to put JUnit-compatible test result files. After a little tinkering, I got it to work. First step was adding execution of it to my build script. Here is the latest-and-greatest version of that script:

mkdir /var/www/games-hudson/${BUILD_ID}
cd ${WORKSPACE}/games
/usr/local/zend/bin/php doctrine-cli migrate
cd ${WORKSPACE}/games/tests
/usr/local/zend/bin/phpunit --log-junit=${WORKSPACE}/build/logs/phpunit-results.xml
cd ${WORKSPACE}/games/scripts
/usr/bin/py.test --junitxml=${WORKSPACE}/build/logs/pytest-xmlrunner.xml
cp -R /var/lib/hudson/jobs/${JOB_NAME}/workspace/games/* /var/www/games-hudson/${BUILD_ID}
chmod 777 /var/www/games-hudson/${BUILD_ID}/tmp
rm -rf /var/www/games-hudson/current
ln -sf /var/www/games-hudson/${BUILD_ID} /var/www/games-hudson/current

Next, I then told Huson where it could find the JUnit-compatible files generated by py.test:

Telling Hudson where to find the py.test output

So there you have it. Now, when I do a commit and trigger a Hudson build, both my PHPUnit and Python tests get run. And there is output to check, so I don't have to dig through console output to figure things out.
PHPUnit

Categories: Blogs

Focus on One Platform, Contribute to Open Source, and Unit Test

It's easy for a programmer to get excited about the plethora of languages that developers have now to build all sorts of applications, but Andrew Theken says the best advice he can give to most programmers is to focus on one language platform and learn it really well.  Then if you're ready to move on after awhile, you can shift your focus completely to a new platform.  Theken also thinks its...
Categories: Communities

symfony 2 documentation team looking for translators

Zend Developer Zone - Thu, 07/29/2010 - 15:04
As tweeted by Fabien Potencier, symfony2 now has a “translations” page on their site. If you read and write English and another language, they want you!
Categories: Communities

Practical PHP Patterns: Two Step View

The Two Step View pattern, as its own name suggests, proposes a mechanism composed of two steps for generating an HTML page:first, a logical representation of the page is produced, as a map (key => value) of the different elements of the page.then, the physical representation is rendered, by juggling around the single elements to compose the final HTML.The first step is usually related to...
Categories: Communities

Daily Dose - Google Plans Licensing Server to Protect Android Apps

By introducing a central licensing server on the Android Marketplace, Google hopes to provide an effective method for protecting Android apps that can currently be copied pretty easily.  The licensing service works with almost every version of Android, all the way back to 1.5.  You can read their documentation to learn how to license your applications.A Brand New "Day" for Adobe
Categories: Communities

Digg is Using Continuous Deployment. To Deploy to Production.

I recently stumbled across an amazing article. I've been using continuous integration for years, and I've used continuous deployment for a long time, but I've never tried this trick. The clever developers working on the very popular Digg.com site are using a continuous deployment system to push out new code to one of their sites. Article Type:  ...
Categories: Communities

Zend Technologies Launches Unlimited Subscription Model for Businesses Using PHP; Signs Major Enterprise Customers in U.S., Europe

Zend Press Releases - Thu, 07/29/2010 - 01:00
Zend Technologies Launches Unlimited Subscription Model for Businesses Using PHP; Signs Major Enterprise Customers in U.S., Europe
Categories: Companies