printing a warning in case of nonstandard chars in g1 folder names
This commit is contained in:
parent
05c322810a
commit
30f3645a35
@ -48,6 +48,11 @@ class Admin_g1_import_Controller extends Admin_Controller {
|
||||
$view->content->resize_size = module::get_var('gallery', 'resize_size');
|
||||
|
||||
if (g1_import::is_initialized()) {
|
||||
|
||||
if (count(g1_import::$warn_utf8)>0) {
|
||||
message::error(t('Your G1 contains %count folder(s) containing nonstandard characters that G3 doesn\'t work with: <pre>%names</pre>Please rename the above folders in G1 before trying to import your data.', array('count' => count(g1_import::$warn_utf8), 'names' => "\n\n ".implode("\n ", g1_import::$warn_utf8)."\n\n")));
|
||||
}
|
||||
|
||||
if ((bool)ini_get('eaccelerator.enable') || (bool)ini_get('xcache.cacher')) {
|
||||
message::warning(t('The eAccelerator and XCache PHP performance extensions are known to cause issues. If you\'re using either of those and are having problems, please disable them while you do your import. Add the following lines: <pre>%lines</pre> to gallery3/.htaccess and remove them when the import is done.', array('lines' => "\n\n php_value eaccelerator.enable 0\n php_value xcache.cacher off\n php_value xcache.optimizer off\n\n")));
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ class g1_import_Core {
|
||||
public static $thumb_size = null;
|
||||
public static $tree = array();
|
||||
public static $version = null;
|
||||
public static $warn_utf8 = array();
|
||||
|
||||
public static $queued_items = array();
|
||||
public static $queued_comments = array();
|
||||
@ -146,8 +147,15 @@ class g1_import_Core {
|
||||
return self::$version;
|
||||
}
|
||||
|
||||
static function recursiveCountGallery($albumDir, $array, $level) {
|
||||
static function recursiveCountGallery($albumDir, &$array, $level) {
|
||||
$countAlbum = 0;
|
||||
|
||||
foreach($array as $key => &$value) {
|
||||
$converted = utf8_encode($key);
|
||||
if( $converted != $key )
|
||||
self::$warn_utf8[] = $converted;
|
||||
}
|
||||
|
||||
foreach($array as $key => $value) {
|
||||
if($key!='') {
|
||||
$countAlbum++;
|
||||
@ -236,6 +244,7 @@ class g1_import_Core {
|
||||
self::$queued_highlights = array();
|
||||
self::$albums_flat = array();
|
||||
self::$albums_hidden = array();
|
||||
self::$warn_utf8 = array();
|
||||
if(count(self::$tree)) $stats['albums'] = 1 /* <= THE ROOT ALBUM!!!*/ + g1_import::recursiveCountGallery($albumDir, self::$tree, 0);
|
||||
|
||||
$stats['photos'] = count(self::$queued_items);
|
||||
|
Reference in New Issue
Block a user