×ðÁú¿­Ê±¹ÙÍøµÇ¼

laravel Æô¶¯Á÷³Ì

laravel ÊÇÒ»ÖÖÊ¢ÐÐµÄ php web ¿ª·¢¿ò¼Ü¡£ËüÌṩÁËÒ»ÖÖ¾«Á·¡¢Ò×ÓÚѧϰºÍʹÓõĿª·¢·½·¨¡£laravel µÄÆô¶¯Á÷³Ì°üÀ¨Á˶à¸ö°ì·¨ £¬Ã¿¸ö°ì·¨¶¼ÓÐÆäÌض¨µÄ×÷Óá£ÔÚÄ»ºó £¬laravel ±³ºóµÄÊÂÇéÁ÷³ÌÊÇÖØ´óµÄ £¬µ« larevel µÄ¿ò¼ÜÉè¼ÆʹµÃÕû¸öÆô¶¯Á÷³Ì¸üΪ¼òÆÓÖ±¹Û¡£ÏÂÎĽ«ÏêϸÏÈÈÝ larevel µÄÆô¶¯Á÷³Ì¡£

Ò»¡¢¼ÓÔØ¿ò¼Ü½¹µã

Laravel µÄËùÓÐÆô¶¯Àú³Ì¶¼ÊÇͨ¹ý³ÌÐòÈë¿ÚÎļþ×îÏȵÄ¡£Õû¸öÆô¶¯Á÷³Ì´Ó public/index.php Îļþ×îÏÈ¡£¸ÃÎļþΨһµÄ¹¦Ð§ÊǼÓÔØ Laravel ¿ò¼ÜµÄ½¹µãÎļþ¡£ÔÚ public/index.php ÖÐ £¬ÎÒÃÇ¿ÉÒÔ¿´µ½ÒÔÏ´úÂëƬ¶Ï£º

require __DIR__.'/../vendor/autoload.php';
$app = require_once __DIR__.'/../bootstrap/app.php';

µÇ¼ºó¸´ÖÆ

µÚÒ»ÐдúÂëÈÏÕæ¼ÓÔØ Composer ÌìÉúµÄ vendor Ŀ¼ÏµÄ×Ô¶¯¼ÓÔØÆ÷¡£¸Ã×Ô¶¯¼ÓÔØÆ÷ÎļþÔÚÔËÐÐʱ¶¯Ì¬µØ¼ÓÔØ¿ò¼ÜËùÐèµÄËùÓÐÒÀÀµ¡£

µÚ¶þÐÐÔòÈÏÕæ¼ÓÔØ Laravel Ó¦ÓóÌÐòµÄ½¹µã¡£¸ÃÐдúÂëͨ¹ýŲÓà bootstrap/app.php ÎļþÖÐµÄ bootstrap() º¯Êý·µ»ØÒ»¸öʵÀý»¯µÄÓ¦ÓóÌÐò¹¤¾ß $app¡£

¶þ¡¢ÔËÐÐ Bootstrap

bootstrap/app.php ÎļþÊÇ Laravel µÄÖ¸µ¼Îļþ¡£¸ÃÎļþ³õʼ»¯²¢ÉèÖøÿò¼ÜµÄÖÖÖÖЧÀͺÍ×é¼þ¡£±ðµÄ £¬¸ÃÎļþ»¹¼ÓÔØÁËÓ¦ÓóÌÐòµÄÉèÖá¢Â·ÓÉ¡¢ÖÐÑë¼þ¡¢Òì³£´¦Àí³ÌÐòµÈ¡£

ÔÚ bootstrap/app.php ÎļþÖÐ £¬ÎÒÃÇ¿ÉÒÔ¿´µ½ÒÔÏ´úÂëƬ¶Ï£º

$app = new IlluminateFoundationApplication(
    realpath(__DIR__.'/../')
);

$app->singleton(
    IlluminateContractsHttpKernel::class,
    AppHttpKernel::class
);

$app->singleton(
    IlluminateContractsConsoleKernel::class,
    AppConsoleKernel::class
);

$app->singleton(
    IlluminateContractsDebugExceptionHandler::class,
    AppExceptionsHandler::class
);

return $app;

µÇ¼ºó¸´ÖÆ

ÕâЩ´úÂëƬ¶Ï³õʼ»¯ÁËÓ¦ÓóÌÐòµÄ½¹µã £¬°üÀ¨£º

ʵÀý»¯Ò»¸ö Application ¹¤¾ß £¬¸Ã¹¤¾ßΪӦÓóÌÐòµÄ¿ØÖÆ̨ÔËÐÐʱºÍ HTTP ÔËÐÐʱÌṩ»ù´¡ÉèÊ©¡£

°ó¶¨ÖÖÖÖЧÀÍÌṩÕß £¬Èç IlluminateContractsHttpKernel, IlluminateContractsConsoleKernel, ºÍ IlluminateContractsDebugExceptionHandler¡£

Èý¡¢¼ÓÔØЧÀÍÌṩÕß

ÎÒÃÇÔÚÉÏÒ»²½ÖÐÒѾ­Ìáµ½Ó¦ÓÃÁËÈýÖÖЧÀÍÌṩÕß¡£Ð§ÀÍÌṩÕßÊÇ Laravel Ó¦ÓóÌÐòÄ£¿é»¯µÄ»ù´¡ £¬ÈÏÕæΪӦÓóÌÐòµÄËùÓй¦Ð§ÌṩЧÀÍ¡£

