Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Swoole\Lock; class DB { var $lockname; var $timeout; var $lock..

Decoded Output download

<?php
namespace Swoole\Lock;
class DB
{
    var $lockname;
    var $timeout;
    var $locked;

    function __construct($name, $timeout = 0)
    {
        $this->lockname = $name;
        $this->timeout = $timeout;
        $this->locked = -1;
    }

    function lock()
    {
        $rs = qdb("SELECT GET_LOCK('".$this->lockname."', ".$this->timeout.")");
        $this->locked = result($rs, 0);
        mysqli_free_result($rs);
    }

    function release()
    {
        $rs = qdb("SELECT RELEASE_LOCK('".$this->lockname."')");
        $this->locked = !result($rs, 0);
        mysqli_free_result($rs);

    }

    function isFree()
    {
        $rs = qdb("SELECT IS_FREE_LOCK('".$this->lockname."')");
        $lock = (bool)result($rs, 0);
        mysqli_free_result($rs);

        return $lock;
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php
namespace Swoole\Lock;
class DB
{
    var $lockname;
    var $timeout;
    var $locked;

    function __construct($name, $timeout = 0)
    {
        $this->lockname = $name;
        $this->timeout = $timeout;
        $this->locked = -1;
    }

    function lock()
    {
        $rs = qdb("SELECT GET_LOCK('".$this->lockname."', ".$this->timeout.")");
        $this->locked = result($rs, 0);
        mysqli_free_result($rs);
    }

    function release()
    {
        $rs = qdb("SELECT RELEASE_LOCK('".$this->lockname."')");
        $this->locked = !result($rs, 0);
        mysqli_free_result($rs);

    }

    function isFree()
    {
        $rs = qdb("SELECT IS_FREE_LOCK('".$this->lockname."')");
        $lock = (bool)result($rs, 0);
        mysqli_free_result($rs);

        return $lock;
    }
}

Function Calls

None

Variables

None

Stats

MD5 0ece627ed0c0edc2fc380eb3370db420
Eval Count 0
Decode Time 96 ms