View unanswered posts | View active topics It is currently Sun Jul 21, 2024 11:49 pm

Reply to topic  [ 1 post ] 
PHP 5.3.3+, Composer and Git (GitHub ?) support 
Author Message
New pChart user
New pChart user

Joined: Thu Sep 26, 2013 3:07 pm
Posts: 1
Post PHP 5.3.3+, Composer and Git (GitHub ?) support
Hi All !

I am new to this forum but former user of pChart (one or two year before).
For a new project (CLI and SaaS) I am currently in the process of selecting a Chart library with PHP 5.3+ support (and if possible, 5.4+)
As I was very happy with my previous experience with pChart, I first want to select it as a first choice. But I currently have some questions before using it.

I am currently targetting PHP 5.3.3+ (PHP 5.3.10+ bundled with Ubuntu 12.04 LTS).
As you probably now, since PHP 5.3.3 the use of __construct() as the class constructor name is highly recommanded in class (but not required if class not in a namespace), and pChart 2.1.3 (last stable version by now) seems not to be compatible with that requirement, but is fully compatible with PHP 5.3.3+ because no namespace are used by now. Probably it will be interesting to prepare future by renamings constructs before using namespaces.

Nowadays, the use of Composer ( in PHP Projects is very popular and helps developers to deal with projects dependencies and third party libraries. To be fully compatibile with Composer, the use of a composer.json file (at project root) defining project name, authors, license and autoloading mechanism (i.e. where are classes) is required. Last pChart stable/public release does not provide such support.

Indeed, Composer (and which is the official / public package catalog) is design to be used with SCM such as Git (or Subversion). pChart project seems not to provide Git repository as well, at least for users.

My project is using Composer, Git and GitHub (like lots of other open source projects) and it will be easy to integrate pChart 2.x with it if pChart provide support for Composer/PHP 5.3.3+/Git.

Are such topics already parts of pChart 2.x roadmap ? pChart 3.x ?

As a first step, I think providing a git repository (probably you own already one ?) as public, on GitHub (if possible, because very popular and well integrated) should be a good thing.
After that, people like me could be able to "fork" the GPLv3 project to provide pull request to your official repository for you to integrate improvements (like PHP 5.3.3+ support, ...)

For you to know, I plan to use pChart for PDF / HTML / DOCX / PPTX report generation using an open source tool (but commercial license will also be required for a SaaS web application on top of the open source tool).

To show you, I have created an unofficial GitHub repository ( and an unofficial Packagist/Composer package ( ... unofficial) based on the v2.1.3.

So that the following code is fully functional using composer autoloading mechanism :


require_once __DIR__ . '/vendor/autoload.php';

$data = new pData();
$picture = new pImage(700,230,$data);
$picture->setFontProperties(array("FontName"=>__DIR__ . '/vendor/ohoareau/pchart-unofficial/fonts/Forgotte.ttf',"FontSize"=>11));

Using Composer, it is easy to integrate pChart in projects using modern frameworks (Symfony 2, Zend Framework 2, ...), and will easy the creation of high level bundle provding extra feature on top of pChart to enhance integration with those framework.

What are your thoughts about that ?

Thanks in advance for your answer,

Best regards !

Olivier Hoareau
PHPPRO (french)

Thu Sep 26, 2013 3:48 pm
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: