+++ /dev/null
-<?php
-/*
- +----------------------------------------------------------------------+
- | eAccelerator control panel |
- +----------------------------------------------------------------------+
- | Copyright (c) 2004-2006 eAccelerator |
- | http://eaccelerator.net |
- +----------------------------------------------------------------------+
- | This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.zend.com/license/2_00.txt. |
- | If you did not receive a copy of the Zend license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@zend.com so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
-
- $ Id: $
-*/
-
-if (!function_exists('eaccelerator_info')) {
- die('eAccelerator isn\'t installed or isn\'t compiled with info support!');
-}
-
-/** config **/
-$user = "admin";
-$pw = "abc123";
-/** /config **/
-
-/* {{{ auth */
-if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_USER']) ||
- $_SERVER['PHP_AUTH_USER'] != $user || $_SERVER['PHP_AUTH_PW'] != $pw) {
- header('WWW-Authenticate: Basic realm="eAccelerator control panel"');
- header('HTTP/1.0 401 Unauthorized');
- exit;
-}
-/* }}} */
-
-/* {{{ process any commands */
-$info = eaccelerator_info();
-if (isset($_POST['caching'])) {
- if ($info['cache']) {
- eaccelerator_caching(false);
- } else {
- eaccelerator_caching(true);
- }
-} else if (isset($_POST['optimizer']) && function_exists('eaccelerator_optimizer')) {
- if ($info['optimizer']) {
- eaccelerator_optimizer(false);
- } else {
- eaccelerator_optimizer(true);
- }
-} else if (isset($_POST['clear'])) {
- eaccelerator_clear();
-} else if (isset($_POST['clean'])) {
- eaccelerator_clean();
-} else if (isset($_POST['purge'])) {
- eaccelerator_purge();
-}
-$info = eaccelerator_info();
-/* }}} */
-
-function compare($x, $y)
-{
- global $sortby;
-
- if ( $x[$sortby] == $y[$sortby] )
- return 0;
- else if ( $x[$sortby] < $y[$sortby] )
- return -1;
- else
- return 1;
-}
-
-function revcompare($x, $y)
-{
- global $sortby;
-
- if ( $x[$sortby] == $y[$sortby] )
- return 0;
- else if ( $x[$sortby] < $y[$sortby] )
- return 1;
- else
- return -1;
-}
-
-/* {{{ create_script_table */
-function create_script_table($list) {
- global $sortby;
-
- if (isset($_GET['order']) && ($_GET['order'] == "asc" || $_GET['order'] =="desc")) {
- $order = $_GET['order'];
- } else {
- $order = "asc";
- }
-
- if (isset($_GET['sort'])) {
- switch ($_GET['sort']) {
- case "mtime":
- case "size":
- case "reloads":
- case "hits":
- $sortby = $_GET['sort'];
- ($order == "asc" ? uasort($list, 'compare') : uasort($list, 'revcompare'));
- break;
- default:
- $sortby = "file";
- ($order == "asc" ? uasort($list, 'compare') : uasort($list, 'revcompare'));
- }
- }
-
-?>
- <table>
- <tr>
- <th><a href="<?=$_SERVER['PHP_SELF']?>?sort=file&order=<?=($order == "asc" ? "desc" : "asc")?>">Filename</a> <? if($sortby == "file") echo ($order == "asc" ? "↓" : "↑")?></th>
- <th><a href="<?=$_SERVER['PHP_SELF']?>?sort=mtime&order=<?=($order == "asc" ? "desc" : "asc")?>">MTime</a> <? if($sortby == "mtime") echo ($order == "asc" ? "↓" : "↑")?></th>
- <th><a href="<?=$_SERVER['PHP_SELF']?>?sort=size&order=<?=($order == "asc" ? "desc" : "asc")?>">Size</a> <? if($sortby == "size") echo ($order == "asc" ? "↓" : "↑")?></th>
- <th><a href="<?=$_SERVER['PHP_SELF']?>?sort=reloads&order=<?=($order == "asc" ? "desc" : "asc")?>">Reloads</a> <? if($sortby == "reloads") echo ($order == "asc" ? "↓" : "↑")?></th>
- <th><a href="<?=$_SERVER['PHP_SELF']?>?sort=hits&order=<?=($order == "asc" ? "desc" : "asc")?>">Hits</a> <? if($sortby == "hits") echo ($order == "asc" ? "↓" : "↑")?></th>
- </tr>
- <?php
- switch ($sortby) {
- case "mtime":
- case "size":
- case "reloads":
- case "hits":
- ($order == "asc" ? uasort($list, 'compare') : uasort($list, 'revcompare'));
- break;
- case "file":
- default:
- $sortby = "file";
- ($order == "asc" ? uasort($list, 'compare') : uasort($list, 'revcompare'));
-
- }
-
- foreach($list as $script) { ?>
- <tr>
- <?php if (function_exists('eaccelerator_dasm_file')) { ?>
- <td class="e"><a href="dasm.php?file=<?php echo $script['file']; ?>"><?php echo $script['file']; ?></a></td>
- <?php } else { ?>
- <td class="e"><?php echo $script['file']; ?></td>
- <?php } ?>
- <td class="vr"><?php echo date('Y-m-d H:i', $script['mtime']); ?></td>
- <td class="vr"><?php echo number_format($script['size'] / 1024, 2); ?> KB</td>
- <td class="vr"><?php echo $script['reloads']; ?> (<?php echo $script['usecount']; ?>)</td>
- <td class="vr"><?php echo $script['hits']; ?></td>
- </tr>
- <?php } ?>
- </table>
-<?php
-}
-/* }}} */
-
-/* {{{ create_key_table */
-function create_key_table($list) {
-?>
- <table class="key">
- <tr>
- <th>Name</th>
- <th>Created</th>
- <th>Size</th>
- <th>ttl</th>
- </tr>
-<?php
- foreach($list as $key) {
-?>
- <tr>
- <td class="e"><?php echo $key['name']; ?></td>
- <td class="vr"><?php echo date('Y-m-d H:i', $key['created']); ?></td>
- <td class="vr"><?php echo number_format($key['size']/1024, 3); ?>KB</td>
- <td class="vr"><?php
- if ($key['ttl'] == -1) {
- echo 'expired';
- } elseif ($key['ttl'] == 0) {
- echo 'none';
- } else {
- echo date('Y-m-d H:i', $key['ttl']);
- }
- ?></td>
- </tr>
-<?php
- }
-?>
- </table>
-<?php
-}
-/* }}} */
-
-/* {{{ print_header */
-function print_header() { ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head>
- <title>eAccelerator control panel</title>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
- <meta http-equiv="Content-Style-Type" content="text/css" />
- <meta http-equiv="Content-Language" content="en" />
-
- <style type="text/css" media="all">
- body {background-color: #ffffff; color: #000000;}
- body, td, th, h1, h2 {font-family: sans-serif;}
- pre {margin: 0px; font-family: monospace;}
- a:link {color: #000099; text-decoration: none}
- a:hover {text-decoration: underline;}
- table {border-collapse: collapse; width: 800px;}
- .center {text-align: center;}
- .center table { margin-left: auto; margin-right: auto; text-align: left;}
- .center th { text-align: center !important; }
- td, th { border: 1px solid #000000; font-size: 75%; vertical-align: baseline;}
- h1 {font-size: 150%;}
- h2 {font-size: 125%;}
- .p {text-align: left;}
- .e {background-color: #ccccff; font-weight: bold; color: #000000;}
- .h,th {background-color: #9999cc; font-weight: bold; color: #000000;}
- .v,td {background-color: #cccccc; color: #000000;}
- .vr{background-color: #cccccc; text-align: right; color: #000000; white-space: nowrap;}
- img {float: right; border: 0px;}
- hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #000000;}
- input {width: 150px}
- h1 {width: 800px; border: 1px solid #000000; margin-left: auto; margin-right: auto; background-color: #9999cc;}
- </style>
-</head>
-<?php
-}
-/* }}} */
-?>
-
-<?php print_header(); ?>
-<body class="center">
-<h1>eAccelerator <?php echo $info['version']; ?> control panel</h1>
-
-<!-- {{{ information -->
-<h2>Information</h2>
-<table>
-<tr>
- <td class="e">Caching enabled</td>
- <td><?php echo $info['cache'] ? 'yes':'no' ?></td>
-</tr>
-<tr>
- <td class="e">Optimizer enabled</td>
- <td><?php echo $info['optimizer'] ? 'yes':'no' ?></td>
-</tr>
-<tr>
- <td class="e">Memory usage</td>
- <td><?php echo number_format(100 * $info['memoryAllocated'] / $info['memorySize'], 2); ?>%
- (<?php echo number_format($info['memoryAllocated'] / (1024*1024), 2); ?>MB/
- <?php echo number_format($info['memorySize'] / (1024*1024), 2); ?>MB)</td>
-</tr>
-<tr>
- <td class="e">Free memory</td>
- <td><?php echo number_format($info['memoryAvailable'] / (1024*1024), 2); ?>MB</td>
-</tr>
-<tr>
- <td class="e">Cached scripts</td>
- <td><?php echo $info['cachedScripts']; ?></td>
-</tr>
-<tr>
- <td class="e">Removed scripts</td>
- <td><?php echo $info['removedScripts']; ?></td>
-</tr>
-<tr>
- <td class="e">Cached keys</td>
- <td><?php echo $info['cachedKeys']; ?></td>
-</tr>
-</table>
-<!-- }}} -->
-
-<!-- {{{ control -->
-<h2>Actions</h2>
-<form name="ea_control" method="post">
- <table>
- <tr>
- <td class="e">Caching</td>
- <td><input type="submit" name="caching" value="<?php echo $info['cache']?'disable':'enable'; ?>" /></td>
- </tr>
- <tr>
- <td class="e">Optimizer</td>
- <td><input type="submit" name="optimizer" value="<?php echo $info['optimizer']?'disable':'enable'; ?>" /></td>
- </tr>
- <tr>
- <td class="e">Clear cache</td>
- <td><input type="submit" name="clear" value="clear" title="remove all unused scripts and data from shared memory and disk cache" /></td>
- </tr>
- <tr>
- <td class="e">Clean cache</td>
- <td><input type="submit" name="clean" value="clean" title=" remove all expired scripts and data from shared memory and disk cache" /></td>
- </tr>
- <tr>
- <td class="e">Purge cache</td>
- <td><input type="submit" name="purge" value="purge" title="remove all 'removed' scripts from shared memory" /></td>
- </tr>
- </table>
-</form>
-<!-- }}} -->
-
-<h2>Cached scripts</h2>
-<?php create_script_table(eaccelerator_cached_scripts()); ?>
-
-<h2>Removed scripts</h2>
-<?php create_script_table(eaccelerator_removed_scripts()); ?>
-
-<?php
-if (function_exists('eaccelerator_get')) {
- echo "<h2>Cached keys</h2>";
- create_key_table(eaccelerator_list_keys());
-}
-?>
-
-<!-- {{{ footer -->
-<br /><br />
-<table>
- <tr><td class="center">
- <a href="http://eaccelerator.net"><img src="?=<?php echo $info['logo']; ?>" alt="eA logo" /></a>
- <strong>Created by the eAccelerator team, <a href="http://eaccelerator.net">http://eaccelerator.net</a></strong><br /><br />
- <nobr>eAccelerator <?php echo $info['version']; ?> [shm:<?php echo $info['shm_type']?> sem:<?php echo $info['sem_type']; ?>]</nobr><br />
- <nobr>PHP <?php echo phpversion();?> [ZE <?php echo zend_version(); ?>]</nobr><br />
- <nobr>Using <?php echo php_sapi_name();?> on <?php echo php_uname(); ?></nobr><br />
- </td></tr>
-</table>
-<!-- }}} -->
-</body>
-</html>
-
-<?php
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
-
-?>
-#Kyberia README
-
-##Kyberia
- * This repository contains sources of Kyberia.sk website.
- * See http://kyberia.sk/ and http://kyberia.cz/ for more.
-
-##COPYING
- * everything in this repository
- * is protected by copyright of it's respective author(s)
- * is licensed as specified in COPYING file in root of this repository
- * can be licensed somehow else if other licence was specified by author
-
## How to make your kyberia run.
-1. Install: apache2 (+php support), mysql
+1. Install: apache2 (+php&mysql support ), mysql
2. Create mysql account ( create user kyberia identified by "pass")
3. Create database kyberia2 (as user kyberia)
4. Import data (mysql -u kyberia -p kyberia2 < kyberia_2.3_...sql )
-5. Copy http dir from svn into your www-root (for example cp kyberia/trunk /var/www/ )
+5. Copy http dir from repository into your www-root ( XXX)
6. Copy kyberia-data dir into same directory.
-7. Copy 003-kyberia.conf (apache2 conf. file) into /etc/apache2/sites-enabled. Edit if needed.
-8. Maybe you will need something apache configuration tweaks (like a2enmod rewrite).
+7. Include kyberia.conf into your apache conf.
+ (dir /etc/apache2/sites-enabled in debian). Edit if needed.
+8. Maybe you will need some apache configuration tweaks (like a2enmod rewrite).
9. Start apache and mysql (something like /etc/init.d/apache2 start, ...)
10. Set DB login data in inc/db.inc
11. Depends on your DNS, maybe add alias www.localhost to /etc/hosts file.
13. Find out why it is still not working. (check permisions, symlinks, directory names...)
14. If you want full functionality, add following lines to your www users crontab
+ XXX
*/2 * * * * /path-to-kyberia-wwwroot/cron/logoutidle.php
0 0 * * * /path-to-kyberia-wwwroot/cron/k.php
*/3 * * * * /path-to-kyberia-wwwroot/cron/process-img.sh
// output buffering forcing (mx)
if (!empty($_POST['FORCE_OB']) && $_POST['FORCE_OB'] == 'true') ob_start();
-//header("Location: http://kyberia.sk");
-// just a little joke:-))) darkaural
-//header("Location: http://kenny.in-the-hell.org/albums/album22/HPIM1443.sized.jpg");
-//header("Location: http://zoznamka.azet.sk/inzeraty.phtml?&kat=8");
//header("Location: http://web.archive.org/web/20020925021139/http://kyberia.sk");
-//echo "este posledna pauza :)";
-//exit;
-//die("tak este nie ;o)<br>uplatky posielajte postovou poukazkou ;-p<br>prajem pekny den<br>stab<br>");
//echo "je to uz uplne v pici. vsetky data su stratene, prajem pekny den :)";
//exit;
-error_reporting(0);
-// echo "<center>prvy april presiel ale ja nechcem byt koderom azetu takze ring volny</center>";
-//echo "ehm, roztiekla sa databaza, zachovajte paniku, snad sme o hodinku spat ;)<br>br";
-//echo "<title>establishing artificial environment</title><br><br><center>healing database inconsistency.comeback today</center>";
-//echo '<body bgcolor=black><center><img src="http://kyberia.sk/images/under-construction.gif"><br><font color=silver>je mi luto, ale nachvilku to musim sundat ;). s pozdravom brrrrr </font></center></body>';
-//echo '<body bgcolor=black><center><img src="http://kyberia.sk/images/construction.jpg"><br><font color=silver>je mi luto, ale nachvilku to musim sundat ;). s pozdravom br </font></center></body>';
-//session_start();
-//if ($_GET['node_id'] != 2334 && $_SESSION['user_id'] != '2334' && $_SESSION['user_id'] != 2095638 && $_SESSION['user_id'] != 2088 && $_GET['node_id'] != 1478235) {
-//echo "<body><center><img src='/images/stuff/kyberia-stickerIV.jpg' /><br /><br />";
-//echo "<b><h3>snazime sa nieco spravit s rychlostou, stay tuned.</h3></b><br />";
-//echo "PS: my sme to odpojili z vonka</center></body>";
+error_reporting(1);
//exit;
-//}
+
//starting timer for benchmarking purposes
$timer_start=Time()+SubStr(MicroTime(),0,8);
}
//requiring main config file with path/database etc. constants
-require('../config/config.inc');
+require('config/config.inc');
require(INCLUDE_DIR.'senate.inc');
preg_match("/id\/(.*)\//",$_SERVER['HTTP_REFERER'],$ref_match);