當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Flyspray::function_disabled方法代碼示例

本文整理匯總了PHP中Flyspray::function_disabled方法的典型用法代碼示例。如果您正苦於以下問題:PHP Flyspray::function_disabled方法的具體用法?PHP Flyspray::function_disabled怎麽用?PHP Flyspray::function_disabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Flyspray的用法示例。


在下文中一共展示了Flyspray::function_disabled方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: show

 /**
  * show 
  * 
  * @access public
  * @return void
  */
 function show()
 {
     global $user, $page, $fs, $conf, $db, $proj, $baseurl;
     $path_to_dot = array_get($conf['general'], 'dot_path', '');
     //php 4 on windows does not have is_executable..
     $func = function_exists('is_executable') ? 'is_executable' : 'is_file';
     $path_to_dot = $func($path_to_dot) ? $path_to_dot : '';
     $useLocal = !Flyspray::function_disabled('shell_exec') && $path_to_dot;
     $fmt = Filters::enum(array_get($conf['general'], 'dot_format', 'png'), array('png', 'svg'));
     $id = $this->task['task_id'];
     $page->assign('task_id', $id);
     $prunemode = Get::num('prune', 0);
     $selfurl = CreateURL(array('depends', 'task' . $id));
     $pmodes = array(L('none'), L('pruneclosedlinks'), L('pruneclosedtasks'));
     foreach ($pmodes as $mode => $desc) {
         if ($mode == $prunemode) {
             $strlist[] = $desc;
         } else {
             $strlist[] = "<a href='" . Filters::noXSS($selfurl) . ($mode != 0 ? "&amp;prune={$mode}" : "") . "'>{$desc}</a>\n";
         }
     }
     $page->assign('strlist', $strlist);
     $starttime = microtime();
     $sql = 'SELECT t1.task_id AS id1, t1.prefix_id AS pxid1, p1.project_prefix AS ppx1, t1.item_summary AS sum1,
                  t1.percent_complete AS pct1, t1.is_closed AS clsd1,
                  t1.closure_comment AS com1, u1c.real_name AS clsdby1,
                  r1.item_name as res1,
                  t2.task_id AS id2, t2.prefix_id AS pxid2, p2.project_prefix AS ppx2, t2.item_summary AS sum2,
                  t2.percent_complete AS pct2, t2.is_closed AS clsd2,
                  t2.closure_comment AS com2, u2c.real_name AS clsdby2,
                  r2.item_name as res2
            FROM  {dependencies} AS d
            JOIN  {tasks} AS t1 ON d.task_id=t1.task_id
       LEFT JOIN  {users} AS u1c ON t1.closed_by=u1c.user_id
       LEFT JOIN  {projects} AS p1 ON t1.project_id = p1.project_id
       LEFT JOIN  {list_items} AS r1 ON t1.resolution_reason=r1.list_item_id
            JOIN  {tasks} AS t2 ON d.dep_task_id=t2.task_id
       LEFT JOIN  {users} AS u2c ON t2.closed_by=u2c.user_id
       LEFT JOIN  {projects} AS p2 ON t2.project_id = p2.project_id
       LEFT JOIN  {list_items} AS r2 ON t2.resolution_reason=r2.list_item_id
           WHERE  t1.project_id= ?
        ORDER BY  d.task_id, d.dep_task_id';
     $edges = $db->x->getAll($sql, null, $proj->id);
     $edge_list = array();
     $rvrs_list = array();
     $node_list = array();
     foreach ($edges as $row) {
         extract($row, EXTR_REFS);
         $edge_list[$id1][] = $id2;
         $rvrs_list[$id2][] = $id1;
         if (!isset($node_list[$id1])) {
             $node_list[$id1] = array('id' => $id1, 'sum' => $sum1, 'pct' => $pct1, 'clsd' => $clsd1, 'ppx' => $ppx1, 'pxid' => $pxid1, 'com' => $com1, 'clsdby' => $clsdby1, 'res' => $res1);
         }
         if (!isset($node_list[$id2])) {
             $node_list[$id2] = array('id' => $id2, 'sum' => $sum2, 'pct' => $pct2, 'clsd' => $clsd2, 'ppx' => $ppx2, 'pxid' => $pxid2, 'com' => $com2, 'clsdby' => $clsdby2, 'res' => $res2);
         }
     }
     // Now we have our lists of nodes and edges, along with a helper
     // list of reverse edges. Time to do the graph coloring, so we know
     // which ones are in our particular connected graph. We'll set up a
     // list and fill it up as we visit nodes that are connected to our
     // main task.
     $connected = array();
     $levelsdown = 0;
     $levelsup = 0;
     function ConnectsTo($id, $down, $up, &$connected, &$edge_list, &$rvrs_list, &$levelsdown, &$levelsup, &$prunemode, &$node_list)
     {
         if (!isset($connected[$id])) {
             $connected[$id] = 1;
         }
         if ($down > $levelsdown) {
             $levelsdown = $down;
         }
         if ($up > $levelsup) {
             $levelsup = $up;
         }
         $selfclosed = $node_list[$id]['clsd'];
         if (isset($edge_list[$id])) {
             foreach ($edge_list[$id] as $neighbor) {
                 $neighborclosed = $node_list[$neighbor]['clsd'];
                 if (!isset($connected[$neighbor]) && !($prunemode == 1 && $selfclosed && $neighborclosed) && !($prunemode == 2 && $neighborclosed)) {
                     ConnectsTo($neighbor, $down, $up + 1, $connected, $edge_list, $rvrs_list, $levelsdown, $levelsup, $prunemode, $node_list);
                 }
             }
         }
         if (isset($rvrs_list[$id])) {
             foreach ($rvrs_list[$id] as $neighbor) {
                 $neighborclosed = $node_list[$neighbor]['clsd'];
                 if (!isset($connected[$neighbor]) && !($prunemode == 1 && $selfclosed && $neighborclosed) && !($prunemode == 2 && $neighborclosed)) {
                     ConnectsTo($neighbor, $down + 1, $up, $connected, $edge_list, $rvrs_list, $levelsdown, $levelsup, $prunemode, $node_list);
                 }
             }
         }
     }
//.........這裏部分代碼省略.........
開發者ID:negram,項目名稱:flyspray,代碼行數:101,代碼來源:depends.php


注:本文中的Flyspray::function_disabled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。