vendor/swiftmailer/doc/installing.rst
changeset 0 7f95f8617b0b
equal deleted inserted replaced
-1:000000000000 0:7f95f8617b0b
       
     1 Installing the Library
       
     2 ======================
       
     3 
       
     4 Installing Swift Mailer is trivial. Usually it's just a case of uploading the
       
     5 extracted source files to your web server.
       
     6 
       
     7 Installing from a Package
       
     8 -------------------------
       
     9 
       
    10 Most users will download a package from the Swift Mailer website and install
       
    11 Swift Mailer using this.
       
    12 
       
    13 If you downloaded Swift Mailer as a ``.tar.gz`` or
       
    14 ``.zip`` file installation is as simple as extracting the archive
       
    15 and uploading it to your web server.
       
    16 
       
    17 Extracting the Library
       
    18 ~~~~~~~~~~~~~~~~~~~~~~
       
    19 
       
    20 You extract the archive by using your favorite unarchiving tool such as
       
    21 ``tar`` or 7-Zip.
       
    22 
       
    23 You will need to have access to a program that can open uncompress the
       
    24 archive. On Windows computers, 7-Zip will work. On Mac and Linux systems you
       
    25 can use ``tar`` on the command line.
       
    26 
       
    27 To extract your downloaded package:
       
    28 
       
    29 * Use the "extract" facility of your archiving software.
       
    30 
       
    31 The source code will be placed into a directory with the same name as the
       
    32 archive (e.g. Swift-4.0.0-b1).
       
    33 
       
    34 The following example shows the process on Mac OS X and Linux systems using
       
    35 the ``tar`` command.
       
    36 
       
    37 .. code-block:: bash
       
    38 
       
    39     chrisbook:build chris$ ls
       
    40     Swift-4.0.0-dev.tar.gz
       
    41     chrisbook:build chris$ tar xvzf Swift-4.0.0-dev.tar.gz 
       
    42     Swift-4.0.0-dev/
       
    43     Swift-4.0.0-dev/lib/
       
    44     Swift-4.0.0-dev/lib/classes/
       
    45     Swift-4.0.0-dev/lib/classes/Swift/
       
    46     Swift-4.0.0-dev/lib/classes/Swift/ByteStream/
       
    47     Swift-4.0.0-dev/lib/classes/Swift/CharacterReader/
       
    48     Swift-4.0.0-dev/lib/classes/Swift/CharacterReaderFactory/
       
    49     Swift-4.0.0-dev/lib/classes/Swift/CharacterStream/
       
    50     Swift-4.0.0-dev/lib/classes/Swift/Encoder/
       
    51 
       
    52       ... etc etc ...
       
    53 
       
    54     Swift-4.0.0-dev/tests/unit/Swift/Transport/LoadBalancedTransportTest.php
       
    55     Swift-4.0.0-dev/tests/unit/Swift/Transport/SendmailTransportTest.php
       
    56     Swift-4.0.0-dev/tests/unit/Swift/Transport/StreamBufferTest.php
       
    57     chrisbook:build chris$ cd Swift-4.0.0-dev
       
    58     chrisbook:Swift-4.0.0-dev chris$ ls
       
    59     CHANGES		LICENSE.GPL	LICENSE.LGPL	README		VERSION		examples	lib		test-suite	tests
       
    60     chrisbook:Swift-4.0.0-dev chris$
       
    61 
       
    62 Installing from Git
       
    63 -------------------
       
    64 
       
    65 It's possible to download and install Swift Mailer directly from github.com if
       
    66 you want to keep up-to-date with ease.
       
    67 
       
    68 Swift Mailer's source code is kept in a git repository at github.com so you
       
    69 can get the source directly from the repository.
       
    70 
       
    71 .. note::
       
    72 
       
    73     You do not need to have git installed to use Swift Mailer from github. If
       
    74     you don't have git installed, go to `github`_ and click the "Download"
       
    75     button.
       
    76 
       
    77 Cloning the Repository
       
    78 ~~~~~~~~~~~~~~~~~~~~~~
       
    79 
       
    80 The repository can be cloned from git://github.com/swiftmailer/swiftmailer.git
       
    81 using the ``git clone`` command.
       
    82 
       
    83 You will need to have ``git`` installed before you can use the
       
    84 ``git clone`` command.
       
    85 
       
    86 To clone the repository:
       
    87 
       
    88 * Open your favorite terminal environment (command line).
       
    89 
       
    90 * Move to the directory you want to clone to.
       
    91 
       
    92 * Run the command ``git clone git://github.com/swiftmailer/swiftmailer.git
       
    93   swiftmailer``.
       
    94 
       
    95 The source code will be downloaded into a directory called "swiftmailer".
       
    96 
       
    97 The example shows the process on a UNIX-like system such as Linux, BSD or Mac
       
    98 OS X.
       
    99 
       
   100 .. code-block:: bash
       
   101 
       
   102     chrisbook:~ chris$ cd source_code/
       
   103     chrisbook:source_code chris$ git clone git://github.com/swiftmailer/swiftmailer.git swiftmailer
       
   104     Initialized empty Git repository in /Users/chris/source_code/swiftmailer/.git/
       
   105     remote: Counting objects: 6815, done.
       
   106     remote: Compressing objects: 100% (2761/2761), done.
       
   107     remote: Total 6815 (delta 3641), reused 6326 (delta 3286)
       
   108     Receiving objects: 100% (6815/6815), 4.35 MiB | 162 KiB/s, done.
       
   109     Resolving deltas: 100% (3641/3641), done.
       
   110     Checking out files: 100% (1847/1847), done.
       
   111     chrisbook:source_code chris$ cd swiftmailer/
       
   112     chrisbook:swiftmailer chris$ ls
       
   113     CHANGES		LICENSE.LGPL	README.git	VERSION		docs		lib		test-suite	util
       
   114     LICENSE.GPL	README		TODO		build.xml	examples	notes		tests
       
   115     chrisbook:swiftmailer chris$
       
   116 
       
   117 Uploading to your Host
       
   118 ----------------------
       
   119 
       
   120 You only need to upload the "lib/" directory to your web host for production
       
   121 use. All other files and directories are support files not needed in
       
   122 production.
       
   123 
       
   124 You will need FTP, rsync or similar software installed in order to upload the
       
   125 "lib/" directory to your web host.
       
   126 
       
   127 To upload Swift Mailer:
       
   128 
       
   129 * Open your FTP program, or a command line if you prefer rsync/scp.
       
   130 
       
   131 * Upload the "lib/" directory to your hosting account.
       
   132 
       
   133 The files needed to use Swift Mailer should now be accessible to PHP on your
       
   134 host.
       
   135 
       
   136 The following example shows show you can upload the files using
       
   137 ``rsync`` on Linux or OS X.
       
   138 
       
   139 .. note::
       
   140 
       
   141     You do not need to place the files inside your web root. They only need to be in a place
       
   142     where your PHP scripts can "include" them.
       
   143 
       
   144     .. code-block: bash
       
   145 
       
   146         chrisbook:Swift-4.0.0-dev chris$ rsync -rvz lib d11wtq@swiftmailer.org:swiftmailer
       
   147         building file list ... done
       
   148         created directory swiftmailer
       
   149         lib/
       
   150         lib/mime_types.php
       
   151         lib/preferences.php
       
   152         lib/swift_required.php
       
   153         lib/classes/
       
   154         lib/classes/Swift/
       
   155         lib/classes/Swift/Attachment.php
       
   156         lib/classes/Swift/CharacterReader.php
       
   157           ... etc etc ...
       
   158         lib/dependency_maps/
       
   159         lib/dependency_maps/cache_deps.php
       
   160         lib/dependency_maps/mime_deps.php
       
   161         lib/dependency_maps/transport_deps.php
       
   162 
       
   163         sent 151692 bytes  received 2974 bytes  5836.45 bytes/sec
       
   164         total size is 401405  speedup is 2.60
       
   165         chrisbook:Swift-4.0.0-dev chris$
       
   166 
       
   167 .. _`github`: http://github.com/swiftmailer/swiftmailer