[pmwiki-devel] PHP warning in totalcounter

7 views
Skip to first unread message

Simon

unread,
Sep 5, 2012, 5:08:25 AM9/5/12
to PmWiki Devel Mailing List
I'm seeing lots of errors in my log

[25-Aug-2012 14:33:42] PHP Warning:  chmod() [<a href='function.chmod'>function.chmod</a>]: Operation not permitted in /home/ttc/public_html/pmwiki/cookbook/totalcounter.php on line 1163
[25-Aug-2012 14:33:42] PHP Warning:  chmod() [<a href='function.chmod'>function.chmod</a>]: Operation not permitted in /home/ttc/public_html/pmwiki/cookbook/totalcounter.php on line 1174

Can anyone give me a quick heads up on what might need to be fixed?

ta

Simon

Petko Yotov

unread,
Sep 5, 2012, 8:17:31 PM9/5/12
to PmWiki Devel Mailing List
Simon writes:
> [25-Aug-2012 14:33:42] PHP Warning:  chmod() [<a
> href='function.chmod'>function.chmod</a>]: Operation not permitted in
> /home/ttc/public_html/pmwiki/cookbook/totalcounter.php on line 1174
>
> Can anyone give me a quick heads up on what might need to be fixed?

I haven't used or reviewed that recipe, but if nothing is mentioned about
your problem on the cookbook page or on the talk page, and if nobody replies
on the mailing list, you may try to contact the authors directly -- they may
be unsubscribed from the mailing lists.

Petko


_______________________________________________
pmwiki-devel mailing list
pmwiki...@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Simon

unread,
Sep 6, 2012, 2:22:04 AM9/6/12
to Weldon Sams, PmWiki Devel Mailing List
thanks

Simon

//Windows 9x FLOCK Alternative - Chozo4
//Passes multiple instance stress testing
//Modified (breaks and returns 0 on failure,
// or returns 1 on success) by Mateusz Czaplinski, 22.01.2008

function aquirelock($wp) {
//Check if lock doesn't exist or our target is unwritable
if(file_exists("$wp.l") || !is_writable($wp))
return 0;

//create the lock - hide warnings and pass empty if already created from racing
return @ fopen("$wp.l", 'x');
}

function dblock($wp) {
global $TotalCounterEnableChmods;
//Check for lockfile handle - if empty , another process raced the lock so report a failure
$ftw = aquirelock($wp);
if( !$ftw )
return 0;

if($TotalCounterEnableChmods) chmod($wp, 0444); //set the target file to read-only  // LINE 1163
fwrite($ftw, 'lock'); //write the lockfile with 4bytes
if($TotalCounterEnableChmods) chmod("$wp.l", 0444); //set the lockfile to read only (OPTIONAL)
fclose($ftw); //close our lockfile
clearstatcache(); //Clear the stat cache
return 1;
}

// Note: don't call it if 'dblock()' returned 0 !
function dbexport_unlock($wp, $data, $meth) {
global $TotalCounterEnableChmods;
if($TotalCounterEnableChmods) chmod($wp, 0666); //Set the target file to read+write // LINE 1174

//Write the passed string to the target file then close
fwrite($ftw = fopen($wp, $meth), $data);
fclose($ftw);

//Validate the written data ujsing a string comparison
$check = file_get_contents($wp);
if ($check != $data)
echo "Data Mismatch - Locking FAILED!<br>";

chmod("$wp.l", 0666); //Set the lockfile to read+write (OPTIONAL)
unlink("$wp.l"); //Release the lockfile by removing it
}


On 6 September 2012 13:30, Weldon Sams <wjs...@gmail.com> wrote:
Would you copy some of the lines around 1174 in a reply?

       Weldon


On Wed, Sep 5, 2012 at 5:08 AM, Simon <nzs...@gmail.com> wrote:
I'm seeing lots of errors in my log

[25-Aug-2012 14:33:42] PHP Warning:  chmod() [<a href='function.chmod'>function.chmod</a>]: Operation not permitted in /home/ttc/public_html/pmwiki/cookbook/totalcounter.php on line 1163
[25-Aug-2012 14:33:42] PHP Warning:  chmod() [<a href='function.chmod'>function.chmod</a>]: Operation not permitted in /home/ttc/public_html/pmwiki/cookbook/totalcounter.php on line 1174

Can anyone give me a quick heads up on what might need to be fixed?

ta

Simon




--
____
http://kiwiwiki.co.nz
Reply all
Reply to author
Forward
0 new messages