Changeset 8514
- Timestamp:
- 04/17/08 20:25:39 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/task/generator/sfGenerateAppTask.class.php
r8260 r8514 90 90 $app = $arguments['application']; 91 91 92 // Validate the application name 93 if (!preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $app)) 94 { 95 throw new sfCommandException(sprintf('The application name "%s" is invalid.', $app)); 96 } 97 92 98 $appDir = sfConfig::get('sf_apps_dir').'/'.$app; 93 99 branches/1.1/lib/task/generator/sfGenerateModuleTask.class.php
r8148 r8514 70 70 $module = $arguments['module']; 71 71 72 // Validate the module name 73 if (!preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $app)) 74 { 75 throw new sfCommandException(sprintf('The module name "%s" is invalid.', $app)); 76 } 77 72 78 $moduleDir = sfConfig::get('sf_app_module_dir').'/'.$module; 73 79 branches/1.1/lib/task/generator/sfGenerateTaskTask.class.php
r8513 r8514 63 63 $name = isset($taskNameComponents[1]) ? $taskNameComponents[1] : $taskNameComponents[0]; 64 64 $taskClassName = str_replace('-', '', ($namespace ? $namespace.ucfirst($name) : $name)).'Task'; 65 66 // Validate the class name 67 if (!preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $app)) 68 { 69 throw new sfCommandException(sprintf('The task class name "%s" is invalid.', $app)); 70 } 71 65 72 $briefDescription = $options['brief-description']; 66 73 $detailedDescription = <<<HED