コード例 #1
0
function do_test()
{
    $responses = array("data://text/plain,HTTP/1.0 404 Not Found\r\n\r\n", "data://text/plain,HTTP/1.0 404 Not Found\r\n\r\n", "data://text/plain,HTTP/1.0 404 Not Found\r\n\r\n");
    $pid = http_server("tcp://127.0.0.1:12342", $responses, $output);
    $a = $b = count(get_resources());
    $i = 3;
    while ($i--) {
        $context = stream_context_create(array('http' => array('timeout' => 1)));
        file_get_contents('http://127.0.0.1:12342/', 0, $context);
        unset($context);
        $b = $a;
        $a = count(get_resources());
    }
    http_server_kill($pid);
    echo "leak? penultimate iteration: {$b}, last one: {$a}\n";
    var_dump($a == $b);
}
コード例 #2
0
<?php

fclose(fopen("php://temp", "w+"));
$count = count(get_resources());
fclose(fopen("php://temp", "w+"));
var_dump(count(get_resources()) == $count);
fclose(fopen("php://temp", "w+"));
var_dump(count(get_resources()) == $count);
コード例 #3
0
    echo $_lang['new_tmplvars'];
    ?>
</a></li>
<?php 
    if ($modx->hasPermission('save_template') && $total > 1) {
        echo '<li><a href="index.php?a=117&amp;id=' . $_REQUEST['id'] . '"><img src="' . $_style['sort'] . '" />' . $_lang['template_tv_edit'] . '</a></li>';
    }
    ?>
		</ul>
		</div>
		<div class="sectionHeader"><?php 
    echo $_lang['a16_use_resources'];
    ?>
</div>
		<div class="sectionBody"><?php 
    echo get_resources($id, $modx, $_lang);
    ?>
</div>
	</div>
<?php 
}
?>

<?php 
// invoke OnTempFormRender event
$evtOut = $modx->invokeEvent("OnTempFormRender", array('id' => $id));
if (is_array($evtOut)) {
    echo implode("", $evtOut);
}
?>
</form>