Development

Changeset 4984

You must first sign up to be able to contribute.

Changeset 4984

Show
Ignore:
Timestamp:
09/05/07 16:09:17 (1 year ago)
Author:
Garfield-fr
Message:

Add export options

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfProjectExportPlugin/README

    r4974 r4984  
    2525}}} 
    2626 
     27* You can specify which specific folders or files you want to add with an argument, here is the complete possible list. (optional) Separate options with '+' 
     28 
     29{{{ 
     30symfony project-export /folder/to/export/the/project cache+uploads+fixtures+doc+test+command 
     31}}} 
     32 
    2733== Changelog == 
    28   
     34 
     35=== 09-05-2007 | 1.1.3 Stable === 
     36 
     37 * Bertrand.Zuchuat: Add options 
     38 
    2939=== 09-04-2007 | 1.1.2 Stable === 
    3040 
  • plugins/sfProjectExportPlugin/data/tasks/sfPakeExport.php

    r4974 r4984  
    11<?php 
     2/* 
     3 * (c) 2004-2006 Bertrand Zuchuat <bertrand.zuchuat@funstaff.ch> 
     4 *  
     5 * For the full copyright and license information, please view the LICENSE 
     6 * file that was distributed with this source code. 
     7 */ 
    28 
     9  
    310pake_desc('export freeze project without .svn folder'); 
    411pake_task('project-export', 'project_exists'); 
     
    2128  } 
    2229 
     30    $opts = isset($args[1]) ? explode('+', $args[1]): array(); 
     31     
     32    $options = array('cache' => false, 
     33                     'uploads' => false, 
     34                     'fixtures' => false, 
     35                     'doc' => false, 
     36                     'test' => false, 
     37                     'command' => false 
     38                     ); 
     39                      
     40    if(count($opts) > 0) 
     41    { 
     42        foreach($opts AS $key) 
     43        { 
     44            $options[$key] = true; 
     45        } 
     46    } 
     47     
    2348  $sf_root_dir = sfConfig::get('sf_root_dir'); 
    2449  $finder = pakeFinder::type('any')->ignore_version_control()->discard('*_dev.php', '*.php.bak', '*.log'); 
     
    3661     
    3762    // Delete cache content 
    38     pake_echo_action('project-export', 'Delete cache folder content'); 
    39     $sf_cache_dir = $sf_export_path . '/cache'; 
    40     pake_remove($finder, $sf_cache_dir); 
     63    if(!$options['cache']) 
     64    { 
     65        pake_echo_action('project-export', 'Delete cache folder content'); 
     66        $sf_cache_dir = $sf_export_path . '/cache'; 
     67        pake_remove($finder, $sf_cache_dir); 
     68    } 
    4169     
    4270    // Delete all files into the uploads dir 
    43     pake_echo_action('project-export', 'Delete uploads folder content'); 
    44     $sf_upload_dir = $sf_export_path . '/web/uploads'; 
    45     pake_remove($finder, $sf_upload_dir); 
     71    if(!$options['uploads']) 
     72    { 
     73        pake_echo_action('project-export', 'Delete uploads folder content'); 
     74        $sf_upload_dir = $sf_export_path . '/web/uploads'; 
     75        pake_remove($finder, $sf_upload_dir); 
     76    } 
    4677     
    4778    // Delete all files and fixtures dir 
    48     $sf_fixtures_dir = $sf_export_path . '/data/fixtures'; 
    49     if(is_dir($sf_fixtures_dir)) 
     79    if(!$options['fixtures']) 
    5080    { 
    51         pake_echo_action('project-export', 'Delete fixtures folder'); 
    52         pake_remove($finder, $sf_fixtures_dir); 
    53         pake_remove($sf_fixtures_dir, ''); 
     81        $sf_fixtures_dir = $sf_export_path . '/data/fixtures'; 
     82        if(is_dir($sf_fixtures_dir)) 
     83        { 
     84            pake_echo_action('project-export', 'Delete fixtures folder'); 
     85            pake_remove($finder, $sf_fixtures_dir); 
     86            pake_remove($sf_fixtures_dir, ''); 
     87        } 
    5488    } 
    5589     
    5690    // Delete doc dir 
    57     pake_echo_action('project-export', 'Delete doc folder'); 
    58     $sf_doc_dir = $sf_export_path . '/doc'; 
    59     pake_remove($finder, $sf_doc_dir); 
    60     pake_remove($sf_doc_dir, ''); 
     91    if(!$options['doc']) 
     92    { 
     93        pake_echo_action('project-export', 'Delete doc folder'); 
     94        $sf_doc_dir = $sf_export_path . '/doc'; 
     95        pake_remove($finder, $sf_doc_dir); 
     96        pake_remove($sf_doc_dir, ''); 
     97    } 
    6198     
    6299    // Delete test dir 
    63     pake_echo_action('project-export', 'Delete test folder'); 
    64     $sf_test_dir = $sf_export_path . '/test'; 
    65     pake_remove($finder, $sf_test_dir); 
    66     pake_remove($sf_test_dir, ''); 
     100    if(!$options['test']) 
     101    { 
     102        pake_echo_action('project-export', 'Delete test folder'); 
     103        $sf_test_dir = $sf_export_path . '/test'; 
     104        pake_remove($finder, $sf_test_dir); 
     105        pake_remove($sf_test_dir, ''); 
     106    } 
    67107     
    68108    // Delete file symfony and symfony.php 
    69     if(file_exists($sf_export_path . '/symfony')
     109    if(!$options['command']
    70110    { 
    71         pake_echo_action('project-export', 'Delete symfony file'); 
    72         pake_remove($sf_export_path . '/symfony', ''); 
    73     } 
     111        if(file_exists($sf_export_path . '/symfony')) 
     112        { 
     113            pake_echo_action('project-export', 'Delete symfony file'); 
     114            pake_remove($sf_export_path . '/symfony', ''); 
     115        } 
    74116     
    75     if(file_exists($sf_export_path . '/symfony.php')) 
    76     { 
    77         pake_echo_action('project-export', 'Delete symfony.php file'); 
    78         pake_remove($sf_export_path . '/symfony.php', ''); 
     117        if(file_exists($sf_export_path . '/symfony.php')) 
     118        { 
     119            pake_echo_action('project-export', 'Delete symfony.php file'); 
     120            pake_remove($sf_export_path . '/symfony.php', ''); 
     121        } 
    79122    } 
    80123 
  • plugins/sfProjectExportPlugin/package.xml

    r4976 r4984  
    1111  <active>yes</active> 
    1212 </lead> 
    13  <date>2007-09-04</date> 
     13 <date>2007-09-05</date> 
    1414 <version> 
    15    <release>1.1.2</release> 
     15   <release>1.1.3</release> 
    1616   <api>1.1.0</api> 
    1717 </version> 
     
    2424 <contents> 
    2525  <dir name="/"> 
    26    <file md5sum="37691c56a895428c82a5742449d393d0" name="data/tasks/sfPakeExport.php" role="data" /> 
    27    <file md5sum="70f493125c885ddbb1c7b8f5c7b61c5f" name="README" role="data" /> 
    28    <file md5sum="28b534f18b615a9ca0553e80b4da4b61" name="LICENSE" role="data" /> 
     26   <file name="data/tasks/sfPakeExport.php" role="data" /> 
     27   <file name="README" role="data" /> 
     28   <file name="LICENSE" role="data" /> 
    2929  </dir> 
    3030</contents> 
     
    4040    <name>symfony</name> 
    4141    <channel>pear.symfony-project.com</channel> 
    42     <min>0.8.1</min> 
     42    <min>1.0.0</min> 
    4343    <max>1.1.0</max> 
    4444    <exclude>1.1.0</exclude> 
     
    4747 </dependencies> 
    4848 
    49  <phprelease> 
    50  </phprelease> 
    51  
    52  <changelog> 
    53  </changelog> 
     49 <phprelease /> 
     50 <changelog /> 
    5451</package>