{"id":776,"date":"2007-09-05T01:00:00","date_gmt":"2007-09-04T16:00:00","guid":{"rendered":"https:\/\/ecoop.net\/memo\/2007-09-05-1.html"},"modified":"2026-08-10T14:41:16","modified_gmt":"2026-08-10T05:41:16","slug":"2007-09-05-1","status":"publish","type":"post","link":"https:\/\/www.ecoop.net\/memo\/archives\/2007-09-05-1.html","title":{"rendered":"symfony &#8211; \u5358\u4f53\u30c6\u30b9\u30c8\u3067 propel \u3092\u4f7f\u3046\u65b9\u6cd5"},"content":{"rendered":"<p>\n\u6a5f\u80fd\u30c6\u30b9\u30c8(functional test) \u3084\u30d0\u30c3\u30c1\u30b9\u30af\u30ea\u30d7\u30c8(batch)\u3067 Propel \u3092\u4f7f\u3046\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u4ee5\u524d<a href=\"https:\/\/www.ecoop.net\/memo\/2007-08-12-4.html\">\u3053\u3061\u3089\u306e\u8a18\u4e8b<\/a>\u3067<\/p>\n<blockquote><p>sfContext::getInstance(); \n<\/p><\/blockquote>\n<p>\u3092\u6700\u521d\u306b\u5b9f\u884c\u3059\u308c\u3070\u52d5\u4f5c\u3059\u308b\u3001\u3068\u66f8\u304d\u307e\u3057\u305f\u3002<br \/>\n&nbsp;<br \/>\n\u3057\u304b\u3057\u5358\u4f53\u30c6\u30b9\u30c8\u3067 Propel \u3092\u4f7f\u3046\u969b\u306f\u3001\u5358\u7d14\u306b\n<\/p>\n<blockquote><p>require_once(dirname(__FILE__).&#8217;\/..\/bootstrap\/unit.php&#8217;);<br \/>\nsfContext::getInstance();\n<\/p><\/blockquote>\n<p>\u3068\u3059\u308b\u3060\u3051\u3067\u306f\n<\/p>\n<blockquote><p>Fatal error: Class &#8216;sfContext&#8217; not found in &#8230;\n<\/p><\/blockquote>\n<p>\u306e\u3088\u3046\u306b\u3001sfContext \u30af\u30e9\u30b9\u304c\u898b\u4ed8\u304b\u3089\u305a\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3053\u3053\u3067\u5358\u7d14\u306b sfContext \u3092 include \u3057\u3066\u3082\u3001sfCore \u3084 myUser \u306a\u3069\u304c\u5b58\u5728\u3057\u306a\u3044\u3068\u8a00\u308f\u308c\u305f\u308a\u3001\u69d8\u3005\u306a\u30a8\u30e9\u30fc\u304c\u3067\u3066\u52d5\u4f5c\u3057\u307e\u305b\u3093\u3002<br \/>\n\u524d\u8ff0\u306e\u8a18\u4e8b\u306e<a href=\"http:\/\/www.symfony-project.com\/forum\/index.php\/m\/32906\/\">\u53c2\u8003URL<\/a>\u306b\u3042\u308b\u3088\u3046\u306b\u3001\u6b21\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059(\u6ce8: \u53c2\u8003\u5143\u306e\u6295\u7a3f\u30b3\u30fc\u30c9\u304b\u3089\u50c5\u304b\u306b\u624b\u3092\u52a0\u3048\u3066\u3044\u307e\u3059)\u3002\n<\/p>\n<blockquote><p>\/\/ TODO: \u8981\u5909\u66f4 &#8211; \u30c6\u30b9\u30c8\u5bfe\u8c61\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u540d<br \/>\n$app_name = &#8220;frontend&#8221;;<br \/>\n&nbsp;<br \/>\n\/\/begin initialise database code<br \/>\ninclude(dirname(__FILE__).&#8217;\/..\/bootstrap\/unit.php&#8217;);<br \/>\ninclude(dirname(__FILE__).&#8217;\/..\/..\/config\/config.php&#8217;);<\/p>\n<p>require_once($sf_symfony_lib_dir.&#8217;\/util\/sfCore.class.php&#8217;);<br \/>\nsfCore::initSimpleAutoload(array(SF_ROOT_DIR.&#8217;\/lib\/model&#8217; \/\/ DB model classes<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,$sf_symfony_lib_dir \/\/ Symfony itself<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,dirname(__FILE__).&#8217;\/..\/..\/apps\/stageselect\/lib&#8217; \/\/ Location app lib<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,SF_ROOT_DIR.&#8217;\/plugins&#8217;)); \/\/ Location plugins<br \/>\nset_include_path($sf_symfony_lib_dir . &#8216;\/vendor&#8217; . PATH_SEPARATOR . SF_ROOT_DIR . PATH_SEPARATOR . get_include_path());<br \/>\n&nbsp;<br \/>\ndefine(&#8216;SF_ENVIRONMENT&#8217;, &#8216;test&#8217;);<br \/>\ndefine(&#8216;SF_APP&#8217;, $app_name);<br \/>\ndefine(&#8216;SF_DEBUG&#8217;,       true);<br \/>\n&nbsp;<br \/>\nsfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir);<br \/>\nsfContext::getInstance();<br \/>\nPropel::setConfiguration(sfPropelDatabase::getConfiguration());<br \/>\nPropel::initialize();<br \/>\n\/\/ end initialise database code<br \/>\n&nbsp;<br \/>\n\/\/ \u521d\u671f\u5316\u7d42\u308f\u308a\u3001\u4ee5\u4e0b\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u304c\u7d9a\u304f&#8230;<br \/>\n&nbsp;<br \/>\n$lime = new lime_test();<br \/>\n&nbsp;<br \/>\n\/\/ :\n<\/p><\/blockquote>\n<p>&nbsp;<br \/>\n\u539f\u56e0\u306b\u3064\u3044\u3066\u306f\u30a8\u30e9\u30fc\u3084\u5bfe\u7b56\u306e\u30b3\u30fc\u30c9\u3092\u898b\u308c\u3070\u60f3\u50cf\u304c\u3064\u304f\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u5358\u4f53\u30c6\u30b9\u30c8\u3067\u306f\u6a5f\u80fd\u30c6\u30b9\u30c8\u3068\u9055\u3044 bootstrap (unit.php, functional.php)\u3092 include \u3059\u308b\u3060\u3051\u3067 symfony \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u307e\u308b\u3054\u3068\u8aad\u307f\u8fbc\u3093\u3060\u308a\u521d\u671f\u5316\u3057\u306a\u3044\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u305f\u3081\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6a5f\u80fd\u30c6\u30b9\u30c8(functional test) \u3084\u30d0\u30c3\u30c1\u30b9\u30af\u30ea\u30d7\u30c8(batch)\u3067 Propel \u3092\u4f7f\u3046\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u4ee5\u524d\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3067 sfContext::getInstance(); \u3092\u6700\u521d\u306b\u5b9f\u884c\u3059\u308c\u3070\u52d5\u4f5c\u3059\u308b\u3001\u3068\u66f8 &hellip; <a href=\"https:\/\/www.ecoop.net\/memo\/archives\/2007-09-05-1.html\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">symfony &#8211; \u5358\u4f53\u30c6\u30b9\u30c8\u3067 propel \u3092\u4f7f\u3046\u65b9\u6cd5<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[141],"tags":[32],"class_list":["post-776","post","type-post","status-publish","format-standard","hentry","category-lifehack","tag-php"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/776","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/comments?post=776"}],"version-history":[{"count":1,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/776\/revisions"}],"predecessor-version":[{"id":1676,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/776\/revisions\/1676"}],"wp:attachment":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/media?parent=776"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/categories?post=776"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/tags?post=776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}