Commit fbafbd4d authored by jdleonard's avatar jdleonard Committed by lussoluca

Issue #2864828 by jdleonard: Instructions for installing libraries: use "dist" instead of "source"

parent 0019023d
!! README.md is a work in progress !!
#Dependencies:
# Dependencies
- d3.js: Webprofiler module requires D3 library 3.x (not 4.x) to render data.
- highlight.js: Webprofiler module requires highlight 9.7.x library to syntax highlight collected queries.
##Install using Composer (recommended)
## Install using Composer (recommended)
If you use composer to manage dependencies, edit `composer.json` as follows.
If you use Composer to manage dependencies, edit `/composer.json` as follows.
First, make sure you have the `composer/installers` plugin in the "require"
section of your `composer.json`
1\. Run `composer require --prefer-dist composer/installers` to ensure that you have the `composer/installers` package installed. This package facilitates the installation of packages into directories other than `/vendor` (e.g. `/libraries`) using Composer.
Add the following to the "require" section:
```
"d3/d3": "3.5.*",
"components/highlightjs": "9.7.*"
```
Add the following in "installer-paths":
2\. Add the following to the "installer-paths" section of `composer.json`:
```
"libraries/{$name}": ["type:drupal-library"],
```
Finally, add this in "repositories":
3\. Add the following to the "repositories" section of `composer.json`:
```
{
"type": "package",
"package": {
"d3": {
"type": "package",
"package": {
"name": "d3/d3",
"version": "v3.5.17",
"type": "drupal-library",
"source": {
"url": "https://github.com/d3/d3",
"type": "git",
"reference": "v3.5.17"
"dist": {
"url": "https://github.com/d3/d3/archive/v3.5.17.zip",
"type": "zip"
}
}
},
{
"type": "package",
"package": {
}
},
"highlightjs": {
"type": "package",
"package": {
"name": "components/highlightjs",
"version": "9.7.0",
"type": "drupal-library",
"source": {
"url": "https://github.com/components/highlightjs",
"type": "git",
"reference": "9.7.0"
"dist": {
"url": "https://github.com/components/highlightjs/archive/9.7.0.zip",
"type": "zip"
}
}
}
}
```
Then run `composer update` - you should find new directories have been created
under /libraries
4\. Run `composer require --prefer-dist d3/d3:3.5.* components/highlightjs:9.7.*` - you should find that new directories have been created
under `/libraries`
##Manual install
## Install manually
- d3.js:
- Create a `/libraries/d3/` directory below your Drupal root directory
- Download https://d3js.org/d3.v3.min.js
- Rename it to /libraries/d3/d3.min.js
- Rename it to `/libraries/d3/d3.min.js`
For further details on how to obtain D3.js, see https://github.com/d3/d3/
- highlight.js:
- highlight.js:
- Create `/libraries/highlightjs/` directory below your Drupal root directory
- Download the library and CSS from http://highlightjs.org into it
#IDE link:
# IDE link
Each class name discovered while profiling (controller class, event class) is specially linked to open the class in
an IDE. You can configure the URLs for these links to work for your IDE.
## Sublime text (2 and 3) - macOS
See https://github.com/dhoulb/subl
## Textmate
Use txmt://open?url=file://@file&line=@line
Every class name discovered while profiling (controller class, event class) are linked to an url for directly open in
an IDE, you can configure the url of those link based on the IDE you are using:
## PhpStorm 8+
Use phpstorm://open?file=@file&line=@line
- Sublime text (2 and 3): see https://github.com/dhoulb/subl for Mac OS X
- Textmate: should be supported by default, use txmt://open?url=file://@file&line=@line as link
- PhpStorm 8+: use phpstorm://open?file=@file&line=@line as link
# Timeline
#Timeline:
It is also possible to collect the time needed to instantiate every single service used in a request.
Now it is possible to also collect the time needed to instantiate every single service used in a request, to make it
work you need to add these two lines to settings.php (or, event better, to settings.local.php):
Add the following two lines to `settings.php` (or, even better, to `settings.local.php`):
```
$class_loader->addPsr4('Drupal\\webprofiler\\', [ __DIR__ . '/../../modules/contrib/devel/webprofiler/src']);
$settings['container_base_class'] = '\Drupal\webprofiler\DependencyInjection\TraceableContainer';
```
Check if the path from the Webprofiler module in your settings.php file matches the location of the installed Webprofiler module in your project.
Check if the path from the Webprofiler module in your `settings.php` file matches the location of the installed Webprofiler module in your project.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment