O:39:"phpDocumentor\Descriptor\FileDescriptor":20:{s:7:" * hash";s:32:"d26110f4bc25d4869410fef53821f818";s:9:" * source";s:1865:"<?php

namespace OpenCloud\Common;

class Debug 
{
    
    const PREFIX = 'DEBUG';
    const FORMAT = "%s : (%s) : %s\r\n";
    
    protected $debugState = false;

    public function setDebug($state)
    {
        $this->setState($state);
    }
    
    public function setState($state = true) 
    {
        $this->debugState = $state;
    }
    
    public function isEnabled()
    {
        return $this->debugState;
    }
    
    public static function logMessage(Base $class, array $arguments = array())
    {    
        // Retrieve and unset format as first element
        $format = $arguments[0];
        unset($arguments[0]);
        
        // Format message and output
        if (empty($arguments)) {
            $message = $format;
        } else {
            $message = vsprintf($format, $arguments);
        }
        
        $message .= "\r\n";
        
        return self::outputString($class, $message);
    }
    
    private static function outputString(Base $class, $message)
    {
        // Format according to a generic style
        $string = sprintf(self::FORMAT, self::PREFIX, get_class($class), $message);
        
        // Either echo or return message
        if ($class->getDebugOutputStyle()) {
            echo $string;
        } else {
            return $string;
        }
    }
    
    public static function investigate(Base $class)
    {
        $namespace = get_class($class);
        
        // Show information about this object
        echo trim(sprintf(self::FORMAT, self::PREFIX, $namespace, ''));
        echo "\r\n";
        echo "PARENT CLASS: " . get_parent_class($class);
        echo "\r\n";
        echo "CLASS PROPERTIES: "; print_r(get_class_vars($namespace));
        echo "\r\n";
        echo "CLASS METHODS: "; print_r(get_class_methods($namespace));
        
        return $class;
    }
    
}
";s:20:" * namespace_aliases";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:11:" * includes";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:12:" * constants";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:12:" * functions";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:10:" * classes";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{s:5:"Debug";O:40:"phpDocumentor\Descriptor\ClassDescriptor":17:{s:9:" * parent";s:0:"";s:13:" * implements";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:11:" * abstract";b:0;s:8:" * final";b:0;s:12:" * constants";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:2:{s:6:"PREFIX";O:43:"phpDocumentor\Descriptor\ConstantDescriptor":13:{s:9:" * parent";r:14;s:8:" * types";N;s:8:" * value";s:7:"'DEBUG'";s:8:" * fqsen";s:31:"\OpenCloud\Common\Debug::PREFIX";s:7:" * name";s:6:"PREFIX";s:12:" * namespace";s:17:"\OpenCloud\Common";s:10:" * package";s:0:"";s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:7:" * path";s:0:"";s:7:" * line";i:8;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{s:8:"internal";N;}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}s:6:"FORMAT";O:43:"phpDocumentor\Descriptor\ConstantDescriptor":13:{s:9:" * parent";r:14;s:8:" * types";N;s:8:" * value";s:20:""%s : (%s) : %s\r\n"";s:8:" * fqsen";s:31:"\OpenCloud\Common\Debug::FORMAT";s:7:" * name";s:6:"FORMAT";s:12:" * namespace";s:17:"\OpenCloud\Common";s:10:" * package";s:0:"";s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:7:" * path";s:0:"";s:7:" * line";i:9;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{s:8:"internal";N;}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}}}s:13:" * properties";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{s:10:"debugState";O:43:"phpDocumentor\Descriptor\PropertyDescriptor":15:{s:9:" * parent";r:14;s:8:" * types";N;s:10:" * default";s:5:"false";s:9:" * static";b:0;s:13:" * visibility";s:9:"protected";s:8:" * fqsen";s:35:"\OpenCloud\Common\Debug::debugState";s:7:" * name";s:10:"debugState";s:12:" * namespace";N;s:10:" * package";s:0:"";s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:7:" * path";s:0:"";s:7:" * line";i:11;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{s:8:"internal";N;}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:40:"phpDocumentor\Descriptor\Validator\Error":4:{s:11:" * severity";s:5:"error";s:7:" * code";s:13:"PPC:ERR-50007";s:7:" * line";i:11;s:10:" * context";a:1:{i:0;s:11:"$debugState";}}}}}}}s:10:" * methods";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:6:{s:8:"setDebug";O:41:"phpDocumentor\Descriptor\MethodDescriptor":16:{s:9:" * parent";r:14;s:11:" * abstract";b:0;s:8:" * final";b:0;s:9:" * static";b:0;s:13:" * visibility";s:6:"public";s:12:" * arguments";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{s:6:"$state";O:43:"phpDocumentor\Descriptor\ArgumentDescriptor":13:{s:8:" * types";a:0:{}s:10:" * default";N;s:14:" * byReference";b:0;s:8:" * fqsen";s:0:"";s:7:" * name";s:6:"$state";s:12:" * namespace";N;s:10:" * package";N;s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:7:" * path";s:0:"";s:7:" * line";i:0;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}}}s:8:" * fqsen";s:35:"\OpenCloud\Common\Debug::setDebug()";s:7:" * name";s:8:"setDebug";s:12:" * namespace";N;s:10:" * package";s:0:"";s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:7:" * path";s:0:"";s:7:" * line";i:13;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:2:{s:5:"param";a:0:{}s:8:"internal";N;}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:40:"phpDocumentor\Descriptor\Validator\Error":4:{s:11:" * severity";s:5:"error";s:7:" * code";s:13:"PPC:ERR-50008";s:7:" * line";i:13;s:10:" * context";a:1:{i:0;s:10:"setDebug()";}}}}}s:8:"setState";O:41:"phpDocumentor\Descriptor\MethodDescriptor":16:{s:9:" * parent";r:14;s:11:" * abstract";b:0;s:8:" * final";b:0;s:9:" * static";b:0;s:13:" * visibility";s:6:"public";s:12:" * arguments";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{s:6:"$state";O:43:"phpDocumentor\Descriptor\ArgumentDescriptor":13:{s:8:" * types";a:0:{}s:10:" * default";s:4:"true";s:14:" * byReference";b:0;s:8:" * fqsen";s:0:"";s:7:" * name";s:6:"$state";s:12:" * namespace";N;s:10:" * package";N;s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:7:" * path";s:0:"";s:7:" * line";i:0;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}}}s:8:" * fqsen";s:35:"\OpenCloud\Common\Debug::setState()";s:7:" * name";s:8:"setState";s:12:" * namespace";N;s:10:" * package";s:0:"";s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:7:" * path";s:0:"";s:7:" * line";i:18;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:2:{s:5:"param";a:0:{}s:8:"internal";N;}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:40:"phpDocumentor\Descriptor\Validator\Error":4:{s:11:" * severity";s:5:"error";s:7:" * code";s:13:"PPC:ERR-50008";s:7:" * line";i:18;s:10:" * context";a:1:{i:0;s:10:"setState()";}}}}}s:9:"isEnabled";O:41:"phpDocumentor\Descriptor\MethodDescriptor":16:{s:9:" * parent";r:14;s:11:" * abstract";b:0;s:8:" * final";b:0;s:9:" * static";b:0;s:13:" * visibility";s:6:"public";s:12:" * arguments";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:8:" * fqsen";s:36:"\OpenCloud\Common\Debug::isEnabled()";s:7:" * name";s:9:"isEnabled";s:12:" * namespace";N;s:10:" * package";s:0:"";s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:7:" * path";s:0:"";s:7:" * line";i:23;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{s:8:"internal";N;}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:40:"phpDocumentor\Descriptor\Validator\Error":4:{s:11:" * severity";s:5:"error";s:7:" * code";s:13:"PPC:ERR-50008";s:7:" * line";i:23;s:10:" * context";a:1:{i:0;s:11:"isEnabled()";}}}}}s:10:"logMessage";O:41:"phpDocumentor\Descriptor\MethodDescriptor":16:{s:9:" * parent";r:14;s:11:" * abstract";b:0;s:8:" * final";b:0;s:9:" * static";b:1;s:13:" * visibility";s:6:"public";s:12:" * arguments";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:2:{s:6:"$class";O:43:"phpDocumentor\Descriptor\ArgumentDescriptor":13:{s:8:" * types";a:1:{i:0;s:22:"\OpenCloud\Common\Base";}s:10:" * default";N;s:14:" * byReference";b:0;s:8:" * fqsen";s:0:"";s:7:" * name";s:6:"$class";s:12:" * namespace";N;s:10:" * package";N;s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:7:" * path";s:0:"";s:7:" * line";i:0;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}s:10:"$arguments";O:43:"phpDocumentor\Descriptor\ArgumentDescriptor":13:{s:8:" * types";a:1:{i:0;s:5:"array";}s:10:" * default";s:7:"array()";s:14:" * byReference";b:0;s:8:" * fqsen";s:0:"";s:7:" * name";s:10:"$arguments";s:12:" * namespace";N;s:10:" * package";N;s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:7:" * path";s:0:"";s:7:" * line";i:0;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}}}s:8:" * fqsen";s:37:"\OpenCloud\Common\Debug::logMessage()";s:7:" * name";s:10:"logMessage";s:12:" * namespace";N;s:10:" * package";s:0:"";s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:7:" * path";s:0:"";s:7:" * line";i:28;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:2:{s:5:"param";a:0:{}s:8:"internal";N;}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:40:"phpDocumentor\Descriptor\Validator\Error":4:{s:11:" * severity";s:5:"error";s:7:" * code";s:13:"PPC:ERR-50008";s:7:" * line";i:28;s:10:" * context";a:1:{i:0;s:12:"logMessage()";}}}}}s:12:"outputString";O:41:"phpDocumentor\Descriptor\MethodDescriptor":16:{s:9:" * parent";r:14;s:11:" * abstract";b:0;s:8:" * final";b:0;s:9:" * static";b:1;s:13:" * visibility";s:7:"private";s:12:" * arguments";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:2:{s:6:"$class";O:43:"phpDocumentor\Descriptor\ArgumentDescriptor":13:{s:8:" * types";a:1:{i:0;s:22:"\OpenCloud\Common\Base";}s:10:" * default";N;s:14:" * byReference";b:0;s:8:" * fqsen";s:0:"";s:7:" * name";s:6:"$class";s:12:" * namespace";N;s:10:" * package";N;s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:7:" * path";s:0:"";s:7:" * line";i:0;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}s:8:"$message";O:43:"phpDocumentor\Descriptor\ArgumentDescriptor":13:{s:8:" * types";a:0:{}s:10:" * default";N;s:14:" * byReference";b:0;s:8:" * fqsen";s:0:"";s:7:" * name";s:8:"$message";s:12:" * namespace";N;s:10:" * package";N;s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:7:" * path";s:0:"";s:7:" * line";i:0;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}}}s:8:" * fqsen";s:39:"\OpenCloud\Common\Debug::outputString()";s:7:" * name";s:12:"outputString";s:12:" * namespace";N;s:10:" * package";s:0:"";s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:7:" * path";s:0:"";s:7:" * line";i:46;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:2:{s:5:"param";a:0:{}s:8:"internal";N;}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:40:"phpDocumentor\Descriptor\Validator\Error":4:{s:11:" * severity";s:5:"error";s:7:" * code";s:13:"PPC:ERR-50008";s:7:" * line";i:46;s:10:" * context";a:1:{i:0;s:14:"outputString()";}}}}}s:11:"investigate";O:41:"phpDocumentor\Descriptor\MethodDescriptor":16:{s:9:" * parent";r:14;s:11:" * abstract";b:0;s:8:" * final";b:0;s:9:" * static";b:1;s:13:" * visibility";s:6:"public";s:12:" * arguments";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{s:6:"$class";O:43:"phpDocumentor\Descriptor\ArgumentDescriptor":13:{s:8:" * types";a:1:{i:0;s:22:"\OpenCloud\Common\Base";}s:10:" * default";N;s:14:" * byReference";b:0;s:8:" * fqsen";s:0:"";s:7:" * name";s:6:"$class";s:12:" * namespace";N;s:10:" * package";N;s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:7:" * path";s:0:"";s:7:" * line";i:0;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}}}s:8:" * fqsen";s:38:"\OpenCloud\Common\Debug::investigate()";s:7:" * name";s:11:"investigate";s:12:" * namespace";N;s:10:" * package";s:0:"";s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:7:" * path";s:0:"";s:7:" * line";i:59;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:2:{s:5:"param";a:0:{}s:8:"internal";N;}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:40:"phpDocumentor\Descriptor\Validator\Error":4:{s:11:" * severity";s:5:"error";s:7:" * code";s:13:"PPC:ERR-50008";s:7:" * line";i:59;s:10:" * context";a:1:{i:0;s:13:"investigate()";}}}}}}}s:8:" * fqsen";s:23:"\OpenCloud\Common\Debug";s:7:" * name";s:5:"Debug";s:12:" * namespace";s:17:"\OpenCloud\Common";s:10:" * package";s:0:"";s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:7:" * path";r:1;s:7:" * line";i:5;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:40:"phpDocumentor\Descriptor\Validator\Error":4:{s:11:" * severity";s:5:"error";s:7:" * code";s:13:"PPC:ERR-50005";s:7:" * line";i:5;s:10:" * context";a:1:{i:0;s:23:"\OpenCloud\Common\Debug";}}}}}}}s:13:" * interfaces";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:9:" * traits";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:10:" * markers";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:8:" * fqsen";s:0:"";s:7:" * name";s:9:"Debug.php";s:12:" * namespace";N;s:10:" * package";s:0:"";s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:7:" * path";s:26:"OpenCloud/Common/Debug.php";s:7:" * line";i:0;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}