documentation markdown

This commit is contained in:
Mark Baker 2013-05-19 22:14:52 +01:00
parent e7f8f616f7
commit d6ec415676
5 changed files with 21 additions and 9 deletions

View File

@ -12,7 +12,6 @@ The following software is required to develop using PHPExcel:
- PHP extension php_xml enabled
- PHP extension php_gd2 enabled (if not compiled in)
[^phpzip_footnote]: __php_zip__ is only needed by __PHPExcel_Reader_Excel2007__, __PHPExcel_Writer_Excel2007__ and __PHPExcel_Reader_OOCalc__. In other words, if you need PHPExcel to handle .xlsx or .ods files you will need the zip extension, but otherwise not. You can remove this dependency for writing Excel2007 files (though not yet for reading) by using the PCLZip library that is bundled with PHPExcel. See the FAQ section of this document for details about this. PCLZip does have a dependency on PHP's zlib extension being enabled.
### Installation instructions
@ -27,6 +26,7 @@ If your web root folder is /var/www/ you may want to create a subfolder called /
/var/www/Classes/PHPExcel/Cell.php
...
### Getting started
A good way to get started is to run some of the tests included in the download.
@ -42,7 +42,8 @@ http://example.com/Tests/01simple.php
http://example.com/Tests/02types.php
...
Note: It may be necessary to modify the include/require statements at the beginning of each of the test scripts if your "Classes" folder from above is named differently.
**Note:** It may be necessary to modify the include/require statements at the beginning of each of the test scripts if your "Classes" folder from above is named differently.
### Useful links and tools
@ -59,7 +60,8 @@ There are some links and tools which are very useful when developing using PHPEx
- __OpenXML Package Explorer__
[http://www.codeplex.com/PackageExplorer/][6]
#### Frequently asked questions
### Frequently asked questions
The up-to-date F.A.Q. page for PHPExcel can be found on [http://www.codeplex.com/PHPExcel/Wiki/View.aspx?title=FAQ&referringTitle=Requirements][7].
@ -140,6 +142,7 @@ The short answer is that PHPExcel uses a measure where padding is included. See
Thanks to peterrlynch for the following advice on resolving issues between the [PHPExcel autoloader and Joomla Autoloader][17]
#### Tutorials
- __English PHPExcel tutorial__
@ -172,3 +175,7 @@ Thanks to peterrlynch for the following advice on resolving issues between the [
[19]: http://g-ernaelsten.developpez.com/tutoriels/excel2007/
[20]: http://www.web-junior.net/sozdanie-excel-fajjlov-s-pomoshhyu-phpexcel/
[21]: http://journal.mycom.co.jp/articles/2009/03/06/phpexcel/index.html
[^phpzip_footnote]: __php_zip__ is only needed by __PHPExcel_Reader_Excel2007__, __PHPExcel_Writer_Excel2007__ and __PHPExcel_Reader_OOCalc__. In other words, if you need PHPExcel to handle .xlsx or .ods files you will need the zip extension, but otherwise not.<br />You can remove this dependency for writing Excel2007 files (though not yet for reading) by using the PCLZip library that is bundled with PHPExcel. See the FAQ section of this document for details about this. PCLZip does have a dependency on PHP's zlib extension being enabled.

View File

@ -7,6 +7,7 @@
![01-schematic.png](./images/01-schematic.png "")
### Lazy Loader
PHPExcel implements an autoloader or "lazy loader"<22>, which means that it is not necessary to include every file within PHPExcel. It is only necessary to include the initial PHPExcel class file, then the autoloader will include other class files as and when required, so only those files that are actually required by your script will be loaded into PHP memory. The main benefit of this is that it reduces the memory footprint of PHPExcel itself, so that it uses less PHP memory.
@ -27,12 +28,14 @@ spl_autoload_register('myAutoload');
```
Your autoloader will then co-exist with the autoloader of PHPExcel.
### Spreadsheet in memory
PHPExcel's architecture is built in a way that it can serve as an in-memory spreadsheet. This means that, if one would want to create a web based view of a spreadsheet which communicates with PHPExcel's object model, he would only have to write the front-end code.
Just like desktop spreadsheet software, PHPExcel represents a spreadsheet containing one or more worksheets, which contain cells with data, formulas, images, ...
### Readers and writers
On its own, PHPExcel does not provide the functionality to read from or write to a persisted spreadsheet (on disk or in a database). To provide that functionality, readers and writers can be used.
@ -41,7 +44,6 @@ By default, the PHPExcel package provides some readers and writers, including on
![02-readers-writers.png](./images/02-readers-writers.png "")
### Fluent interfaces
PHPExcel supports fluent interfaces in most locations. This means that you can easily "chain"" calls to specific methods without requiring a new PHP statement. For example, take the following code:
@ -66,5 +68,6 @@ $objPHPExcel->getProperties()
->setCategory("Test result file");
```
__Using fluent interfaces is not required__
Fluent interfaces have been implemented to provide a convenient programming API. Use of them is not required, but can make your code easier to read and maintain. It can also improve performance, as you are reducing the overall number of calls to PHPExcel methods.
> __Using fluent interfaces is not required__
> Fluent interfaces have been implemented to provide a convenient programming API. Use of them is not required, but can make your code easier to read and maintain.
> It can also improve performance, as you are reducing the overall number of calls to PHPExcel methods: in the above example, the `getProperties()` method is being called only once rather than 7 times in the non-fluent version.

View File

@ -1,5 +1,6 @@
# PHPExcel Developer Documentation
## Creating a spreadsheet
### The PHPExcel class

View File

@ -1,5 +1,6 @@
# PHPExcel Developer Documentation
## Configuration Settings
Once you have included the PHPExcel files in your script, but before instantiating a PHPExcel object or loading a workbook file, there are a number of configuration options that can be set which will affect the subsequent behaviour of the script.
@ -114,7 +115,7 @@ When your script terminates all entries will be cleared from Wincache, regardles
#### PHPExcel_CachedObjectStorageFactory::cache_to_sqlite
Uses an SQLite 2 "in-memory"" database for caching cell data. Unlike other caching methods, neither cells nor an index are held in PHP memory - an indexed database table makes it unnecessary to hold any index in PHP memory, which makes this the most memory-efficient of the cell caching methods.
Uses an SQLite 2 "in-memory" database for caching cell data. Unlike other caching methods, neither cells nor an index are held in PHP memory - an indexed database table makes it unnecessary to hold any index in PHP memory, which makes this the most memory-efficient of the cell caching methods.
#### PHPExcel_CachedObjectStorageFactory::cache_to_sqlite3;
@ -129,11 +130,11 @@ Some localisation elements have been included in PHPExcel. You can set a locale
$locale = 'pt_br';
$validLocale = PHPExcel_Settings::setLocale($locale);
if (!$validLocale) {
echo 'Unable to set locale to '.$locale." - reverting to en_us<br />\n";
echo 'Unable to set locale to ' . $locale . " - reverting to en_us" . PHP_EOL;
}
```
If Brazilian Portuguese language files aren't available, then the Portuguese will be enabled instead: if Portuguese language files aren't available, then the setLocale() method will return an error, and American English (en_us) settings will be used throughout.
If Brazilian Portuguese language files aren't available, then Portuguese will be enabled instead: if Portuguese language files aren't available, then the setLocale() method will return an error, and American English (en_us) settings will be used throughout.
More details of the features available once a locale has been set, including a list of the languages and locales currently supported, can be found in the section of this document entitled "Locale Settings for Formulae".