Changeset 240

Show
Ignore:
Timestamp:
09/25/07 20:43:37 (1 year ago)
Author:
mrook
Message:

Merge r236:r239 to 2.3 branch.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.3/classes/phing/tasks/ext/ZipTask.php

    r227 r240  
    119119                } 
    120120                 
    121                 if (0 == count($this->fileset)) 
     121                if (empty($this->filesets)) 
    122122                { 
    123123                        // add the main fileset to the list of filesets to process. 
    124                         $mainFileSet = new FileSet($this->fileset); 
     124                        $mainFileSet = new ZipFileSet($this->fileset); 
    125125                        $mainFileSet->setDir($this->baseDir); 
    126126                        $this->filesets[] = $mainFileSet; 
  • branches/2.3/classes/phing/tasks/ext/phpunit/PHPUnitTask.php

    r219 r240  
    2020 */ 
    2121 
    22 require_once 'PEAR/Registry.php'; 
    2322require_once 'phing/Task.php'; 
    2423require_once 'phing/system/io/PhingFile.php'; 
     
    5958                 
    6059                /** 
    61                  * Ugly hack to get PHPUnit version number from PEAR 
     60                 * Determine PHPUnit version number 
    6261                 */ 
    63                 $config = new PEAR_Config(); 
    64                 $registry = new PEAR_Registry($config->get('php_dir')); 
    65                 $pkg_info = $registry->_packageInfo("PHPUnit", null, "pear.phpunit.de"); 
    66                  
    67                 if ($pkg_info != NULL) 
    68                 { 
    69                         if (version_compare($pkg_info['version']['api'], "3.0.0") >= 0) 
    70                         { 
    71                                 PHPUnitUtil::$installedVersion = 3; 
    72                         } 
    73                         else 
    74                         { 
    75                                 PHPUnitUtil::$installedVersion = 2; 
    76                         } 
     62                @include_once 'PHPUnit/Runner/Version.php'; 
     63                @include_once 'PHPUnit2/Runner/Version.php'; 
     64 
     65                if (class_exists('PHPUnit_Runner_Version')) 
     66                { 
     67                        $version = PHPUnit_Runner_Version::id(); 
     68                } 
     69                elseif (class_exists('PHPUnit2_Runner_Version')) 
     70                { 
     71                        $version = PHPUnit2_Runner_Version::id(); 
    7772                } 
    7873                else 
    7974                { 
    80                         /** 
    81                          * Try to find PHPUnit3 
    82                          */ 
    83                         @include_once 'PHPUnit/Util/Filter.php'; 
    84                          
    85                         if (class_exists('PHPUnit_Util_Filter')) 
    86                         { 
    87                                 PHPUnitUtil::$installedVersion = 3; 
    88                         } 
    89                         else 
    90                         {                        
    91                                 /** 
    92                                  * Try to find PHPUnit2 
    93                                  */ 
    94                                 @include_once 'PHPUnit2/Util/Filter.php'; 
    95                          
    96                                 if (!class_exists('PHPUnit2_Util_Filter')) { 
    97                                         throw new BuildException("PHPUnit task depends on PEAR PHPUnit 2 or 3 package being installed.", $this->getLocation()); 
    98                                 } 
    99  
    100                                 PHPUnitUtil::$installedVersion = 2; 
    101                         } 
    102                 } 
    103                  
    104                 // other dependencies that should only be loaded when class is actually used. 
     75                        throw new BuildException("PHPUnit task depends on PHPUnit 2 or 3 package being installed.", $this->getLocation()); 
     76                } 
     77                 
     78                if (version_compare($version, "3.0.0") >= 0) 
     79                { 
     80                        PHPUnitUtil::$installedVersion = 3; 
     81                } 
     82                else 
     83                { 
     84                        PHPUnitUtil::$installedVersion = 2; 
     85                } 
     86                 
     87                /** 
     88                 * Other dependencies that should only be loaded when class is actually used. 
     89                 */ 
    10590                require_once 'phing/tasks/ext/phpunit/PHPUnitTestRunner.php'; 
    10691                require_once 'phing/tasks/ext/phpunit/BatchTest.php'; 
    10792                require_once 'phing/tasks/ext/phpunit/FormatterElement.php'; 
    108                 //require_once 'phing/tasks/ext/phpunit/SummaryPHPUnit2ResultFormatter.php'; 
    109  
    110                 // add some defaults to the PHPUnit filter 
     93 
     94                /** 
     95                 * Add some defaults to the PHPUnit filter 
     96                 */ 
    11197                if (PHPUnitUtil::$installedVersion == 3) 
    11298                { 
  • branches/2.3/classes/phing/tasks/ext/svn/SvnBaseTask.php

    r227 r240  
    198198                return isset( $this->svnSwitches['no-auth-cache'] ) ? $this->svnSwitches['no-auth-cache'] : ''; 
    199199        } 
    200  
     200         
     201        /** 
     202         * Toggles recursive behavior 
     203         */ 
     204        function setRecursive($value) 
     205        { 
     206                $this->svnSwitches['non-recursive'] = is_bool($value) ? !$value : TRUE; 
     207        } 
     208         
     209        /** 
     210         * Returns status of recursive behavior 
     211         */ 
     212        function getRecursive() 
     213        { 
     214                return isset( $this->svnSwitches['non-recursive'] ) ? $this->svnSwitches['non-recursive'] : ''; 
     215        } 
     216         
    201217        /** 
    202218         * Creates a VersionControl_SVN class based on $mode 
  • branches/2.3/docs/phing_guide/book/chapters/appendixes/AppendixC-OptionalTasks.html

    r226 r240  
    2323  implement the tasks. So if you are searching for the reference to the <code>&lt;phplint&gt;</code> 
    2424  tag, for example, you will want to look at the reference of PhpLintTask. </p> 
    25    
     25 
    2626<h2><a name="DbDeployTask"></a>DbDeployTask</h2> 
    2727<p>The <em>DbDeployTask</em> creates .sql files for making revisions to a database, based on dbdeploy conventions centering around a changelog table in the database. See <a href="http://dbdeploy.com/documentation/getting-started/rules-for-using-dbdeploy/">rules for using dbdeploy</a> for more information. You will need a changelog table like so:</p> 
     
    4040&lt;taskdef name=&quot;dbdeploy&quot; classname=&quot;phing.tasks.ext.dbdeploy.DbDeployTask&quot;/&gt; 
    4141 
    42 &lt;dbdeploy  
     42&lt;dbdeploy 
    4343  url=&quot;sqlite:${project.basedir}/data/db.sqlite&quot;&gt; 
    4444  userid=&quot;dbdeploy&quot; 
     
    914914<h3>Examples</h3> 
    915915<pre> 
    916 &lt;phpdoc title=&quot;Phing Documentation&quot; \ 
     916&lt;phpdoc title=&quot;API Documentation&quot; 
    917917  destdir=&quot;apidocs&quot; 
    918   sourcepath=&quot;classes/phing&quot; 
     918  sourcecode=&quot;no&quot; 
    919919  output=&quot;HTML:Smarty:PHP&quot;&gt; 
    920    &lt;fileset dir=&quot;./classes&quot; &gt; 
    921       &lt;include name=&quot;**/*.php&quot;&gt; 
     920   &lt;fileset dir=&quot;./classes&quot;&gt; 
     921      &lt;include name=&quot;**/*.php&quot; /&gt; 
    922922   &lt;/fileset&gt; 
    923    &lt;projdocfileset dir=&quot;.&quot; &gt; 
    924       &lt;include name=&quot;README&quot;&gt; 
    925       &lt;include name=&quot;INSTALL&quot;&gt; 
    926       &lt;include name=&quot;CHANGELOG&quot;&gt; 
     923   &lt;projdocfileset dir=&quot;.&quot;&gt; 
     924      &lt;include name=&quot;README&quot; /&gt; 
     925      &lt;include name=&quot;INSTALL&quot; /&gt; 
     926      &lt;include name=&quot;CHANGELOG&quot; /&gt; 
    927927   &lt;/projdocfileset&gt; 
    928928&lt;/phpdoc&gt;