{"id":935,"date":"2010-07-24T16:32:36","date_gmt":"2010-07-24T07:32:36","guid":{"rendered":"http:\/\/www.kazu.tv\/blog\/?p=935"},"modified":"2010-07-24T16:32:36","modified_gmt":"2010-07-24T07:32:36","slug":"symfony-task","status":"publish","type":"post","link":"https:\/\/kazu.tv\/blog\/2010\/07\/24\/symfony-task\/","title":{"rendered":"symfony\u3067\u30bf\u30b9\u30af"},"content":{"rendered":"<p>symfony\u306f\u3054\u5b58\u3058\u306e\u901a\u308aweb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308b\u305f\u3081\u306ePHP\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306a\u3093\u3060\u3051\u3069\u3001\u305d\u308c\u4ee5\u5916\u306b\u3082\u4fbf\u5229\u306a\u306a\u6a5f\u80fd\u304c\u3042\u308b\u3002<\/p>\n<p>\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u308b\u306e\u3063\u3066\u3001\u5358\u306b\u8868\u306b\u51fa\u3066\u304f\u308b\u6a5f\u80fd\u3092\u4f5c\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3066\u3001\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3060\u3063\u305f\u308a\u30c7\u30fc\u30bf\u306e\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u3060\u3063\u305f\u308a\u3063\u3066\u306e\u3082\u542b\u307e\u308c\u308b\u3093\u3060\u3051\u3069\u3001\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u52d5\u304f\u30bf\u30b9\u30af\u30fb\u30b8\u30e7\u30d6\u3092\u7c21\u5358\u306b\u4f5c\u308c\u308b\u6a5f\u80fd\u304csymfony\u306b\u306f\u3042\u308b\u30021.2\u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u306bcookbook\u306b<a href=\"http:\/\/www.symfony-project.org\/cookbook\/1_2\/ja\/tasks\" target=\"_blank\">\u8aac\u660e<\/a>\u304c\u3042\u308b\u306e\u3067\u30011.2\u304b\u3089\u51fa\u6765\u305f\u6a5f\u80fd\u304b\u3082\u3002<\/p>\n<p>&nbsp;\u307e\u3001\u3053\u306e<a href=\"http:\/\/morinoyume.com\/techs\/symfony1-4symfony1-3%E3%81%A7%E3%83%90%E3%83%83%E3%83%81%E5%87%A6%E7%90%86\/\" target=\"_blank\">\u30da\u30fc\u30b8<\/a>\u306e\u8aac\u660e\u3067\u5927\u4f53\u9593\u306b\u5408\u3063\u3066\u3057\u307e\u3046\u6c17\u3082\u3059\u308b\u3051\u3069\u3001\u5c11\u3057\u8aac\u660e\u3002<\/p>\n<p><!--more--><\/p>\n<h3>\u25a0DB\u3078\u306e\u30a2\u30af\u30bb\u30b9<\/h3>\n<p>sfBaseTask\u306e\u5b50\u30af\u30e9\u30b9\u306e\u4e2d\u3067\u306fsymfony\u306e\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u5074\u3067\u4f7f\u3048\u308b\u3088\u3046\u306a\u6a5f\u80fd\u304c\uff08\u591a\u5206\uff09\u5168\u90e8\u4f7f\u3048\u308b\u3002\u4e0a\u8a18\u306eCookbook\u306b\u306f\u300c\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30ec\u30a4\u30e4\u30fc\u306f\u5fc5\u8981\u3067\u3059\u304b\uff1f\u300d\u3063\u3066\u3044\u3046\u898b\u51fa\u3057\u306e\u4e0b\u306b<\/p>\n<pre class=\"brush: php; code\">\n$databaseManager = new sfDatabaseManager($this-&gt;configuration);<\/pre>\n<p>&nbsp;\u306a\u3093\u3066\u30b3\u30fc\u30c9\u304c\u66f8\u3044\u3066\u3042\u308b\u3051\u3069\u3001\uff08\u5c11\u306a\u304f\u3068\u3082symfony 1.4\u3067\u306f\uff09\u666e\u901a\u306b\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u7d4c\u7531\u3067DB\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u306e\u3067\u3001\u975e\u5e38\u306b\u7c21\u5358\u3002<\/p>\n<h3>\u25a0\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u5024\u3092\u53d6\u5f97<\/h3>\n<p>app.yml\u304b\u3089\u5024\u3092\u53d6\u5f97\u3059\u308b\u3068\u3044\u3046\u306e\u306f\u826f\u304f\u3042\u308b\u4e8b\u3060\u3068\u601d\u3046\u3051\u3069\u3001\u305d\u3082\u305d\u3082task\u306f\u3069\u306eapplication\uff08backend, frontend etc.\uff09\u306b\u5c5e\u3059\u3082\u306e\u306a\u3093\u3060\u308d\u3046\u304b&hellip;\u3069\u3046\u3084\u3089\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6307\u5b9a\u3067\u304d\u308b\u3089\u3057\u3044\u3002\u3053\u306e<a href=\"http:\/\/d.hatena.ne.jp\/yoshihi6\/20090727\/1248677772\" target=\"_blank\">\u30da\u30fc\u30b8<\/a>\u3092\u53c2\u8003\u3002<\/p>\n<pre class=\"brush: php; code\">\n$this-&gt;addOptions(array(\n\/\/ \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u540d\u306ffrontend, backend\u7b49\nnew sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name', '\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u540d'),\nnew sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),\nnew sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),\n\/\/ add your own options here\n));\n<\/pre>\n<p>\u3053\u3046\u3057\u3066\u4f5c\u3063\u305f\u30bf\u30b9\u30af\u3092cron\u3067\u52d5\u304b\u3057\u305f\u308a\u3001\u30b8\u30e7\u30d6\u30b9\u30b1\u30b8\u30e5\u30fc\u30e9\u304b\u3089\u52d5\u304b\u3057\u305f\u308a\u3001\u306a\u3093\u3066\u3059\u308c\u3070\u7acb\u6d3e\u306a\u30b7\u30b9\u30c6\u30e0\u3078\u66f4\u306b\u4e00\u6b69\u8fd1\u3065\u3051\u308b\u304b\u306a\u3001\u3068\u3002&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>symfony\u3067\u30bf\u30b9\u30af\u3092\u4f5c\u308b\u65b9\u6cd5<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[401],"tags":[744,745,746,442,747,748],"class_list":["post-935","post","type-post","status-publish","format-standard","hentry","category-php","tag-app-yml","tag-generatetask","tag-sfconfig","tag-symfony","tag-747","tag-748"],"_links":{"self":[{"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/posts\/935","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/comments?post=935"}],"version-history":[{"count":0,"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/posts\/935\/revisions"}],"wp:attachment":[{"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/media?parent=935"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/categories?post=935"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/tags?post=935"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}