Configure ApiGen
This commit is contained in:
parent
857e1c15cc
commit
6edd399d37
20
apigen.neon
Normal file
20
apigen.neon
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
parameters:
|
||||||
|
paths: [
|
||||||
|
'upload/admin',
|
||||||
|
'upload/catalog',
|
||||||
|
'upload/extension',
|
||||||
|
'upload/system/engine',
|
||||||
|
'upload/system/library',
|
||||||
|
'upload/system/helper',
|
||||||
|
]
|
||||||
|
include: ['*.php']
|
||||||
|
exclude: ['upload/system/storage/vendor']
|
||||||
|
excludeProtected: false
|
||||||
|
excludePrivate: true
|
||||||
|
excludeTagged: ['internal']
|
||||||
|
outputDir: 'docs/api'
|
||||||
|
themeDir: null
|
||||||
|
title: 'OpenCart API'
|
||||||
|
baseUrl: ''
|
||||||
|
workerCount: 8
|
||||||
|
memoryLimit: '512M'
|
@ -1,34 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// This script is used to generate the OpenCart API documentation
|
|
||||||
include(__DIR__ . '/ApiGen/vendor/autoload.php');
|
|
||||||
|
|
||||||
if ((isset($_SERVER['HTTPS']) && (($_SERVER['HTTPS'] == 'on') || ($_SERVER['HTTPS'] == '1'))) || $_SERVER['SERVER_PORT'] == 443) {
|
$directory = chdir(__DIR__ . '/..');
|
||||||
$protocol = 'https://';
|
|
||||||
} else {
|
|
||||||
$protocol = 'http://';
|
|
||||||
}
|
|
||||||
|
|
||||||
$directory = realpath(__DIR__ . '/../') . '/';
|
passthru('php tools/ApiGen/bin/apigen --working-dir "upload/system/storage"');
|
||||||
|
|
||||||
$url = $protocol . $_SERVER['HTTP_HOST'] . substr($directory, strlen($_SERVER['DOCUMENT_ROOT']));
|
|
||||||
|
|
||||||
$command = 'php ' . $directory . 'tools/ApiGen/bin/apigen';
|
|
||||||
$command .= ' --title "OpenCart API"';
|
|
||||||
$command .= ' --include *.php';
|
|
||||||
$command .= ' --exclude ' . $directory . 'upload/system/storage/vendor/*';
|
|
||||||
$command .= ' --working-dir ' . $directory . 'tools/ApiGen';
|
|
||||||
$command .= ' --output ' . $directory. 'docs/api/';
|
|
||||||
$command .= ' --base-url ' . $url . 'docs/api/';
|
|
||||||
$command .= ' ' . $directory . 'upload/admin/';
|
|
||||||
$command .= ' ' . $directory . 'upload/catalog/';
|
|
||||||
$command .= ' ' . $directory . 'upload/extension/';
|
|
||||||
$command .= ' ' . $directory . 'upload/system/engine/';
|
|
||||||
$command .= ' ' . $directory . 'upload/system/library/';
|
|
||||||
$command .= ' ' . $directory . 'upload/system/helper/';
|
|
||||||
|
|
||||||
$output = [];
|
|
||||||
|
|
||||||
exec($command, $output);
|
|
||||||
|
|
||||||
echo $command . "\n";
|
|
||||||
print_r($output);
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user