Ejemplo n.º 1
0
 /**
  *
  * Checks that the argument are valid
  * @param array $arguments
  */
 public static function checkArguments(array $arguments)
 {
     //Checks if the ini argument was given
     if (!isset($arguments['ini']) || !$arguments['ini'] || is_null($arguments['ini'])) {
         uiConfDeployment::printUsage('missing argument --ini');
     }
     //Checks if the partner argument was given
     if (!isset($arguments['partner']) || !$arguments['partner'] || is_null($arguments['partner'])) {
         KalturaLog::debug("--partner argument wasn't given. Using defualt partner 0");
     } else {
         self::$partner = PartnerPeer::retrieveByPK($arguments['partner']);
         if (!self::$partner) {
             die('no such partner.' . PHP_EOL);
         }
     }
     //Check if ini file exists
     if (!file_exists($arguments['ini'])) {
         uiConfDeployment::printUsage('config file not found ' . $arguments['ini']);
     }
 }
Ejemplo n.º 2
0
    $arg_value = @$arg_pair[1];
    if (!isset($arguments[$arg_name])) {
        uiConfDeployment::printUsage('unknown argument ' . $arg_name);
    }
    if (is_null($arg_value)) {
        $arg_value = true;
    }
    $arguments[$arg_name] = $arg_value;
}
$includeCode = $arguments['include-code'];
$skipAddUiconf = $arguments['no-create'];
if (!isset($arguments['ini']) || !$arguments['ini'] || is_null($arguments['ini'])) {
    uiConfDeployment::printUsage('missing argument --ini');
}
if (!file_exists($arguments['ini'])) {
    uiConfDeployment::printUsage('config file not found ' . $arguments['ini']);
}
//error_reporting(0);
$confObj = uiConfDeployment::init($arguments['ini']);
$baseTag = $confObj->general->component->name;
$defaultTags = "autodeploy, {$baseTag}_{$confObj->general->component->version}";
$sections = explode(',', $confObj->general->component->required_widgets);
if ($includeCode) {
    $code[] = '$c = new Criteria();';
    $code[] = '$c->addAnd(UiConfPeer::PARTNER_ID, ' . $confObj->statics->partner_id . ');';
    $code[] = '$c->addAnd(UiConfPeer::TAGS, "%' . $baseTag . '_".$this->kmc_' . $baseTag . '_version."%", Criteria::LIKE);';
    $code[] = '$c->addAnd(UiConfPeer::TAGS, "%autodeploy%", Criteria::LIKE);';
    $code[] = '$this->confs = UiConfPeer::doSelect($c);';
}
$tags_search = array();
foreach ($sections as $section) {