欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

ZF缓存类前端File配合XML的使用

程序员文章站 2022-05-14 09:18:21
...

学习练习 Zend Framework ?xml version="1.0" encoding="UTF-8"?ConfigMysqlhost127.0.0.1/hostuserroot/userpassword111/passworddbnametest/dbname/Mysql/Config ?phprequire_once("Zend/Loader.php");//载入缓存类与Config类的子类XMLZend_Loader::loadCla

学习练习 Zend Framework
127.0.0.1root111test
 'Zend_Cache_File.php','automatic_serialization' => true);
//开启缓存(前端,后端,前端配置)
$Cache = Zend_Cache::factory('File','File',$Foptions);
//讲实例化的XML对象资源保存到缓存,并命名
$Cache -> save($XML,'config');
//载入缓存
$Result = $Cache -> load('config');
//----------调用XML--------------
echo "主机名是:" . $Result ->host . "
"; echo "用户名是:" . $Result ->user . "
"; echo "密码是:" . $Result ->password . "
"; echo "库名是:" . $Result ->dbname . "
"; ?>