当前位置: 首页>>代码示例>>PHP>>正文


PHP Settings::optimise方法代码示例

本文整理汇总了PHP中newznab\db\Settings::optimise方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::optimise方法的具体用法?PHP Settings::optimise怎么用?PHP Settings::optimise使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在newznab\db\Settings的用法示例。


在下文中一共展示了Settings::optimise方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: AdminPage

<?php

require_once "config.php";
use newznab\db\Settings;
$page = new AdminPage();
$db = new Settings();
$tablelist = $db->optimise();
$page->title = "DB Table Optimise";
$page->smarty->assign('tablelist', $tablelist);
$page->content = $page->smarty->fetch('db-optimise.tpl');
$page->render();
开发者ID:RickDB,项目名称:newznab-tmux,代码行数:11,代码来源:db-optimise.php

示例2: isset

<?php

require_once "config.php";
use newznab\db\Settings;
$force = isset($argv[1]) && $argv[1] == "true";
$db = new Settings();
$ret = $db->optimise($force);
if (count($ret) > 0) {
    echo "Optmze  : Optimised " . count($ret) . " tables\n";
} else {
    echo "Optmze  : Nothing required optimisation." . (!$force ? " Try using force (optimise_db.php true)" : "") . "\n";
}
开发者ID:RickDB,项目名称:newznab-tmux,代码行数:12,代码来源:optimise_db.php

示例3: COUNT

$runVar['commands']['_php'] = $show_time . " nice -n{$tmux_niceness} {$PHP}";
$runVar['commands']['_phpn'] = "nice -n{$tmux_niceness} {$PHP}";
$runVar['commands']['_python'] = $show_time . " nice -n{$tmux_niceness} {$PYTHON}";
$runVar['commands']['_sleep'] = "{$runVar['commands']['_phpn']} {$runVar['paths']['misc']}update_scripts/nix_scripts/tmux/bin/showsleep.php";
//spawn IRCScraper as soon as possible
$tRun->runPane('scraper', $runVar);
//get list of panes by name
$runVar['panes'] = $tRun->getListOfPanes($runVar['constants']);
//totals per category in db, results by parentid
$catcntqry = "SELECT c.parentid AS parentid, COUNT(r.id) AS count FROM category c, releases r WHERE r.categoryid = c.id GROUP BY c.parentid";
//create timers and set to now
$runVar['timers']['timer1'] = $runVar['timers']['timer2'] = $runVar['timers']['timer3'] = $runVar['timers']['timer4'] = $runVar['timers']['timer5'] = time();
$runVar['timers']['query']['tmux_time'] = $runVar['timers']['query']['split_time'] = $runVar['timers']['query']['init_time'] = $runVar['timers']['query']['proc1_time'] = $runVar['timers']['query']['proc2_time'] = $runVar['timers']['query']['proc3_time'] = $runVar['timers']['query']['split1_time'] = $runVar['timers']['query']['init1_time'] = $runVar['timers']['query']['proc11_time'] = $runVar['timers']['query']['proc21_time'] = $runVar['timers']['query']['proc31_time'] = $runVar['timers']['query']['tpg_time'] = $runVar['timers']['query']['tpg1_time'] = 0;
// Analyze tables
printf($pdo->log->info("\nAnalyzing your tables to refresh your indexes."));
$pdo->optimise(false, 'analyze', false, ['releases']);
passthru('clear');
$runVar['settings']['monitor'] = 0;
$runVar['counts']['iterations'] = 1;
$runVar['modsettings']['fc']['firstrun'] = true;
$runVar['modsettings']['fc']['num'] = 0;
while ($runVar['counts']['iterations'] > 0) {
    //check the db connection
    if ($pdo->ping(true) == false) {
        unset($pdo);
        $pdo = new Settings();
    }
    $timer01 = time();
    // These queries are very fast, run every loop -- tmux and site settings
    $runVar['settings'] = $pdo->queryOneRow($tRun->getMonitorSettings(), false);
    $runVar['timers']['query']['tmux_time'] = time() - $timer01;
开发者ID:engine9-,项目名称:newznab-tmux,代码行数:31,代码来源:monitor.php

示例4: foreach

    }
}
unset($value);
$sql = "SHOW table status";
$tables = $pdo->query($sql);
foreach ($tables as $row) {
    $tbl = $row['name'];
    if (preg_match('/binaries_\\d+/', $tbl) || preg_match('/parts_\\d+/', $tbl) || preg_match('/collections_\\d+/', $tbl) || preg_match('/partrepair_\\d+/', $tbl) || preg_match('/\\d+_binaries/', $tbl) || preg_match('/\\d+_collections/', $tbl) || preg_match('/\\d+_parts/', $tbl) || preg_match('/\\d+_partrepair_\\d+/', $tbl)) {
        $rel = $pdo->queryDirect(sprintf('DROP TABLE %s', $tbl));
        if ($rel !== false) {
            echo $pdo->log->primary("Dropping {$tbl} completed.");
        }
    }
}
(new \SphinxSearch())->truncateRTIndex('releases_rt');
$pdo->optimise(false, 'full');
echo $pdo->log->header("Deleting nzbfiles subfolders.");
try {
    $files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($pdo->getSetting('nzbpath'), \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::CHILD_FIRST);
    foreach ($files as $file) {
        if (basename($file) != '.gitignore' && basename($file) != 'tmpunrar') {
            $todo = $file->isDir() ? 'rmdir' : 'unlink';
            @$todo($file);
        }
    }
} catch (UnexpectedValueException $e) {
    echo $pdo->log->error($e->getMessage());
}
echo $pdo->log->header("Deleting all images, previews and samples that still remain.");
try {
    $dirItr = new \RecursiveDirectoryIterator(NN_COVERS);
开发者ID:engine9-,项目名称:newznab-tmux,代码行数:31,代码来源:resetdb.php


注:本文中的newznab\db\Settings::optimise方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。