{"id":2890,"date":"2013-05-17T13:17:26","date_gmt":"2013-05-17T04:17:26","guid":{"rendered":"http:\/\/www.lancard.com\/blog\/?p=2890"},"modified":"2025-03-12T11:29:02","modified_gmt":"2025-03-12T02:29:02","slug":"roundcube%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e8%a8%ad%e5%ae%9a%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%81%ae%e5%88%a9%e7%94%a8%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.lancard.com\/blog\/2013\/05\/17\/roundcube%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e8%a8%ad%e5%ae%9a%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%81%ae%e5%88%a9%e7%94%a8%e6%96%b9%e6%b3%95\/","title":{"rendered":"Roundcube\u30d7\u30e9\u30b0\u30a4\u30f3\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u5229\u7528\u65b9\u6cd5"},"content":{"rendered":"<p>Roundcube\u30d7\u30e9\u30b0\u30a4\u30f3\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u5229\u7528\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u7528\u610f\u3057\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/05\/img11.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2013\/05\/img11.png\" alt=\"\" title=\"img1\" width=\"189\" height=\"108\" class=\"aligncenter size-full wp-image-2893\" \/><\/a><\/p>\n<p>\u30bd\u30fc\u30b9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>sample.php<\/p>\n<pre line=\"1\" lang=\"php\">\r\n<?php\r\nclass sample extends rcube_plugin {\r\nprivate $rc = null;\r\n\r\npublic function __construct(&#038;$api){\r\nparent::__construct(&#038;$api);\r\n      \r\n\/\/rcmail\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53d6\u5f97\r\n$this->rc = rcmail::get_instance();\r\n\r\n\/\/\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u30ed\u30fc\u30c9\r\n$this->load_config('config\/config.inc.php');\r\n}\r\n\r\nfunction init() {\r\n$name = $this->rc->config->get('sample.user', '');\r\nerror_log('name:'.$name);\r\n}\r\n\r\n}\r\n<\/pre>\n<p>config.inc.php<\/p>\n<pre line=\"1\" lang=\"php\">\r\n<?php\r\n$rcmail_config['sample.user'] = 'foo';\r\n?>\r\n<\/pre>\n<p>\u5272\u3068\u7c21\u5358\u306b\u4f7f\u3048\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<pre line=\"1\" lang=\"php\">\r\n<?php\r\n$this->rc->config->get('sample.user', '');\r\n?>\r\n<\/pre>\n<p>\u3053\u3053\u306econfig\u306e\u5b9f\u614b\u306frcube_config\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\nget\u30e1\u30bd\u30c3\u30c9\u306e\u7b2c\u4e8c\u5f15\u6570\u306f\u5024\u304c\u53d6\u5f97\u51fa\u6765\u306a\u304b\u3063\u305f\u5834\u5408\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u6ce8\u610f\u70b9\u3068\u3057\u3066\u306f<\/p>\n<pre line=\"1\" lang=\"php\">\r\n<?php\r\nparent::__construct(&#038;$api);\r\n?>\r\n<\/pre>\n<p>\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306e\u4e2d\u3067\u89aa\u30af\u30e9\u30b9\u3067\u3042\u308brcube_plugin\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3092<br \/>\n\u5fc5\u305a\u547c\u3073\u51fa\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>rcube_plugin\u30af\u30e9\u30b9\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre line=\"1\" lang=\"php\">\r\n<?php\r\n  public function __construct($api)\r\n  {\r\n    $this->ID = get_class($this);\r\n    $this->api = $api;\r\n    $this->home = $api->dir . $this->ID;\r\n    $this->urlbase = $api->url . $this->ID . '\/';\r\n  }\r\n?>\r\n<\/pre>\n<p>home\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306a\u3069\u306e\u5024\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001rcube_plugin\u30af\u30e9\u30b9\u306eload_config\u30e1\u30bd\u30c3\u30c9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre line=\"1\" lang=\"php\">\r\n<?php\r\n  public function load_config($fname = 'config.inc.php')\r\n  {\r\n    $fpath = $this->home.'\/'.$fname;\r\n    $rcmail = rcmail::get_instance();\r\n    if (is_file($fpath) && !$rcmail->config->load_from_file($fpath)) {\r\n      raise_error(array('code' => 527, 'type' => 'php',\r\n        'file' => __FILE__, 'line' => __LINE__,\r\n        'message' => \"Failed to load config from $fpath\"), true, false);\r\n      return false;\r\n    }\r\n\r\n    return true;\r\n  }\r\n?>\r\n<\/pre>\n<p>\u3053\u3053\u3067\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u5834\u6240\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306bhome\u5909\u6570\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u305f\u3081<br \/>\nrcube_plugin\u30af\u30e9\u30b9\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3092\u547c\u3073\u51fa\u3057\u3066\u3044\u306a\u3044\u3068\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u5f97\u51fa\u6765\u306a\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F2890&#038;t=Roundcube%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E8%A8%AD%E5%AE%9A%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AE%E5%88%A9%E7%94%A8%E6%96%B9%E6%B3%95&#038;s=100&#038;p&#091;url&#093;=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F2890&#038;p&#091;images&#093;&#091;0&#093;=http%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-content%2Fuploads%2F2013%2F05%2Fimg11.png&#038;p&#091;title&#093;=Roundcube%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E8%A8%AD%E5%AE%9A%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AE%E5%88%A9%E7%94%A8%E6%96%B9%E6%B3%95\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"http:\/\/twitter.com\/share?url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F2890&#038;text=Roundcube%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E8%A8%AD%E5%AE%9A%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AE%E5%88%A9%E7%94%A8%E6%96%B9%E6%B3%95\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F2890&#038;title=Roundcube%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E8%A8%AD%E5%AE%9A%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AE%E5%88%A9%E7%94%A8%E6%96%B9%E6%B3%95\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-tumblr nolightbox\" data-provider=\"tumblr\" target=\"_blank\" rel=\"nofollow\" title=\"Share on tumblr\" href=\"https:\/\/tumblr.com\/share?s=&#038;v=3&#038;t=Roundcube%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E8%A8%AD%E5%AE%9A%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AE%E5%88%A9%E7%94%A8%E6%96%B9%E6%B3%95&#038;u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F2890\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"tumblr\" title=\"Share on tumblr\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/tumblr.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=Roundcube%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E8%A8%AD%E5%AE%9A%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AE%E5%88%A9%E7%94%A8%E6%96%B9%E6%B3%95&#038;body=%E3%82%B7%E3%82%A7%E3%82%A2%E3%81%99%E3%82%8B%EF%BC%9A:%20https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F2890\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>Roundcube\u30d7\u30e9\u30b0\u30a4\u30f3\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u5229\u7528\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u7528\u610f\u3057\u307e\u3059\u3002 \u30bd\u30fc\u30b9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 sample.php \u5272\u3068\u7c21\u5358\u306b\u4f7f\u3048\u308b\u3088\u3046\u3067\u3059\u3002 \u3053\u3053\u306econfig\u306e\u5b9f\u614b\u306frcu [&hellip;]<\/p>\n","protected":false},"author":21,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,99],"tags":[],"class_list":["post-2890","post","type-post","status-publish","format-standard","hentry","category-php","category-roundcube"],"_links":{"self":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/2890","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/comments?post=2890"}],"version-history":[{"count":4,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/2890\/revisions"}],"predecessor-version":[{"id":2895,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/2890\/revisions\/2895"}],"wp:attachment":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/media?parent=2890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/categories?post=2890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/tags?post=2890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}