PHP code example of fgh151 / yii2-beanstalk-singleton

1. Go to this page and download the library: Download fgh151/yii2-beanstalk-singleton library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fgh151 / yii2-beanstalk-singleton example snippets



class TestController extends udokmeci\yii2beanstalk\BeanstalkController
{
    use fgh151\beanstalk\Singleton;
    
}


class BuildController extends BeanstalkController
{
    use fgh151\beanstalk\Singleton {
        Singleton::__construct as private __TraitConstruct;
        Singleton::__destruct as private __TraitDestruct;
    }

    public function __construct($id, Module $module, array $config)
    {
        $this->__TraitConstruct($id, $module, $config);
    }
    
    public function __destruct()
    {
        $this->__TraitDestruct();
    }
}

php composer.phar