You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

63 lines
1.3 KiB

<?php
/**
* Télécharger une fois pour toutes le code CSS et HTML de la barre de navigation (topnav)
*/
namespace autodoc\Plugin\Core\Compiler\Pass;
use phpDocumentor\Compiler\CompilerPassInterface;
use phpDocumentor\Descriptor\Collection;
use phpDocumentor\Descriptor\ProjectDescriptor;
use Cilex\Application;
/**
* Collecter les erreurs
*/
class GetTopNav implements CompilerPassInterface
{
const COMPILER_PRIORITY = 8750;
/**
* L'application
*
* Pour retrouver la configuration
*
* @var Application
**/
private $app;
/**
* Constructeur
*
* @param Application $app
**/
public function __construct(Application $app) {
$this->app = $app;
}
/**
* {@inheritDoc}
*/
public function getDescription()
{
return '[Autodoc] Get "topnav" HTML and CSS code.';
}
/**
* {@inheritDoc}
*/
public function execute(ProjectDescriptor $project)
{
$topnav = $this->app['config']->getOptions()->get('topnav');
if (!$topnav OR !$topnav->getValue()) return;
$js = file_get_contents($topnav->getValue());
$topnav = new Collection(array(
'js' => $js
));
$project->getIndexes()->set('topnav', $topnav);
}
}