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.
 
 
 
 
 
 

30 lines
633 B

<?php
// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
$file = $_SERVER['argv'][1];
$tokens = token_get_all(file_get_contents($file));
$out = [];
foreach ($tokens as $token) {
if (! is_array($token) || $token[0] !== T_COMMENT) {
$out[] = $token;
}
}
ob_start();
foreach ($out as $o) {
if (is_array($o)) {
echo $o[1];
} else {
echo $o;
}
}
file_put_contents($file, ob_get_clean());