CC-2166: Packaging Improvements. Moved the Zend app into airtime_mvc. It is now installed to /var/www/airtime. Storage is now set to /srv/airtime/stor. Utils are now installed to /usr/lib/airtime/utils/. Added install/airtime-dircheck.php as a simple test to see if everything is install/uninstalled correctly.
This commit is contained in:
parent
514777e8d2
commit
b11cbd8159
4546 changed files with 138 additions and 51 deletions
59
airtime_mvc/library/phing/mappers/FileNameMapper.php
Normal file
59
airtime_mvc/library/phing/mappers/FileNameMapper.php
Normal file
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
/*
|
||||
* $Id: FileNameMapper.php 905 2010-10-05 16:28:03Z mrook $
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the LGPL. For more information please see
|
||||
* <http://phing.info>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Interface for filename mapper classes.
|
||||
*
|
||||
* @author Andreas Aderhold, andi@binarycloud.com
|
||||
* @author Hans Lellelid <hans@xmpl.org>
|
||||
* @version $Revision: 905 $
|
||||
* @package phing.mappers
|
||||
*/
|
||||
interface FileNameMapper {
|
||||
|
||||
/**
|
||||
* The mapper implementation.
|
||||
*
|
||||
* @param mixed $sourceFileName The data the mapper works on.
|
||||
* @return array The data after the mapper has been applied; must be in array format (for some reason).
|
||||
*/
|
||||
public function main($sourceFileName);
|
||||
|
||||
/**
|
||||
* Accessor. Sets the to property. The actual implementation
|
||||
* depends on the child class.
|
||||
*
|
||||
* @param string $to To what this mapper should convert the from string
|
||||
* @return void
|
||||
*/
|
||||
public function setTo($to);
|
||||
|
||||
/**
|
||||
* Accessor. Sets the from property. What this mapper should
|
||||
* recognize. The actual implementation is dependent upon the
|
||||
* child class
|
||||
*
|
||||
* @param string $from On what this mapper should work
|
||||
* @return void
|
||||
*/
|
||||
public function setFrom($from);
|
||||
|
||||
}
|
55
airtime_mvc/library/phing/mappers/FlattenMapper.php
Normal file
55
airtime_mvc/library/phing/mappers/FlattenMapper.php
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
/*
|
||||
* $Id: FlattenMapper.php 905 2010-10-05 16:28:03Z mrook $
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the LGPL. For more information please see
|
||||
* <http://phing.info>.
|
||||
*/
|
||||
|
||||
require_once 'phing/mappers/FileNameMapper.php';
|
||||
|
||||
/**
|
||||
* Removes any directory information from the passed path.
|
||||
*
|
||||
* @author Andreas Aderhold <andi@binarycloud.com>
|
||||
* @version $Revision: 905 $
|
||||
* @package phing.mappers
|
||||
*/
|
||||
class FlattenMapper implements FileNameMapper {
|
||||
|
||||
/**
|
||||
* The mapper implementation. Returns string with source filename
|
||||
* but without leading directory information
|
||||
*
|
||||
* @param string $sourceFileName The data the mapper works on
|
||||
* @return array The data after the mapper has been applied
|
||||
*/
|
||||
function main($sourceFileName) {
|
||||
$f = new PhingFile($sourceFileName);
|
||||
return array($f->getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Ignored here.
|
||||
*/
|
||||
function setTo($to) {}
|
||||
|
||||
/**
|
||||
* Ignored here.
|
||||
*/
|
||||
function setFrom($from) {}
|
||||
|
||||
}
|
113
airtime_mvc/library/phing/mappers/GlobMapper.php
Normal file
113
airtime_mvc/library/phing/mappers/GlobMapper.php
Normal file
|
@ -0,0 +1,113 @@
|
|||
<?php
|
||||
/*
|
||||
* $Id: GlobMapper.php 905 2010-10-05 16:28:03Z mrook $
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the LGPL. For more information please see
|
||||
* <http://phing.info>.
|
||||
*/
|
||||
|
||||
include_once 'phing/mappers/FileNameMapper.php';
|
||||
|
||||
/**
|
||||
* description here
|
||||
*
|
||||
* @author Andreas Aderhold, andi@binarycloud.com
|
||||
* @version $Revision: 905 $
|
||||
* @package phing.mappers
|
||||
*/
|
||||
class GlobMapper implements FileNameMapper {
|
||||
|
||||
/**
|
||||
* Part of "from" pattern before the *.
|
||||
*/
|
||||
private $fromPrefix = null;
|
||||
|
||||
/**
|
||||
* Part of "from" pattern after the *.
|
||||
*/
|
||||
private $fromPostfix = null;
|
||||
|
||||
/**
|
||||
* Length of the prefix ("from" pattern).
|
||||
*/
|
||||
private $prefixLength;
|
||||
|
||||
/**
|
||||
* Length of the postfix ("from" pattern).
|
||||
*/
|
||||
private $postfixLength;
|
||||
|
||||
/**
|
||||
* Part of "to" pattern before the *.
|
||||
*/
|
||||
private $toPrefix = null;
|
||||
|
||||
/**
|
||||
* Part of "to" pattern after the *.
|
||||
*/
|
||||
private $toPostfix = null;
|
||||
|
||||
|
||||
function main($_sourceFileName) {
|
||||
if (($this->fromPrefix === null)
|
||||
|| !StringHelper::startsWith($this->fromPrefix, $_sourceFileName)
|
||||
|| !StringHelper::endsWith($this->fromPostfix, $_sourceFileName)) {
|
||||
return null;
|
||||
}
|
||||
$varpart = $this->_extractVariablePart($_sourceFileName);
|
||||
$substitution = $this->toPrefix.$varpart.$this->toPostfix;
|
||||
return array($substitution);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function setFrom($from) {
|
||||
$index = strrpos($from, '*');
|
||||
|
||||
if ($index === false) {
|
||||
$this->fromPrefix = $from;
|
||||
$this->fromPostfix = "";
|
||||
} else {
|
||||
$this->fromPrefix = substr($from, 0, $index);
|
||||
$this->fromPostfix = substr($from, $index+1);
|
||||
}
|
||||
$this->prefixLength = strlen($this->fromPrefix);
|
||||
$this->postfixLength = strlen($this->fromPostfix);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the "to" pattern. Required.
|
||||
*/
|
||||
function setTo($to) {
|
||||
$index = strrpos($to, '*');
|
||||
if ($index === false) {
|
||||
$this->toPrefix = $to;
|
||||
$this->toPostfix = "";
|
||||
} else {
|
||||
$this->toPrefix = substr($to, 0, $index);
|
||||
$this->toPostfix = substr($to, $index+1);
|
||||
}
|
||||
}
|
||||
|
||||
private function _extractVariablePart($_name) {
|
||||
// ergh, i really hate php's string functions .... all but natural
|
||||
$start = ($this->prefixLength === 0) ? 0 : $this->prefixLength;
|
||||
$end = ($this->postfixLength === 0) ? strlen($_name) : strlen($_name) - $this->postfixLength;
|
||||
$len = $end-$start;
|
||||
return substr($_name, $start, $len);
|
||||
}
|
||||
|
||||
}
|
54
airtime_mvc/library/phing/mappers/IdentityMapper.php
Normal file
54
airtime_mvc/library/phing/mappers/IdentityMapper.php
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
/*
|
||||
* $Id: IdentityMapper.php 905 2010-10-05 16:28:03Z mrook $
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the LGPL. For more information please see
|
||||
* <http://phing.info>.
|
||||
*/
|
||||
|
||||
require_once 'phing/mappers/FileNameMapper.php';
|
||||
|
||||
/**
|
||||
* This mapper does nothing ;)
|
||||
*
|
||||
* @author Andreas Aderhold <andi@binarycloud.com>
|
||||
* @author Hans Lellelid <hans@xmpl.org>
|
||||
* @version $Revision: 905 $
|
||||
* @package phing.mappers
|
||||
*/
|
||||
class IdentityMapper implements FileNameMapper {
|
||||
|
||||
/**
|
||||
* The mapper implementation. Basically does nothing in this case.
|
||||
*
|
||||
* @param string $sourceFileName The data the mapper works on.
|
||||
* @return array The data after the mapper has been applied
|
||||
*/
|
||||
function main($sourceFileName) {
|
||||
return array($sourceFileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ignored here.
|
||||
*/
|
||||
function setTo($to) {}
|
||||
|
||||
/**
|
||||
* Ignored here.
|
||||
*/
|
||||
function setFrom($from) {}
|
||||
|
||||
}
|
69
airtime_mvc/library/phing/mappers/MergeMapper.php
Normal file
69
airtime_mvc/library/phing/mappers/MergeMapper.php
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
/*
|
||||
* $Id: MergeMapper.php 905 2010-10-05 16:28:03Z mrook $
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the LGPL. For more information please see
|
||||
* <http://phing.info>.
|
||||
*/
|
||||
|
||||
include_once 'phing/mappers/FileNameMapper.php';
|
||||
|
||||
/**
|
||||
* For merging files into a single file. In practice just returns whatever value
|
||||
* was set for "to".
|
||||
*
|
||||
* @author Andreas Aderhold <andi@binarycloud.com>
|
||||
* @version $Revision: 905 $
|
||||
* @package phing.mappers
|
||||
*/
|
||||
class MergeMapper implements FileNameMapper {
|
||||
|
||||
/** the merge */
|
||||
private $mergedFile;
|
||||
|
||||
/**
|
||||
* The mapper implementation. Basically does nothing in this case.
|
||||
*
|
||||
* @param mixed The data the mapper works on
|
||||
* @returns mixed The data after the mapper has been applied
|
||||
* @access public
|
||||
* @author Andreas Aderhold, andi@binarycloud.com
|
||||
*/
|
||||
function main($sourceFileName) {
|
||||
if ($this->mergedFile === null) {
|
||||
throw new BuildException("MergeMapper error, to attribute not set");
|
||||
}
|
||||
return array($this->mergedFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Accessor. Sets the to property
|
||||
*
|
||||
* @param string To what this mapper should convert the from string
|
||||
* @returns boolean True
|
||||
* @access public
|
||||
* @author Andreas Aderhold, andi@binarycloud.com
|
||||
*/
|
||||
function setTo($to) {
|
||||
$this->mergedFile = $to;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ignored.
|
||||
*/
|
||||
function setFrom($from) {}
|
||||
|
||||
}
|
97
airtime_mvc/library/phing/mappers/RegexpMapper.php
Normal file
97
airtime_mvc/library/phing/mappers/RegexpMapper.php
Normal file
|
@ -0,0 +1,97 @@
|
|||
<?php
|
||||
/*
|
||||
* $Id: RegexpMapper.php 905 2010-10-05 16:28:03Z mrook $
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the LGPL. For more information please see
|
||||
* <http://phing.info>.
|
||||
*/
|
||||
|
||||
require_once 'phing/mappers/FileNameMapper.php';
|
||||
include_once 'phing/util/StringHelper.php';
|
||||
include_once 'phing/util/regexp/Regexp.php';
|
||||
|
||||
/**
|
||||
* Uses regular expressions to perform filename transformations.
|
||||
*
|
||||
* @author Andreas Aderhold <andi@binarycloud.com>
|
||||
* @author Hans Lellelid <hans@velum.net>
|
||||
* @version $Revision: 905 $
|
||||
* @package phing.mappers
|
||||
*/
|
||||
class RegexpMapper implements FileNameMapper {
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $to;
|
||||
|
||||
/**
|
||||
* The Regexp engine.
|
||||
* @var Regexp
|
||||
*/
|
||||
private $reg;
|
||||
|
||||
function __construct() {
|
||||
// instantiage regexp matcher here
|
||||
$this->reg = new Regexp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the "from" pattern. Required.
|
||||
*/
|
||||
function setFrom($from) {
|
||||
$this->reg->SetPattern($from);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the "to" pattern. Required.
|
||||
*/
|
||||
function setTo($to) {
|
||||
|
||||
// [HL] I'm changing the way this works for now to just use string
|
||||
//$this->to = StringHelper::toCharArray($to);
|
||||
|
||||
$this->to = $to;
|
||||
}
|
||||
|
||||
function main($sourceFileName) {
|
||||
if ($this->reg === null || $this->to === null || !$this->reg->matches((string) $sourceFileName)) {
|
||||
return null;
|
||||
}
|
||||
return array($this->replaceReferences($sourceFileName));
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace all backreferences in the to pattern with the matched groups.
|
||||
* groups of the source.
|
||||
* @param string $source The source filename.
|
||||
*/
|
||||
private function replaceReferences($source) {
|
||||
|
||||
// FIXME
|
||||
// Can't we just use engine->replace() to handle this? the Preg engine
|
||||
// will automatically convert \1 references to $1
|
||||
|
||||
// the expression has already been processed (when ->matches() was run in Main())
|
||||
// so no need to pass $source again to the engine.
|
||||
$groups = (array) $this->reg->getGroups();
|
||||
|
||||
// replace \1 with value of $groups[1] and return the modified "to" string
|
||||
return preg_replace('/\\\([\d]+)/e', "\$groups[$1]", $this->to);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue