|
1 | | -PHPProject is an open source project licensed under the terms of [LGPL version 3](COPYING.LESSER). |
| 1 | +# PHPProject |
| 2 | + |
| 3 | +[](https://packagist.org/packages/phpoffice/phpproject) |
| 4 | +[](https://travis-ci.org/PHPOffice/PHPProject) |
| 5 | +[](https://scrutinizer-ci.com/g/PHPOffice/PHPProject/) |
| 6 | +[](https://scrutinizer-ci.com/g/PHPOffice/PHPProject/) |
| 7 | +[](https://packagist.org/packages/phpoffice/phpproject) |
| 8 | +[](https://packagist.org/packages/phpoffice/phpproject) |
| 9 | + |
| 10 | + |
| 11 | +PHPProject is a library written in pure PHP that provides a set of classes to write to different project management file formats, i.e. Microsoft [MSProjectExchange](http://support.microsoft.com/kb/270139) (MPX) or OASIS [GanttProject](http://www.ganttproject.biz) (GAN). |
| 12 | +PHPProject is an open source project licensed under the terms of [LGPL version 3](https://github.com/PHPOffice/PHPProject/blob/develop/COPYING.LESSER). PHPProject is aimed to be a high quality software product by incorporating [continuous integration](https://travis-ci.org/PHPOffice/PHPProject) and [unit testing](http://phpoffice.github.io/PHPProject/coverage/develop/). You can learn more about PHPProject by reading the [Developers' Documentation](http://phpproject.readthedocs.org/) and the [API Documentation](http://phpoffice.github.io/PHPProject/docs/develop/). |
| 13 | + |
| 14 | +Read more about PHPProject: |
| 15 | + |
| 16 | +- [Features](#features) |
| 17 | +- [Requirements](#requirements) |
| 18 | +- [Installation](#installation) |
| 19 | +- [Getting started](#getting-started) |
| 20 | +- [Known issues](#known-issues) |
| 21 | +- [Contributing](#contributing) |
| 22 | +- [Developers' Documentation](http://phpproject.readthedocs.org/) |
| 23 | +- [API Documentation](http://phpoffice.github.io/PHPProject/docs/master/) |
| 24 | + |
| 25 | +### Features |
| 26 | + |
| 27 | +- Create an in-memory project management representation |
| 28 | +- Set file meta data (author, title, description, etc) |
| 29 | +- Add resources from scratch or from existing one |
| 30 | +- Add tasks from scratch or from existing one |
| 31 | +- Output to different file formats: MSProjectExchange (.mpx), GanttProject (.gan) |
| 32 | +- ... and lots of other things! |
| 33 | + |
| 34 | +### Requirements |
| 35 | + |
| 36 | +PHPProject requires the following: |
| 37 | + |
| 38 | +- PHP 5.3+ |
| 39 | +- [XML Parser extension](http://www.php.net/manual/en/xml.installation.php) |
| 40 | +- [XMLWriter extension](http://php.net/manual/en/book.xmlwriter.php) (optional, used to write DOCX and ODT) |
| 41 | + |
| 42 | +### Installation |
| 43 | + |
| 44 | +It is recommended that you install the PHPProject library [through composer](http://getcomposer.org/). To do so, add |
| 45 | +the following lines to your ``composer.json``. |
| 46 | + |
| 47 | +```json |
| 48 | +{ |
| 49 | + "require": { |
| 50 | + "phpoffice/phpproject": "dev-master" |
| 51 | + } |
| 52 | +} |
| 53 | +``` |
| 54 | + |
| 55 | +Alternatively, you can download the latest release from the [releases page](https://github.com/PHPOffice/PHPProject/releases). |
| 56 | +In this case, you will have to register the autoloader. Register autoloading is required only if you do not use composer in your project. |
| 57 | + |
| 58 | +```php |
| 59 | +require_once 'path/to/PhpPowerpoint/src/PhpProject/Autoloader.php'; |
| 60 | +\PhpOffice\PhpProject\Autoloader::register(); |
| 61 | +``` |
| 62 | + |
| 63 | +## Getting started |
| 64 | + |
| 65 | +The following is a basic usage example of the PHPProject library. |
| 66 | + |
| 67 | +```php |
| 68 | +require_once 'src/PhpProject/Autoloader.php'; |
| 69 | +\PhpOffice\PhpProject\Autoloader::register(); |
| 70 | + |
| 71 | +$objPHPProject = new PhpProject();$objPHPProject = new PhpProject(); |
| 72 | + |
| 73 | +// Create resource |
| 74 | +$objRes1 = $objPHPProject->createResource(); |
| 75 | +$objRes1->setTitle('UserBoy'); |
| 76 | + |
| 77 | +// Create a task |
| 78 | +$objTask1 = $objPHPProject->createTask(); |
| 79 | +$objTask1->setName('Start of the project'); |
| 80 | +$objTask1->setStartDate('02-01-2012'); |
| 81 | +$objTask1->setEndDate('03-01-2012'); |
| 82 | +$objTask1->setProgress(0.5); |
| 83 | +$objTask1->addResource($objRes1); |
| 84 | + |
| 85 | +$oWriterGAN = IOFactory::createWriter($objPHPPowerPoint, 'GanttProject'); |
| 86 | +$oWriterGAN->save(__DIR__ . "/sample.gan"); |
| 87 | +``` |
| 88 | + |
| 89 | +More examples are provided in the [samples folder](samples/). You can also read the [Developers' Documentation](http://phpproject.readthedocs.org/) and the [API Documentation](http://phpoffice.github.io/PHPProject/docs/master/) for more details. |
| 90 | + |
| 91 | + |
| 92 | +## Contributing |
| 93 | + |
| 94 | +We welcome everyone to contribute to PHPProject. Below are some of the things that you can do to contribute: |
| 95 | + |
| 96 | +- Read [our contributing guide](https://github.com/PHPOffice/PHPProject/blob/master/CONTRIBUTING.md) |
| 97 | +- [Fork us](https://github.com/PHPOffice/PHPProject/fork) and [request a pull](https://github.com/PHPOffice/PHPProject/pulls) to the [develop](https://github.com/PHPOffice/PHPProject/tree/develop) branch |
| 98 | +- Submit [bug reports or feature requests](https://github.com/PHPOffice/PHPProject/issues) to GitHub |
| 99 | +- Follow [@PHPOffice](https://twitter.com/PHPOffice) on Twitter |
0 commit comments