ЧÀÍÌṩÕß±»½ç˵ÔÚ config/app.php ÎļþÖÐµÄ providers Êý×éÖÐ £¬¸ÃÊý×éÁгöÁËÓ¦ÓóÌÐòÖÐËùÓпÉÓõÄЧÀÍÌṩÕß¡£ÔÚÆô¶¯Ó¦ÓóÌÐòʱ £¬ Laravel ½«±éÀúËùÓеÄЧÀÍÌṩÕß £¬²¢ÎªÖ®½¨Éèµ¥¸ö°ó¶¨¡£ÕâÑù £¬Ó¦ÓóÌÐòµÄÆäËû×é¼þ¾Í¿ÉÒÔÇáËɵػá¼ûËùÐèµÄЧÀÍ¡£

ÀýÈç £¬ÈôÊÇÎÒÃÇÔÚ config/app.php ÎļþÖÐÌí¼ÓÒÔÏ´úÂëƬ¶Ï£º

'providers' => [
    // ...
    AppProvidersCustomServiceProvider::class,
    // ...
],

µÇ¼ºó¸´ÖÆ

µ±Ó¦ÓóÌÐòÆô¶¯Ê± £¬ Laravel ʵÀý»¯²¢×¢²á AppProvidersCustomServiceProvider Àà £¬ÆäÒªÁìÓ¦·µ»ØÒ»¸öЧÀÍÈÝÆ÷ʵÀý¡£

ËÄ¡¢×Ô½ç˵Æô¶¯Âß¼­

Laravel µÄ¿ò¼ÜÉè¼ÆʹµÃ×Ô½ç˵ӦÓóÌÐòÆô¶¯Á÷³ÌºÜÊÇÈÝÒס£¿ÉÒÔͨ¹ýÌí¼Ó×Ô½ç˵Âß¼­À´ÔöÇ¿Ó¦ÓóÌÐòµÄ¹¦Ð§ºÍÐÔÄÜ¡£

ÔÚ bootstrap/app.php ÎļþÖÐ £¬ÓÐһЩԤ½ç˵µÄÆô¶¯Âß¼­ £¬ÈçÒÔÏ´úÂëƬ¶Ï£º

$app->registerCoreContainerAliases();

µÇ¼ºó¸´ÖÆ

ÈôÊÇÏ£ÍûÌí¼Ó×Ô½ç˵µÄÆô¶¯Âß¼­ £¬¿ÉÒÔÔÚ bootstrap/app.php ÎļþĩβÌí¼Ó´úÂë¡£ÀýÈç £¬ÔÚÆô¶¯Ê±¿ÉÒÔΪӦÓóÌÐòÌí¼Ó×Ô½ç˵ÉèÖãº

$config = new MyCustomConfiguration();
$config->load();

µÇ¼ºó¸´ÖÆ

Îå¡¢Æô¶¯ HTTP / Console ÄÚºË

½ÓÏÂÀ´ £¬Ó¦ÓóÌÐòÆô¶¯ HTTP Äں˻ò¿ØÖÆ̨ÄÚºË £¬ÕâÈ¡¾öÓÚÓ¦ÓóÌÐò½«ÔõÑùʹÓá£ÔÚ bootstrap/app.php ÎļþÖÐ £¬ÎÒÃÇÉèÖÃÁËÕâÁ½¸öÄںˣº

$app->singleton(
    IlluminateContractsHttpKernel::class,
    AppHttpKernel::class
);

$app->singleton(
    IlluminateContractsConsoleKernel::class,
    AppConsoleKernel::class
);

µÇ¼ºó¸´ÖÆ

ÏÖÔÚ £¬Ó¦ÓóÌÐòÒѾ­×¼±¸Í£µ± £¬¿ÉÒÔƾ֤ÐèÒªÆô¶¯¿ØÖÆ̨»ò HTTP ÔËÐÐʱ¡£ÔÚ Laravel ÖÐ £¬¿ÉÒÔͨ¹ý Artisan ÏÂÁîÐй¤¾ßÆô¶¯¿ØÖÆ̨ £¬Ò²¿ÉÒÔÔÚÉèÖÃµÄ Web ЧÀÍÆ÷ÉÏÔËÐÐËüÀ´Æô¶¯ HTTP ÔËÐС£

Áù¡¢Ö´ÐÐÏìÓ¦ÇëÇó

ÈôÊÇÆô¶¯ HTTP »ù´¡¼Ü¹¹ £¬µ±Óû§»á¼ûÓ¦ÓóÌÐòʱ £¬ÇëÇ󽫽øÈë Laravel ½¹µãµÄ public/index.php Îļþ¡£¸ÃÎļþͨ¹ý·ÓÉϵͳ½«ÇëÇóת´ïµ½×¼È·µÄ¿ØÖÆÆ÷ÒªÁì¡£

×ܵÄÀ´Ëµ £¬Laravel µÄÆô¶¯Á÷³ÌÉæ¼°Ðí¶à°ì·¨ £¬´Ó¼ÓÔØ¿ò¼Ü½¹µã×îÏÈ £¬²¢Í¨¹ýЧÀÍÌṩÕß¡¢×Ô½ç˵Æô¶¯Âß¼­ÒÔ¼°¿ØÖÆ̨ºÍ HTTP Äں˳ÌÐòÆô¶¯µÄÀú³Ì¡£ÕâÖÖÁ÷³ÌʽÉè¼ÆʹµÃ Laravel ÊÇÒ»ÖÖºÜÊÇÎÞа¡¢¿É¶¨ÖÆÇÒÒ×ÓÚʹÓõĿò¼Ü £¬ÊÊÓÃÓÚÖÖÖÖ¹æÄ£µÄÓ¦ÓóÌÐò¿ª·¢¡£

ÒÔÉϾÍÊÇlaravel Æô¶¯Á÷³ÌµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