php script that copies files to all Addon domains in a cpanel hosting

Discussion in 'PHP' started by Edynas, Jun 24, 2008.

  1. #1
    I had this little script that would copy files and directories and paste it on domains that were on the same server.

    I lost it and hope that somebody has something like this.

    Cheers,
    Edwin
     
    Edynas, Jun 24, 2008 IP
  2. King Goilio

    King Goilio Member

    Messages:
    200
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    33
    #2
    I can make one if you like for a small fee
     
    King Goilio, Jun 24, 2008 IP
  3. Edynas

    Edynas Peon

    Messages:
    796
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Think i got it. have to test it if it works with domains but i found this dusty script

    
    
    function full_copy( $source, $target )
        {
            if ( is_dir( $source ) )
            {
                @mkdir( $target );
               
                $d = dir( $source );
               
                while ( FALSE !== ( $entry = $d->read() ) )
                {
                    if ( $entry == '.' || $entry == '..' )
                    {
                        continue;
                    }
                   
                    $Entry = $source . '/' . $entry;           
                    if ( is_dir( $Entry ) )
                    {
                        full_copy( $Entry, $target . '/' . $entry );
                        continue;
                    }
                    copy( $Entry, $target . '/' . $entry );
                }
               
                $d->close();
            }else
            {
                copy( $source, $target );
            }
        }
    
    
    $source ="./";
    $target = "../test2/";
    
    full_copy( $source, $target );
    
    
    PHP:
     
    Edynas, Jun 26, 2008 IP