本文整理汇总了PHP中Zend_Text_Table::appendRow方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Text_Table::appendRow方法的具体用法?PHP Zend_Text_Table::appendRow怎么用?PHP Zend_Text_Table::appendRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Text_Table
的用法示例。
在下文中一共展示了Zend_Text_Table::appendRow方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createTable
public function createTable(array $data, $showHeader = true, $columnWidth = array('columnWidths' => array(10, 20)))
{
$tableConfig = array('columnWidths' => $columnWidth['columnWidths'], 'AutoSeparate' => Zend_Text_Table::AUTO_SEPARATE_ALL, 'padding' => 1);
$table = new Zend_Text_Table($tableConfig);
if ($showHeader) {
$table->appendRow($this->getHeader($data));
}
foreach ($data as $row) {
$row = $this->cleanArray($row);
$table->appendRow($row);
}
return (string) $table;
}
示例2: testTableMagicToString
public function testTableMagicToString()
{
$table = new Zend_Text_Table(array('columnWidths' => array(10)));
$row = new Zend_Text_Table_Row();
$row->appendColumn(new Zend_Text_Table_Column('foobar'));
$table->appendRow($row);
$this->assertEquals((string) $table, "┌──────────┐\n│foobar │\n└──────────┘\n");
}
示例3: _printStatistics
/**
* Print current DB statistics
*
* @throws Zend_Text_Table_Exception
*
* @return void Nothing
*/
protected function _printStatistics()
{
echo "============================================================================================================\n";
echo "Current statistics :\n";
$table = new Zend_Text_Table(array('columnWidths' => array(60, 40)));
foreach ($this->_statistics as $statisticKey => $value) {
$table->appendRow(array($statisticKey, $value));
}
echo (string) $table;
echo "\n";
}
示例4: array
$document->addField(Zend_Search_Lucene_Field::keyword('audience_type', $result['audience_type']));
$document->addField(Zend_Search_Lucene_Field::keyword('audience_value', $result['event_cohort']));
$document->addField(Zend_Search_Lucene_Field::keyword('event_start', $result['event_start']));
$document->addField(Zend_Search_Lucene_Field::unStored('files_body', $filesBody));
$document->addField(Zend_Search_Lucene_Field::keyword('organisation_id', $result['organisation_id']));
$index->addDocument($document);
}
break;
case 'optimize':
$index = Zend_Search_Lucene::open($path . '/' . $input->index);
$index->optimize();
break;
case 'search':
$index = Zend_Search_Lucene::open($path . '/' . $input->index);
$userQuery = Zend_Search_Lucene_Search_QueryParser::parse($input->term);
$results = $index->find($userQuery);
$textTable = new Zend_Text_Table(array('columnWidths' => array(12, 12, 5, 45)));
$textTable->appendRow(array('Document ID', 'Database ID', 'Score', 'Title'));
foreach ($results as $hit) {
$textTable->appendRow(array((string) $hit->id, (string) $hit->event_id, (string) round($hit->score, 2), $hit->title));
}
echo $textTable;
break;
case 'status':
$index = Zend_Search_Lucene::open($path . '/' . $input->index);
$textTable = new Zend_Text_Table(array('columnWidths' => array(30, 10)));
$textTable->appendRow(array('Documents Count', (string) $index->count()));
$textTable->appendRow(array('Non-deleted Documents Count', (string) $index->numDocs()));
echo $textTable;
break;
}
示例5: array
<?php
set_include_path('/var/www/zend-framework-1.7.2/library:.');
require_once 'Zend/Text/Table.php';
require_once 'Zend/Text/Table/Column.php';
$options = array('columnWidths' => array(20, 20));
$table = new Zend_Text_Table($options);
$table->appendRow(array('Ete', 'Dummy'));
$table->appendRow(array('Eté', 'Dummy'));
echo '<pre>' . $table . '</pre>';
示例6: logprofiler
public function logprofiler($action)
{
$suiteLogPath = Mage::getBaseDir('var') . DS . 'log' . DS . 'SagePaySuite';
$profilerPath = $suiteLogPath . DS . 'PROFILER';
if (!is_dir($suiteLogPath)) {
mkdir($suiteLogPath, 0755);
}
if (!is_dir($profilerPath)) {
mkdir($profilerPath, 0755);
}
$timers = Varien_Profiler::getTimers();
$request = $action->getRequest();
$prefix = $request->getParam('vtxcode', $request->getParam('VPSTxId', null));
$prefix = $prefix ? $prefix . '_' : '';
$longest = 0;
$rows = array();
foreach ($timers as $name => $timer) {
$sum = Varien_Profiler::fetch($name, 'sum');
$count = Varien_Profiler::fetch($name, 'count');
$realmem = Varien_Profiler::fetch($name, 'realmem');
$emalloc = Varien_Profiler::fetch($name, 'emalloc');
if ($sum < 0.001 && $count < 10 && $emalloc < 10000) {
continue;
}
$rows[] = array((string) $name, (string) number_format($sum, 4), (string) $count, (string) number_format($emalloc), (string) number_format($realmem));
$thislong = strlen($name);
if ($thislong > $longest) {
$longest = $thislong;
}
}
//Create table
$table = new Zend_Text_Table(array('columnWidths' => array($longest, 10, 6, 12, 12), 'decorator' => 'ascii'));
//Memory
$preheader = new Zend_Text_Table_Row();
$real = memory_get_usage(true);
$emalloc = memory_get_usage();
$preheader->appendColumn(new Zend_Text_Table_Column('real Memory usage: ' . $real . ' ' . ceil($real / 1048576) . 'MB', 'center', 1));
$preheader->appendColumn(new Zend_Text_Table_Column('emalloc Memory usage: ' . $emalloc . ' ' . ceil($emalloc / 1048576) . 'MB', 'center', 4));
$table->appendRow($preheader);
//Append Header
$header = new Zend_Text_Table_Row();
$header->appendColumn(new Zend_Text_Table_Column('Code Profiler', 'center'));
$header->appendColumn(new Zend_Text_Table_Column('Time', 'center'));
$header->appendColumn(new Zend_Text_Table_Column('Cnt', 'center'));
$header->appendColumn(new Zend_Text_Table_Column('Emalloc', 'center'));
$header->appendColumn(new Zend_Text_Table_Column('RealMem', 'center'));
$table->appendRow($header);
foreach ($rows as $row) {
$table->appendRow($row);
}
//SQL profile
$dbprofile = print_r(Varien_Profiler::getSqlProfiler(Mage::getSingleton('core/resource')->getConnection('core_write')), TRUE);
$dbprofile = substr($dbprofile, 0, -4);
$dbprofile = str_replace('<br>', "\n", $dbprofile);
$preheaderlabel = new Zend_Text_Table_Row();
$preheaderlabel->appendColumn(new Zend_Text_Table_Column('DATABASE', 'center', 5));
$table->appendRow($preheaderlabel);
$preheader = new Zend_Text_Table_Row();
$preheader->appendColumn(new Zend_Text_Table_Column($dbprofile, 'left', 5));
$table->appendRow($preheader);
//Request
$rqlabel = new Zend_Text_Table_Row();
$rqlabel->appendColumn(new Zend_Text_Table_Column('REQUEST', 'center', 5));
$table->appendRow($rqlabel);
$inforqp = new Zend_Text_Table_Row();
$inforqp->appendColumn(new Zend_Text_Table_Column($this->_filterRequest($request), 'left', 5));
$table->appendRow($inforqp);
$date = Mage::getModel('core/date')->date('Y-m-d\\.H-i-s');
$file = new SplFileObject($profilerPath . DS . $prefix . $date . '_' . $action->getFullActionName() . '.txt', 'w');
$file->fwrite($table);
}
示例7: _renderInfoTable
protected function _renderInfoTable()
{
$table = new Zend_Text_Table(array('columnWidths' => array(15, 15, 13, 15, 20, 18, 20, 13)));
$headerRow = array('Parent Id', 'Children Ids', '[C] Grouped Simple Links', '[X] Super Links', '[X] Super Attribute', '[X] Custom Options', '[X] Attribute Values', '[C] Positions');
$linesCounter = 0;
foreach ($this->_processedProducts as $data) {
if (0 == $linesCounter % 20) {
//Append Header on 0 and every 20 lines
$table->appendRow($headerRow);
}
$row = new Zend_Text_Table_Row();
foreach ($data as $value) {
$value = is_array($value) ? implode(',', $value) : (string) $value;
$row->appendColumn(new Zend_Text_Table_Column($value));
}
$table->appendRow($row);
$linesCounter++;
}
echo $table;
}