forked from PHPOffice/PHPPresentation
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PHPOffice#176 : Implementation for ZIP Adapter
- Loading branch information
Showing
28 changed files
with
256 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.4.0 | ||
0.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
.. _writersreaders: | ||
|
||
Readers | ||
======= | ||
|
||
ODPresentation | ||
-------------- | ||
|
||
The name of the reader is ``ODPresentation``. | ||
|
||
.. code-block:: php | ||
$oWriter = IOFactory::createReader('ODPresentation'); | ||
$oWriter->load(__DIR__ . '/sample.odp'); | ||
PowerPoint97 | ||
------------ | ||
|
||
The name of the reader is ``PowerPoint97``. | ||
|
||
.. code-block:: php | ||
$oWriter = IOFactory::createReader('PowerPoint97'); | ||
$oWriter->load(__DIR__ . '/sample.ppt'); | ||
PowerPoint2007 | ||
-------------- | ||
|
||
The name of the reader is ``PowerPoint2007``. | ||
|
||
.. code-block:: php | ||
$oWriter = IOFactory::createReader('PowerPoint2007'); | ||
$oWriter->load(__DIR__ . '/sample.pptx'); | ||
Serialized | ||
---------- | ||
|
||
The name of the reader is ``Serialized``. | ||
|
||
.. code-block:: php | ||
$oWriter = IOFactory::createReader('Serialized'); | ||
$oWriter->load(__DIR__ . '/sample.phppt'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
.. _writersreaders: | ||
|
||
Writers | ||
======= | ||
|
||
|
||
ODPresentation | ||
-------------- | ||
|
||
The name of the writer is ``ODPresentation``. | ||
|
||
.. code-block:: php | ||
$oWriter = IOFactory::createWriter($oPhpPresentation, 'PowerPoint2007'); | ||
$oWriter->save(__DIR__ . '/sample.pptx'); | ||
PowerPoint2007 | ||
-------------- | ||
|
||
The name of the writer is ``PowerPoint2007``. | ||
|
||
.. code-block:: php | ||
$oWriter = IOFactory::createWriter($oPhpPresentation, 'PowerPoint2007'); | ||
$oWriter->save(__DIR__ . '/sample.pptx'); | ||
You can change the ZIP Adapter for the writer. By default, the ZIP Adapter is ZipArchiveAdapter. | ||
|
||
.. code-block:: php | ||
use PhpOffice\Common\Adapter\Zip\PclZipAdapter; | ||
use PhpOffice\Common\Adapter\Zip\ZipArchiveAdapter; | ||
$oWriter = IOFactory::createWriter($oPhpPresentation, 'PowerPoint2007'); | ||
$oWriter->setZipAdapter(PclZipAdapter); | ||
$oWriter->save(__DIR__ . '/sample.pptx'); | ||
Serialized | ||
---------- | ||
|
||
The name of the writer is ``Serialized``. | ||
|
||
.. code-block:: php | ||
$oWriter = IOFactory::createWriter($oPhpPresentation, 'Serialized'); | ||
$oWriter->save(__DIR__ . '/sample.phppt'); | ||
You can change the ZIP Adapter for the writer. By default, the ZIP Adapter is ZipArchiveAdapter. | ||
|
||
.. code-block:: php | ||
use PhpOffice\Common\Adapter\Zip\PclZipAdapter; | ||
use PhpOffice\Common\Adapter\Zip\ZipArchiveAdapter; | ||
$oWriter = IOFactory::createWriter($oPhpPresentation, 'Serialized'); | ||
$oWriter->setZipAdapter(PclZipAdapter); | ||
$oWriter->save(__DIR__ . '/sample.phppt'); | ||
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace PhpOffice\PhpPresentation\Writer; | ||
|
||
use PhpOffice\Common\Adapter\Zip\ZipInterface; | ||
|
||
abstract class AbstractWriter | ||
{ | ||
/** | ||
* @var ZipInterface | ||
*/ | ||
protected $oZipAdapter; | ||
|
||
/** | ||
* @param ZipInterface $oZipAdapter | ||
* @return $this | ||
*/ | ||
public function setZipAdapter(ZipInterface $oZipAdapter) | ||
{ | ||
$this->oZipAdapter = $oZipAdapter; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return ZipInterface | ||
*/ | ||
public function getZipAdapter() | ||
{ | ||
return $this->oZipAdapter; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.