{"id":289679,"date":"2018-09-20T18:35:02","date_gmt":"2018-09-20T14:35:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=289679"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=289679","title":{"rendered":"\u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0444\u0430\u0439\u043b\u043e\u0432"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ti\/up\/px\/tiuppxliueu75a1ycliw537yw-k.jpeg\" alt=\"image\"><\/p>\n<p>  \u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0437\u0434\u0440\u0430\u0432\u0438\u044f, \u0425\u0430\u0431\u0440\u0430\u0436\u0438\u0442\u0435\u043b\u0438!<\/p>\n<p>  \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0441\u0430\u0439\u0442\u0430 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c \u0422\u0417 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e 10 \u0444\u0430\u0439\u043b\u0430\u043c\u0438. \u041d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439-\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0442\u044b\u0441\u044f\u0447. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u0435\u0433\u043e \u043d\u044b\u043d\u0435\u0448\u043d\u0435\u043c \u0432\u0438\u0434\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0430\u0436 \u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u00ab\u043d\u0443\u043b\u0435\u0432\u044b\u0445\u00bb. \u0422\u043e \u0435\u0441\u0442\u044c \u0442\u0430\u043c \u0443\u0436\u0435 \u0442\u044b\u0441\u044f\u0447\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u0431\u0430\u0437\u0435. \u041f\u043e\u0447\u0442\u0438 \u043b\u044e\u0431\u0430\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043d\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u0443\u0437\u043b\u043e\u0432 \u0432 \u043f\u0430\u043f\u043a\u0435. \u041f\u043e \u043e\u043f\u044b\u0442\u0443 \u043c\u043e\u0433\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0443\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 1000-1500 \u0444\u0430\u0439\u043b\u043e\u0432\/\u043f\u0430\u043f\u043e\u043a \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u043f\u0430\u043f\u043a\u0435.<br \/>  <a name=\"habracut\"><\/a><br \/>  <i>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440. \u042f \u043f\u043e\u0433\u0443\u0433\u043b\u0438\u043b \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0435\u043c\u043e\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/habr.com\/post\/227855\/\">\u0442\u0443\u0442<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/habr.com\/sandbox\/51447\/\">\u0442\u0443\u0442<\/a>). \u041d\u043e \u043d\u0435 \u043d\u0430\u0448\u0451\u043b \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0432 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043c\u043e\u0435\u043c\u0443. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043b\u0438\u0448\u044c \u0434\u0435\u043b\u044e\u0441\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438.<\/i><\/p>\n<h3>\u0422\u0435\u043e\u0440\u0438\u044f<\/h3>\n<p>  \u041f\u043e\u043c\u0438\u043c\u043e \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0432\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u043e \u0435\u0449\u0451 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432 \u0422\u0417, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u0430 \u0431\u044b\u043b\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043a \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438. \u0421\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439, \u0431\u0435\u0437 \u0411\u0414 \u0442\u0443\u0442 \u043d\u0435 \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c. \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u2014 \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u0430-\u0434\u0430\u043d\u043d\u044b\u0445 (\u043f\u043e\u0434\u043f\u0438\u0441\u0438, \u0442\u0430\u0439\u0442\u043b\u044b \u0438 \u0442.\u043f.) \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435. \u041a\u0430\u0436\u0434\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0434\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u0432 \u0411\u0414. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0435\u0441\u0442\u044c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440.<\/p>\n<p>  \u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435. \u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e \u0430\u0432\u0442\u043e\u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442. \u041d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 \u0434\u0435\u0441\u044f\u0442\u043e\u043a-\u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u044b\u0441\u044f\u0447 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0412\u043e\u043f\u0440\u043e\u0441 \u0432 \u0442\u043e\u043c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0435\u043a\u0442 \u0437\u0430 \u0432\u0441\u0451 \u0432\u0440\u0435\u043c\u044f \u0435\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0430\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u044f \u00ab\u0434\u0430\u0442\u0438\u043d\u0433-\u0440\u0443\u00bb \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0442\u0435\u043d \u0442\u044b\u0441\u044f\u0447. \u041e\u0434\u043d\u0430\u043a\u043e, \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0435 \u0441\u0435\u0431\u0435 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0443\u0434\u0430\u043b\u0438\u043b\u043e\u0441\u044c \u0437\u0430 \u0432\u0440\u0435\u043c\u044f \u0436\u0438\u0437\u043d\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430; \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0435 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u043f\u043b\u044e\u0441\u0443\u0439\u0442\u0435 \u043d\u0430\u0448\u0435 \u0437\u0430\u043a\u043e\u043d\u043e\u0434\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e, \u043e\u0431\u044f\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u0445 \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043b\u0443\u0433\u043e\u0434\u0430\u2026 \u0420\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e 4 \u0441 \u043a\u043e\u043f\u0435\u0439\u043a\u0430\u043c\u0438 \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u0430 <b>UNSIGNED INT<\/b> \u0437\u0430\u043a\u043e\u043d\u0447\u0430\u0442\u0441\u044f. \u041f\u043e \u0441\u0435\u043c\u0443 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0434\u043b\u044f primary-\u043a\u043b\u044e\u0447\u0430 \u0431\u0440\u0430\u0442\u044c <b>BIGINT<\/b>.<\/p>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0447\u0438\u0441\u043b\u043e \u0442\u0438\u043f\u0430 <b>BIGINT<\/b>. \u042d\u0442\u043e 8 \u0431\u0430\u0439\u0442. \u041a\u0430\u0436\u0434\u044b\u0439 \u0431\u0430\u0439\u0442 \u2014 \u044d\u0442\u043e \u043e\u0442 0 \u0434\u043e 255. 255 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u043d\u043e\u0434 \u2014 \u044d\u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0422\u043e \u0435\u0441\u0442\u044c \u0431\u0435\u0440\u0451\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0444\u0430\u0439\u043b\u0430 \u0432 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438, \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u043c \u043e\u043d\u043e\u0435 \u043d\u0430 \u0447\u0430\u043d\u043a\u0438 \u043f\u043e \u0434\u0432\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u0430. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u0438 \u0447\u0430\u043d\u043a\u0438, \u043a\u0430\u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043f\u043e\u043a, \u043f\u0440\u0438\u0447\u0451\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d\u0438 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. PROFIT!<\/p>\n<p>  <code>0f\/65\/84\/10\/67\/68\/19\/ff.file<\/code><\/p>\n<p>  \u042d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e. \u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0442\u0443\u0442 \u043d\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e. \u0412\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0444\u0430\u0439\u043b \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443 \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 MIME-\u0442\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0431\u0430\u0437\u0435. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0444\u0430\u0439\u043b\u0435 \u0432 \u0431\u0430\u0437\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u043d\u0435\u043c\u0443 \u0434\u043b\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430. \u0421\u043a\u0430\u0436\u0435\u043c, \u0444\u0430\u0439\u043b \u0443 \u043d\u0430\u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u043e \u043f\u0443\u0442\u0438 <code>\/content\/files\/0f\/65\/84\/10\/67\/68\/19\/ff.file<\/code>. \u0410 \u0432 \u0431\u0430\u0437\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u043c\u0443 URL, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>\/content\/users\/678\/files\/somefile<\/code>. SEO-\u0448\u043d\u0438\u043a\u0438 \u0441\u0435\u0439\u0447\u0430\u0441, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0443\u043b\u044b\u0431\u043d\u0443\u043b\u0438\u0441\u044c. \u0412\u0441\u0451 \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043d\u0435 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u043e \u0442\u043e\u043c, \u0433\u0434\u0435 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<h3>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0432 \u0411\u0414<\/h3>\n<p>  \u041f\u043e\u043c\u0438\u043c\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430, MIME-\u0442\u0438\u043f\u0430, URL \u0438 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 md5 \u0438 sha1 \u0444\u0430\u0439\u043b\u043e\u0432 \u0434\u043b\u044f \u043e\u0442\u0441\u0435\u0438\u0432\u0430\u043d\u0438\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u0421\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u044d\u0442\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0441\u0432\u044f\u0437\u0438 \u0441 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c\u0438. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, ID \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b. \u0410 \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0435 \u0448\u0438\u0431\u043a\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u0442\u043e \u0432 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c, \u0441\u043a\u0430\u0436\u0435\u043c, \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438 \u0442\u043e\u0432\u0430\u0440\u043e\u0432. \u041f\u043e \u0441\u0435\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u044c.<\/p>\n<p>  \u041a\u0441\u0442\u0430\u0442\u0438, \u043e \u043f\u0442\u0438\u0447\u043a\u0430\u0445. \u0415\u0441\u043b\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 .htaccess \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438\u0437\u0432\u043d\u0435, \u0442\u043e \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 \u0441\u043a\u0440\u0438\u043f\u0442. \u0410 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0444\u0430\u0439\u043b\u0443. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0437\u0430\u0431\u0435\u0433\u0430\u044f \u0432\u043f\u0435\u0440\u0451\u0434, \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u0432 \u043c\u043e\u0435\u0439 CMS (\u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0435\u0439\u0447\u0430\u0441 \u0438 \u043f\u0438\u043b\u0438\u0442\u0441\u044f \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442) \u0434\u043e\u0441\u0442\u0443\u043f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c\u0438 \u0433\u0440\u0443\u043f\u043f\u0430\u043c\u0438, \u043a\u043e\u0438\u0445 \u0443 \u043c\u0435\u043d\u044f 8 \u2014 \u0433\u043e\u0441\u0442\u0438, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b, \u0430\u0434\u043c\u0438\u043d\u044b, \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435, \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435, \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u044b\u0435 \u0438 \u0441\u0443\u043f\u0435\u0440-\u0430\u0434\u043c\u0438\u043d\u044b. \u0421\u0443\u043f\u0435\u0440-\u0430\u0434\u043c\u0438\u043d\u0443 \u043c\u043e\u0436\u043d\u043e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0432\u0441\u0451, \u0442\u0430\u043a \u0447\u0442\u043e \u0435\u0433\u043e \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043e\u043d\u044b\u0439 \u043d\u0435 \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u0435\u0442. \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0443 \u044e\u0437\u0435\u0440\u0430 \u0444\u043b\u0430\u0433 \u0441\u0443\u043f\u0435\u0440-\u0430\u0434\u043c\u0438\u043d\u0430, \u0437\u043d\u0430\u0447\u0438\u0442 \u043e\u043d \u0441\u0443\u043f\u0435\u0440-\u0430\u0434\u043c\u0438\u043d. \u0412\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e. \u0422\u043e \u0435\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u043c\u0441\u044f \u0441\u0435\u043c\u0438 \u0433\u0440\u0443\u043f\u043f\u0430\u043c. \u0414\u043e\u0441\u0442\u0443\u043f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u2014 \u043b\u0438\u0431\u043e \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b, \u043b\u0438\u0431\u043e \u043d\u0435 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c. \u0418\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043f\u043e\u043b\u0435 \u0442\u0438\u043f\u0430 <b>TINYINT<\/b>.<\/p>\n<p>  \u0418 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043c\u043e\u043c\u0435\u043d\u0442. \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043d\u0430\u0448\u0435\u043c\u0443 \u0437\u0430\u043a\u043e\u043d\u043e\u0434\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0443 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438. \u0422\u043e \u0435\u0441\u0442\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u043f\u043e\u043c\u0435\u0447\u0430\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u043a\u0430\u043a \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u044b\u0435, \u0432\u043c\u0435\u0441\u0442\u043e \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f. \u0423\u0434\u043e\u0431\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435. \u042f \u043e\u0431\u044b\u0447\u043d\u043e \u0432 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043f\u043e\u043b\u0435 \u0442\u0438\u043f\u0430 <b>INT<\/b>. \u0427\u0442\u043e\u0431\u044b \u0441 \u0437\u0430\u043f\u0430\u0441\u043e\u043c, \u0442\u0430\u043a \u0441\u043a\u0430\u0437\u0430\u0442\u044c. \u041f\u0440\u0438\u0442\u043e\u043c \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0443\u0436\u0435 \u0443\u0441\u0442\u043e\u044f\u0432\u0448\u0430\u044f\u0441\u044f \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u0444\u043b\u0430\u0433 <b>DELETED<\/b> \u0432 5-\u043c \u0431\u0438\u0442\u0435 \u0441 \u043a\u043e\u043d\u0446\u0430. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u044f\u0442\u044c \u0442\u0430\u043a\u0438 \u0436\u0435.<\/p>\n<p>  \u0427\u0442\u043e \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0432 \u0438\u0442\u043e\u0433\u0435:  <\/p>\n<pre><code class=\"sql\">create table `files` (   `id`          bigint not null auto_increment, -- \u041f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447   `entity_type` char(32) not null default '', -- \u0422\u0438\u043f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438   `entity`      bigint null, -- ID \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438   `mime`        char(32) not null default '', -- MIME-\u0442\u0438\u043f   `md5`         char(32) not null default '', -- MD5   `sha1`        char(40) not null default '', -- SHA1   `file`        char(64) not null default '', -- \u0424\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435   `url`         varchar(250) not null default '', -- URL   `meta`        text null, -- \u041c\u0435\u0442\u0430-\u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON \u0438\u043b\u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430   `size`        bigint not null default '0', -- \u0420\u0430\u0437\u043c\u0435\u0440   `created`     datetime not null, -- \u0414\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f   `updated`     datetime null, -- \u0414\u0430\u0442\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f   `access`      tinyint not null default '0', -- \u0411\u0438\u0442\u043e\u0432\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f   `flags`       int not null default '0', -- \u0424\u043b\u0430\u0433\u0438   primary key (`id`),   index (`entity_type`),   index (`entity`),   index (`mime`),   index (`md5`),   index (`sha1`),   index (`url`)   ) engine = InnoDB;<\/code><\/pre>\n<h3>\u041a\u043b\u0430\u0441\u0441-\u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0444\u0430\u0439\u043b\u044b \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c. \u041a\u043b\u0430\u0441\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b, \u0437\u0430\u043c\u0435\u043d\u044f\u0442\u044c\/\u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0444\u0430\u0439\u043b\u044b, \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0444\u0430\u0439\u043b\u044b. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0441\u0442\u043e\u0438\u0442 \u0443\u0447\u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043c\u043e\u043c\u0435\u043d\u0442\u0430. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043f\u0440\u043e\u0435\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0451\u043d \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u0417\u043d\u0430\u0447\u0438\u0442 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0435 \u043a\u043e\u0440\u043d\u0435\u0432\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0444\u0430\u0439\u043b\u043e\u0432. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e, \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0433\u0440\u043e\u0445\u043d\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u0411\u0414. \u0417\u043d\u0430\u0447\u0438\u0442 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445. \u0421 \u043f\u0435\u0440\u0432\u044b\u043c \u0432\u0441\u0451 \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u0427\u0442\u043e \u0436\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u043e \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c.<\/p>\n<p>  <b>ID<\/b> \u2014 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430<br \/>  <b>entity_type<\/b> \u2014 \u043d\u0435 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f<br \/>  <b>entity<\/b> \u2014 \u043d\u0435 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f<br \/>  <b>mime<\/b> \u2014 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f finfo<br \/>  <b>md5<\/b> \u2014 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0441\u0430\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430<br \/>  <b>sha1<\/b> \u2014 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0441\u0430\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430<br \/>  <b>file<\/b> \u2014 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430<br \/>  <b>url<\/b> \u2014 \u043d\u0435 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f<br \/>  <b>meta<\/b> \u2014 \u043d\u0435 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f<br \/>  <b>size<\/b> \u2014 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0441\u0430\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430<br \/>  <b>created<\/b> \u2014 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u0444\u0430\u0439\u043b\u0430<br \/>  <b>updated<\/b> \u2014 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u0444\u0430\u0439\u043b\u0430<br \/>  <b>access<\/b> \u2014 \u043d\u0435 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f<br \/>  <b>flags<\/b> \u2014 \u043d\u0435 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f<\/p>\n<p>  \u0421\u0440\u0430\u0437\u0443 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043c\u0435\u0442\u0430-\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u041e\u043d\u0430 \u043d\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u0430 \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0418 \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0441\u0451 \u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c MIME-\u0442\u0438\u043f. \u0418\u0442\u043e\u0433\u043e: \u0442\u0438\u043f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, ID \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, MIME, URL, \u0434\u043e\u0441\u0442\u0443\u043f \u0438 \u0444\u043b\u0430\u0433\u0438. \u0414\u0430\u0431\u044b \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0432 \u0441\u0430\u043c\u043e\u0439 \u043f\u0430\u043f\u043a\u0435.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  class BigFiles {     const FLAG_DELETED = 0x08000000; \/\/ \u041f\u043e\u043a\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u043b\u0430\u0433 \"\u0423\u0434\u0430\u043b\u0451\u043d\"      \/** @var mysqli $_db *\/     protected $_db       = null;     protected $_webRoot  = '';     protected $_realRoot = '';      function __construct(mysqli $db = null) {         $this-&gt;_db = $db;     }      \/**      * \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\/\u0447\u0442\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u043d\u044f \u0434\u043b\u044f URL-\u043e\u0432      * @param string $v  \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435      * @return string      *\/     public function webRoot($v = null) {         if (!is_null($v)) {             $this-&gt;_webRoot = $v;         }         return $this-&gt;_webRoot;     }      \/**      * \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\/\u0447\u0442\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u043d\u044f \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432      * @param string $v  \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435      * @return string      *\/     public function realRoot($v = null) {         if (!is_null($v)) {             $this-&gt;_realRoot = $v;         }         return $this-&gt;_realRoot;     }      \/**      * \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u0430      * @param array  $data    \u0414\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430      * @param string $url     URL \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0438      * @param string $eType   \u0422\u0438\u043f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438      * @param int    $eID     ID \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438      * @param mixed  $meta    \u041c\u0435\u0442\u0430-\u0434\u0430\u043d\u043d\u044b\u0435      * @param int    $access  \u0414\u043e\u0441\u0442\u0443\u043f      * @param int    $flags   \u0424\u043b\u0430\u0433\u0438      * @param int    $fileID  ID \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430      * @return bool      * @throws Exception      *\/     public function upload(array $data, $url, $eType = '', $eID = null, $meta = null, $access = 127, $flags = 0, $fileID = 0) {         $meta = is_array($meta) ? serialize($meta) : $meta;         if (empty($data['tmp_name']) || empty($data['name'])) {             $fid = intval($fileID);             if (empty($fid)) {                 return false;             }             $meta = empty($meta) ? 'null' : \"'\" . $this-&gt;_db-&gt;real_escape_string($meta) . \"'\";             $q = \"`meta`={$meta},`updated`=now()\";             $this-&gt;_db-&gt;query(\"UPDATE `files` SET {$q} WHERE (`id` = {$fid}) AND (`entity_type` = '{$eType}')\");             return $fid;         }         \/\/ File data         $meta  = empty($meta) ? 'null' : \"'\" . $this-&gt;_db-&gt;real_escape_string($meta) . \"'\";         $finfo = finfo_open(FILEINFO_MIME_TYPE);         $mime  = finfo_file($finfo , $data['tmp_name']);         finfo_close($finfo);         \/\/ FID, file name         if (empty($fileID)) {             $eID = empty($eID) ? 'null' : intval($eID);             $q = &lt;&lt;&lt;sql insert into `files` set     `mime`       = '{$mime}',     `entity`     = {$eID},     `entityType` = '{$eType}',     `created`    = now(),     `access`     = {$access},     `flags`      = {$flags} sql;             $this-&gt;_db-&gt;query($q);             $fid = $this-&gt;_db-&gt;insert_id;             list($ffs, $fhn) = self::fid($fid);             $url = $this-&gt;_webRoot . $url . '\/' . $fid;             $fdir = $this-&gt;_realRoot . $ffs;             self::validateDir($fdir);             $index = self::getIndex($fdir);             $index[$fhn] = array($fhn, $mime, $url, ($eID == 'null' ? 0 : $eID), $access, $flags);             self::setIndex($fdir, $index);             $fname = $ffs . '\/' . $fhn . '.file';         } else {             $fid = intval($fileID);             $fname = $this-&gt;fileName($fid);         }         \/\/ Move file         $fdir = $this-&gt;_realRoot . $fname;         if (!move_uploaded_file($data['tmp_name'], $fdir)) {             throw new Exception('Upload error');         }         $q = '`md5`=\\'' . md5_file($fdir) . '\\',`sha1`=\\'' . sha1_file($fdir) . '\\','            . '`size`=' . filesize($fdir) . ',`meta`=' . $meta . ','            . (empty($fileID) ? \"`url`='{$url}',`file`='{$fname}'\" : '`updated`=now()');         $this-&gt;_db-&gt;query(\"UPDATE `files` SET {$q} WHERE (`id` = {$fid}) AND (`entity_type` = '{$eType}')\");         return $fid;     }      \/**      * \u0427\u0442\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430      * @param string $url         URL      * @param string $basicGroup  \u0411\u0430\u0437\u043e\u0432\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f      * @throws Exception      *\/     public function read($url, $basicGroup = 'anonimous') {         if (!ctype_alnum(str_replace(array('\/', '.', '-', '_'), '', $url))) {             header('HTTP\/1.1 400 Bad Request');             exit;         }         $url = $this-&gt;_db-&gt;real_escape_string($url);         $q = \"SELECT * FROM `files` WHERE `url` = '{$url}' ORDER BY `created` ASC\";         if ($result = $this-&gt;_db-&gt;query($q)) {             $vars = array();             $ints = array('id', 'entity', 'size', 'access', 'flags');             while ($row = $result-&gt;fetch_assoc()) {                 foreach ($ints as $i) {                     $row[$i] = intval($row[$i]);                 }                 $fid = $row['id'];                 $vars[$fid] = $row;             }             if (empty($vars)) {                 header('HTTP\/1.1 404 Not Found');                 exit;             }             $deleted = false;             $access  = true;             $found   = '';             $mime    = '';             foreach ($vars as $fdata) {                 $flags   = intval($fdata['flags']);                 $deleted = ($flags &amp; self::FLAG_DELETED) != 0;                 $access  = self::granted($basicGroup, $fdata['access']);                 if (!$access || $deleted) {                     continue;                 }                 $found   = $fdata['file'];                 $mime    = $fdata['mime'];             }             if (empty($found)) {                 if ($deleted) {                     header('HTTP\/1.1 410 Gone');                     exit;                 } elseif (!$access) {                     header('HTTP\/1.1 403 Forbidden');                     exit;                 }             } else {                 header('Content-type: ' . $mime . '; charset=utf-8');                 readfile($this-&gt;_realRoot . $found);                 exit;             }         }         header('HTTP\/1.1 404 Not Found');         exit;     }      \/**      * \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 (\u0444\u0430\u0439\u043b\u043e\u0432) \u0438\u0437 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430      * @param mixed $fid  \u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440(\u044b)      * @return bool      * @throws Exception      *\/     public function delete($fid) {         $fid = is_array($fid) ? implode(',', $fid) : $fid;         $q = \"delete from `table` where `id` in ({$fid})\";         $this-&gt;_db-&gt;query($q);         $result = true;         foreach ($fid as $fid_i) {             list($ffs, $fhn) = self::fid($fid_i);             $fdir = $this-&gt;_realRoot . $ffs;             $index = self::getIndex($fdir);             unset($index[$fhn]);             self::setIndex($fdir, $index);             $result &amp;= unlink($fdir . '\/'. $fhn . '.file');         }         return $result;     }      \/**      * \u041f\u043e\u043c\u0435\u0447\u0430\u0435\u0442 \u0444\u0430\u0439\u043b(\u044b) \u0444\u043b\u0430\u0433\u043e\u043c \"\u0443\u0434\u0430\u043b\u0435\u043d\u043e\"      * @param int  $fid    \u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440(\u044b)      * @param bool $value  \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u043b\u0430\u0433\u0430      * @return bool      *\/     public function setDeleted($fid, $value=true) {         $fid = is_array($fid) ? implode(',', $fid) : $fid;         $o = $value ? ' | ' . self::FLAG_DELETED : ' &amp; ' . (~self::FLAG_DELETED);         $this-&gt;_db-&gt;query(\"update `files` set `flags` = `flags` {$o} where `id` in ({$fid})\");         return true;     }      \/**      * \u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430      * @param int $fid  \u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440      * @return string      * @throws Exception      *\/     public function fileName($fid) {         list($ffs, $fhn) = self::fid($fid);         self::validateDir($this-&gt;_realRoot . $ffs);         return $ffs . '\/' . $fhn . '.file';     }      \/**      * \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0444\u0430\u0439\u043b\u0430.      * \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u043f\u0430\u043f\u043a\u043e\u0439 \u043a \u0444\u0430\u0439\u043b\u0443 \u0438 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0438\u0440\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u043b\u0430\u0434\u0448\u0435\u0433\u043e \u0431\u0430\u0439\u0442\u0430.      * @param int $fid  \u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0444\u0430\u0439\u043b\u0430      * @return array      *\/     public static function fid($fid) {         $ffs = str_split(str_pad(dechex($fid), 16, '0', STR_PAD_LEFT), 2);         $fhn = array_pop($ffs);         $ffs = implode('\/', $ffs);         return array($ffs, $fhn);     }      \/**      * \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0444\u0430\u0439\u043b\u0430      * @param string $f  \u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0443      * @return bool      * @throws Exception      *\/     public static function validateDir($f) {         if (!is_dir($f)) {             if (!mkdir($f, 0700, true)) {                 throw new Exception('cannot make dir: ' . $f);             }         }         return true;     }      \/**      * \u0427\u0442\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430      * @param string $f  \u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430      * @return array      *\/     public static function getIndex($f) {         $index = array();         if (file_exists($f . '\/.index')) {             $_ = file($f . '\/.index');             foreach ($_ as $_i) {                 $row = trim($_i);                 $row = explode('|', $row);                 array_walk($row, 'trim');                 $rid = $row[0];                 $index[$rid] = $row;             }         }         return $index;     }      \/**      * \u0417\u0430\u043f\u0438\u0441\u044c \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430      * @param string $f      \u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430      * @param array  $index  \u041c\u0430\u0441\u0441\u0438\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043d\u0434\u0435\u043a\u0441\u0430      * @return bool      *\/     public static function setIndex($f, array $index) {         $_ = array();         foreach ($index as $row) {             $_[] = implode('|', $row);         }         return file_put_contents($f . '\/.index', implode(\"\\r\\n\", $_));     }      \/**      * \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438      * @param string $group  \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0433\u0440\u0443\u043f\u043f\u044b (\u0441\u043c. \u043d\u0438\u0436\u0435)      * @param int    $value  \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u0432      * @return bool      *\/     public static function granted($group, $value=0) {         $groups = array('anonimous', 'user', 'manager', 'admin', 'inactive', 'blocked', 'deleted');         if ($group == 'root') {             return true;         }         foreach ($groups as $groupID =&gt; $groupName) {             if ($groupName == $group) {                 return (((1 &lt;&lt; $groupID) &amp; $value) != 0);             }         }         return false;     } }<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b:<br \/>   \u2014 <b>realRoot<\/b> \u2014 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0434\u043e \u043f\u0430\u043f\u043a\u0438 \u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u043e\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0441\u043b\u0435\u0448\u0435\u043c.<br \/>   \u2014 <b>webRoot<\/b> \u2014 \u043f\u0443\u0442\u044c \u043e\u0442 \u043a\u043e\u0440\u043d\u044f \u0441\u0430\u0439\u0442\u0430 \u0431\u0435\u0437 \u0432\u0435\u0434\u0443\u0449\u0435\u0433\u043e \u0441\u043b\u0435\u0448\u0430 (\u043d\u0438\u0436\u0435 \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u043f\u043e\u0447\u0435\u043c\u0443).<br \/>   \u2014 \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0421\u0423\u0411\u0414 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 <b>MySQLi<\/b>. <br \/>   \u2014 \u041f\u043e \u0441\u0443\u0442\u0438 \u0432 \u043c\u0435\u0442\u043e\u0434 <b>upload<\/b> \u043f\u0435\u0440\u0432\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <b>$_FILES<\/b>.<br \/>   \u2014 \u0415\u0441\u043b\u0438 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <b>update<\/b> \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c ID \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0451\u043d, \u0435\u0441\u043b\u0438 \u0432 <b>tmp_name<\/b> \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043f\u0443\u0441\u0442\u044b\u043c.<br \/>   \u2014 \u0423\u0434\u0430\u043b\u044f\u0442\u044c \u0438 \u043c\u0435\u043d\u044f\u0442\u044c \u0444\u043b\u0430\u0433\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0448\u0442\u0443\u043a. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0444\u0430\u0439\u043b\u0430 \u043b\u0438\u0431\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u043c\u0438, \u043b\u0438\u0431\u043e \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u043e\u043d\u044b\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e.<\/p>\n<h3>\u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u0441\u0451 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u0441\u0442\u0440\u043e\u0447\u043a\u0430\u043c \u0432 htaccess \u0432 \u043a\u043e\u0440\u043d\u0435 \u0441\u0430\u0439\u0442\u0430 (\u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e mod_rewrite \u0432\u043a\u043b\u044e\u0447\u0435\u043d):<\/p>\n<pre><code class=\"apache\">RewriteCond %{REQUEST_URI} ^\/content\/(.*)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+)$ content\/index.php?file=$1 [L,QSA]<\/code><\/pre>\n<p>  \u00abcontent\u00bb \u2014 \u044d\u0442\u043e \u043f\u0430\u043f\u043a\u0430 \u0432 \u043a\u043e\u0440\u043d\u0435 \u0441\u0430\u0439\u0442\u0430 \u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435. \u0421\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439 \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443. \u041d\u0443 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u0441\u0430\u043c index.php, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0439\u0441\u044f \u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432 \u043f\u0430\u043f\u043a\u0435 content:<\/p>\n<pre><code class=\"php\">&lt;?php     $dbHost = '127.0.0.1';     $dbUser = 'user';     $dbPass = '****';     $dbName = 'database';      try {         if (empty($_REQUEST['file'])) {             header('HTTP\/1.1 400 Bad Request');             exit;         }         $userG = 'anonimous';         \/\/ \u0412\u043e\u0442 \u0442\u0443\u0442 \u0431\u0443\u0434\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u0443 \u044e\u0437\u0435\u0440\u0430; \u043b\u044e\u0431\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u0412\u0430\u0448 \u0432\u044b\u0431\u043e\u0440         $files = new BigFiles(new mysqli($dbHost,$dbUser,$dbPass,$dbName));         $files-&gt;realRoot(dirname(__FILE__).'\/files\/');         $files-&gt;read($_REQUEST['file'],$userG);     } catch (Exception $e) {         header('HTTP\/1.1 500 Internal Error');         header('Content-Type: text\/plain; charset=utf-8');         echo $e-&gt;getMessage();         exit;     } <\/code><\/pre>\n<p>  \u041d\u0443 \u0438 \u0441\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439 \u0437\u0430\u043a\u0440\u043e\u0435\u043c \u0441\u0430\u043c\u0443 \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043e\u0442 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u041f\u043e\u043b\u043e\u0436\u0438\u043c \u0432 \u043a\u043e\u0440\u0435\u043d\u044c \u043f\u0430\u043f\u043a\u0438 <code>content\/files<\/code> \u0444\u0430\u0439\u043b <code>.htaccess<\/code> \u0441 \u043e\u0434\u043d\u043e\u0439 \u043b\u0438\u0448\u044c \u0441\u0442\u0440\u043e\u0447\u043a\u043e\u0439:<\/p>\n<pre><code class=\"apache\">Deny from all<\/code><\/pre>\n<h3>\u0418\u0442\u043e\u0433<\/h3>\n<p>  \u0414\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u043e\u0442\u0435\u0440\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438\u0437-\u0437\u0430 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0444\u0430\u0439\u043b\u043e\u0432. \u041f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0431\u0435\u0434\u044b \u0432 \u0432\u0438\u0434\u0435 \u0442\u044b\u0441\u044f\u0447 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0442\u043e\u0447\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c. \u0418 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0442\u0435\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0444\u0430\u0439\u043b\u0430\u043c \u043f\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e-\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u0430\u0434\u0440\u0435\u0441\u0430\u043c. \u041f\u043b\u044e\u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043d\u0430\u0448\u0435\u043c\u0443 \u043c\u0440\u0430\u0447\u043d\u043e\u043c\u0443 \u0437\u0430\u043a\u043e\u043d\u043e\u0434\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0443. \u0421\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c, \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u041d\u0415 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0437\u0430\u0449\u0438\u0442\u044b \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430. \u041f\u043e\u043c\u043d\u0438\u0442\u0435: \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435, \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e.<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/423875\/\"> https:\/\/habr.com\/post\/423875\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ti\/up\/px\/tiuppxliueu75a1ycliw537yw-k.jpeg\" alt=\"image\"><\/p>\n<p>  \u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0437\u0434\u0440\u0430\u0432\u0438\u044f, \u0425\u0430\u0431\u0440\u0430\u0436\u0438\u0442\u0435\u043b\u0438!<\/p>\n<p>  \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0441\u0430\u0439\u0442\u0430 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c \u0422\u0417 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e 10 \u0444\u0430\u0439\u043b\u0430\u043c\u0438. \u041d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439-\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0442\u044b\u0441\u044f\u0447. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u0435\u0433\u043e \u043d\u044b\u043d\u0435\u0448\u043d\u0435\u043c \u0432\u0438\u0434\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0430\u0436 \u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u00ab\u043d\u0443\u043b\u0435\u0432\u044b\u0445\u00bb. \u0422\u043e \u0435\u0441\u0442\u044c \u0442\u0430\u043c \u0443\u0436\u0435 \u0442\u044b\u0441\u044f\u0447\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u0431\u0430\u0437\u0435. \u041f\u043e\u0447\u0442\u0438 \u043b\u044e\u0431\u0430\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043d\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u0443\u0437\u043b\u043e\u0432 \u0432 \u043f\u0430\u043f\u043a\u0435. \u041f\u043e \u043e\u043f\u044b\u0442\u0443 \u043c\u043e\u0433\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0443\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 1000-1500 \u0444\u0430\u0439\u043b\u043e\u0432\/\u043f\u0430\u043f\u043e\u043a \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u043f\u0430\u043f\u043a\u0435.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-289679","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/289679","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=289679"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/289679\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=289679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=289679"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=289679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}