{"id":555,"date":"2011-09-06T21:37:59","date_gmt":"2011-09-06T12:37:59","guid":{"rendered":"http:\/\/takanix.com\/?p=555"},"modified":"2011-09-06T21:39:08","modified_gmt":"2011-09-06T12:39:08","slug":"%e3%80%90pear%e3%80%91%e3%81%95%e3%81%8f%e3%82%89%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%80%81%e5%8f%97%e4%bf%a1%e3%83%a1%e3%83%bc%e3%83%ab%e3%81%ae%e5%86%85%e5%ae%b9%e3%82%92%e5%8f%96","status":"publish","type":"post","link":"https:\/\/takanix.com\/?p=555","title":{"rendered":"\u3010PEAR\u3011\u3055\u304f\u3089\u30b5\u30fc\u30d0\u30fc\u3067\u3001\u53d7\u4fe1\u30e1\u30fc\u30eb\u306e\u5185\u5bb9\u3092\u53d6\u308a\u51fa\u3059"},"content":{"rendered":"<p>\u307e\u305a\u3001\u3055\u304f\u3089\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u30b5\u30fc\u30d0\u30fc\u3067\u4ee5\u4e0b\u306e2\u70b9\u306f\u5b8c\u4e86\u3057\u3066\u304a\u3044\u3066\u4e0b\u3055\u3044\u3002<br \/>\n\u4ee5\u524d\u50d5\u304c\u30d6\u30ed\u30b0\u5185\u3067\u66f8\u3044\u305f\u3082\u306e\u3067\u3059\u3002<\/p>\n<ol>\n<li><a href=\"https:\/\/takanix.com\/?p=481\">\u3010PEAR\u3011\u3055\u304f\u3089\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u30b5\u30fc\u30d0\u30fc\u3067PEAR\u3092\u4f7f\u3046<\/a><\/li>\n<li><a href=\"https:\/\/takanix.com\/?p=420\">\u3010\u7a7a\u30e1\u30fc\u30eb\u3011\u3055\u304f\u3089\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u3067\u3001\u7a7a\u30e1\u30fc\u30eb\u304b\u3089PHP\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3059\u308b\u3002<\/a><\/li>\n<li><a href=\"https:\/\/takanix.com\/?p=553\">\u3010PEAR\u3011\u3055\u304f\u3089\u30b5\u30fc\u30d0\u30fc\u3067\u3001\u753b\u50cf\u6dfb\u4ed8\u30e1\u30fc\u30eb\u306e\u753b\u50cf\u3092\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u53d6\u308a\u51fa\u3059\u3002<\/a><\/li>\n<\/ol>\n<p>2\u756a\u3067\u7528\u610f\u3057\u305fPHP\u30d5\u30a1\u30a4\u30eb\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<p>1\u756a\u3067\u884c\u3063\u305fPEAR\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5834\u6240\u3067\u8a18\u8ff0\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u6587\u5b57\u30a8\u30f3\u30b3\u30fc\u30c9\u306f\u3001UTF-8\u3067\u66f8\u3044\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u753b\u50cf\u3092\u4fdd\u5b58\u3057\u305f\u308a\u3057\u305f\u3044\u65b9\u306f\u30013\u756a\u3092\u53c2\u7167\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<p>\u6dfb\u4ed8\u753b\u50cf\u306a\u3057\u3067\u3001\u9001\u4fe1\u8005\u30a2\u30c9\u30ec\u30b9\u3068\u4ef6\u540d\u3001\u672c\u6587\u3092\u53d6\u5f97\u3057\u305f\u3044\u65b9\u306e\u307f\u306e\u8a18\u8ff0\u3067\u3059\u3002<br \/>\n\u591a\u5c11\u8efd\u304f\u306a\u308b\u306e\u3067\u3001\u753b\u50cf\u304c\u5fc5\u8981\u306e\u7121\u3044\u65b9\u306f\u3053\u3061\u3089\u3067\u3002<\/p>\n<p>\u53d6\u5f97\u3057\u305f\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3084\u4ef6\u540d\u306f\u3001\u30c7\u30fc\u30bf\u30fc\u30d9\u30fc\u30b9\u306b\u767b\u9332\u3059\u308b\u306a\u308a\u3001\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3059\u308b\u306a\u308a\u3001\u30e1\u30fc\u30eb\u3067\u9001\u308a\u306a\u308a\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8211;\u3053\u3053\u304b\u3089&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>#!\/usr\/local\/bin\/php<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;?php<\/p>\n<p>\/\/PEAR\u306e\u30d1\u30b9\u3092\u8a2d\u5b9a<\/p>\n<p>$path = &#8216;\/home\/(\u30e6\u30fc\u30b6\u30fc\u540d)\/pear\/PEAR\/&#8217;;<br \/>\nset_include_path(get_include_path() . PATH_SEPARATOR . $path);<br \/>\nrequire_once &#8216;\/home\/(\u30e6\u30fc\u30b6\u30fc\u540d)\/pear\/PEAR\/Mail\/mimeDecode.php&#8217;;<\/p>\n<p>&nbsp;<\/p>\n<p>\/\/\u53d7\u4fe1\u30e1\u30fc\u30eb\u304b\u3089\u8aad\u307f\u8fbc\u307f<\/p>\n<p>$params[&#8216;include_bodies&#8217;] = true;<br \/>\n$params[&#8216;decode_bodies&#8217;] = true;<br \/>\n$params[&#8216;decode_headers&#8217;] = true;<br \/>\n$params[&#8216;input&#8217;] = file_get_contents(&#8220;php:\/\/stdin&#8221;);<br \/>\n$params[&#8216;crlf&#8217;] = &#8220;\\r\\n&#8221;;<\/p>\n<p>if (!$params[&#8216;input&#8217;]) {<\/p>\n<p>\/\/ \u8aad\u307f\u8fbc\u307f\u5931\u6557<\/p>\n<p>exit();<\/p>\n<p>}<\/p>\n<p>$structure = Mail_mimeDecode::decode($params);<\/p>\n<p>\/\/\u9001\u4fe1\u8005\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u62bd\u51fa<\/p>\n<p>$mail = $structure-&gt;headers[&#8216;from&#8217;];<\/p>\n<p>$mail = addslashes($mail);<\/p>\n<p>$mail = str_replace(&#8216;&#8221;&#8216;,&#8221;,$mail);<br \/>\n$mail = preg_replace(&#8216;\/(^.*&lt;|&gt;$)\/&#8217;, &#8221;, $mail);<\/p>\n<p>&nbsp;<\/p>\n<p>\/\/ \u4ef6\u540d\u3092\u53d6\u5f97<\/p>\n<p>$subject = $structure-&gt;headers[&#8216;subject&#8217;];<\/p>\n<p>switch (strtolower($structure-&gt;ctype_primary)) {<br \/>\ncase &#8220;text&#8221;:<br \/>\n$body = $structure-&gt;body;<br \/>\nbreak;<br \/>\ndefault:<br \/>\n$body = &#8220;&#8221;;<br \/>\n}<\/p>\n<p>&nbsp;<\/p>\n<p>?&gt;<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8211;\u3053\u3053\u307e\u3067&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>&nbsp;<\/p>\n<p>\u8a73\u7d30\u306a\u3069\u306f\u3001<a href=\"https:\/\/takanix.com\/?p=553\">\u3010PEAR\u3011\u3055\u304f\u3089\u30b5\u30fc\u30d0\u30fc\u3067\u3001\u753b\u50cf\u6dfb\u4ed8\u30e1\u30fc\u30eb\u306e\u753b\u50cf\u3092\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u53d6\u308a\u51fa\u3059\u3002<\/a>\u3092\u53c2\u7167\u3057\u3066\u4e0b\u3055\u3044\u306d\u3002<br \/>\n\u5185\u5bb9\u306f\u753b\u50cf\u4fdd\u5b58\u4ee5\u5916\u3001\u540c\u3058\u3067\u3059\u306e\u3067\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u307e\u305a\u3001\u3055\u304f\u3089\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u30b5\u30fc\u30d0\u30fc\u3067\u4ee5\u4e0b\u306e2\u70b9\u306f\u5b8c\u4e86\u3057\u3066\u304a\u3044\u3066\u4e0b\u3055\u3044\u3002 \u4ee5\u524d\u50d5\u304c\u30d6\u30ed\u30b0\u5185\u3067\u66f8\u3044\u305f\u3082\u306e\u3067\u3059\u3002 \u3010PEAR\u3011\u3055\u304f\u3089\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u30b5\u30fc\u30d0\u30fc\u3067PEAR\u3092\u4f7f\u3046 \u3010\u7a7a\u30e1\u30fc\u30eb\u3011\u3055\u304f\u3089\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u3067\u3001\u7a7a\u30e1\u30fc\u30eb\u304b\u3089PHP [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":""},"categories":[78,1,245],"tags":[286,239,287,311],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/takanix.com\/index.php?rest_route=\/wp\/v2\/posts\/555"}],"collection":[{"href":"https:\/\/takanix.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/takanix.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/takanix.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/takanix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=555"}],"version-history":[{"count":3,"href":"https:\/\/takanix.com\/index.php?rest_route=\/wp\/v2\/posts\/555\/revisions"}],"predecessor-version":[{"id":570,"href":"https:\/\/takanix.com\/index.php?rest_route=\/wp\/v2\/posts\/555\/revisions\/570"}],"wp:attachment":[{"href":"https:\/\/takanix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/takanix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/takanix.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}