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


PHP Zend_Text_Table::appendRow方法代码示例

本文整理汇总了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;
 }
开发者ID:keywork,项目名称:MageConsole,代码行数:13,代码来源:Data.php

示例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");
 }
开发者ID:omusico,项目名称:logica,代码行数:8,代码来源:TableTest.php

示例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";
 }
开发者ID:keyur-iksula,项目名称:mongogento,代码行数:18,代码来源:mongoify.php

示例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;
}
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:31,代码来源:search-lucene.php

示例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>';
开发者ID:Tony133,项目名称:zf-web,代码行数:10,代码来源:Zend_Table.php

示例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);
 }
开发者ID:xiaoguizhidao,项目名称:mydigibits,代码行数:71,代码来源:Data.php

示例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;
 }
开发者ID:JulienDotDev,项目名称:convert-configurable2grouped,代码行数:20,代码来源:convert-configurable2grouped.php


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