Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML Writer error #126

Closed
niklas-agethen opened this issue Jul 21, 2015 · 11 comments
Closed

XML Writer error #126

niklas-agethen opened this issue Jul 21, 2015 · 11 comments
Assignees
Milestone

Comments

@niklas-agethen
Copy link

When saving the generated PowerPoint-file, the following error occurs:

PHP Fatal error: Class 'PhpOffice\Common\XMLWriter' not found in ...\src\PhpPresentation\Writer\PowerPoint2007\AbstractPart.php on line 74

Working with current version (0.4.0) in connection with XAMPP on Windows.
Version 0.3.0 is working fine.

@Progi1984
Copy link
Member

@niklas-agethen You are not using 0.4.0 but the develop version. Normally, you should have the package PhpOffice\Common in version 0.2.0

phpoffice/common": "0.2.*"

@Progi1984 Progi1984 added this to the 0.5.0 milestone Jul 22, 2015
@niklas-agethen
Copy link
Author

Any way to make 0.4.0 work properly?
Need new features of that version (non 3D - pie chart).

@Progi1984
Copy link
Member

@niklas-agethen The version 0.4.0 runs without problem. (https://travis-ci.org/PHPOffice/PHPPowerPoint/builds/69867965).

Could you show me your composer.json ? and the part of your code ? Please :)

@Progi1984 Progi1984 modified the milestones: Waiting For Answer, 0.5.0 Aug 3, 2015
@Nedobr
Copy link

Nedobr commented Nov 16, 2015

Hello! I have this problem too! Mac OS El Captain, Apache/2.4.16, PHP 5.5.29

Composer:
{
"require": {
"phpoffice/phppresentation": "0.5.*"
}
}

Code: Sample 01 Complex (as is)

@Progi1984
Copy link
Member

@Nedobr Could you see the #127 ?

@Nedobr
Copy link

Nedobr commented Nov 16, 2015

Thank you!
But I resolved this problem: chmod -R 777 path/to/vendor/phpoffice

@Progi1984
Copy link
Member

@niklas-agethen Have you always got the same problem ?

@Nedobr
Copy link

Nedobr commented Nov 16, 2015

@Progi1984 sorry, I'm confused! This problem has not been solved! In 127 using Composer (include 'vendor/autoload.php';), but i can't use it. Can i use PHPPresentation without Composer?

This code in Sample_Header:
use PhpOffice\PhpPresentation\Autoloader;
use PhpOffice\PhpPresentation\Settings;
use PhpOffice\PhpPresentation\IOFactory;
use PhpOffice\PhpPresentation\Slide;
use PhpOffice\PhpPresentation\PhpPresentation;
use PhpOffice\PhpPresentation\AbstractShape;
use PhpOffice\PhpPresentation\DocumentLayout;
use PhpOffice\PhpPresentation\Shape\Drawing;
use PhpOffice\PhpPresentation\Shape\MemoryDrawing;
use PhpOffice\PhpPresentation\Shape\RichText;
use PhpOffice\PhpPresentation\Shape\RichText\BreakElement;
use PhpOffice\PhpPresentation\Shape\RichText\TextElement;
use PhpOffice\PhpPresentation\Style\Bullet;

error_reporting(E_ALL);
define('CLI', (PHP_SAPI == 'cli') ? true : false);
define('EOL', CLI ? PHP_EOL : '
');
define('SCRIPT_FILENAME', basename($_SERVER['SCRIPT_FILENAME'], '.php'));
define('IS_INDEX', SCRIPT_FILENAME == 'index');

require_once DIR . '/../src/PhpPresentation/Autoloader.php';
Autoloader::register();

// Set writers
$writers = array('PowerPoint2007' => 'pptx', 'ODPresentation' => 'odp');

But:
Class 'PhpOffice\Common\XMLWriter' not found in <Document_Root>\phpoffice\phppresentation\src\PhpPresentation\Writer\PowerPoint2007\AbstractPart.php on line 74

@Nedobr
Copy link

Nedobr commented Nov 17, 2015

@Progi1984
I downloaded PhpOffice Common Lib and added this rows in Sample_header PhpPresentation:

require_once DIR . '/../../Common/src/Common/Autoloader.php';
PhpOffice\Common\Autoloader::register();

And problem has resolved.

@Progi1984
Copy link
Member

Perfect. I have not understand that you have downloaded directly from GIthub.

@Progi1984 Progi1984 modified the milestones: 0.6.0, Waiting For Answer Nov 20, 2015
@Progi1984 Progi1984 self-assigned this Nov 20, 2015
@pranshuagrawal
Copy link

@Nedobr Can you please tell me where have you stroed the files of Common Library? I am not getting in which directory should i copy it.

Progi1984 added a commit to Progi1984/PHPPresentation that referenced this issue Mar 7, 2016
Progi1984 added a commit to Progi1984/PHPPresentation that referenced this issue Mar 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants