laravel important concepts and implementation methods

5266 단어

Initialization of Application


$app = new Illuminate\Foundation\Application(
    realpath(__DIR__.'/../')
);

Register basic bindings


$this->instance();


Register the corresponding alias in the instances array

$this->registerBaseBindings();


Bind app and Container to an instance array, and the implementations are both instances of Application
$this->instance('app', $this);
$this->instance('Illuminate\Container\Container', $this);

Register a basic service provider


$this->register()


Put the registered provider in $this->serviceProviders[]

$this->registerBaseServiceProviders()


Put the registered provider in $this->serviceProviders[] and directly trigger the register() method in the provider. If the application has been booted, then trigger the boot method in the provider.
$this->register(new EventServiceProvider($this));
$this->register(new RoutingServiceProvider($this));

Register core container aliases


$this->registerCoreContainerAliases()


Register the class address in $this->aliases, why?

Implementation of facade



is the class name implemented by class_alias


  • When the app starts, the kernel passes the handle, triggers the bootstrapwith in the app, and triggers the bootstrap method in the class implementation in each list
  • bootstrapwith loads a list of all bootstrap needs,
  • A bootstrap is triggered in RegisterFacade in the list, then AliasLoader loads the aliases configuration in config and executes register
  • register is registered through autoload, and the internal implementation is through class_alias

  • Loading of helpers helper functions



    Through autoload, autoload_files are loaded, and then require directly

    return array(
        '1d1b89d124cc9cb8219922c9d5569199' => $vendorDir . '/hamcrest/hamcrest-php/hamcrest/Hamcrest.php',
        '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
        '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
        '2c102faa651ef8ea5874edb585946bce' => $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php',
        '5255c38a0faeba867671b61dfda6d864' => $vendorDir . '/paragonie/random_compat/lib/random.php',
        'bd9634f2d41831496de0d3dfe4c94881' => $vendorDir . '/symfony/polyfill-php56/bootstrap.php',
        'e7223560d890eab89cda23685e711e2c' => $vendorDir . '/psy/psysh/src/Psy/functions.php',
        'f0906e6318348a765ffb6eb24e0d0938' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/helpers.php',
        '58571171fd5812e6e447dce228f52f4d' => $vendorDir . '/laravel/framework/src/Illuminate/Support/helpers.php',
    );
    

    Hamcrest


    This is a thing similar to assert.h in c language, assert

    /symfony/polyfill-mbstring



    « Symfony is a set of PHP Components, a Web Application framework, a Philosophy, and a Community — all working together in harmony. »

    This is a collection of methods for implementing mbstring extension through php. If the mbstring extension is not installed, this can be achieved.

    / is a buddha/var-dumper/resources/functions/dump.PHP



    A Method That Can Replace var_dump The VarDumper component provides mechanisms for walking through any arbitrary PHP variable. Built on top, it provides a better dump() function that you can use instead of var_dump.

    /Swift bought R/Swift bought R/Church/Swift_required.PHP



    Class Free Feature-rich PHP Mailer for sending mail
    Swift Mailer integrates into any web app written in PHP 5, offering a flexible and elegant object-oriented approach to sending emails with a multitude of features.
    Send emails using SMTP, sendmail, postfix or a custom Transport implementation of your own

    Support servers that require username & password and/or encryptionProtect from header injection attacks without stripping request data contentSend MIME compliant HTML/multipart emailsUse event-driven plugins to customize the libraryHandle large attachments and inline/embedded images with low memory use

    paragonie/random_compat/lib/random.php


    No corresponding instructions were found, but it should be to generate a random number

    /is a buddha/poly fill-PHP56/bootstrap.PHP


    A hash_equals and ldap_escape but I don't know what it means. What is a timing attack? What is ldap?

    /Pan Shiyi/usual diet/double bed/PSY/functions.PHP


    an interactive console

    좋은 웹페이지 즐겨찾기