本文整理汇总了PHP中ProjectManager::getSplitData方法的典型用法代码示例。如果您正苦于以下问题:PHP ProjectManager::getSplitData方法的具体用法?PHP ProjectManager::getSplitData怎么用?PHP ProjectManager::getSplitData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectManager
的用法示例。
在下文中一共展示了ProjectManager::getSplitData方法的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());
}
}
示例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());