HEX
Server: Apache
System: Linux sg241.singhost.net 2.6.32-896.16.1.lve1.4.51.el6.x86_64 #1 SMP Wed Jan 17 13:19:23 EST 2018 x86_64
User: honghock (909)
PHP: 8.0.30
Disabled: passthru,system,shell_exec,show_source,exec,popen,proc_open
Upload Files
File: //opt/cpanel/ea-php54/root/usr/share/pear/RVSeagullMod/modules/block/classes/BlockDAO.php
<?php
require_once SGL_MOD_DIR  . '/block/classes/Block.php';

/**
 * Data access methods for the default module.
 *
 * @package Default
 * @author  Demian Turner <demian@phpkitchen.com>
 * @copyright Demian Turner 2005
 */
class BlockDAO extends SGL_Manager
{
    /**
     * Constructor - set default resources.
     *
     * @return BlockDAO
     */
    function BlockDAO()
    {
        parent::SGL_Manager();
    }

    /**
     * @access  public
     * @static
     * @return  BlockDAO reference to BlockDAO object
     */
    public static function singleton()
    {
        static $instance;

        // If the instance is not there, create one
        if (!isset($instance)) {
            $class = __CLASS__;
            $instance = new $class();
        }
        return $instance;
    }

    function addBlock($oBlock)
    {
        $block = new Block();
        ///fix PHP 5.3
         $block = &$block;
             
        //  insert block record
        $block->setFrom($oBlock);
        $ok = $block->insert();

        //  clear cache so a new cache file is built reflecting changes
        SGL_Cache::clear('blocks');
        return $ok;
    }
}
?>