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


PHP GO::setMemoryLimit方法代码示例

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


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

示例1: render

 public function render($return = false)
 {
     \GO::setMemoryLimit(512);
     $this->_pdf = new Pdf('L');
     //		$this->_pdf->font_size=8;
     $this->_pdf->title = $this->name();
     if ($this->project) {
         $this->_pdf->title .= ': ' . $this->project->path;
     }
     if (!empty($_REQUEST['startdate'])) {
         $this->_pdf->subtitle = $_REQUEST['startdate'];
         if (!empty($_REQUEST['enddate'])) {
             $this->_pdf->subtitle .= " - " . $_REQUEST['enddate'];
         }
     }
     $this->_pdf->AddPage();
     $this->_addProjects();
     if ($return) {
         return $this->_pdf->Output($this->filename . ".pdf", 'I');
     } else {
         Http::outputDownloadHeaders(new File($this->filename . ".pdf"));
         echo $this->_pdf->Output($this->filename . ".pdf", 'I');
     }
 }
开发者ID:ajaboa,项目名称:crmpuan,代码行数:24,代码来源:ProjectsReportLarge.php

示例2: actionRemoveDuplicates

 public function actionRemoveDuplicates($params)
 {
     \GO::setMaxExecutionTime(300);
     \GO::setMemoryLimit(1024);
     $this->render('externalHeader');
     $tasklist = \GO\Tasks\Model\Tasklist::model()->findByPk($params['tasklist_id']);
     if (!$tasklist) {
         throw new \GO\Base\Exception\NotFound();
     }
     \GO\Base\Fs\File::setAllowDeletes(false);
     //VERY IMPORTANT:
     \GO\Files\Model\Folder::$deleteInDatabaseOnly = true;
     \GO::session()->closeWriting();
     //close writing otherwise concurrent requests are blocked.
     $checkModels = array("GO\\Tasks\\Model\\Task" => array('name', 'start_time', 'due_time', 'rrule', 'user_id', 'tasklist_id'));
     foreach ($checkModels as $modelName => $checkFields) {
         if (empty($params['model']) || $modelName == $params['model']) {
             echo '<h1>' . \GO::t('removeDuplicates') . '</h1>';
             $checkFieldsStr = 't.' . implode(', t.', $checkFields);
             $findParams = \GO\Base\Db\FindParams::newInstance()->ignoreAcl()->select('t.id, count(*) AS n, ' . $checkFieldsStr)->group($checkFields)->having('n>1');
             $findParams->getCriteria()->addCondition('tasklist_id', $tasklist->id);
             $stmt1 = \GO::getModel($modelName)->find($findParams);
             echo '<table border="1">';
             echo '<tr><td>ID</th><th>' . implode('</th><th>', $checkFields) . '</th></tr>';
             $count = 0;
             while ($dupModel = $stmt1->fetch()) {
                 $select = 't.id';
                 if (\GO::getModel($modelName)->hasFiles()) {
                     $select .= ', t.files_folder_id';
                 }
                 $findParams = \GO\Base\Db\FindParams::newInstance()->ignoreAcl()->select($select . ', ' . $checkFieldsStr)->order('id', 'ASC');
                 $findParams->getCriteria()->addCondition('tasklist_id', $tasklist->id);
                 foreach ($checkFields as $field) {
                     $findParams->getCriteria()->addCondition($field, $dupModel->getAttribute($field));
                 }
                 $stmt = \GO::getModel($modelName)->find($findParams);
                 $first = true;
                 while ($model = $stmt->fetch()) {
                     echo '<tr><td>';
                     if (!$first) {
                         echo '<span style="color:red">';
                     }
                     echo $model->id;
                     if (!$first) {
                         echo '</span>';
                     }
                     echo '</th>';
                     foreach ($checkFields as $field) {
                         echo '<td>' . $model->getAttribute($field, 'html') . '</td>';
                     }
                     echo '</tr>';
                     if (!$first) {
                         if (!empty($params['delete'])) {
                             if ($model->hasLinks() && $model->countLinks()) {
                                 echo '<tr><td colspan="99">' . \GO::t('skippedDeleteHasLinks') . '</td></tr>';
                             } elseif (($filesFolder = $model->getFilesFolder(false)) && ($filesFolder->hasFileChildren() || $filesFolder->hasFolderChildren())) {
                                 echo '<tr><td colspan="99">' . \GO::t('skippedDeleteHasFiles') . '</td></tr>';
                             } else {
                                 $model->delete();
                             }
                         }
                         $count++;
                     }
                     $first = false;
                 }
             }
             echo '</table>';
             echo '<p>' . sprintf(\GO::t('foundDuplicates'), $count) . '</p>';
             echo '<br /><br /><a href="' . \GO::url('tasks/tasklist/removeDuplicates', array('delete' => true, 'tasklist_id' => $tasklist->id)) . '">' . \GO::t('clickToDeleteDuplicates') . '</a>';
         }
     }
     $this->render('externalFooter');
 }
开发者ID:ajaboa,项目名称:crmpuan,代码行数:73,代码来源:TasklistController.php


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