本文整理汇总了PHP中Generator::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Generator::instance方法的具体用法?PHP Generator::instance怎么用?PHP Generator::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Generator
的用法示例。
在下文中一共展示了Generator::instance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$sharedTypes = $cli->getValue('--sharedTypes');
$createAccessors = $cli->getValue('--createAccessors');
$constructorDefaultsToNull = $cli->getValue('--constructorNull');
$noIncludes = $cli->getValue('--noIncludes');
$optionsArray = array();
if ($cli->getValue('--singleElementArrays')) {
$optionsArray[] = 'SOAP_SINGLE_ELEMENT_ARRAYS';
}
if ($cli->getValue('--xsiArrayType')) {
$optionsArray[] = 'SOAP_USE_XSI_ARRAY_TYPE';
}
if ($cli->getValue('--waitOneWayCalls')) {
$optionsArray[] = 'SOAP_WAIT_ONE_WAY_CALLS';
}
$wsdlCache = '';
if ($cli->getValue('--cacheNone')) {
$wsdlCache = 'WSDL_CACHE_NONE';
} elseif ($cli->getValue('--cacheDisk')) {
$wsdlCache = 'WSDL_CACHE_DISK';
} elseif ($cli->getValue('--cacheMemory')) {
$wsdlCache = 'WSDL_CACHE_MEMORY';
} elseif ($cli->getValue('--cacheBoth')) {
$wsdlCache = 'WSDL_CACHE_BOTH';
}
$gzip = '';
if ($cli->getValue('--gzip')) {
$gzip = 'SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP';
}
$config = new Config($inputFile, $outputDir, $verbose, $singleFile, $classExists, $noTypeConstructor, $namespaceName, $optionsArray, $wsdlCache, $gzip, $classNames, $prefix, $suffix, $sharedTypes, $createAccessors, $constructorDefaultsToNull, $noIncludes);
$generator = Generator::instance();
$generator->generate($config);
示例2: instance
/**
* Initializes the single instance if it hasn't been, and returns it if it has.
*/
public static function instance()
{
if (self::$instance === null) {
self::$instance = new Generator();
}
return self::$instance;
}