Changeset 25051 for documentation/trunk/php
- Timestamp:
- 2012-02-07T11:07:26+13:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentation/trunk/php/common.php
r25026 r25051 115 115 function mkAllDir($destination_dir, $mode) 116 116 { 117 ///cho '<p> * Make all directories: ' . $destination_dir . '</p>' . "\n";117 echo '<p> * Make all directories: ' . $destination_dir . '</p>' . "\n"; 118 118 $dirs_to_create = array(); 119 119 $dir = $destination_dir; 120 120 while (!empty($dir) && !file_exists($dir)) 121 121 { 122 echo 'Does not exist - create...<br/>'; 122 123 array_unshift($dirs_to_create, $dir); 123 124 $dir = substr($dir, 0, strrpos($dir, '/')); 125 echo 'Testing for the existance of: ' . $dir . '<br/>'; 124 126 } 125 127 foreach ($dirs_to_create as $dir) 126 128 { 127 mkdir($dir, 0755); 129 if (!file_exists($dir)) 130 { 131 mkdir($dir, 0755); 132 } 128 133 } 129 134 if (!file_exists($destination_dir)) … … 137 142 function parseCLIArguments() 138 143 { 139 if ( $_SERVER['argc'])144 if (isset($_SERVER['argc']) && $_SERVER['argc'] > 0) 140 145 { 141 146 for ($i = 1; $i < $_SERVER['argc'] && !$unknown_argument; $i++) 142 147 { 143 if (preg_match('/^\-+ m/i', $_SERVER['argv'][$i]))148 if (preg_match('/^\-+(l|m)/i', $_SERVER['argv'][$i], $matches)) 144 149 { 145 150 $i++; 146 $_REQUEST[ 'm'] = $_SERVER['argv'][$i];151 $_REQUEST[$matches[1]] = $_SERVER['argv'][$i]; 147 152 } 148 153 else
Note:
See TracChangeset
for help on using the changeset viewer.