ucfirst() static public method

See also: http://ca.php.net/manual/en/function.ucfirst.php
static public ucfirst ( $string ) : string
$string string Input string
return string ucfirst version of input string
 /**
  * @see TypeDescription::parseTypeName()
  */
 function parseTypeName($typeName)
 {
     // Standard validators are based on string input.
     parent::parseTypeName('string');
     // Split the type name into validator name and arguments.
     $typeNameParts = explode('(', $typeName, 2);
     switch (count($typeNameParts)) {
         case 1:
             // no argument
             $this->_validatorArgs = '';
             break;
         case 2:
             // parse arguments (no UTF8-treatment necessary)
             if (substr($typeNameParts[1], -1) != ')') {
                 return false;
             }
             // FIXME: Escape for PHP code inclusion?
             $this->_validatorArgs = substr($typeNameParts[1], 0, -1);
             break;
     }
     // Validator name must start with a lower case letter
     // and may contain only alphanumeric letters.
     if (!PKPString::regexp_match('/^[a-z][a-zA-Z0-9]+$/', $typeNameParts[0])) {
         return false;
     }
     // Translate the validator name into a validator class name.
     $this->_validatorClassName = 'Validator' . PKPString::ucfirst($typeNameParts[0]);
     return true;
 }
Esempio n. 2
0
 /**
  * Set the required runtime environment
  * @param $runtimeEnvironment RuntimeEnvironment
  */
 function setRuntimeEnvironment(&$runtimeEnvironment)
 {
     assert(is_a($runtimeEnvironment, 'RuntimeEnvironment'));
     $this->_runtimeEnvironment =& $runtimeEnvironment;
     // Inject the runtime settings into the data object
     // for persistence.
     $runtimeSettings = $this->supportedRuntimeEnvironmentSettings();
     foreach ($runtimeSettings as $runtimeSetting => $defaultValue) {
         $methodName = 'get' . PKPString::ucfirst($runtimeSetting);
         $this->setData($runtimeSetting, $runtimeEnvironment->{$methodName}());
     }
 }