* @link http://www.php-tools.net */ /** * Main prepend file */ require_once 'prepend.php'; $knownExamples = array(); $notReferenced = array(); $missing = array(); foreach( $sections as $sectionID => $sectionDef ) { foreach( $sectionDef['pages'] as $pageID => $pageDef ) { $file = $sectionDef['basename'].$pageID.'.php'; array_push( $knownExamples, $file ); if( !file_exists( '../'.$file ) ) { array_push( $missing, $file ); } } } $d = dir( '../' ); while( false !== ( $entry = $d->read() ) ) { if( stristr( $entry, 'example_' ) && stristr( $entry, '.php' ) && !in_array( $entry, $knownExamples ) ) { array_push( $notReferenced, $entry ); } } $d->close(); echo 'The following examples are not referenced to in the sections:

'; if( empty( $notReferenced ) ) { echo 'none'; } else { echo implode( '
', $notReferenced ); } echo '

The following examples are missing:

'; if( empty( $missing ) ) { echo 'none'; } else { echo implode( '
', $missing ); } ?>