Commit 6075f215 by seldaek

cleanup of some \r\n's

git-svn-id: svn://dwoo.org/dwoo/trunk@206 0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent 7996536c
<?php
/**
* <strong>Agavi specific plugin</strong>
*
* uses AgaviTranslationManager to localize a string
*
* <pre>
* * string : the string to localize
* </pre>
*
* Examples:
* <code>
* {t "Hello"}
* {t $header}
* </code>
*
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from the use of this software.
*
* This file is released under the LGPL
* "GNU Lesser General Public License"
* More information can be found here:
* {@link http://www.gnu.org/copyleft/lesser.html}
*
* @author Jordi Boggiano <j.boggiano@seld.be>
* @copyright Copyright (c) 2008, Jordi Boggiano
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @link http://dwoo.org/
* @version 1.0.0
* @date 2008-09-08
* @package Dwoo
*/
function Dwoo_Plugin_t_compile(Dwoo_Compiler $compiler, $string)
{
return '$this->data[\'tm\']->_('.$string.')';
<?php
/**
* <strong>Agavi specific plugin</strong>
*
* uses AgaviTranslationManager to localize a string
*
* <pre>
* * string : the string to localize
* </pre>
*
* Examples:
* <code>
* {t "Hello"}
* {t $header}
* </code>
*
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from the use of this software.
*
* This file is released under the LGPL
* "GNU Lesser General Public License"
* More information can be found here:
* {@link http://www.gnu.org/copyleft/lesser.html}
*
* @author Jordi Boggiano <j.boggiano@seld.be>
* @copyright Copyright (c) 2008, Jordi Boggiano
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @link http://dwoo.org/
* @version 1.0.0
* @date 2008-09-08
* @package Dwoo
*/
function Dwoo_Plugin_t_compile(Dwoo_Compiler $compiler, $string)
{
return '$this->data[\'tm\']->_('.$string.')';
}
\ No newline at end of file
<?php
/**
* <strong>Agavi specific plugin</strong>
*
* uses AgaviRouting to create an url
*
* <pre>
* * route : the route name, optional (by default the current url is returned)
* * params : an array with variables to build the route, optional
* * options : an array of options to pass to the routing object, optional
* * rest : for convenience, you can just pass named parameters that will be used as
* the params array, but you must not provide the params array in this case
* </pre>
*
* Examples:
* <code>
* {a url("route.name" array(param="Value", param2=$otherVal))}Here is a link{/a}
* <form action="{url}"> {* without any parameter it just returns the current url *}
* </code>
*
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from the use of this software.
*
* This file is released under the LGPL
* "GNU Lesser General Public License"
* More information can be found here:
* {@link http://www.gnu.org/copyleft/lesser.html}
*
* @author Jordi Boggiano <j.boggiano@seld.be>
* @copyright Copyright (c) 2008, Jordi Boggiano
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @link http://dwoo.org/
* @version 1.0.0
* @date 2008-09-08
* @package Dwoo
*/
function Dwoo_Plugin_url_compile(Dwoo_Compiler $compiler, $route = null, $params = null, $options = null, array $rest = array())
{
if ($params == 'null') {
if (count($rest)) {
$params = array();
foreach ($rest as $k=>$v) {
if (is_numeric($k)) {
$params[] = $k.'=>'.$v;
} else {
$params[] = '"'.$k.'"=>'.$v;
}
}
$params = 'array('.implode(', ', $params).')';
} else {
$params = 'array()';
}
}
if ($options == 'null') {
$options = 'array()';
}
return '$this->data[\'ro\']->gen('.$route.', '.$params.', '.$options.')';
<?php
/**
* <strong>Agavi specific plugin</strong>
*
* uses AgaviRouting to create an url
*
* <pre>
* * route : the route name, optional (by default the current url is returned)
* * params : an array with variables to build the route, optional
* * options : an array of options to pass to the routing object, optional
* * rest : for convenience, you can just pass named parameters that will be used as
* the params array, but you must not provide the params array in this case
* </pre>
*
* Examples:
* <code>
* {a url("route.name" array(param="Value", param2=$otherVal))}Here is a link{/a}
* <form action="{url}"> {* without any parameter it just returns the current url *}
* </code>
*
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from the use of this software.
*
* This file is released under the LGPL
* "GNU Lesser General Public License"
* More information can be found here:
* {@link http://www.gnu.org/copyleft/lesser.html}
*
* @author Jordi Boggiano <j.boggiano@seld.be>
* @copyright Copyright (c) 2008, Jordi Boggiano
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @link http://dwoo.org/
* @version 1.0.0
* @date 2008-09-08
* @package Dwoo
*/
function Dwoo_Plugin_url_compile(Dwoo_Compiler $compiler, $route = null, $params = null, $options = null, array $rest = array())
{
if ($params == 'null') {
if (count($rest)) {
$params = array();
foreach ($rest as $k=>$v) {
if (is_numeric($k)) {
$params[] = $k.'=>'.$v;
} else {
$params[] = '"'.$k.'"=>'.$v;
}
}
$params = 'array('.implode(', ', $params).')';
} else {
$params = 'array()';
}
}
if ($options == 'null') {
$options = 'array()';
}
return '$this->data[\'ro\']->gen('.$route.', '.$params.', '.$options.')';
}
\ No newline at end of file
<?php
/**
* interface that represents a dwoo plugin proxy
*
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from the use of this software.
*
* This file is released under the LGPL
* "GNU Lesser General Public License"
* More information can be found here:
* {@link http://www.gnu.org/copyleft/lesser.html}
*
* @author Denis Arh <denis@arh.cc>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @copyright Copyright (c) 2008, Denis Arh, Jordi Boggiano
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @link http://dwoo.org/
* @version 0.9.1
* @date 2008-05-30
* @package Dwoo
*/
interface Dwoo_IPluginProxy
{
/**
* returns true or false to say whether the given plugin is handled by this proxy or not
*
* @param string $name the plugin name
* @return bool true if the plugin is known and usable, otherwise false
*/
public function handles($name);
/**
* returns the code (as a string) to call the plugin
* (this will be executed at runtime inside the Dwoo class)
*
* @param string $name the plugin name
* @param array $params a parameter array, array key "*" is the rest array
* @return string
*/
public function getCode($name, $params);
/**
* returns a callback to the plugin, this is used with the reflection API to
* find out about the plugin's parameter names etc.
*
* should you need a rest array without the possibility to edit the
* plugin's code, you can provide a callback to some
* other function with the correct parameter signature, i.e. :
* <code>
* return array($this, "callbackHelper");
* // and callbackHelper would be as such:
* public function callbackHelper(array $rest=array()){}
* </code>
*
* @param string $name the plugin name
* @return callback
*/
public function getCallback($name);
/**
* returns some code that will check if the plugin is loaded and if not load it
* this is optional, if your plugins are autoloaded or whatever, just return an
* empty string
*
* @param string $name the plugin name
* @return string
*/
public function getLoader($name);
<?php
/**
* interface that represents a dwoo plugin proxy
*
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from the use of this software.
*
* This file is released under the LGPL
* "GNU Lesser General Public License"
* More information can be found here:
* {@link http://www.gnu.org/copyleft/lesser.html}
*
* @author Denis Arh <denis@arh.cc>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @copyright Copyright (c) 2008, Denis Arh, Jordi Boggiano
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @link http://dwoo.org/
* @version 0.9.1
* @date 2008-05-30
* @package Dwoo
*/
interface Dwoo_IPluginProxy
{
/**
* returns true or false to say whether the given plugin is handled by this proxy or not
*
* @param string $name the plugin name
* @return bool true if the plugin is known and usable, otherwise false
*/
public function handles($name);
/**
* returns the code (as a string) to call the plugin
* (this will be executed at runtime inside the Dwoo class)
*
* @param string $name the plugin name
* @param array $params a parameter array, array key "*" is the rest array
* @return string
*/
public function getCode($name, $params);
/**
* returns a callback to the plugin, this is used with the reflection API to
* find out about the plugin's parameter names etc.
*
* should you need a rest array without the possibility to edit the
* plugin's code, you can provide a callback to some
* other function with the correct parameter signature, i.e. :
* <code>
* return array($this, "callbackHelper");
* // and callbackHelper would be as such:
* public function callbackHelper(array $rest=array()){}
* </code>
*
* @param string $name the plugin name
* @return callback
*/
public function getCallback($name);
/**
* returns some code that will check if the plugin is loaded and if not load it
* this is optional, if your plugins are autoloaded or whatever, just return an
* empty string
*
* @param string $name the plugin name
* @return string
*/
public function getLoader($name);
}
\ No newline at end of file
<?php
function dwooAutoload($class)
{
if (substr($class, 0, 5) === 'Dwoo_') {
include strtr($class, '_', DIRECTORY_SEPARATOR).'.php';
}
}
spl_autoload_register('dwooAutoload');
set_include_path(str_replace(PATH_SEPARATOR.dirname(__FILE__), '', get_include_path()) . PATH_SEPARATOR . dirname(__FILE__));
<?php
function dwooAutoload($class)
{
if (substr($class, 0, 5) === 'Dwoo_') {
include strtr($class, '_', DIRECTORY_SEPARATOR).'.php';
}
}
spl_autoload_register('dwooAutoload');
set_include_path(str_replace(PATH_SEPARATOR.dirname(__FILE__), '', get_include_path()) . PATH_SEPARATOR . dirname(__FILE__));
include 'Dwoo.php';
\ No newline at end of file
<?php
function Dwoo_Plugin_loaderTest(Dwoo $dwoo)
{
return 'Moo';
}
<?php
function Dwoo_Plugin_loaderTest(Dwoo $dwoo)
{
return 'Moo';
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment