You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
797 B
PHTML
36 lines
797 B
PHTML
5 years ago
|
<?php
|
||
|
/**
|
||
|
* Examples for how to use CFPropertyList
|
||
|
* Read a Binary PropertyList
|
||
|
* @package plist
|
||
|
* @subpackage plist.examples
|
||
|
*/
|
||
|
namespace CFPropertyList;
|
||
|
|
||
|
// just in case...
|
||
|
error_reporting( E_ALL );
|
||
|
ini_set( 'display_errors', 'on' );
|
||
|
|
||
|
/**
|
||
|
* Require CFPropertyList
|
||
|
*/
|
||
|
require_once(__DIR__.'/../classes/CFPropertyList/CFPropertyList.php');
|
||
|
|
||
|
|
||
|
/*
|
||
|
* create a new CFPropertyList instance which loads the sample.plist on construct.
|
||
|
* since we know it's a binary file, we can skip format-determination
|
||
|
*/
|
||
|
$plist = new CFPropertyList( __DIR__.'/sample.binary.plist', CFPropertyList::FORMAT_BINARY );
|
||
|
|
||
|
/*
|
||
|
* retrieve the array structure of sample.plist and dump to stdout
|
||
|
*/
|
||
|
|
||
|
echo '<pre>';
|
||
|
var_dump( $plist->toArray() );
|
||
|
echo '</pre>';
|
||
|
|
||
|
$plist->saveBinary( __DIR__.'/sample.binary.plist' );
|
||
|
|
||
|
?>
|