vendor/swiftmailer/doc/including-the-files.rst
changeset 0 7f95f8617b0b
equal deleted inserted replaced
-1:000000000000 0:7f95f8617b0b
       
     1 Including Swift Mailer (Autoloading)
       
     2 ====================================
       
     3 
       
     4 Swift Mailer uses an auto-loader so the only file you need to include is the
       
     5 ``lib/swift_required.php`` file.
       
     6 
       
     7 To use Swift Mailer's autoloader:
       
     8 
       
     9 * Put Swift Mailer somewhere accessible to your PHP scripts (this does not
       
    10   need to be in the web root).
       
    11 
       
    12 * Include, or require the ``lib/swift_required.php`` file.
       
    13 
       
    14 * Follow the remainder of the documentation for using the available
       
    15   components.
       
    16 
       
    17 .. note::
       
    18 
       
    19     While Swift Mailer's autoloader is designed to play nicely with other
       
    20     autoloaders, sometimes you may have a need to avoid using Swift Mailer's
       
    21     autoloader and use your own instead. Include the ``swift_init.php``
       
    22     instead of the ``swift_required.php`` if you need to do this. The very
       
    23     minimum include is the ``swift_init.php`` file since Swift Mailer will not
       
    24     work without the dependency injection this file sets up:
       
    25 
       
    26     .. code-block:: php
       
    27 
       
    28         require_once '/path/to/swift-mailer/lib/swift_required.php';
       
    29 
       
    30         /* rest of code goes here */