mam następujące kody ( do robienia pliku konfiguracyjnego w xml ):
<?php class ConfigParser { private $config; public function __construct() { $this -> loadConfig(); } public function loadConfig() { { $this -> parseConfig(); } else { } } public function parseConfig() { $this -> config = simplexml_load_file( 'config.xml' ); /* echo '<pre>'; var_dump( $this -> configFile ); echo '</pre>'; */ } // Kilka metod wyciągających poszczególne dane np.: public function getPostLoadingModules( $module = false ) { return $this -> config -> postloadingmodules -> module; if( $module !== false ) { { return $this -> config -> postLoadingModules -> module[$path]; } else { return false; } } else { return $this -> config -> postloadingmodules -> module; } } } ?>
<?xml version="1.0" encoding="iso-8859-1"?> <kernel-config> <paths> <modules-path>module/</modules-path> <auth-path>auth/</auth-path> </paths> <preloadingmodules> <module>headery</module> <module>menu</module> <module>calendar</module> </preloadingmodules> <postloadingmodules> <module>stats</module> <module>footer</module> </postloadingmodules> </kernel-config>
Cytat("config.php")
O:16:"SimpleXMLElement":3:{s:5:"paths";O:16:"SimpleXMLElement":2:{s:12:"modules-path";s:7:"module/";s:9:"auth-path";s:5:"auth/";}s:17:"preloadingmodules";O:16:"SimpleXMLElement":1:{s:6:"module";a:3:{i:0;s:7:"headery";i:1;s:4:"menu";i:2;s:8:"calendar";}}s:18:"postloadingmodules";O:16:"SimpleXMLElement":1:{s:6:"module";a:2:{i:0;s:5:"stats";i:1;s:6:"footer";}}}
który zwraca następujące błedy:
Cytat("errory")
Warning: unserialize() [function.unserialize]: Node no longer exists in C:\www\xampp\htdocs\engine\config.parser.php on line 18
No i ja po prostu nie wiem co mam z tym zrobić 