Allows to search for code fragments in various code hosting platforms.
- run
composer install
- enter requested parameters
github
- https://developer.github.com/v3/search/#search-code- required parameters:
vb_github_search_username
- your github usernamevb_github_search_token
- your github login token
- required parameters:
You can implement search in other hosting platforms,
just replace the vb_code_search.search_handler
parameter in config.yml
:
vb_code_search:
search_handler: vb_code_search.search_handler.github
-
run
bin/console server:run localhost:8000
-
make request:
GET http://localhost:8000/rest/v1/search/code?term=symfony
- supported query params:
term
- term to search for;string
page
- page number;integer
per_page
- items per page;integer
order_direction
- order direction;string
enumasc
,desc
order_by
- order by;string
Please check https://developer.github.com/v3/search/#parameters-2 for supported values
- supported query params:
-
response consists of
items
and_metadata
items
contains list objects withrepository_name
- repository name where search term is foundowner_name
- repository ownerfile_name
- file name in repository
_metadata
containstotal
- total items countpage
- page numberper_page
- items per page
./bin/phpunit