Update from 1.11 to 1.12 with error
First, thank you for updated the module. I updated from 1.11 to 1.12, but the module name is not "impression" - it's an other name, since we could rename.
Maybe this function is broken within the new version and an update is not possible.
Maybe this function is broken within the new version and an update is not possible.
Leave a comment
on 2013-01-08 15:04 *
By mcdonald3072
Thanks for reporting this issue.
Think it is caused by this line in icms_version.php:
Think it is caused by this line in icms_version.php:
$modversion['modname'] = 'impression';
on 2013-01-09 03:07 *
By
This is true. If I delete this line (same like version 1.11), works as well.
on 2013-01-09 14:19 *
By mcdonald3072
Looks like the issue is not caused by the line mentioned earlier but by the name of the module in the naming of a class.
For example, mod_impression_ArticlesHandler should be renamed to mod_<dirname>_ArticlesHandler
For example, mod_impression_ArticlesHandler should be renamed to mod_<dirname>_ArticlesHandler
on 2013-01-09 14:44 *
By davidimpress
One way to avoid this issue is to utilise the stand-alone "clone.php" code from Smartsection.
This routine will allow you to rename all the constants, names, functions etc which are unique to a module - example SmartSection, SMARTSECTION, smartsection to an alternative one.
So in this case: Impression, IMPRESSION, impression (and other combinations) could be renamed by the routine to: Article, ARTICLE, article (etc)
The code does work to clone other IPF modules - as I have used this with News_IPF .. however it really could do with updating to make easier to use.
This routine will allow you to rename all the constants, names, functions etc which are unique to a module - example SmartSection, SMARTSECTION, smartsection to an alternative one.
So in this case: Impression, IMPRESSION, impression (and other combinations) could be renamed by the routine to: Article, ARTICLE, article (etc)
The code does work to clone other IPF modules - as I have used this with News_IPF .. however it really could do with updating to make easier to use.
on 2013-01-10 21:18 *
By mcdonald3072
Just did a quick test with clone.php and it seems to work fine.
<?php
/*
Usage:
Copy clone.php in <xoops_root>
Change current working directory to <xoops_root>
Update mappings as per new modulename.
php -q clone.php
*/
// ##########################################################
// Define your mapping here
// ##########################################################
$patterns = array(
// first one must be module directory name
'impression' => 'impressionclone',
'IMPRESSION' => 'IMPRESSIONCLONE'
);
$patKeys = array_keys($patterns);
$patValues = array_values($patterns);
// work around for PHP < 5.0.x
if(!function_exists('file_put_contents')) {
function file_put_contents($filename, $data, $file_append = false) {
$fp = fopen($filename, (!$file_append ? 'w+' : 'a+'));
if(!$fp) {
trigger_error('file_put_contents cannot write in file.', E_USER_ERROR);
return;
}
fputs($fp, $data);
fclose($fp);
}
}
// recursive clonning script
function cloneFileFolder($path)
{
global $patKeys;
global $patValues;
$newPath = str_replace($patKeys[0], $patValues[0], $path);
if (is_dir($path))
{
// create new dir
mkdir($newPath);
// check all files in dir, and process it
if ($handle = opendir($path))
{
while ($file = readdir($handle))
{
if ($file != '.' && $file != '..')
{
cloneFileFolder("$path/$file");
}
}
closedir($handle);
}
}
else
{
if(preg_match('/(.jpg|.gif|.png|.zip)$/i', $path))
{
copy($path, $newPath);
}
else
{
// file, read it
$content = file_get_contents($path);
$content = str_replace($patKeys, $patValues, $content);
file_put_contents($newPath, $content);
}
}
}
cloneFileFolder('modules/impression');
echo "Happy cloning...\n";
echo "check directory modules/" . $patterns['impression'] . " for cloned module \n";
echo "Consider modifying new module by editing language/english/modinfo.php and images/mysection_slogo.png manually (if you care)\n";
?>