Mercurial > public > src > phphgadmin
comparison admin/application/libraries/hgphp.php @ 11:2ec108f96fad
Cleaned up config. UI tidy up. Commenting. Still missing caching and concurrency checks.
author | joshjcarrier |
---|---|
date | Thu, 13 May 2010 23:28:00 -0700 |
parents | 0e7e4cead7c9 |
children | 4aa2707ae587 |
comparison
equal
deleted
inserted
replaced
10:0e7e4cead7c9 | 11:2ec108f96fad |
---|---|
2 | 2 |
3 /** | 3 /** |
4 * CodeIgniter Mercurial Repository Management class | 4 * CodeIgniter Mercurial Repository Management class |
5 * | 5 * |
6 * Scans file system and Mercurial projects directory, allowing | 6 * Scans file system and Mercurial projects directory, allowing |
7 * web-based manipulation of the hgwebdir.config and hgrc configuration files. | 7 * web-based manipulation of the hgweb.config and hgrc configuration files. |
8 * | 8 * |
9 * Depends on the HgConf2Ini library. | 9 * Depends on the HgConf2Ini library. |
10 * | 10 * |
11 * @package CodeIgniter | 11 * @package CodeIgniter |
12 * @subpackage Libraries | 12 * @subpackage Libraries |
228 if(!$this->can_create($repository_name)) | 228 if(!$this->can_create($repository_name)) |
229 { | 229 { |
230 return false; | 230 return false; |
231 } | 231 } |
232 | 232 |
233 $cd = $this->_repositories_rel_dir; | 233 $cd = $this->_repositories_abs_dir; |
234 mkdir($cd . $repository_name . '/.hg/store/data/', 0755, TRUE); | 234 mkdir($cd . $repository_name . '/.hg/store/data/', 0755, TRUE); |
235 | 235 |
236 // create hgrc | 236 // create hgrc |
237 return $this->_ci->hgconf2ini->touchHGRC($repository_name); | 237 return $this->_ci->hgconf2ini->touchHGRC($repository_name); |
238 } | 238 } |
242 if(!$this->can_delete($repository_name)) | 242 if(!$this->can_delete($repository_name)) |
243 { | 243 { |
244 return false; | 244 return false; |
245 } | 245 } |
246 | 246 |
247 $cd = $this->_repositories_rel_dir . $repository_name; | 247 $cd = $this->_repositories_abs_dir . $repository_name; |
248 | 248 |
249 $this->recursiveDelete($cd . '/.hg/'); | 249 $this->recursiveDelete($cd . '/.hg/'); |
250 return $this->recursiveDelete($cd); | 250 return $this->recursiveDelete($cd); |
251 } | 251 } |
252 | 252 |
262 function __realdirscan() | 262 function __realdirscan() |
263 { | 263 { |
264 $this->_ci->load->helper('directory'); | 264 $this->_ci->load->helper('directory'); |
265 | 265 |
266 // FIXME this doesn't check if file or directory... | 266 // FIXME this doesn't check if file or directory... |
267 $realdir = directory_map($this->_repositories_rel_dir, TRUE); | 267 $realdir = directory_map($this->_repositories_abs_dir, TRUE); |
268 | 268 |
269 $verifiedrealdir = array(); | 269 $verifiedrealdir = array(); |
270 foreach($realdir as $file) | 270 foreach($realdir as $file) |
271 { | 271 { |
272 // checks if we detected a folder | 272 // checks if we detected a folder |
273 if(is_dir($this->_repositories_rel_dir . $file)) | 273 if(is_dir($this->_repositories_abs_dir . $file)) |
274 { | 274 { |
275 $verifiedrealdir[$file] = $file; | 275 $verifiedrealdir[$file] = $file; |
276 } | 276 } |
277 } | 277 } |
278 | 278 |
279 return $verifiedrealdir; | 279 return $verifiedrealdir; |
280 } | 280 } |
281 | |
282 | |
283 | |
284 function getProjectParams() | |
285 { | |
286 return array('ui'=>array('config1'=>'value')); | |
287 } | |
288 | |
289 | |
290 | |
291 | 281 |
292 /** | 282 /** |
293 * Delete a file or recursively delete a directory | 283 * Delete a file or recursively delete a directory |
294 * | 284 * |
295 * @param string $str Path to file or directory | 285 * @param string $str Path to file or directory |