phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: phpgroupware archiveTemplate.php,NONE,1.1.2.1


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgroupware archiveTemplate.php,NONE,1.1.2.1
Date: Fri, 18 Apr 2003 14:47:00 -0400

Update of /cvsroot/phpgroupware/phpgroupware
In directory subversions:/tmp/cvs-serv31915

Added Files:
      Tag: Version-0_9_16-branch
        archiveTemplate.php 
Log Message:
update idots

--- NEW FILE ---
<?php

        /************ description ***************
        *
        * this script quickly archives all 
        * templates files of one selected 
        * template so that this archive can be 
        * submitted                     
        *
        * this script is published under GPL v2
        * written by Pim Snel, address@hidden
        *
        ****************************************/

        /**************** help ******************
        put this file in the root of the 
        phpGW-dir and check the tar-path in the
        config-vars

        if your running in save-mode copy tar
        to your phpGW-root directory.

        have you done this.. then point your 
        browser to http://......./archiveLang.php
        and submit your lang
        ****************************************/

        /************ configuration ************/

        $tar_location='tar';


        /************ end configvars ************/

        if ($GLOBALS['HTTP_POST_VARS']['target'])
        {
                $target_template=$HTTP_POST_VARS['target'];


                $current_dir=getcwd();

                if (is_file($current_dir.'/header.inc.php'))
                {

                        if ($handle = opendir($current_dir)) {
                                while (false !== ($file = readdir($handle))) { 
                                        if ($file != "." && $file != ".." && 
is_dir($file)) { 

                                                //      echo 
$current_dir.'/'.$file.'/templates/'.$target_template;
                                                if 
(is_dir($current_dir.'/'.$file.'/templates/'.$target_template))
                                                {


                                                        echo 'archiving ' . 
$file.'/templates/'.$target_template.'<br>';
                                                        $files .= ' ' . 
$file.'/templates/'.$target_template;

                                                }

                                        } 
                                }
                                closedir($handle); 

                        }


                        $today = date( "Ymd", time() );
                        $archive=$target_template.'-'.$today.'.tar.bz2'; 
                        $exec = $tar_location.' cvjf '. $archive .' '. $files;
                        echo $exec;
                
                        if (exec($exec))
                        {
                                echo '<P>seems like everything went fine. 
Please check if <i>'.$archive.'</i> exists';
                        }
                        else
                        {
                                echo 'Error. done nothing. Check if this 
scripts is allowed to write';
                        }
                        
                }
                else
                {
                        echo 'Error. done nothing. Check if this scripts really 
is in the root of a phpGW-directory';

                }



        } 
        else
        {

        ?>
        <html>
        <head>
        <title>Choose target template</title>
        </head>
        <body>
        <form action="archiveTemplate.php" method="post">
        fill in template to archive<br>
        <input type=text name=target>
        <input type="submit">
        </body>
        </html>
        <?


}

?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]