installing.rst 5.5KB

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