当前位置: 首页>>代码示例>>PHP>>正文


PHP Cli::addFlag方法代码示例

本文整理汇总了PHP中Cli::addFlag方法的典型用法代码示例。如果您正苦于以下问题:PHP Cli::addFlag方法的具体用法?PHP Cli::addFlag怎么用?PHP Cli::addFlag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cli的用法示例。


在下文中一共展示了Cli::addFlag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGetValue

 /**
  * 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'));
 }
开发者ID:rgantt,项目名称:wsdl2phpgenerator,代码行数:15,代码来源:CliTest.php

示例2: substr

    $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);
开发者ID:rgantt,项目名称:wsdl2phpgenerator,代码行数:31,代码来源:generate.php


注:本文中的Cli::addFlag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。