{"id":453,"date":"2014-05-09T14:10:44","date_gmt":"2014-05-09T06:10:44","guid":{"rendered":"http:\/\/blog.turn.tw\/?p=453"},"modified":"2014-05-09T14:10:44","modified_gmt":"2014-05-09T06:10:44","slug":"%e6%88%912%e6%9c%8812%e8%99%9f%e5%88%b05%e6%9c%888%e8%99%9f%e5%ad%b8%e5%88%b0%e4%ba%86%e4%bb%80%e9%ba%bc%ef%bc%9f%ef%bc%88%e8%bb%9f%e9%ab%94%e7%af%87%ef%bc%89","status":"publish","type":"post","link":"https:\/\/blog.turn.tw\/?p=453","title":{"rendered":"\u62112\u670812\u865f\u52305\u67088\u865f\u5b78\u5230\u4e86\u4ec0\u9ebc\uff1f\uff08\u8edf\u9ad4\u7bc7\uff09"},"content":{"rendered":"<p>\u5de5\u4f5c\u5e7e\u500b\u6708\u4e4b\u5f8c\u6211\u958b\u59cb\u60f3\uff1a<\/p>\n<p>\u5927\u5bb6\u90fd\u5e0c\u671b\u5de5\u4f5c\u7d93\u9a57\u8d8a\u4e45\u3001\u85aa\u6c34\u8d8a\u9ad8\uff0c\u6191\u4ec0\u9ebc\uff1f<\/p>\n<p>\u5e74\u7d00\u8d8a\u5927\uff0c\u5be6\u529b\u4e00\u5b9a\u8d8a\u5f37\u55ce\uff1f<\/p>\n<p>\u6240\u4ee5\u6211\u6bd4\u4e0a\u500b\u6708\u5f37\uff1f\u6211\u6bd4\u6628\u5929\u5f37\uff1f<\/p>\n<p>\u5230\u5e95\u5f37\u5728\u54ea\uff1f\u96e3\u9053\u53ea\u80fd\u7a7a\u6cdb\u7684\u56de\u7b54\uff1a\u6211\u7d93\u9a57\u66f4\u8c50\u5bcc\u4e86\u3002<\/p>\n<p>\u65bc\u662f\u6211\u5c31\u958b\u59cb\u7b46\u8a18\uff0c\u660e\u78ba\u7684\u8a18\u4e0b\u4f86\uff0c\u70ba\u4ec0\u9ebc\u6211\u6bcf\u5929\u90fd\u6bd4\u524d\u4e00\u5929\u5f37\u3002<\/p>\n<p>\u5beb\u5230\u4eca\u5929\u7d04\u83ab\u4e09\u500b\u6708\u4e86\uff0c\u6c7a\u5b9a\u6253\u6210\u300c\u8edf\u9ad4\u7bc7\u300d\u3001\u300c\u7ba1\u7406\u7bc7\u300d\u5169\u7bc7\u6587\u7ae0\u3002<\/p>\n<p>\u8ddf\u5404\u4f4d\u5206\u4eab\u9019\u672c\u6d41\u6c34\u5e33\u3002<\/p>\n<p><strong style=\"line-height: 1.5;\">2\u670812\u865f<\/strong><\/p>\n<p>* \u7b2c\u4e00\u6b21\u7528\u5225\u5f35table\u7684id\u7576\u4e3b\u9375\uff0c\u4ee5\u524d\u90fd\u662f\u65b0\u5efa\u4e00\u500bid\u6b04\u4f4d\u7576\u4e3b\u9375<\/p>\n<p>* \u7b2c\u4e00\u6b21\u4f7f\u7528CodeIgniter\u5167\u5efa\u7684Test library<\/p>\n<p>* \u61c9\u7528\u4e86Jamie Rumbelow\u7684MY_Model\u8ddf\u5b83\u7684relationship\u529f\u80fd<\/p>\n<p>* \u6211\u7d42\u65bc\u77e5\u9053\u600e\u9ebc\u5beb\u55ae\u5143\u6e2c\u8a66\u4e86\uff01<\/p>\n<p>* \u7b2c\u4e00\u6b21\u61c9\u7528Mock up\u7684\u6280\u5de7<\/p>\n<p>* \u7b2c\u4e00\u6b21\u628adependency injection\u61c9\u7528\u5728\u820a\u7684model<\/p>\n<p><strong>2\u670813\u865f<\/strong><\/p>\n<p>* \u66ff\u6bcf\u500bweb app\u5728server\u4e0a\u5efa\u4e00\u500b\u5e33\u865f\u6709\u597d\u8655\u3002\u6539root\u5bc6\u78bc\u6642\u5c31\u4e0d\u7528\u5168\u90e8shut down\u4e86\u3002<\/p>\n<p>* \u55ae\u5143\u6e2c\u8a66\u771f\u4e0d\u932f\u3002\u4f60\u66ffmodel\u52a0\u65b0\u529f\u80fd\uff0c\u63a5\u8457\u52a0\u65b0test\uff0c\u7136\u5f8c\u4f60\u53ef\u4ee5\u78ba\u5b9a\u5168\u90e8\u529f\u80fd\u904b\u4f5c\u6b63\u5e38<\/p>\n<p>* \u5b78\u6703\u600e\u9ebc\u7528JavaScript\u9a57\u8b49input\u662f\u6574\u6578\u4f86\u9054\u5230\u4e0d\u932f\u7684User Experience\u3002<\/p>\n<p>* \u5f88\u6d41\u66a2\u7684\u5b8c\u6210\u7684\u4e00\u6bb5\u8907\u96dc\u7684\u4ea4\u6613\u7cfb\u7d71\u3002<\/p>\n<p><span style=\"line-height: 1.5;\">* \u5728\u9700\u8981\u540c\u6642\u958b\u767c\u65b0\u529f\u80fd\u3001\u4feebug\u3001\u66f4\u65b0\u7f8e\u5de5\u7684\u60c5\u6cc1\u4e0b\uff0c\u7528git\u7684branch\u505a\u4e86\u826f\u597d\u7684\u7ba1\u7406\u3002<\/span><\/p>\n<p><strong>2\u670814\u865f<\/strong><\/p>\n<p>* \u64cd\u4f60\u5abd\u7684Bitbucket\u5c45\u7136\u6703\u639b\u7ad9\u3002\u6240\u4ee5\u6211\u5b78\u6703\u5982\u4f55\u5728windows\u4e0a\u7528AppServ, WINSCP, GitShell, Putty, LinuxReader\u9054\u5230\u985e\u4f3cLinux\u7684\u958b\u767c\u74b0\u5883\u4e86\u3002<\/p>\n<p>* \u5abd\u7684PHP\u5c45\u7136\u75c5\u6bd2\u822c\u5403\u5149\u6211Linux\u8cc7\u6e90\u3002\u6240\u4ee5\u6211\u5b78\u6703recovery \u6a21\u5f0f\u3001top\u9084\u6709kill\u6307\u4ee4\u4e86\u3002<\/p>\n<p><strong>2\u670819\u865f<\/strong><\/p>\n<p>* \u5728\u524d\u4e00\u4efdphp\u6a94\u5b9a\u7fa9\u5e38\u6578\u53ef\u4ee5\u9632\u6b62\u7570\u5e38\u4f7f\u7528\u7576\u524d\u7684php\u6a94\u6b38<\/p>\n<p>* \u77e5\u9053php\u7684singleton\u51fd\u5f0f\u600e\u9ebc\u5beb\u4e86<\/p>\n<p><strong>2\u670820\u865f<\/strong><\/p>\n<p>* \u5be6\u4f5c\u4e00\u500b\u7c21\u6613log\u7cfb\u7d71<\/p>\n<p>* \u5b78\u6703jeditable\uff0c\u9084\u6709\u4e00\u9ede\u5c0fhack<\/p>\n<p><span style=\"line-height: 1.5;\">* Restful\u7684\u5b9a\u7fa9\u591a\u7406\u89e3\u4e86\u4e00\u4e9b\u3002<\/span><\/p>\n<p><strong>3\u67083\u865f<\/strong><\/p>\n<p>* \u539f\u4f86\u700f\u89bd\u5668\u5728submit\u8868\u55ae\u53ea\u652f\u63f4GET\u8ddfPOST<\/p>\n<p>* \u77e5\u9053\u600e\u9ebc\u6d41\u66a2\u8655\u7406exceptions\u6216\u662ferrors\u4e86<\/p>\n<p>* \u81ea\u5275\u4e00\u5957\u65b9\u6cd5\uff0c\u5728model\u5167\u61c9\u7528validation library\u3002\uff08\u5225\u4eba\u90fd\u5728controller\u5167\u7528\uff0c\u6211\u89ba\u5f97\u919c\u6b7b\u4e86\u3002\uff09<\/p>\n<p>* \u77e5\u9053\u600e\u9ebc\u7528salt\u8ddfhash\u66f4\u5b89\u5168\u7684\u8655\u7406\u5bc6\u78bc\u8cc7\u6599\u3002<\/p>\n<p><span style=\"line-height: 1.5;\">* \u5abd\u7684\u7528salt\u4e0b\u53bbhash\uff0c\u4e1f\u5931salt\u4e4b\u5f8c\u70ba\u4ec0\u9ebc\u9084\u662f\u53ef\u4ee5\u9a57\u8b49\uff1f\u4e0a\u4e00\u500b\u5de5\u7a0b\u5e2b\u5230\u5e95\u5728\u5beb\u6bba\u5c0f\uff1f<\/span><\/p>\n<p><strong>3\u67085\u865f<\/strong><\/p>\n<p>* catch\u4f4fexception\uff0c\u53ef\u4ee5\u986f\u793a\u932f\u8aa4\u8a0a\u606f\u7136\u5f8c\u518d\u4e1f\u51fa\u53bb\u3002\u9019\u6a23\u4e0d\u932f\u3002<\/p>\n<p>* \u5b78\u5230\u4e86\u7b2c\u4e09\u65b9\u5957\u4ef6Mandrill\u9084\u6709\u5b83\u7684\u8a2d\u8a08\u67b6\u69cb\u3002<\/p>\n<p><strong>3\u67086\u865f<\/strong><\/p>\n<p>* \u5b78\u6703\u600e\u9ebc\u7528phpmail\u900f\u904egmail\u767c\u4fe1\u4e86<\/p>\n<p>* \u5be6\u4f5c\u4e86\u300c\u5fd8\u8a18\u5bc6\u78bc\u300d\u7684\u7a0b\u5e8f<\/p>\n<p><strong>3\u67088\u865f<\/strong><\/p>\n<p>* \u4ed6\u5abd\u7684\uff0cmysql\u7684float\u5c45\u7136\u90231.3\u62161.4\u90fd\u5b58\u4e0d\u597d\uff0c\u5e79\u3002<\/p>\n<p>* php\u6709array_unique\u8ddfunset\u9019\u5169\u500b\u51fd\u5f0f\u6b38\u3002\u7cd9\uff0c\u9019\u8a9e\u8a00\u771f\u7684\u6c92\u4ec0\u9ebc\u54c1\u5473\u3002<\/p>\n<p>* \u5c07simpletest\u5c0e\u5165CodeIgniter\u4e26\u4e14\u6e96\u5099\u4f7f\u7528\u5b83\u4e86\u3002<\/p>\n<p>* \u4eca\u5929\u53c8\u78b0\u4e86\u4e00\u6b21spark<\/p>\n<p><strong>3\u670810\u865f<\/strong><\/p>\n<p><span style=\"line-height: 1.5;\">* \u9019\u8f29\u5b50\u7b2c\u4e00\u6b21\u53bb\u770bApache\u7684server log\u4f86debug\uff01<\/span><\/p>\n<p><strong>3\u670814\u865f<\/strong><\/p>\n<p>* \u7406\u89e3\u5230controller\u61c9\u8a72\u5e7e\u4e4e\u4ec0\u9ebc\u90fd\u4e0d\u505a\uff0c\u4f46model\u4e5f\u4e0d\u80fd\u592a\u5927\u3002\u6240\u6709class\u90fd\u61c9\u8a72\u8981\u5c0f\uff01\u7528library\u5427\uff0c\u4e0d\u8981\u51fa\u73feGod Pattern\uff0c\u4e0d\u8981\u51fa\u73femixin(\u5546\u696d\u908f\u8f2f\u8207\u5448\u73fe\u6df7\u5728\u4e00\u8d77)\u3002\u6bcf\u500bclass\u5c08\u6ce8\u5728\u4e00\u4ef6\u4e8b\u4e0a\uff01<\/p>\n<p><strong>3\u670817\u865f<\/strong><\/p>\n<p>* \u77e5\u9053\u5982\u4f55\u7528table\u5c07email\u5167\u5bb9\u7f6e\u4e2d<\/p>\n<p><strong>3\u670821\u865f<\/strong><\/p>\n<p>* \u5b78\u6703migration\u4e86<\/p>\n<p><span style=\"line-height: 1.5;\"><strong style=\"line-height: 1.5;\">3\u670822\u865f<\/strong><\/span><\/p>\n<p>* \u6703\u7528simpletest\u4e86<\/p>\n<p>* \u66f4\u4e86\u89e3Test Driven Development<span style=\"line-height: 1.5;\">\u00a0<\/span><\/p>\n<p><strong>4\u67083\u865f<\/strong><\/p>\n<p>* \u66f4\u61c2abstract class\u662f\u4ec0\u9ebc\u4e86\u3002\uff08\u8ab0\u8981\u662f\u7e7c\u627f\u6211\uff0c\u5c31\u5fc5\u9808\u63d0\u4f9b\u9019\u4e9b\u51fd\u5f0f\uff09<\/p>\n<p>* \u5728Github\u4e0a\u958b\u4e86\u6211\u751f\u6daf\u7b2c\u4e00\u500bissue<\/p>\n<p><strong><span style=\"line-height: 1.5;\">4\u67089\u865f<\/span><\/strong><\/p>\n<p>* \u5ba2\u88fd\u5316Exception\u6709\u5169\u7a2e\uff1a\u50b3\u5165code\u6216\u76f4\u63a5\u7e7c\u627f\u5b83<\/p>\n<p>\u9019\u6a23\u7406\u89e3\u5b83\uff1a<\/p>\n<p>\u7528code\u5c31\u662f\u72c2\u6b20\u6280\u8853\u50b5\uff08\u4e00\u5806\u6c92\u6574\u7406\u7684\u6578\u5b57\uff09\uff0c\u4f46\u5e7e\u4e4e\u6c92\u5229\u606f\u8981\u9084<\/p>\n<p>\u7528\u7e7c\u627f\u7684\u65b9\u5f0f\u5c31\u662f\u8cc7\u7522\uff0c\u4f46\u958b\u767c\u6bd4\u8f03\u6162<\/p>\n<p><strong>4\u670810\u865f<\/strong><\/p>\n<p>* \u7406\u89e3\u524d\u8f29\u7684log library\u5728\u5beb\u4ec0\u9ebc\u4e86<\/p>\n<p><span style=\"line-height: 1.5;\">* \u7406\u89e3PHP\u00a0set_error_handler\u8ddfset_exception_handler\uff0c\u9084\u6709<\/span>CI\u5982\u4f55\u7d44\u7e54\u5b83\u5011\u4e86<\/p>\n<p><strong>4\u670818\u865f<\/strong><\/p>\n<p>* \u77e5\u9053\u4e86CI, FuelPHP, Kohana, Laravel\u7684\u6b77\u53f2\u80cc\u666f\u4e86<span style=\"line-height: 1.5;\">\u00a0<\/span><\/p>\n<div>\n<p><strong>4\u670823\u865f<\/strong><\/p>\n<p>* \u539f\u4f86\u4e0a\u50b3\u6a94\u6848\u6703\u88abPHP\u66ab\u5b58\u5728tmp\u8cc7\u6599\u593e\uff0c\u7a0b\u5f0f\u8dd1\u5b8c\u6703\u81ea\u52d5\u522a\u6389\u3002<\/p>\n<p>* \u800c\u5be6\u4f5c\u4e0a\u50b3\u529f\u80fd\u53ea\u662f\u628a\u5b83\u5f9etmp\u79fb\u51fa\u53bb\u800c\u5df2\u3002<\/p>\n<p><strong><span style=\"line-height: 1.5;\">5\u67082\u865f<\/span><\/strong><\/p>\n<p>* \u7b2c\u4e00\u6b21\u63a5\u89f8Angular.js\u3002\u9177\u6583\u4e86\u3002\u4f46\u5b83\u597d\u50cf\u5f88\u81ea\u6210\u4e00\u5957\uff0c\u800c\u4e14\u8ddfjQuery\u4e0d\u76f8\u5bb9\u3002<\/p>\n<p>* \u6211\u767c\u73fe\u6211\u7684JavaScript\u9084\u662f\u5beb\u6210procedural programming\uff0c\u4e26\u4e0d\u662fOOP\u6216\u662ffunctional programming\uff01<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<p><span style=\"line-height: 1.5;\">(Photo via \u00a0<\/span><a style=\"line-height: 1.5;\" href=\"https:\/\/www.flickr.com\/photos\/freddyfromutah\/\">Brady Withers<\/a><span style=\"line-height: 1.5;\">, CC license)<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5de5\u4f5c\u5e7e\u500b\u6708\u4e4b\u5f8c\u6211\u958b\u59cb\u60f3\uff1a \u5927\u5bb6\u90fd\u5e0c\u671b\u5de5\u4f5c\u7d93\u9a57\u8d8a\u4e45\u3001\u85aa\u6c34\u8d8a\u9ad8\uff0c\u6191\u4ec0\u9ebc\uff1f \u5e74\u7d00\u8d8a\u5927\uff0c\u5be6\u529b\u4e00\u5b9a\u8d8a\u5f37\u55ce\uff1f \u6240\u4ee5\u6211\u6bd4\u4e0a\u500b &hellip; <a href=\"https:\/\/blog.turn.tw\/?p=453\" class=\"more-link\">\u7e7c\u7e8c\u95b1\u8b80 <span class=\"screen-reader-text\">\u62112\u670812\u865f\u52305\u67088\u865f\u5b78\u5230\u4e86\u4ec0\u9ebc\uff1f\uff08\u8edf\u9ad4\u7bc7\uff09<\/span> <span class=\"meta-nav\">&rarr;<\/span> <\/a><\/p>\n","protected":false},"author":1,"featured_media":454,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[2,4],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.turn.tw\/index.php?rest_route=\/wp\/v2\/posts\/453"}],"collection":[{"href":"https:\/\/blog.turn.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.turn.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.turn.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.turn.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=453"}],"version-history":[{"count":12,"href":"https:\/\/blog.turn.tw\/index.php?rest_route=\/wp\/v2\/posts\/453\/revisions"}],"predecessor-version":[{"id":480,"href":"https:\/\/blog.turn.tw\/index.php?rest_route=\/wp\/v2\/posts\/453\/revisions\/480"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.turn.tw\/index.php?rest_route=\/wp\/v2\/media\/454"}],"wp:attachment":[{"href":"https:\/\/blog.turn.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.turn.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.turn.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}