äžéšã®è£œåãšä»ã®è£œåãšã®çµ±åã¯ãç¹ã«ããããæå³ãããŠããªãå Žåãçœãæè¢ã§ã¯ã»ãšãã©è¡ãããŸããã éåžžãå°ãªããšãç§ã®çµéšã§ã¯ãäžæ¹ã®è£œåãšä»æ¹ã®è£œåã«ç»ãããã®ã³ãŒãã調ã¹ãããã¯ãæžããäžæ¹ã®è¶³ãããäžæ¹ã®è¶³ã«çªã£èŸŒãã«ã¯ãè¢ããŸããäžããªããã°ãªããŸããã ããã¯ãå¥ã®ãã¡ã€ã«ã«ç§»åããããšã¯ãã£ãã«ãããŸãããã¯ã©ã¹ã«ç§»åããé »åºŠã¯ããã«äœãããã³ãã¬ãŒãã䜿çšãããšãç¹ã«ãã³ãã¬ãŒããæäŸãããªãå Žåã¯ãã¹ãŠãå°é£ã«ãªããŸãã éåžžããã®ã³ãŒãã¯åºãåºå®ãããŠããã補åã®æŽæ°æã«åé¡ãåŒãèµ·ããã補åãäžå¯èœãŸãã¯éåžžã«è€éã«ããŸãã ãã®èšäºã§ã¯ãä»ã®è£œåãBitrixã®ããŒã¿ã«ïŒãã©ãã®ã£ã©ãªãŒããã©ãŒã©ã ããã£ããïŒã«çµ±åããæ¹æ³ã«ã€ããŠã話ããããšæããŸãã
ãã®ç¹ã§ç§ã«ãšã£ãŠã¯ãããšãã°ãããŒã¿ã«ãæå³ãããšããã«ããããŒã¿ã«ã«æ¥ç¶ãããå¯èœæ§ãé«ããã©ãŒã©ã ããçµ±åããŒã«ãæäŸããŠããªãããå°ãªããšãã³ãŒãã«æœåšçãªæ©äŒãæäŸããŠããªãããšã¯ããªãé©ãã¹ãããšã§ãã ç§ã®æèŠã§ã¯ãä»ã®å Žæããç°¡åã«æ¥ç¶ã§ããããã«ããã³ãã¬ãŒããæ§æãããã³åæåã³ãŒããå¥ã
ã«åãåºãããšã¯ããã»ã©é£ãããããŸããã ã¯ããã¹ããããããã°ããŒãã«å€æ°-åå¥ã®åå空éãŸãã¯éçå€æ°ãæã€åå¥ã®ã¯ã©ã¹ãäœæããã®ã¯æ¬åœã«é£ããã§ããïŒ ãŸããæ¬åœã«ããããªãã§ã¯ã§ããªãå Žåã¯ãå°ãªããšãããããèããããªãããã«é
ã«çœ®ããŠãå¿
èŠã«å¿ããŠå®æçã«å
¥æã§ããŸãã ããããããžãã¯ã«ã¯æéãããããŸã-ã³ãŒãã¯é·ãéæžãããŠããã誰ããããæãäžããããªããããã¯åäœããŸã-å
¥ããªãã§ãããžãã¹ãç解ããŸãã-ããªãã¯äœã«æéã浪費ããŠããŸããïŒ æ°ããæ©èœãå®è£
ããæ¹ãè¯ãã§ãããããããããéãåãåããŸãã ãããŠãããã¯çããŠããŸãã ããããããªããã«ãŠã³ããããªãã¯å€¢äžã«ãªã£ãŠããŸãã ããžãã¹ã«ã
BitrixïŒ ãšãŠãããã
ç§ã«ãšã£ãŠãçŸãããããžã§ã¯ãã®1ã€ã¯ãæ°ãããããžã§ã¯ãã®ã¿ã¹ã¯ãåãåã£ãããšã§ãã ããŒã¿ã«ã¯ããªãåã«äœæããããã以æ¥ç®¡çã¬ãã«ã§ç¶æãããŠãããæ°ããçåœãå¹ã蟌ãå¿
èŠããããŸããã ã¿ã¹ã¯ã¯ãããã°ã©ãã³ã°ãITå
šè¬ããããªãé ã人ã«ãã£ãŠèšå®ããããããäž»ã«ã¡ãã¥ãŒé
ç®ã®å€æŽãå€èŠ³ã®å€æŽãªã©ã«éå®ãããŸããã 確ãã«ããã¹ãŠã®ã¿ã¹ã¯ã¯ã»ãšãã©è°è«ã®å¯Ÿè±¡ã§ã¯ãªãããã¹ãŠã®ã³ã¹ãã§å®äºããå¿
èŠããããŸããã 圌ãã¯ç§ã«å¿ããç°¡åã«å°ããããšãã§ããŸãããããªãããŒã¿ã«ããã©ãŒã©ã ã§ããã«æ€çŽ¢ã§ããªãã®ã§ããïŒ æ€çŽ¢ãã©ãŒã ãããã®ã§ã圌女ã¯ã©ããæ¢ããŠããŸãããïŒ ãããŠãã©ã®ããã«ããŠåœŒå¥³ãã©ãã«ã§ãèŠããã§ããããïŒã ãããŠããã®ãããªç¡éªæ°ãªã圌ãã®èŠ³ç¹ãããã¿ã¹ã¯ãå®çŸããå¿
èŠããããŸãã ç§ã¯ä»äºã®éãèŠãŠããããžã§ã¯ãã«ç²Ÿéãã«è¡ããŸããã
ç§ã¯bitrixã§ããŒã¿ã«ãèŠãŸããã æ©èœãã»ãšãã©ãªãéåžžã®æ
å ±ããŒã¿ã«ã¯ãããªãå€ããã®ã§ãã ããŒã¿ã«ã«ã¯ãåå¥ã®è£œåãšããŠããã©ãã®ã£ã©ãªãŒããã©ãŒã©ã ããã£ãããä»å±ããŠããŸããããããã¯ãèšèšäžãããŒã¿ã«ã«äŒŒãŠããŸãããã©ã®ããã«ãçµ±åãããŠããŸããã§ããã ããŒã¿ã«ã®ãã¹ãŠã®èŠçŽ ã¯ããšãããåãã¿ã¹ã¯ãæã£ãŠããŸã-ããããåãå€èŠ³ã«ãããã€ãŸã-Bitrixããæšæºã®ããããŒãšããŒã¹ã¡ã³ããè¿œå ããŸãã ç§ãã¡ãç¹æ ã®æ代ã«äœãã§ããŠããã¹ãŠã®äººãå¹³çã§ããœãŒã»ãŒãžã®ã³ã¹ãã2p.20kopã ã£ãå ŽåããããŠãã¹ãŠã®ãœãããŠã§ã¢è£œåã¯OOPã®ææ°ã®åŸåãèæ
®ããŠèšè¿°ãããã¿ã¹ã¯ã¯ãããã®è£œåã®ãã³ãã¬ãŒããš10åéã®ã¹ãã«ã®ç°¡åãªèªç¥ãŠã©ãŒã¯ã«å€ãããŸãç¶æ¿ãããã¯ã©ã¹ãŸãã¯æ¥ç¶ãã¿ãŒã³ã ããããããã¯çããããšã¯éå±ã ããã ãã€ãã®ããã«ãBitrixã¯ç§ãæ倧éã«æ¥œããŸããŸããã
è
åšåæã
ããã§ããŸãã幞éãªçç±ã§ããŸã å
éšããBitrixã«æ
£ããŠããªã人ã®ããã®å°ããªææã ãã®äžã®ããžãã¯ãšè¡šç€ºã¯ã³ã³ããŒãã³ãå
ã§ã®ã¿åé¢ãããŸãããã«ãŒãã«å
šäœã¯ä»¥åã®ããŒãžã§ã³ã®æ§é ãä¿æããŠããããããã¹ãŠãæ··åãããŸãã
å
žåçãªbitrixããŒãžã¯æ¬¡ã®ããã«ãªããŸãã
<?require_once $_SERVER['DOCUMENT_ROOT'].'/bitrix/header.php'?>
.
<?require_once $_SERVER['DOCUMENT_ROOT'].'/bitrix/footer.php'?>
åæã«ãããŒãžã®ããããŒãšããã¿ãŒã«ã¯ããã³ãã¬ãŒãã®ã¬ã³ããªã³ã°ãå«ãbitrixã®ããžãã¯ããããŸãã ãã³ãã¬ãŒãã®è¡šç€ºãå¶åŸ¡ããããžãã¯ããŠãŒã¶ãŒã¹ã¯ãªããã«èšè¿°ã§ããããã«ããããã«ãBitrixã¯ããããé
延åŒã³åºãé¢æ°ã䜿çšããŸãã ãããã¯ãã§ã«äœåºŠãæžãããŠããŸãïŒããšãã°ã
ãããBitrixã®ããã¥ã¡ã³ããªã©ïŒããããã£ãŠãç§ã¯äºåºŠãšåºããŸããã ãã®ãããªé¢æ°ãæ©èœããã«ã¯ããããã¡ãªã³ã°ãå¿
èŠã§ãããããã£ãŠãããããŒåŒã³åºãã§ã¯ãå
容ãåžåããããã«ãããã¡ãéãããå°äžã§ã¯ããããã¡ãéãããããã®å
容ãã¹ããªãŒã ã«ãã³ããããŸãã
Bitrixã¯ç¬èªã®æ¹æ³ã§ãŠããŒã¯ã§ããããã®äžéšãã©ã®ããã«æ©èœããããç解ãããå Žåã¯ãéåžžãããã«ã³ãŒãã«å
¥ãããšãæåã§ãã ããã«æ°åãæªããªããªãå Žåã¯ãããã§éåžžã«èå³æ·±ããã®ãèŠã€ããããšãã§ããŸãã ããã¥ã¡ã³ãã¯è¯ãã®ã§ãããããã§å¿
èŠãªãã®ãèŠã€ããããšãåžžã«ã§ãããšã¯éããŸããããBitrixã¯ä»ã®è£œåãšã®çµ±åãç®çãšããŠããªãããïŒ1Cãæå³ããããã§ã¯ãããŸããïŒãæäœæ¥ã§ä»äžããå¿
èŠããããŸãã ã ãããé²æ¯ãã¹ã¯ãã€ããŠæœãã
ãã¡ã€ã«/bitrix/modules/main/include/prolog_before.phpã®è¿ãã§æ³³ããŸãã ãããŠããããã¡ãªã³ã°ãæ
åœããã³ãŒããããã¯ããããŸãã
if(COption::GetOptionString("main", "buffer_content", "Y")=="Y" && (!defined("BX_BUFFER_USED") || BX_BUFFER_USED!==true))
{
ob_start(Array(&$APPLICATION, "EndBufferContent"));
$APPLICATION->buffered = true;
define("BX_BUFFER_USED", true);
}
<offtop>
ãšããã§ãããŒãžã§ã³7ã§ã¯ããã®åŸã次ã®è¡ã衚瀺ãããŸãã
register_shutdown_function(create_function('', 'while(@ob_end_flush());'));
ç§ãBitrixãæããŠããã®ã§ãããã§ç§ã¯ãªã©ãã¯ã¹ã§ãããåžžã«è¯ãç¶æ
ãä¿ã£ãŠããŸãã
</ Offtop>
ãããŠãèå³æ·±ã質åãçããŸãã ã³ã³ãã³ãããããã¡ããå¿
èŠããããã©ããã瀺ãbuffer_contentèšå®ãããããšãããããŸãã ããã¯ã管çããã«ãä»ããŠèšå®ãããŠããããæšæºã®ãŒãããŒã¹ã§ã¯ååšããªãããšã¯æ³šç®ã«å€ããŸãïŒã¯ãªãŒã³ãªbitrixãã€ã³ã¹ããŒã«ããå ŽåïŒã ãããã£ãŠãããã©ã«ãå€ïŒãã®å Žåã¯ãYãïŒã䜿çšãããŸãã ãããããããè¿œå ããŠãNãã«èšå®ãããšã©ããªããŸããïŒ ããŒã¿ããŒã¹ãb_optionããŒãã«ã«é²ã¿ãããã§éå§ããŸãã 次ã«ã/ bitrix / managed_cacheãã©ã«ããŒãã¯ãªãŒã³ã¢ããããã¹ã¯ãªãããèšè¿°ããããšããŸãã ããã ãã§ãã³ã³ãã³ãã¯ãããã¡ãªã³ã°ãããªããªããå®éã«ã¯ãããŒãžã®ããããŒã®å€èŠ³ïŒã¿ã€ãã«ãªã©ïŒãå€æŽããæ©èœã倱ãããŸãã ãã ããããã§ã¯ãã©ã¡ããããéèŠããéžæããå¿
èŠããããŸãã
ãŸããbitrixèªäœã®ã¡ãœãããã€ãŸãCOption :: SetOptionStringã¡ãœããã䜿çšããŠèšå®ãèšå®ããããšãã§ããŸãã ãã ããæåŸ
ã©ããã«æ©èœããªãããšã«æ³šæããŠãã ããã ini_seté¢æ°ãšåæ§ã«ãããã䜿çšããèšå®ãã¹ã¯ãªããã®æéäžã«èšå®ãããŠããå Žåãç§ã«ã¯è«ççã«æããŸããã ãã ãããã®ã¡ãœããã¯ããŒã¿ããŒã¹ã«èšå®ãçŽæ¥èšå®ããã ãã§ãã ini_setããã®ããã«åäœããããšãæ³åããŠãã ãã-ã¹ã¯ãªããã«å¯ŸããŠerror_reportingïŒE_ALLïŒãæå¹ã«ããŸã-ãããŠããã¹ãã£ã³ã°å
šäœãããŠã³ããŸããã ããã§ããããã¡ãªã³ã°ãæå¹å/ç¡å¹åããæ¹æ³ãåŠã³ãŸããã
ãŠã©ãŒã ã¢ããã
ã©ã€ã³ã®æåã®é¡§å®¢ã¯ã®ã£ã©ãªãŒã§ãã
ããã§ã¯ãã±ãŒã¹ã¯éåžžã«åçŽã§ã-ããããŒãæ¥ç¶ããã ãã§ãã 確ãã«ãäž¡æ¹ã®è£œåã®ã°ããŒãã«å€æ°ãžã®äŸåã«ãããããã§ã¯ãäžè§é¢ä¿ãçºçããŸããïŒbitrixããã©ãã®ã£ã©ãªãŒãã°ããŒãã«å€æ°$ USERã ãã®ãããèšå®ããã«åé€ããå¿
èŠããããŸããã ãã ãããã®ç¶æ³ã¯ãäœããã®çç±ã§OOPãšã«ãã»ã«åã®äœ¿çšãé åºã«æåŠãã補åã®çµ±åã§ã¯éåžžã«äžè¬çã§ãã ãŸããç¥ã¯åœŒããèš±ããŸãã å°äžå®€ã§ã¯ããã¹ãŠãéåžžã«ç°¡åã§ã-ã°ããŒãã«$ varnameãä»ããŠã°ããŒãã«å€æ°ïŒããã§ã¯$ APPLICATIONã®ã¿ãå¿
èŠïŒãåŒãåºãã ãã§ããããããããŸããã
å³ãããã©ãŒã©ã ã
2çªç®ã«ç¶ãã±ãŒã¹ã¯ãvbullentinãã©ãŒã©ã ã§ãã 第äžã«ããããæ¯æãããŠãããããèªå®¶ã§ã³ãŒãã«å
¥ãããšãã§ããªãããšããããŠç¬¬äºã«ãããã¯ãŸãã²ããæã€éé
·ãªç·æ§ã«ãã£ãŠæžãããŠããããïŒåœŒãã®åããã¹ãŠæãããã®ã§ãæ€çŽ¢ã¹ã¯ãªãããç解ããããšããããšãã§ããŸãïŒãã©ãŒã©ã ã§ïŒã
ãã³ãã¬ãŒããšã³ãžã³ã«ã¯ç¬èªã®phpã³ãŒãããããå®è¡ãããªãããããã³ãã¬ãŒãã§ã¹ã¯ãªããæ¥ç¶ãæ©èœããŸããã§ããã 圌ãã§ããå¯äžã®ããšã¯ãããphpå€æ°ãå¥ã®phpå€æ°ã«çœ®ãæããããšã§ãã ä»ã«ãªãã®ã§ãç§ã¯ããã䜿ããªããã°ãªããŸããã§ããã ãã®ãããªå€æ°ãå
¥åããããã«ããã©ãŒã©ã ã§ã¯phpã§ãããã³ã°ïŒããã¯ïŒãèšè¿°ããç¹å®ã®ã€ãã³ãïŒåœç¶ãè©äŸ¡ïŒã§ããããå®è¡ã§ããŸãã ã€ãã³ãã®1ã€ã¯éåžžã«é©ããŠããã®ã§ãããã§åžœåãåºå·ããããšã¯ããªãå¯èœã§ããã åé¡ã¯ããã³ãã¬ãŒãåºåã®åã«ããã¯ãå®è¡ããããããBitrixããããŒã®åºåããããã¡ãªã³ã°ããå¿
èŠããã£ãããšã§ãã ã€ãŸãããŠã§ããžã¯ãŠã§ããžã«ãã£ãŠè¿œãåºãããŸãã æåã¯ç§ã¯é·ãéè¯ãæ¹æ³ã§è©Šã¿ãŸãããæ£çŽã«Bitrixã«ãã£ãŠéããããããã¡ãŒãéããããšããŸããããç§ã®è©Šã¿ã¯ãã¹ãŠç¡é§ã§ãã-ããã§ç§ã¯ãããå
æããããšãã§ããŸããã§ããã 誰ããæåããå Žåã¯ãã¬ã€ã¢ãŠãããŠãã ãã-ãããã©ã®ããã«é£Œãæ
£ããããŠããããèŠãããšã«èå³ããããŸãã
ãããã£ãŠããã©ãŒã©ã ãã¬ã³ããªã³ã°ããå Žåã¯ãäžèšã®æ¹æ³ã§ææ¬çãªå¯Ÿçãè¬ããbuffer_contentãã©ã¡ãŒã¿ãŒã䜿çšããŠãããã¡ãªã³ã°ãç¡å¹ã«ããããšã«ããŸããã ã€ãŸããã¹ã¯ãªãã/bitrix/php_interface/init.phpã«æ¬¡ã®ã³ãŒããè¿œå ããå¿
èŠããããŸããã
if(strpos($APPLICATION->GetCurDir(), '/forum/') === false)
COption::SetOptionString("main", "buffer_content", "Y",'','ru');
else
COption::SetOptionString("main", "buffer_content", "N",'','ru');
ãã¡ãããããã¯æ²ãã£ãŠããŠäžå¿«ã§ãããåäœããŸãã ããã§ããã©ãŒã©ã èªäœã®ãã³ãã¬ãŒããã¬ã³ããªã³ã°ããåã«ãããããŒãšå°äžã®äž¡æ¹ããããã¡ãŒã§ããŸãã ããªãã¡ïŒ
ob_start();
include('bitrix/header.php');
$bitrixheader = ob_get_clean();
åæ§ã«å°äžå®€ã§ã ãããŠã$ bitrixHeaderå€æ°ããã³ãã¬ãŒãã«åºåããŸãã ãã¡ãããããã§ã¯ã°ããŒãã«å€æ°ãèšå®ãããŠããªãããã§ã¯ãããŸãããããããã¯äºçŽ°ãªããšã§ãã
ã¹ããã3.åãããã³perlã
ãŸãã軜é£ã®ããã«-ãã£ããã ãã®ãªãã·ã§ã³ã¯ãbitrixã«åé¡ããã£ãããšãããªãã£ããããæãå°é£ã§ããããšãå€æããŸããã 1996幎ã«2002幎ã®æ¿å
¥ç©ã§æžãããçç ã®ãã£ãããåãã¹ã¿ã€ã«ïŒããããã£ã¿ã°ã§æå®ãããåäžã®ã¹ã¿ã€ã«ã§ã¯ãªããã¬ãŒã ã»ããïŒããã³ãã¬ãŒãã®åäžã®ãã³ãã§ã¯ãªããtxtãã¡ã€ã«ã®ããŒã¿ããœãªããã¹ããªãŒã ã§ã®åºåãè¯ãããã€ãã®æ©èœããããŸããããããããã¹ãŠãåºæ¿çã§ããã ã¯ãããã®å€èŠ³ã«ããããŒãžãéããããšæããŸãããã奜ã¿ã«ã€ããŠã¯è°è«ããŸãã-ãŠãŒã¶ãŒã¯ããã奜ãã§ãã倧äžå€«ã§ãã PHPã®ã³ã³ãœãŒã«ãèµ·åããã¹ã¯ãªãããå®è¡ããŠçµæã衚瀺ããããã®å¯äžã®æ¹æ³ã§æ¿å
¥ãè¡ãå¿
èŠããããŸããã Bitrix capsãŸãã¯basementãå®è¡ãããšãã¹ã¯ãªãããçµäºããããããããã¡ãŒãã¹ããªãŒã ã«åºåãããŸãããããã«ã¯åé¡ã¯ãããŸããã å¯äžã®åŸ®åŠãªç¹ã¯ãã¹ã¯ãªãããã³ã³ãœãŒã«ã§å®è¡ããããããBitrixã®éå§ã¹ã¯ãªãããšçµäºã¹ã¯ãªãããç¹å¥ãªæ¹æ³ã§æ¥ç¶ããå¿
èŠããã£ãããšã§ããã
å
¬åŒããã¥ã¡ã³ãã§ã¯ããã«ã€ããŠããªã容èªã§ããŸãã ãã£ããã®äž»ãªåé¡ã¯ããã®æãããæ§é ãšç«æŽŸãªå¹Žéœ¢ã®ããã«ããããŠç§ãç§ã®äººçã§åããŠçç ãèŠãããã«ãèµ·ãããŸããã ç§ã¯éåžžã«æéãåããã®ã§ãä»ã¯æ
éã«çç ã®ã¹ã¯ãªãããéããŸãã ãã®çµæãæ¶ãåºãªãã»ã©ã²ã©ãæªç©ã«ãªããŸãããå¥ã®ãã¬ãŒã ãè¿œå ããŠããã«ããããŒã衚瀺ããå¿
èŠããããŸããã çç ã®ã¹ã¯ãªãããphpã¹ã¯ãªãããåŒã³åºããšãããã¯ãçºçããŸããphpã¹ã¯ãªããã¯ãå
éšã§å¥ã®çç ã®ã¹ã¯ãªãããåŒã³åºããŸã...äœæ¥ãçµããåŸãæãæŽã£ãŠKunstkameraã«åŒãæž¡ããããšæããŸããã govnokod.ruã¯äŒãã§ããŸãã
ãããã«
ããããBitrixãšã®çµ±åã®1ã€ã§ãã ã¡ãªã¿ã«ãç§ã¯ãã®äººæ°ã«ãããããããèªåã§èšå®ããŠãã¡ã€ã«ã§ã·ã£ãŒãã«ããããã®åºç¯ãªè³æããªãããšã«é©ããŠããŸã-ã»ãã®å°æ°ã®æçããèŠã€ãããŸããã§ããã ããã«ããã€ãã£ããã©ãŒã©ã ã¯æããã«ä»ã®ãã©ãŒã©ã ãããå£ã£ãŠããããããµãŒãããŒãã£ãã©ãŒã©ã ãžã®çµ±åãè¡ãããŠããŸãã ãã®ç¹ã§å
±æãããã®ãããå Žå-ããªãã¯å€§æè¿ã§ããããã¯ç¥ãããšã¯èå³æ·±ãã§ãããã
perlã®ãã³ããš
å€åãªé埳çãµããŒãã«ã€ããŠ
biorootã«æè¬ããŸãã