Exemple #1
0
 /**
  * Tests the whole getValue function, implicitly tests the getFlag function too
  */
 public function testGetValue()
 {
     $this->object->addFlag('-f', 'test', true, true);
     $this->object->addFlag('-g', 'test', true, false);
     $this->object->addAlias('-f', '--bar');
     $this->object->validate(array('-f=foo', '--bar', 'foo'));
     $this->assertEquals('foo', $this->object->getValue('-f'));
     $this->assertEquals('foo', $this->object->getValue('--bar'));
     $this->assertEquals(false, $this->object->getValue('-g'));
     $this->assertEquals(false, $this->object->getValue('--invalidFlag'));
     $this->assertNotEquals(false, $this->object->getValue('-f'));
 }
    $lcDir = 'LC_MESSAGES';
    $path = 'conf/translations';
    $loc = substr($locale, 0, 5);
    $file = $path . '/' . $loc . '/' . $lcDir . '/' . $domain . '.mo';
    if (file_exists($file) == false) {
        throw new Exception('The selected language file (' . $file . ') does not exist!');
    }
    bindtextdomain($domain, $path);
    textdomain($domain);
    setlocale(LC_ALL, $locale);
} catch (Exception $e) {
    // This should be the no file exception, then use the default settings
}
// Start
$cli = new Cli('wsdl2php', '[OPTIONS] -i wsdlfile -o directory', '1.5.1');
$cli->addFlag('-e', _('If all classes should be guarded with if(!class_exists) statements'), true, false);
$cli->addFlag('-t', _('If no type constructor should be generated'), true, false);
$cli->addFlag('-s', _('If the output should be a single file'), true, false);
$cli->addFlag('-v', _('If the output to the console should be verbose'), true, false);
$cli->addFlag('-i', _('The input wsdl file'), false, true);
$cli->addFlag('-o', _('The output directory or file if -s is used (in that case, .php will be appened to file name)'), false, true);
$cli->addFlag('-n', _('Use namespace with the name'), false, false);
$cli->addFlag('-c', _('A comma separated list of classnames to generate. If this is used only classes that exist in the list will be generated. If the service is not in this list and the -s flag is used the filename will be the name of the first class that is generated'), false, false);
$cli->addFlag('-p', _('The prefix to use for the generated classes'), false, false);
$cli->addFlag('-q', _('The suffix to use for the generated classes'), false, false);
$cli->addFlag('--singleElementArrays', _('Adds the option to use single element arrays to the client'), true, false);
$cli->addFlag('--xsiArrayType', _('Adds the option to use xsi arrays to the client'), true, false);
$cli->addFlag('--waitOneWayCalls', _('Adds the option to use wait one way calls to the client'), true, false);
$cli->addFlag('--cacheNone', _('Adds the option to not cache the wsdl to the client'), true, false);
$cli->addFlag('--cacheDisk', _('Adds the option to cache the wsdl on disk to the client'), true, false);
$cli->addFlag('--cacheMemory', _('Adds the option to cache the wsdl in memory to the client'), true, false);
Exemple #3
0
    $lcDir = 'LC_MESSAGES';
    $path = 'conf/translations';
    $loc = substr($locale, 0, 5);
    $file = $path . '/' . $loc . '/' . $lcDir . '/' . $domain . '.mo';
    if (file_exists($file) == false) {
        throw new Exception('The selected language file (' . $file . ') does not exist!');
    }
    bindtextdomain($domain, $path);
    textdomain($domain);
    setlocale(LC_ALL, $locale);
} catch (Exception $e) {
    // This should be the no file exception, then use the default settings
}
// Start
$cli = new Cli('wsdl2php', '[OPTIONS] -i wsdlfile -o directory', '1.5.2');
$cli->addFlag('-e', _('If all classes should be guarded with if(!class_exists) statements'), true, false);
$cli->addFlag('-t', _('If no type constructor should be generated'), true, false);
$cli->addFlag('-s', _('If the output should be a single file'), true, false);
$cli->addFlag('-v', _('If the output to the console should be verbose'), true, false);
$cli->addFlag('-i', _('The input wsdl file'), false, true);
$cli->addFlag('-o', _('The output directory or file if -s is used (in that case, .php will be appened to file name)'), false, true);
$cli->addFlag('-n', _('Use namespace with the name'), false, false);
$cli->addFlag('-c', _("A comma separated list of classnames to generate.\nIf this is used only classes that exist in the list will be generated.\nIf the service is not in this list and the -s flag is used\nthe filename will be the name of the first class that is generated"), false, false);
$cli->addFlag('-p', _('The prefix to use for the generated classes'), false, false);
$cli->addFlag('-q', _('The suffix to use for the generated classes'), false, false);
$cli->addFlag('--sharedTypes', _('If multiple class got the name, the first will be used, other will be ignored'), true, false);
$cli->addFlag('--createAccessors', _('Create getter and setter methods for member variables'), true, false);
$cli->addFlag('--constructorNull', _('Create getter and setter methods for member variables'), true, false);
$cli->addFlag('--noIncludes', _('Do not add include_once statements for loading individual files'), true, false);
$cli->addFlag('--singleElementArrays', _('Adds the option to use single element arrays to the client'), true, false);
$cli->addFlag('--xsiArrayType', _('Adds the option to use xsi arrays to the client'), true, false);