本文整理匯總了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;
}