Exemplo n.º 1
0
function build_map(array &$map, $path, $lastPath)
{
    foreach (new DirectoryIterator($path) as $file) {
        /** @var SplFileInfo $file */
        if (in_array($file->getBasename(), array(".", "..")) || $file->getBasename() === "TestCase.php") {
            continue;
        }
        if ($file->isDir()) {
            build_map($map, $file->getRealPath(), $path);
        } else {
            echo "> " . str_replace($lastPath . DIRECTORY_SEPARATOR, "", $file->getRealPath()), PHP_EOL;
            $contents = file_get_contents($file->getRealPath());
            $nsStart = strpos($contents, "namespace ") + 10;
            $nsStop = strpos($contents, ";", $nsStart);
            $ns = substr($contents, $nsStart, $nsStop - $nsStart);
            $body = trim(substr($contents, $nsStop + 1));
            if (!isset($map[$ns])) {
                $map[$ns] = array();
                $map[$ns]["classes"] = array();
                $map[$ns]["imports"] = array();
            }
            // Process imports
            while (($useStart = strpos($body, "use ")) === 0) {
                $useStop = strpos($body, ";", $useStart);
                $use = substr($body, $useStart + 4, $useStop - ($useStart + 4));
                $body = trim(substr($body, $useStop + 1));
                $map[$ns]["imports"][] = $use;
            }
            $map[$ns]["classes"][] = trim($body);
        }
    }
}
Exemplo n.º 2
0
						<td align="left" valign="center"><a href="?action=rotateright" onclick="return check_time()"><img src="img/tower/navigation/right.gif" border="0" alt="Повернуться вправо"></a></td>
					</tr>

					<tr>
						<td><img src="img/tower/navigation/inv.gif" width="30" height="30"></td>
						<td align="center" valign="top"><?php 
if ($step1['back']) {
    echo "<a href='?action=back' onclick='return check_time()'><img src='img/tower/navigation/back.gif' border='0' alt='Назад'></a>";
}
?>
</td>
						<td><img src="img/tower/navigation/inv.gif" width="30" height="30"></td>
					</tr>
				</table>
				<?php 
build_map($my_cord, $my_vector, $users);
?>
			</TD>	
		</TR>
		</TABLE>
		<?php 
if ($smert_bot == true) {
    echo "<font color=red>Рыцарь Смерти Жив [19x11]</font>";
}
?>
	</td>
</tr>
</table>
<br><br><br><br>
<?php 
include_once "counter.php";