Skip to content

Instantly share code, notes, and snippets.

@harikt
Created October 5, 2012 04:56
Show Gist options
  • Select an option

  • Save harikt/3838179 to your computer and use it in GitHub Desktop.

Select an option

Save harikt/3838179 to your computer and use it in GitHub Desktop.
A script to generate API of all aura packages with apigen
<?php
// A script to generate API of all aura packages with apigen
$path = __DIR__ . DIRECTORY_SEPARATOR;
$package_path = $path . 'package';
$docs_path = $path . 'docs';
$dir = new DirectoryIterator( $package_path );
foreach ($dir as $fileinfo) {
if (!$fileinfo->isDot()) {
$dirname = $fileinfo->getFilename();
if ( $dirname == '.placeholder' ) {
continue;
}
$generate[] = $dirname;
}
}
foreach ($generate as $package ) {
$destination = $docs_path . DIRECTORY_SEPARATOR . $package;
$source = $package_path . DIRECTORY_SEPARATOR . $package . DIRECTORY_SEPARATOR . 'src';
passthru("apigen -s $source -d $destination ");
}
echo 'Done!' . PHP_EOL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment