|
18 | 18 | - [Description](#description)
|
19 | 19 | - [Requirements](#requirements)
|
20 | 20 | - [Installing the PHP client](#installing)
|
21 |
| - - [Using packagist/composer](#using_packagist) |
| 21 | + - [Using Composer](#using_composer) |
22 | 22 | - [Cloning the git repository](#cloning_git)
|
23 | 23 | - [How to use the PHP client](#howto_use)
|
24 | 24 | - [Setting up the connection options](#setting_up_connection_options)
|
@@ -78,85 +78,14 @@ To get started you need PHP 5.5 or higher plus an ArangoDB server running on any
|
78 | 78 |
|
79 | 79 | There are two alternative ways to get the ArangoDB PHP client:
|
80 | 80 |
|
81 |
| - * Using packagist/composer |
| 81 | + * Using Composer |
82 | 82 | * Cloning the git repository
|
83 | 83 |
|
84 |
| -<a name="using_packagist"></a> |
85 |
| -## Alternative 1: Using packagist/composer |
| 84 | +<a name="using_composer"></a> |
| 85 | +## Alternative 1: Using Composer |
86 | 86 |
|
87 |
| -When using [packagist](http://packagist.org/), the procedure is as follows: |
88 |
| - |
89 |
| -Get the composer.phar file from [getcomposer.org](http://getcomposer.org): |
90 |
| - |
91 |
| - curl -s http://getcomposer.org/installer | php |
92 |
| - |
93 |
| -This will put the composer.phar file into the current directory. Next, create a new directory for your project, e.g. arangophp, and move into it: |
94 |
| - |
95 |
| - mkdir arangophp && cd arangophp |
96 |
| - |
97 |
| -Then, use composer's init command to define the initial dependencies for your project: |
98 |
| - |
99 |
| - php ../composer.phar init |
100 |
| - |
101 |
| -This will fire up composer's interactive config generator. It will ask you several questions, and the below example shows how you can answer them. Most questions have reasonable default settings and you can should use the defaults whenever you're unsure. |
102 |
| -When asked for a package name, type ## triagens/Arango. This is the package name for the ArangoDB PHP client. When being asked for a package number (package ##), you can either use dev-master (latest version) or one of the designated tagged versions. |
103 |
| - |
104 |
| - Welcome to the Composer config generator |
105 |
| - |
106 |
| -This command will guide you through creating your composer.json config. |
107 |
| - |
108 |
| - Package name (/) [jsteemann/arangophp]: |
109 |
| - Description []: An example application using ArangoDB PHP client |
110 |
| - Author [jsteemann]: |
111 |
| - |
112 |
| - Define your dependencies. |
113 |
| - |
114 |
| - Would you like to define your dependencies interactively [yes]? yes |
115 |
| - Search for a package []: triagens/Arango |
116 |
| - |
117 |
| - Found 3 packages matching triagens/Arango |
118 |
| - |
119 |
| - [0] triagens/ArangoDb dev-master |
120 |
| - [1] triagens/ArangoDb V0.1.1 |
121 |
| - [2] triagens/ArangoDb V0.0.1 |
122 |
| - |
123 |
| - Enter package ## to add, or a couple if it is not listed []: 0 |
124 |
| - Search for a package []: |
125 |
| - |
126 |
| - { |
127 |
| - "name": "jsteemann/arangophp", |
128 |
| - "description": "An example application using ArangoDB PHP client", |
129 |
| - "require": { |
130 |
| - "triagens/arangodb": "dev-master" |
131 |
| - }, |
132 |
| - "authors": [ |
133 |
| - { |
134 |
| - "name": "jsteemann", |
135 |
| - "email": "j.steemann@triagens.de" |
136 |
| - } |
137 |
| - ] |
138 |
| - } |
139 |
| - |
140 |
| - Do you confirm generation [yes]? yes |
141 |
| - Would you like the vendor directory added to your .gitignore [yes]? |
142 |
| - |
143 |
| -The above has created a file composer.json in your current directory, which contains information about your project plus the project dependencies. The ArangoDB PHP client is the only dependency for now, and it can be installed by running the following command: |
144 |
| - |
145 |
| - php ../composer.phar update |
146 |
| - Updating dependencies |
147 |
| - - Package triagens/arangodb (dev-master) |
148 |
| - Cloning e4e9107aec3d1e0c914e40436f77fed0e5df2485 |
149 |
| - |
150 |
| - Writing lock file |
151 |
| - Generating autoload files |
152 |
| - |
153 |
| - |
154 |
| -Running this command has created a subdirectory vendor in the current directory. The vendor directory contains a subdirectory triagens that contains the ArangoDB PHP client library files. The vendor directory also contains a subdirectory .composer that contains auto-generated autoloader files for all dependencies you defined in your composer.json file (the file auto-generated by running the previous init command). |
155 |
| - |
156 |
| -You need to include the generated autoloader file in your project when using the ArangoDB PHP classes. You can do so by adding the following line to any PHP file that will use them: |
157 |
| - |
158 |
| -```php |
159 |
| -require 'vendor/.composer/autoload.php'; |
| 87 | +``` |
| 88 | +composer require triagens/Arango |
160 | 89 | ```
|
161 | 90 |
|
162 | 91 | <a name="cloning_git"></a>
|
@@ -198,7 +127,7 @@ require 'arangodb-php/lib/ArangoDBClient/autoloader.php';
|
198 | 127 | In order to use ArangoDB, you need to specify the connection options. We do so by creating a PHP array $connectionOptions. Put this code into a file named test.php in your current directory:
|
199 | 128 |
|
200 | 129 | ```php
|
201 |
| -// use the following line when using packagist/composer |
| 130 | +// use the following line when using Composer |
202 | 131 | // require __DIR__ . '/vendor/composer/autoload.php';
|
203 | 132 |
|
204 | 133 | // use the following line when using git
|
@@ -707,7 +636,7 @@ ArangoException::disableLogging();
|
707 | 636 | Here's the full code that combines all the pieces outlined above:
|
708 | 637 |
|
709 | 638 | ```php
|
710 |
| -// use the following line when using packagist/composer |
| 639 | +// use the following line when using Composer |
711 | 640 | // require __DIR__ . '/vendor/composer/autoload.php';
|
712 | 641 |
|
713 | 642 | // use the following line when using git
|
|
0 commit comments