Pages

Showing posts with label generate. Show all posts
Showing posts with label generate. Show all posts

Sunday, December 27, 2015

Symfony-Generate Bundle Option not working in app/console

Recently in One of the symfony dumps I gathered from my IT team had an issue due to some reason "Generate Bundle" option was not working from app/console list -- raw

Solution :

Add following lines in File composer.json

"required-dev":{
"sensio/generator-bundle": "~2.3"
}

File AppKernal.php should have

new Sensio\Bundle\GeneratorBundle\SensioGenerator();

That's it

Sunday, September 22, 2013

PHP-Find current quarter for genarating quarterly payments etc.

    $firstday1=date("Y-1-1 00:00:00");
        $lastday1=date("Y-3-31 23:59:59");
        $firstday2=date("Y-4-1 00:00:00");
        $lastday2=date("Y-6-30 23:59:59");
        $firstday3=date("Y-7-1 00:00:00");
        $lastday3=date("Y-9-30 23:59:59");
        $firstday4=date("Y-10-1 00:00:00");
        $lastday4=date("Y-12-31 23:59:59");
        $today = time();
        if( (strtotime($firstday1) <= $today) && ($today<= strtotime($lastday1)))
        {
            $qtr=1;
        }
        elseif( (strtotime($firstday2) <= $today) && ($today <= strtotime($lastday2)))
        {
            $qtr=2;
        }
        elseif( (strtotime($firstday3) <= $today) && ($today <= strtotime($lastday3)))
        {
            $qtr=3;
        }
        elseif( (strtotime($firstday4) <= $today) && ($today <= strtotime($lastday4)))
        {
            $qtr=4;
        }
        echo $qtr;

Sunday, June 9, 2013

PHP-How to generate Youtube like video url's



 <?php  
 $encoded=base64_encode(Uniqid().$myVideosValue['Uservideo']['id']);  
 ?>  


and then send this along with URL and at receiving end decode it as follows

 <?php  
 $decoded= substr(base64_decode($paramstr),13);  
 ?>