Location: PHPKode > projects > Harmony preview > harmony-preview/libraries/Harmony/Script/Context/Line.php
<?php
/**
 * Harmony
 * Copyright (c) 2008 Maxime Bouroumeau-Fuseau
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * @category Harmony
 * @package Harmony_Script
 * @subpackage Harmony_Script_Context
 * @author Maxime Bouroumeau-Fuseau
 * @copyright 2008 (c) Maxime Bouroumeau-Fuseau
 * @license http://www.opensource.org/licenses/mit-license.php
 * @link http://www.harmony-framework.com
 */

/** Harmony_Script_Context */
require_once 'Harmony/Script/Context.php';

/**
 * Handles a line until the end character specified as the
 * endChar parameter
 * 
 * @category Harmony
 * @package Harmony_Script 
 * @subpackage Harmony_Script_Context
 * @copyright 2008 (c) Maxime Bouroumeau-Fuseau
 * @license http://www.opensource.org/licenses/mit-license.php
 */
class Harmony_Script_Context_Line extends Harmony_Script_Context
{
	/**
	 * Checks it it's the end character
	 */
	public function __call($method, $args)
	{
		$car = $args[0];
		
		if ($this->hasParam('endChar')) {
			if ($car != $this->getParam('endChar')) {
				$this->_js .= $car;
				return;
			}
		} else if ($car != ';') {
			$this->_js .= $car;
			return;
		}
		
		$this->exitContext($this->_js);
	}
}
Return current item: Harmony preview