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


PHP ProjectManager::applySplit方法代碼示例

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


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

示例1: doAction

 public function doAction()
 {
     $this->project_data = getProjectJobData($this->project_id);
     try {
         if (empty($this->project_data)) {
             throw new Exception("No Project Found.", -1);
         }
         $pManager = new ProjectManager();
         $pStruct = $pManager->getProjectStructure();
         switch ($this->exec) {
             case 'merge':
                 $this->checkMergeAccess();
                 $pStruct['job_to_merge'] = $this->job_id;
                 $pManager->mergeALL($pStruct);
                 break;
             case 'check':
                 $this->checkSplitAccess();
                 $pStruct['job_to_split'] = $this->job_id;
                 $pStruct['job_to_split_pass'] = $this->job_pass;
                 $pManager->getSplitData($pStruct, $this->num_split, $this->split_values);
                 break;
             case 'apply':
                 $this->checkSplitAccess();
                 $pStruct['job_to_split'] = $this->job_id;
                 $pStruct['job_to_split_pass'] = $this->job_pass;
                 $pManager->getSplitData($pStruct, $this->num_split, $this->split_values);
                 $pManager->applySplit($pStruct);
                 break;
         }
         $this->result["data"] = $pStruct['split_result'];
     } catch (Exception $e) {
         $this->result['errors'][] = array("code" => $e->getCode(), "message" => $e->getMessage());
     }
 }
開發者ID:indynagpal,項目名稱:MateCat,代碼行數:34,代碼來源:splitJobController.php

示例2: isset

$job_pass = $argv[2];
$num_split = $argv[3];
$apply_split = isset($argv[4]) && $argv[4] == "--apply";
@INIT::obtain();
include_once INIT::$UTILS_ROOT . '/CatUtils.php';
include_once INIT::$UTILS_ROOT . '/Utils.php';
include_once INIT::$UTILS_ROOT . '/Log.php';
include_once INIT::$MODEL_ROOT . '/queries.php';
ini_set('error_reporting', E_ALL);
$db = Database::obtain(INIT::$DB_SERVER, INIT::$DB_USER, INIT::$DB_PASS, INIT::$DB_DATABASE);
$db->debug = INIT::$DEBUG;
$db->connect();
include INIT::$UTILS_ROOT . '/RecursiveArrayObject.php';
include INIT::$UTILS_ROOT . '/ProjectManager.php';
error_reporting(E_ALL & ~E_DEPRECATED);
$pm = new ProjectManager();
/*
http://matecat.local/translate/ESPANOL_VERY_BIG_2900_segs.sdlxliff/en-US-fr-FR/5294-e01e940bdca8
*/
$pStruct = $pm->getProjectStructure();
$pStruct['job_to_split'] = $job_num;
$pStruct['job_to_split_pass'] = $job_pass;
$pm->getSplitData($pStruct, $num_split);
if ($apply_split) {
    $pm->applySplit($pStruct);
}
var_export(json_encode($pStruct['split_result']));
echo "\n";
echo "\n";
echo "\n";
var_export($pStruct['split_result']->getArrayCopy());
開發者ID:kevinvnloctra,項目名稱:MateCat,代碼行數:31,代碼來源:manualSplitJob.php


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