Initial commit of Markdown Resume

This includes several vendor libraries: Assetic, LessPHP, Mustache,
SmartyPants, Markdown
This commit is contained in:
Craig Davis
2012-03-04 10:41:18 -06:00
commit f4c52ac4c9
95 changed files with 17961 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
<?php
/*
* This file is part of the Assetic package, an OpenSky project.
*
* (c) 2010-2011 OpenSky Project Inc
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Assetic\Factory\Worker;
use Assetic\Asset\AssetInterface;
use Assetic\Filter\FilterInterface;
/**
* Applies a filter to an asset based on a source and/or target path match.
*
* @author Kris Wallsmith <kris.wallsmith@gmail.com>
* @todo A better asset-matcher mechanism
*/
class EnsureFilterWorker implements WorkerInterface
{
const CHECK_SOURCE = 1;
const CHECK_TARGET = 2;
private $pattern;
private $filter;
private $flags;
/**
* Constructor.
*
* @param string $pattern A regex for checking the asset's target URL
* @param FilterInterface $filter A filter to apply if the regex matches
* @param integer $flags Flags for what to check
*/
public function __construct($pattern, FilterInterface $filter, $flags = null)
{
if (null === $flags) {
$flags = self::CHECK_SOURCE | self::CHECK_TARGET;
}
$this->pattern = $pattern;
$this->filter = $filter;
$this->flags = $flags;
}
public function process(AssetInterface $asset)
{
if (
(self::CHECK_SOURCE === (self::CHECK_SOURCE & $this->flags) && preg_match($this->pattern, $asset->getSourcePath()))
||
(self::CHECK_TARGET === (self::CHECK_TARGET & $this->flags) && preg_match($this->pattern, $asset->getTargetPath()))
) {
$asset->ensureFilter($this->filter);
}
}
}

View File

@@ -0,0 +1,31 @@
<?php
/*
* This file is part of the Assetic package, an OpenSky project.
*
* (c) 2010-2011 OpenSky Project Inc
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Assetic\Factory\Worker;
use Assetic\Asset\AssetInterface;
/**
* Assets are passed through factory workers before leaving the factory.
*
* @author Kris Wallsmith <kris.wallsmith@gmail.com>
*/
interface WorkerInterface
{
/**
* Processes an asset.
*
* @param AssetInterface $asset An asset
*
* @return AssetInterface|null May optionally return a replacement asset
*/
function process(AssetInterface $asset);
}