Skip to content

Commit

Permalink
API Implement Lookup class, convert major branches to minors, "smart"…
Browse files Browse the repository at this point in the history
… namespace lookups
  • Loading branch information
robbieaverill committed Jun 16, 2017
1 parent 82c25b5 commit b544b70
Show file tree
Hide file tree
Showing 11 changed files with 1,778 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = tab
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/src/
/assets/
/htdocs/2.4/
/htdocs/master/
/htdocs/3.*/
Expand Down
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: php

php:
- 5.6
- 7.1

before_script:
- composer install --dev

script:
- vendor/bin/phpunit
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ generated through [APIGen](http://apigen.org/).
* Update the redirections in `htdocs/.htaccess` to the stable version number
* Make a separate commit with the redirection (explained in deployment below)

**Please note:** Often the `master` branch will be representing an unstable major version (currently 4). When this needs
to be updated, please edit `htdocs/search/lookup.php`.

### Deployment to production
1. Raise a ticket with ops team (they have to run a script after deployment)
2. Login to SilverStripe Platform (you'll need to ensure you have "api" stack permissions)
Expand All @@ -56,11 +59,13 @@ Parameters:

* `q`: (required) Class name, method name (`<class>::<method>()` or <class>-><method>()`),
as well as property name ((`<class>::$<property>` or <class>-><property>`).
* `version`: (optional) Version of the targeted module. Should map to a folder name. Defaults to trunk.
* `version`: (optional) Version of the targeted module. Should map to a folder name. Defaults to trunk. Will switch current unstable major version (e.g. 4) to "master".
* `module`: (optional) Module name. Should map to a folder name. Defaults to framework.

Examples:

* `/search/lookup.php?q=DataObject`: Shows `DataObject` docs in `trunk` version of framework
* `/search/lookup.php?q=DataObject::get()&version=3.0`: Shows `DataObject::get()` docs in `3.0` version of framework
* `/search/lookup.php?q=DPSPayment&module=payemtn`: Shows `DPSPayment` class docs in the `ecommerce` module
* `/search/lookup.php?q=DataObject::get()&version=3.0`: Shows `DataObject::get()` docs in `3.6` version of framework (or whatever is the latest stable minor version)
* `/search/lookup.php?q=DPSPayment&module=payemnt`: Shows `DPSPayment` class docs in the `ecommerce` module
* `/search/lookup.php?q=SilverStripe\ORM\DataExtension::onBeforeWrite()&version=4`: Shows `SilverStripe\ORM\DataExtension::onBeforeWrite()` docs in `master` (4.x) version of framework
24 changes: 17 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,22 @@
}
],
"require": {
"apigen/apigen": "2.8.x-dev"
"apigen/apigen": "2.8.x-dev",
"symfony/yaml": "^3.3"
},
"repositories": [
{
"type": "vcs",
"url": "[email protected]:silverstripe-labs/ApiGen.git"
}
]
"repositories": [
{
"type": "vcs",
"url": "[email protected]:silverstripe-labs/ApiGen.git"
}
],
"autoload": {
"psr-4": {
"SilverStripe\\ApiDocs\\": "src/",
"SilverStripe\\ApiDocs\\Test\\": "tests/"
}
},
"require-dev": {
"phpunit/phpunit": "^5.7"
}
}
Loading

0 comments on commit b544b70

Please sign in to comment.