{"id":78,"date":"2008-01-04T21:42:23","date_gmt":"2008-01-04T12:42:23","guid":{"rendered":"http:\/\/akimoto.jp\/blog\/2008\/01\/04\/simplexmlelement%e3%82%92unserialize%e3%81%99%e3%82%8b%e3%81%a8%e3%82%a8%e3%83%a9%e3%83%bc%e3%81%ab%e3%81%aa%e3%82%8b\/"},"modified":"2009-05-26T19:08:36","modified_gmt":"2009-05-26T10:08:36","slug":"simplexmlelement%E3%82%92unserialize%E3%81%99%E3%82%8B%E3%81%A8%E3%82%A8%E3%83%A9%E3%83%BC%E3%81%AB%E3%81%AA%E3%82%8B","status":"publish","type":"post","link":"https:\/\/akimoto.jp\/blog\/2008\/01\/04\/simplexmlelement%E3%82%92unserialize%E3%81%99%E3%82%8B%E3%81%A8%E3%82%A8%E3%83%A9%E3%83%BC%E3%81%AB%E3%81%AA%E3%82%8B\/","title":{"rendered":"SimpleXMLElement\u3092unserialize\u3059\u308b\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b"},"content":{"rendered":"<p>simplexml\u3067\u53d6\u5f97\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u30b7\u30ea\u30a2\u30e9\u30a4\u30ba\u3057\u3066\u3082\u3001\u5143\u306b\u623b\u305b\u306a\u3044\u3002<\/p>\n<pre lang=\"php\">\r\n$gottenItems = simplexml_load_file($serviceUrl);\r\n$hoge = unserialize(serialize($gottenItems));\r\n<\/pre>\n<p>\u30a8\u30e9\u30fc\u306f\u3053\u308c<\/p>\n<pre lang=\"php\">\r\nWarning: unserialize() [function.unserialize]: Node no longer exists in *.php on line *\r\n<\/pre>\n<p><a href=\"http:\/\/php.net\/manual\/ja\/function.simplexml-load-string.php\">simplexml_load_string\u306e\u30de\u30cb\u30e5\u30a2\u30eb<\/a>\u306e\u30b3\u30e1\u30f3\u30c8\u3067\u3082\u56de\u907f\u7b56\u3068\u304b\u63d0\u6848\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<p>\u306a\u3093\u3067\u3053\u3093\u306a\u30a8\u30e9\u30fc\u306b\u51fa\u4f1a\u3063\u305f\u304b\u3068\u3044\u3046\u3068\u3001<a href=\"http:\/\/www.symfony-project.org\/book\/1_0\/18-Performance#Caching%20the%20Result%20of%20a%20Function%20Call\">symfony\u306e\u95a2\u6570\u30ad\u30e3\u30c3\u30b7\u30e5<\/a>\u3092\u4f7f\u304a\u3046\u3068\u3057\u305f\u3089\u3001\u5bfe\u8c61\u306e\u95a2\u6570\u306e\u8fd4\u3059\u306e\u304csimplexml_load_file()\u306e\u8fd4\u3059\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u305d\u306e\u307e\u307e\u3060\u3063\u305f\u304b\u3089\u3067\u3001symfony\u306e\u4e2d\u3067\u30a8\u30e9\u30fc\u306b\u306a\u3063\u305f\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u306f\u3001\u691c\u7d22\u7d50\u679c\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u95a2\u6570\u3092symfony\u3067\u66f8\u3044\u305f\u3082\u306e\u3002symfony\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u30d5\u30a9\u30eb\u30c0\u4ee5\u4e0b\u306b\u751f\u6210\u3055\u305b\u308b\u3053\u3068\u3067\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3092symfony\u7ba1\u7406\u4e0b\u306b\u7f6e\u3044\u3066\u3044\u308b\u3002<\/p>\n<pre lang=\"php\">\r\npublic static function search($words, $offset = 0, $results = 10) {\r\n\t$function_cache_dir = sfConfig::get('sf_cache_dir').'\/mysearch';\r\n\t$fc = new sfFunctionCache($function_cache_dir);\r\n\t$results = $fc->call('doSearch', $words, $offset, $results);\r\n\treturn $results;\r\n}\r\n<\/pre>\n<p>\u30b3\u30e1\u30f3\u30c8\u306b\u3042\u3063\u305f\u56de\u907f\u7b56\u53d6\u308b\u3088\u308a\u306f\u3001\u305d\u3082\u305d\u3082\u30b7\u30ea\u30a2\u30e9\u30a4\u30ba\u3059\u308b\u30dd\u30a4\u30f3\u30c8\u304c\u9593\u9055\u3063\u3066\u308b\u3001\u3068\u3044\u3046\u3053\u3068\u304b\u306a\u3068\u3002<\/p>\n<p>XML\u306e\u307e\u307e\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u5165\u308c\u308b\u304b\u3001SimpleXMLElement\u304b\u3089\u5fc5\u8981\u306a\u3082\u306e\u3092\u53d6\u308a\u51fa\u3057\u3066\u305d\u306e\u914d\u5217\u3084\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092serialize\u3059\u308b\u3088\u3046\u306b\u5909\u66f4\u3057\u3088\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>simplexml\u3067\u53d6\u5f97\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u30b7\u30ea\u30a2\u30e9\u30a4\u30ba\u3057\u3066\u3082\u3001\u5143\u306b\u623b\u305b\u306a\u3044\u3002 $gottenItems = simplexml_load_file($serviceUrl); $hoge = unserialize(se &hellip; <a href=\"https:\/\/akimoto.jp\/blog\/2008\/01\/04\/simplexmlelement%E3%82%92unserialize%E3%81%99%E3%82%8B%E3%81%A8%E3%82%A8%E3%83%A9%E3%83%BC%E3%81%AB%E3%81%AA%E3%82%8B\/\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">SimpleXMLElement\u3092unserialize\u3059\u308b\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b<\/span><\/a><\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[121,472],"tags":[2012,131,132],"class_list":["post-78","post","type-post","status-publish","format-standard","hentry","category-php","category-symfony-php","tag-php","tag-symfony","tag-132"],"_links":{"self":[{"href":"https:\/\/akimoto.jp\/blog\/wp-json\/wp\/v2\/posts\/78","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/akimoto.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/akimoto.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/akimoto.jp\/blog\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/akimoto.jp\/blog\/wp-json\/wp\/v2\/comments?post=78"}],"version-history":[{"count":2,"href":"https:\/\/akimoto.jp\/blog\/wp-json\/wp\/v2\/posts\/78\/revisions"}],"predecessor-version":[{"id":1314,"href":"https:\/\/akimoto.jp\/blog\/wp-json\/wp\/v2\/posts\/78\/revisions\/1314"}],"wp:attachment":[{"href":"https:\/\/akimoto.jp\/blog\/wp-json\/wp\/v2\/media?parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/akimoto.jp\/blog\/wp-json\/wp\/v2\/categories?post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/akimoto.jp\/blog\/wp-json\/wp\/v2\/tags?post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}