Example #1
0
 function __construct()
 {
     if (!memcached()) {
         return;
     }
     $this->memcached = new \Memcached(DOMAIN);
     $Core = Core::instance();
     $this->memcached->addServer($Core->memcached_host ?: '127.0.0.1', $Core->memcached_port ?: 11211);
 }
Example #2
0
 public function test_redis()
 {
     $mc = memcached();
     $this->assertInternalType('object', $mc);
     $this->assertSame($mc, _class('wrapper_memcached'));
     $mc->connect();
     $this->assertTrue($mc->is_ready());
     $key = 'mytestkey';
     $val = 'mytestval';
     if ($mc->get($key)) {
         $this->assertEquals($mc->del($key), 1);
     }
     $this->assertEmpty($mc->get($key));
     $this->assertTrue($mc->set($key, $val));
     $this->assertEquals($mc->get($key), $val);
     $this->assertEquals($mc->del($key), 1);
     $this->assertEmpty($mc->get($key));
 }
Example #3
0
    exit;
}
if ($argv[1] == "--phppfm-fix") {
    phppfm_fix();
    exit;
}
if ($argv[1] == "--phppfm-restart-back") {
    phppfm_restartback();
    exit;
}
if ($argv[1] == "--artica-web") {
    artica_webconsole();
    exit;
}
if ($argv[1] == "--memcache") {
    memcached();
    exit;
}
if ($argv[1] == "--nginx") {
    nginx();
    exit;
}
if ($argv[1] == "--dhcpd") {
    dhcpd();
    exit;
}
if ($argv[1] == "--haarp") {
    haarp();
    exit;
}
if ($argv[1] == "--mysql") {
Example #4
0
    $Index->form = false;
    switch ($Index->route_path[2]) {
        case 'phpinfo':
            $Index->Content = ob_wrapper(function () {
                phpinfo();
            });
            break;
        case 'readme.html':
            $Index->Content = file_get_contents(DIR . '/readme.html');
    }
    $Index->stop;
    return;
}
$hhvm_version = defined('HHVM_VERSION') ? HHVM_VERSION : false;
$Index->form = false;
$Index->content(h::{'table.cs-table-borderless.cs-left-even.cs-right-odd tr| td'}([h::{'a.cs-button[target=_blank]'}('phpinfo()', ['href' => "{$Index->action}/phpinfo"]) . h::{'a.cs-button[target=_blank]'}($L->information_about_system, ['href' => "{$Index->action}/readme.html"]) . h::{'div#cs-system-license.uk-modal pre.uk-modal-dialog-large'}(file_get_contents(DIR . '/license.txt'), ['title' => "{$L->system} » {$L->license}"]) . h::{'button#cs-system-license-open'}($L->license, ['data-title' => $L->click_to_view_details]), ['colspan' => 2]], ["{$L->operation_system}:", php_uname('s') . ' ' . php_uname('r') . ' ' . php_uname('v')], ["{$L->server_type}:", server_api()], preg_match('/apache/i', $_SERVER['SERVER_SOFTWARE']) ? [$L->version_of('Apache') . ':', apache_version()] : false, preg_match('/nginx/i', $_SERVER['SERVER_SOFTWARE']) ? [$L->version_of('Nginx') . ':', explode('/', $_SERVER['SERVER_SOFTWARE'])[1]] : false, $hhvm_version ? [$L->version_of('HHVM') . ':', $hhvm_version] : false, $hhvm_version ? false : ["{$L->available_ram}:", str_replace(['K', 'M', 'G'], [" {$L->KB}", " {$L->MB}", " {$L->GB}"], ini_get('memory_limit'))], [$L->version_of('PHP') . ':', PHP_VERSION], ["{$L->php_components}:", h::{'table.cs-left-odd.cs-table-borderless tr| td'}(["{$L->mcrypt}:", [check_mcrypt() ? $L->on : $L->off . h::icon('info-sign', ['data-title' => $L->mcrypt_warning]), ['class' => state(check_mcrypt())]]], ["{$L->zlib}:", $L->get(zlib())], zlib() ? ["{$L->zlib_compression}:", $L->get(zlib_compression())] : false, zlib_compression() ? ["{$L->zlib_compression_level}:", zlib_compression_level()] : false, ["{$L->curl_lib}:", [$L->get(curl()), ['class' => state(curl())]]], ["{$L->apc_module}:", [$L->get(apc()), ['class' => version_compare(PHP_VERSION, '5.5', '>=') ? false : state(apc())]]], ["{$L->memcached_module}:", [$L->get(memcached())]])], ["{$L->main_db}:", $Core->db_type], ["{$L->properties} {$Core->db_type}:", h::{'table.cs-left-odd.cs-table-borderless tr| td'}(["{$L->host}:", $Core->db_host], [$L->version_of($Core->db_type) . ':', [DB::instance()->server()]], ["{$L->name_of_db}:", $Core->db_name], ["{$L->prefix_for_db_tables}:", $Core->db_prefix])], ["{$L->main_storage}:", $Core->storage_type], ["{$L->cache_engine}:", $Core->cache_engine], ["{$L->free_disk_space}:", format_filesize(disk_free_space('./'), 2)], ["{$L->php_ini_settings}:", h::{'table.cs-left-odd.cs-table-borderless tr| td'}(["{$L->allow_file_upload}:", [$L->get(ini_get('file_uploads')), ['class' => state(ini_get('file_uploads'))]]], $hhvm_version ? false : ["{$L->max_file_uploads}:", ini_get('max_file_uploads')], ["{$L->upload_limit}:", format_filesize(str_replace(['K', 'M', 'G'], [" {$L->KB}", " {$L->MB}", " {$L->GB}"], ini_get('upload_max_filesize')))], ["{$L->post_max_size}:", format_filesize(str_replace(['K', 'M', 'G'], [" {$L->KB}", " {$L->MB}", " {$L->GB}"], ini_get('post_max_size')))], $hhvm_version ? false : ["{$L->max_execution_time}:", format_time(ini_get('max_execution_time'))], $hhvm_version ? false : ["{$L->max_input_time}:", format_time(ini_get('max_input_time'))], $hhvm_version ? false : ["{$L->default_socket_timeout}:", format_time(ini_get('default_socket_timeout'))], ["{$L->allow_url_fopen}:", [$L->get(ini_get('allow_url_fopen')), ['class' => state(ini_get('allow_url_fopen'))]]], ["{$L->display_errors}:", [$L->get(display_errors()), ['class' => state(!display_errors())]]])]));
function state($state)
{
    return $state ? 'uk-alert-success' : 'uk-alert-danger';
}
/**
 * Returns server type
 *
 * @return string
 */
function server_api()
{
    $phpinfo = ob_wrapper(function () {
        phpinfo();
    });
    if (preg_match('/apache/i', $_SERVER['SERVER_SOFTWARE'])) {
Example #5
0
 if ($argv[1] == "--avahi-daemon") {
     echo avahi_daemon();
     die;
 }
 if ($argv[1] == "--time-capsule") {
     echo avahi_daemon();
     echo "\n";
     echo netatalk();
     die;
 }
 if ($argv[1] == "--rrd") {
     echo testingrrd();
     die;
 }
 if ($argv[1] == "--memcached") {
     echo memcached();
     die;
 }
 if ($argv[1] == "--monit") {
     echo monit();
     die;
 }
 if ($argv[1] == "--UpdateUtility") {
     echo UpdateUtilityHTTP();
     die;
 }
 if ($argv[1] == "--zarafa-web") {
     echo zarafa_web();
     die;
 }
 if ($argv[1] == "--ejabberd") {
 /**
  */
 function _init()
 {
     $this->_connection = memcached();
     $this->_connection->connect();
 }