Skip to content

Commit

Permalink
修改数据生成时机,防止文档生成过于频繁。
Browse files Browse the repository at this point in the history
  • Loading branch information
latrell committed Jul 10, 2014
1 parent a30d738 commit 2f90dd6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/Latrell/Swagger/SwaggerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,6 @@ public function boot()
));

if (Config::get('app.debug')) {

$swagger = new Swagger();

$swagger->paths = Config::get('swagger::paths');
$swagger->exclude = Config::get('swagger::exclude');
$swagger->output = Config::get('swagger::output');
$swagger->suffix = Config::get('swagger::suffix');
$swagger->default_api_version = Config::get('swagger::default-api-version');
$swagger->default_swagger_version = Config::get('swagger::default-swagger-version');
$swagger->api_doc_template = Config::get('swagger::api-doc-template');
$swagger->default_base_path = Config::get('swagger::default-base-path');

if (is_null($swagger->default_base_path)) {
$swagger->default_base_path = Config::get('app.url');
}

$swagger->fire();

require __DIR__ . '/../../routes.php';
}
}
Expand Down
17 changes: 17 additions & 0 deletions src/controllers/SwaggerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ class SwaggerController extends Controller

public function getIndex()
{
$swagger = new Swagger();

$swagger->paths = Config::get('swagger::paths');
$swagger->exclude = Config::get('swagger::exclude');
$swagger->output = Config::get('swagger::output');
$swagger->suffix = Config::get('swagger::suffix');
$swagger->default_api_version = Config::get('swagger::default-api-version');
$swagger->default_swagger_version = Config::get('swagger::default-swagger-version');
$swagger->api_doc_template = Config::get('swagger::api-doc-template');
$swagger->default_base_path = Config::get('swagger::default-base-path');

if (is_null($swagger->default_base_path)) {
$swagger->default_base_path = Config::get('app.url');
}

$swagger->fire();

return View::make('swagger::index');
}

Expand Down

0 comments on commit 2f90dd6

Please sign in to comment.