コード例 #1
0
function publish_chart($user, $chart, $fromCli = false, $justLocal = false)
{
    $files = array();
    if (!$fromCli) {
        _setPublishStatus($chart, 0.01);
    } else {
        print "Publishing chart " . $chart->getID() . ".\n";
    }
    $files = array_merge($files, publish_html($user, $chart));
    if (!$fromCli) {
        _setPublishStatus($chart, 0.05);
    }
    $files = array_merge($files, publish_css($user, $chart));
    if (!$fromCli) {
        _setPublishStatus($chart, 0.1);
    }
    $files = array_merge($files, publish_data($user, $chart));
    if (!$fromCli) {
        _setPublishStatus($chart, 0.2);
    }
    $files = array_merge($files, publish_js($user, $chart));
    if (!$fromCli) {
        _setPublishStatus($chart, 0.3);
    } else {
        print "Files stored to static folder (html, css, data, js)\n";
    }
    $totalSize = 0;
    // total file size
    foreach ($files as $i => $file) {
        $totalSize += filesize($file[0]);
    }
    $done = 0;
    foreach ($files as $file) {
        if (!$justLocal) {
            publish_push_to_cdn(array($file), $chart);
        }
        $done += filesize($file[0]);
        _setPublishStatus($chart, 0.3 + $done / $totalSize * 0.7);
    }
    if (!$fromCli) {
        _setPublishStatus($chart, 1);
        _clearPublishStatus($chart);
    } else {
        print "Files pushed to CDN.\n";
    }
    $chart->redirectPreviousVersions();
    DatawrapperHooks::execute(DatawrapperHooks::POST_CHART_PUBLISH, $chart, $user);
}
コード例 #2
0
ファイル: charts.php プロジェクト: shelsonjava/datawrapper
}
function _clearPublishStatus($chart)
{
    if (isset($_GLOBALS['dw-config']['memcache'])) {
        global $memcache;
        $memcache->delete('publish-status-' . $chart->getID());
    } else {
        unlink('../../charts/tmp/publish-status-' . $chart->getID());
    }
}
$app->post('/charts/:id/publish', function ($chart_id) use($app) {
    disable_cache($app);
    if_chart_is_writable($chart_id, function ($user, $chart) use($app) {
        $files = array();
        _setPublishStatus($chart, 0);
        $files = array_merge($files, publish_html($user, $chart));
        $files = array_merge($files, publish_css($user, $chart));
        $files = array_merge($files, publish_data($user, $chart));
        $files = array_merge($files, publish_js($user, $chart));
        _setPublishStatus($chart, 0.3);
        $totalSize = 0;
        // total file size
        foreach ($files as $i => $file) {
            $totalSize += filesize($file[0]);
        }
        $done = 0;
        foreach ($files as $file) {
            publish_push_to_cdn(array($file), $chart);
            $done += filesize($file[0]);
            _setPublishStatus($chart, 0.3 + $done / $totalSize * 0.7);
        }
コード例 #3
0
ファイル: library.php プロジェクト: hudson/svnkit
<h4>Get SVNKit Eclipse Plugin from update site</h4>
<p>To get an Eclipse plugin version use <b>http://svnkit.com/</b> as an update site location in Eclipse Update Manager.
In Eclipse menu select Help->Software Updates->Find and Install... Then choose 'Search for new features to install' combo 
box, click 'Next', then click 'New Remote Site...' and type <b>http://svnkit.com/</b> in the URL field and your preferred 
name for the update site in the name field. After this check the new site (it should appear in the list of update sites) and 
follow further steps prompted by Eclipse.
<br>
<h4>Latest Stable Version</h4>

<table width="100%">
<tbody>

<?
include("../feed/rss_util.php");
publish_html("http://www.svnkit.com/");
?>
<table cellpadding="0" border="0" cellspacing="0" width="100%">
<tr>
<td align="right" width="100%"><a style="text-decoration: none; border: 0px;" href="rss.xml"><span style="font-family:Arial;font-size:9px;background: #ff6000;color: #fff;padding: 0 4px">rss&nbsp;1.0</span>
<a style="text-decoration: none; border: 0px;" href="rss2.xml"><span style="font-family:Arial;font-size:9px;background: #ff6000;color: #fff;padding: 0 4px">rss&nbsp;2.0</span></td>
</tr>
</table>
</p>

<table style="margin-top: 1em;" width="100%" cellpadding="0" cellspacing="0"><tr><td id="footer" align="left" valign="top">Copyright &copy; 
2004-2007, TMate Software</td><td align="right" valign="top" id="footer">feedback is welcome at <a href="mailto:feedback%40svnkit.com">feedback@svnkit.com</a></td></tr>
<tr><td colspan=2 id="footer2">Java&#153; and all Java-based marks are a trademark or registered trademark of Sun Microsystems, Inc, in the United States and other countries. 
TMate Software and the website svnkit.com are independent of Sun Microsystems, Inc. and have no relationship, formal or informal.
</td></tr>
</table>