当前位置: 首页>>代码示例>>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;未经允许,请勿转载。