Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mms] Ignore .git directories in composer bundle directories when cre…
…ating package.xml file.
- Loading branch information
Showing
3 changed files
with
55 additions
and
4 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
framework/Pear/lib/Horde/Pear/Package/Contents/Ignore/Composer.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* Copyright 2015 Horde LLC (http://www.horde.org/) | ||
* | ||
* See the enclosed file COPYING for license information (LGPL). If you | ||
* did not receive this file, see http://www.horde.org/licenses/lgpl21. | ||
* | ||
* @category Horde | ||
* @copyright 2015 Horde LLC | ||
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 | ||
* @link http://pear.horde.org/index.php?package=Pear | ||
* @package Pear | ||
*/ | ||
|
||
/** | ||
* Ignores elements of Composer packaging/state in created packages. | ||
* | ||
* @author Michael Slusarz <slusarz@horde.org> | ||
* @category Horde | ||
* @copyright 2015 Horde LLC | ||
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 | ||
* @link http://pear.horde.org/index.php?package=Pear | ||
* @package Pear | ||
*/ | ||
class Horde_Pear_Package_Contents_Ignore_Composer | ||
implements Horde_Pear_Package_Contents_Ignore | ||
{ | ||
/** | ||
*/ | ||
public function isIgnored(SplFileInfo $element) | ||
{ | ||
$pathname = $element->getPathname(); | ||
|
||
/* Ignore composer state files. */ | ||
if ((strpos($pathname, 'bundle/composer.json') !== false) || | ||
(strpos($pathname, 'bundle/composer.lock') !== false)) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
slusarz
Author
Member
|
||
return true; | ||
} | ||
|
||
/* Ignore composer generated .git data. */ | ||
if ((strpos($pathname, '/bundle/vendor/') !== false) && | ||
(strpos($pathname, '/.git/') !== false)) { | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Do we really want to ignore those files? Those are the normative resources of version information, which could be useful for end users too, e.g. when debugging, or when they want to try a newer bundle.