-function
-jirafeau_check_var_dir ($path)
-{
- $mkdir_str1 = _('The following directory could not be created:');
- $mkdir_str2 = _('You should create this directory by hand.');
- $write_str1 = _('The following directory is not writable:');
- $write_str2 = _('You should give the write right to the web server on ' .
- 'this directory.');
- $solution_str = _('Here is a solution:');
-
- if (!jirafeau_mkdir ($path) || !jirafeau_is_writable ($path))
- return array ('has_error' => true,
- 'why' => $mkdir_str1 . '<br /><code>' .
- $path . '</code><br />' . $solution_str .
- '<br />' . $mkdir_str2);
-
- foreach (array ('files', 'links') as $subdir)
- {
- $subpath = $path.$subdir;
-
- if (!jirafeau_mkdir ($subpath) || !jirafeau_is_writable ($subpath))
- return array ('has_error' => true,
- 'why' => $mkdir_str1 . '<br /><code>' .
- $subpath . '</code><br />' . $solution_str .
- '<br />' . $mkdir_str2);
- }
-
- return array ('has_error' => false, 'why' => '');
-}
-
-function
-jirafeau_add_ending_slash ($path)
-{
- return $path . ((substr ($path, -1) == '/') ? '' : '/');
-}