* Ethna_DB_PEARクラスのコンストラクタ
*
* @access public
- * @param object Ethna_Controller &$controller コントローラオブジェクト
+ * @param object Ethna_Controller $controller コントローラオブジェクト
* @param string $dsn DSN
* @param bool $persistent 持続接続設定
*/
- public function __construct(&$controller, $dsn, $persistent)
+ public function __construct($controller, $dsn, $persistent)
{
parent::__construct($controller, $dsn, $persistent);
$this->db = null;
- $this->logger =& $controller->getLogger();
- $this->sql =& $controller->getSQL();
+ $this->logger = $controller->getLogger();
+ $this->sql = $controller->getSQL();
$this->dsninfo = DB::parseDSN($dsn);
$this->dsninfo['new_link'] = true;
*/
function connect()
{
- $this->db =& DB::connect($this->dsninfo, $this->persistent);
+ $this->db = DB::connect($this->dsninfo, $this->persistent);
if (DB::isError($this->db)) {
$error = Ethna::raiseError('DB Connection Error: %s',
E_DB_CONNECT,
* @param string $table テーブル名
* @return mixed array: PEAR::DBに準じたメタデータ Ethna_Error::エラー
*/
- function &getMetaData($table)
+ function getMetaData($table)
{
- $def =& $this->db->tableInfo($table);
+ $def = $this->db->tableInfo($table);
if (is_array($def) === false) {
return $def;
}
* @param string $query SQL文
* @return mixed DB_Result:結果オブジェクト Ethna_Error:エラー
*/
- function &query($query)
+ function query($query)
{
return $this->_query($query);
}
* @access public
* @return int 更新行数
*/
- function &fetchRow(&$res, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum = null)
+ function fetchRow(&$res, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum = null)
{
- $row =& $res->fetchRow($fetchmode, $rownum);
+ $row = $res->fetchRow($fetchmode, $rownum);
if (is_array($row) === false) {
return $row;
}
* @param string $sqlid SQL-ID(+引数)
* @return mixed DB_Result:結果オブジェクト Ethna_Error:エラー
*/
- function &sqlquery($sqlid)
+ function sqlquery($sqlid)
{
$args = func_get_args();
array_shift($args);
* @param string $query SQL文
* @return mixed DB_Result:結果オブジェクト Ethna_Error:エラー
*/
- function &_query($query)
+ function _query($query)
{
$this->logger->log(LOG_DEBUG, "$query");
- $r =& $this->db->query($query);
+ $r = $this->db->query($query);
if (DB::isError($r)) {
if ($r->getCode() == DB_ERROR_ALREADY_EXISTS) {
$error = Ethna::raiseNotice('Unique Constraint Error SQL[%s]',
if (isset($_SERVER['REQUEST_METHOD']) == false) {
return;
} else if (strcasecmp($_SERVER['REQUEST_METHOD'], 'post') == 0) {
- $http_vars =& $_POST;
+ $http_vars = $_POST;
} else {
- $http_vars =& $_GET;
+ $http_vars = $_GET;
}
//
* Ethna_AppObjectクラスのコンストラクタ
*
* @access public
- * @param object Ethna_Backend &$backend Ethna_Backendオブジェクト
+ * @param object Ethna_Backend $backend Ethna_Backendオブジェクト
* @param mixed $key_type レコードを特定するためのカラム名
* (通常はプライマリーキーのフィールド)
* @param mixed $key レコードを特定するためのカラム値
* @param array $prop プロパティ(レコードの値)一覧
* @return mixed 0:正常終了 -1:キー/プロパティ未指定 Ethna_Error:エラー
*/
- public function __construct(&$backend, $key_type = null, $key = null, $prop = null)
+ public function __construct($backend, $key_type = null, $key = null, $prop = null)
{
- $this->backend =& $backend;
- $this->config =& $backend->getConfig();
- $this->action_form =& $backend->getActionForm();
- $this->af =& $this->action_form;
- $this->session =& $backend->getSession();
- $ctl =& $backend->getController();
+ $this->backend = $backend;
+ $this->config = $backend->getConfig();
+ $this->action_form = $backend->getActionForm();
+ $this->af = $this->action_form;
+ $this->session = $backend->getSession();
+ $ctl = $backend->getController();
// DBオブジェクトの設定
$db_list = $this->_getDBList();
"Ethna_AppObjectを利用するにはデータベース設定が必要です",
E_DB_NODSN);
}
- $this->my_db_rw =& $db_list['rw'];
- $this->my_db_ro =& $db_list['ro'];
+ $this->my_db_rw = $db_list['rw'];
+ $this->my_db_ro = $db_list['ro'];
// XXX: app objはdb typeを知らなくても動くべき
$this->my_db_type = $this->my_db_rw->getType();
// INSERT 文を取得し、実行
$sql = $this->_getSQL_Add();
for ($i = 0; $i < 4; $i++) {
- $r =& $this->my_db_rw->query($sql);
+ $r = $this->my_db_rw->query($sql);
// エラーの場合 -> 重複キーエラーの場合はリトライ
if (Ethna::isError($r)) {
if ($r->getCode() == E_DB_DUPENT) {
$sql = $this->_getSQL_Update();
// エラーの場合 -> 重複キーエラーの場合はリトライ(4回)
for ($i = 0; $i < 4; $i++) { // magic number
- $r =& $this->my_db_rw->query($sql);
+ $r = $this->my_db_rw->query($sql);
if (Ethna::isError($r)) {
if ($r->getCode() == E_DB_DUPENT) {
// 重複エラーキーの判別
function remove()
{
$sql = $this->_getSQL_Remove();
- $r =& $this->my_db_rw->query($sql);
+ $r = $this->my_db_rw->query($sql);
if (Ethna::isError($r)) {
return $r;
}
// プライマリーキー件数検索
if (is_null($offset) == false || is_null($count) == false) {
$sql = $this->_getSQL_SearchLength($filter);
- $r =& $this->my_db_ro->query($sql);
+ $r = $this->my_db_ro->query($sql);
if (Ethna::isError($r)) {
return $r;
}
$id_list = array();
$sql = $this->_getSQL_SearchId($filter, $order, $offset, $count);
- $r =& $this->my_db_ro->query($sql);
+ $r = $this->my_db_ro->query($sql);
if (Ethna::isError($r)) {
return $r;
}
// プライマリーキー件数検索
if (is_null($offset) == false || is_null($count) == false) {
$sql = $this->_getSQL_SearchLength($filter);
- $r =& $this->my_db_ro->query($sql);
+ $r = $this->my_db_ro->query($sql);
if (Ethna::isError($r)) {
return $r;
}
$prop_list = array();
$sql = $this->_getSQL_SearchProp($keys, $filter, $order, $offset, $count);
- $r =& $this->my_db_ro->query($sql);
+ $r = $this->my_db_ro->query($sql);
if (Ethna::isError($r)) {
return $r;
}
$sql = $this->_getSQL_Select($key_type, $key);
// プロパティ取得
- $r =& $this->my_db_ro->query($sql);
+ $r = $this->my_db_ro->query($sql);
if (Ethna::isError($r)) {
return;
}
// プライマリキーはmulti columnsになり得るので別扱い
if ($check_pkey) {
$sql = $this->_getSQL_Duplicate($this->id_def);
- $r =& $this->my_db_rw->query($sql);
+ $r = $this->my_db_rw->query($sql);
if (Ethna::isError($r)) {
return $r;
} else if ($r->numRows() > 0) {
continue;
}
$sql = $this->_getSQL_Duplicate($k);
- $r =& $this->my_db_rw->query($sql);
+ $r = $this->my_db_rw->query($sql);
if (Ethna::isError($r)) {
return $r;
} else if ($r->NumRows() > 0) {
$varname = $elt['varname'];
// for B.C.
- $this->$varname =& $elt['db'];
+ $this->$varname = $elt['db'];
if ($elt['type'] == DB_TYPE_RW) {
- $r['rw'] =& $elt['db'];
+ $r['rw'] = $elt['db'];
} else if ($elt['type'] == DB_TYPE_RO) {
- $r['ro'] =& $elt['db'];
+ $r['ro'] = $elt['db'];
}
}
if ($r['ro'] == null && $r['rw'] != null) {
- $r['ro'] =& $r['rw'];
+ $r['ro'] = $r['rw'];
}
return $r;
break;
}
- $cache_manager =& Ethna_CacheManager::getInstance('localfile');
+ $cache_manager = Ethna_CacheManager::getInstance('localfile');
$cache_manager->setNamespace('ethna_app_object');
$cache_key = md5($this->my_db_ro->getDSN() . '-' . $table_name);
* @access public
* @param object Ethna_Controller &$controller controllerオブジェクト
*/
- public function __construct(&$controller)
+ public function __construct($controller)
{
- $this->controller =& $controller;
+ $this->controller = $controller;
}
/**
* @param mixed &$var エスケープする値
* @static
*/
- function escapeSQL(&$var, $type = null)
+ public static function escapeSQL(&$var, $type = null)
{
if (!is_array($var)) {
if (is_null($var)) {
* @param mixed &$var エスケープを復帰する値
* @static
*/
- function unescapeSQL(&$var, $type = null)
+ public static function unescapeSQL(&$var, $type = null)
{
if (!is_array($var)) {
if ($var == 'NULL') {
{
$tmp = array();
$tmp['name'] = $name;
- $tmp['object'] =& $search_object;
+ $tmp['object'] = $search_object;
$tmp['condition'] = $condition;
$this->object_list[] = $tmp;
}
*/
function &getInstance($type)
{
- $controller =& Ethna_Controller::getInstance();
- $plugin =& $controller->getPlugin();
+ $controller = Ethna_Controller::getInstance();
+ $plugin = $controller->getPlugin();
- $cache_manager =& $plugin->getPlugin('Cachemanager', ucfirst($type));
+ $cache_manager = $plugin->getPlugin('Cachemanager', ucfirst($type));
return $cache_manager;
}
*/
public function __construct(&$controller)
{
- $this->controller =& $controller;
+ $this->controller = $controller;
// 設定ファイルの読み込み
$r = $this->_getConfig();
}
if (strcasecmp($_SERVER['REQUEST_METHOD'], 'post') == 0) {
- $http_vars =& $_POST;
+ $http_vars = $_POST;
} else {
- $http_vars =& $_GET;
+ $http_vars = $_GET;
}
// フォーム値からリクエストされたアクション名を取得する
* @param object Ethna_Renderer レンダラオブジェクト
* @obsolete
*/
- function _setDefaultTemplateEngine(&$renderer)
+ function _setDefaultTemplateEngine($renderer)
{
}
public function __construct(&$controller)
{
// オブジェクトの設定
- $this->controller =& $controller;
- $this->ctl =& $this->controller;
+ $this->controller = $controller;
+ $this->ctl = $this->controller;
- $this->config =& $controller->getConfig();
- $this->logger =& $this->controller->getLogger();
+ $this->config = $controller->getConfig();
+ $this->logger = $this->controller->getLogger();
}
/**
* @return array ログレベル(LOG_NOTICE,...), エラーレベル表示名("E_NOTICE"...)
* @static
*/
- function errorLevelToLogLevel($errno)
+ public static function errorLevelToLogLevel($errno)
{
switch ($errno) {
case E_ERROR: $code = "E_ERROR"; $level = LOG_ERR; break;
*/
public function __construct(&$backend)
{
- $this->backend =& $backend;
- $this->config =& $this->backend->getConfig();
+ $this->backend = $backend;
+ $this->config = $this->backend->getConfig();
}
/**
if ($template === MAILSENDER_TYPE_DIRECT) {
$mail = $macro;
} else {
- $renderer =& $this->getTemplateEngine();
+ $renderer = $this->getTemplateEngine();
// 基本情報設定
$env_datetime = _et('%Y/%m/%d %H:%M:%S');
*/
function &getRenderer()
{
- $_ret_object =& $this->getTemplateEngine();
+ $_ret_object = $this->getTemplateEngine();
return $_ret_object;
}
*/
function &getTemplateEngine()
{
- $c =& $this->backend->getController();
- $renderer =& $c->getRenderer();
+ $c = $this->backend->getController();
+ $renderer = $c->getRenderer();
return $renderer;
}
}
// setup PEAR_Frontend
PEAR_Command::setFrontendType('CLI');
- $this->ui =& PEAR_Command::getFrontendObject();
+ $this->ui = PEAR_Command::getFrontendObject();
// set PEAR's error handling
// TODO: if PEAR/Command/Install.php is newer than 1.117, displayError goes well.
// set target controller
if ($target == 'master') {
- $this->target_ctl =& Ethna_Handle::getEthnaController();
+ $this->target_ctl = Ethna_Handle::getEthnaController();
} else {
- $this->target_ctl =& Ethna_Handle::getAppController($app_dir);
+ $this->target_ctl = Ethna_Handle::getAppController($app_dir);
}
if (Ethna::isError($this->target_ctl)) {
return $this->target_ctl;
// setup PEAR_Config
if ($target == 'master') {
- $ret =& $this->_setMasterConfig();
+ $ret = $this->_setMasterConfig();
} else {
- $ret =& $this->_setLocalConfig();
+ $ret = $this->_setLocalConfig();
}
if (Ethna::isError($ret)) {
return $ret;
$this->ui->setConfig($this->config);
// setup PEAR_Registry
- $this->registry =& $this->config->getRegistry();
+ $this->registry = $this->config->getRegistry();
return $true;
}
$true = true;
// setup config
- $this->config =& PEAR_Config::singleton();
+ $this->config = PEAR_Config::singleton();
// setup channel
- $reg =& $this->config->getRegistry();
+ $reg = $this->config->getRegistry();
if ($reg->channelExists($this->channel) == false) {
- $ret =& $this->doChannelDiscover();
+ $ret = $this->doChannelDiscover();
if (Ethna::isError($ret)) {
return $ret;
}
}
$pearrc = "{$base}/skel/.pearrc";
- $this->config =& PEAR_Config::singleton($pearrc);
+ $this->config = PEAR_Config::singleton($pearrc);
// read local .pearrc if exists.
if (is_file($pearrc) && is_readable($pearrc)) {
}
// setup channel
- $reg =& $this->config->getRegistry();
+ $reg = $this->config->getRegistry();
if ($reg->channelExists($this->channel) == false) {
- $ret =& $this->doChannelDiscover();
+ $ret = $this->doChannelDiscover();
if (Ethna::isError($ret)) {
return $ret;
}
function &doClearCache()
{
$true = true;
- $r =& $this->_run('clear-cache', array(), array());
+ $r = $this->_run('clear-cache', array(), array());
if (PEAR::isError($r)) {
return $r;
}
function &doChannelDiscover()
{
$true = true;
- $r =& $this->_run('channel-discover', array(), array($this->channel));
+ $r = $this->_run('channel-discover', array(), array($this->channel));
if (PEAR::isError($r)) {
return $r;
}
{
$true = true;
if ($this->isChannelExists() == false) {
- $r =& $this->doChannelDiscover();
+ $r = $this->doChannelDiscover();
if (PEAR::isError($r)) {
return $r;
}
}
- $r =& $this->_run('channel-update', array(), array($this->channel));
+ $r = $this->_run('channel-update', array(), array($this->channel));
if (PEAR::isError($r)) {
return $r;
}
function &_doInstallOrUpgrade($command, $package)
{
$true = true;
- $r =& $this->_run($command, array(), array($package));
+ $r = $this->_run($command, array(), array($package));
if (PEAR::isError($r)) {
return $r;
}
if ($state !== null) {
$pkg = "{$pkg}-{$state}";
}
- $r =& $this->_doInstallOrUpgrade('install', $pkg);
+ $r = $this->_doInstallOrUpgrade('install', $pkg);
return $r;
}
// }}}
*/
function &doInstallFromTgz($pkg_file)
{
- $r =& $this->_doInstallOrUpgrade('install', $pkg_file);
+ $r = $this->_doInstallOrUpgrade('install', $pkg_file);
return $r;
}
// }}}
if ($state !== null) {
$pkg = "{$pkg}-{$state}";
}
- $r =& $this->_doInstallOrUpgrade('upgrade', $pkg);
+ $r = $this->_doInstallOrUpgrade('upgrade', $pkg);
return $r;
}
// }}}
*/
function &doUpgradeFromTgz($pkg_file)
{
- $r =& $this->_doInstallOrUpgrade('upgrade', $pkg_file);
+ $r = $this->_doInstallOrUpgrade('upgrade', $pkg_file);
return $r;
}
// }}}
*/
function getVersion($package)
{
- $pobj =& $this->registry->getPackage($package, $this->channel);
+ $pobj = $this->registry->getPackage($package, $this->channel);
return $pobj->getVersion();
}
// }}}
*/
function getState($package)
{
- $pobj =& $this->registry->getPackage($package, $this->channel);
+ $pobj = $this->registry->getPackage($package, $this->channel);
return $pobj->getState();
}
// }}}
if ($this->isInstalled($package) == false) {
return Ethna::raiseNotice("{$this->channel}/{$package} is not installed.");
}
- $r =& $this->_run('uninstall', array(), array("{$this->channel}/{$package}"));
+ $r = $this->_run('uninstall', array(), array("{$this->channel}/{$package}"));
if (PEAR::isError($r)) {
return $r;
}
*/
function &getPackageNameFromTgz($filename)
{
- $config =& PEAR_Config::singleton();
+ $config = PEAR_Config::singleton();
$packagefile = new PEAR_PackageFile($config);
- $info =& $packagefile->fromTgzFile($filename, PEAR_VALIDATE_NORMAL);
+ $info = $packagefile->fromTgzFile($filename, PEAR_VALIDATE_NORMAL);
if (PEAR::isError($info)) {
return $info;
}
if ($this->isInstalled($package) == false) {
return Ethna::raiseNotice("{$this->channel}/{$package} is not installed.");
}
- $pobj =& $this->registry->getPackage($package, $this->channel);
+ $pobj = $this->registry->getPackage($package, $this->channel);
$cname = $pobj->getName();
return $cname;
}
$true = true;
- $cmd =& PEAR_Command::factory($command, $this->config);
+ $cmd = PEAR_Command::factory($command, $this->config);
if (PEAR::isError($cmd)) {
return $cmd;
}
*
* @access public
*/
- public function __construct(&$controller)
+ public function __construct($controller)
{
- $this->controller =& $controller;
- $this->ctl =& $this->controller;
+ $this->controller = $controller;
+ $this->ctl = $this->controller;
$this->template_dir = null;
$this->engine = null;
$this->template = null;
*
* @access public
*/
- function &getEngine()
+ function getEngine()
{
return $this->engine;
}
*
* @access public
*/
- function &getProp($name)
+ function getProp($name)
{
if (isset($this->prop[$name])) {
return $this->prop[$name];
$count = sizeof($keys);
for ($i = 0; $i < $count; $i++) {
- $this->prop[$keys[$i]] =& $array[$keys[$i]];
+ $this->prop[$keys[$i]] = $array[$keys[$i]];
}
}
*/
function setPropByRef($name, &$value)
{
- $this->prop[$name] =& $value;
+ $this->prop[$name] = $value;
}
/**
}
if (strcasecmp($_SERVER['REQUEST_METHOD'], 'post') == 0) {
- $http_vars =& $_POST;
+ $http_vars = $_POST;
} else {
- $http_vars =& $_GET;
+ $http_vars = $_GET;
}
if (array_key_exists($this->session_name, $http_vars)
&& $http_vars[$this->session_name] != null) {
* Ethna_UnitTestCaseのコンストラクタ
*
* @access public
- * @param object Ethna_Controller &$controller コントローラオブジェクト
+ * @param object Ethna_Controller $controller コントローラオブジェクト
*/
- public function __construct(&$controller)
+ public function __construct($controller)
{
parent::__construct();
// オブジェクトの設定
- $this->controller =& $controller;
- $this->ctl =& $this->controller;
- $this->backend =& $this->ctl->getBackend();
- $this->session =& $this->backend->getSession();
+ $this->controller = $controller;
+ $this->ctl = $this->controller;
+ $this->backend = $this->ctl->getBackend();
+ $this->session = $this->backend->getSession();
// 変数の初期化
$this->action_form = $this->af = null;
function _createActionForm($form_name)
{
$this->action_form = new $form_name($this->ctl);
- $this->af =& $this->action_form;
+ $this->af = $this->action_form;
// controler&backendにafを関連付け
$this->ctl->action_name = $this->action_name;
- $this->ctl->action_form =& $this->af;
- $this->backend->action_form =& $this->af;
- $this->backend->af =& $this->af;
+ $this->ctl->action_form = $this->af;
+ $this->backend->action_form = $this->af;
+ $this->backend->af = $this->af;
// action_error, validator の初期化
// これにより、直前のテスト結果をひきずらない
// ようにする
- $ae =& $this->ctl->getActionError();
+ $ae = $this->ctl->getActionError();
$ae->clear();
unset($ae->action_form);
unset($this->ctl->class_factory->object['plugin']->obj_registry["Validator"]);
// オブジェクト生成
$action_class_name = $this->ctl->getActionClassName($this->action_name);
$this->action_class = new $action_class_name($this->backend);
- $this->ac =& $this->action_class;
+ $this->ac = $this->action_class;
// backendにacを関連付け
- $this->backend->action_class =& $this->ac;
- $this->backend->ac =& $this->ac;
+ $this->backend->action_class = $this->ac;
+ $this->backend->ac = $this->ac;
}
/**
// オブジェクト生成
$view_class_name = $this->ctl->getViewClassName($this->forward_name);
$this->view_class = new $view_class_name($this->backend, $this->forward_name, $this->ctl->_getForwardPath($this->forward_name));
- $this->vc =& $this->view_class;
+ $this->vc = $this->view_class;
}
}
}
if (strpos($name, '_') !== false) {
- $instance[$name] = &new $name();
+ $instance[$name] = new $name();
} else {
// get instance with plugin
$ctl = Ethna_Controller::getInstance();
*/
function is_error($name = null)
{
- $c =& Ethna_Controller::getInstance();
- $action_error =& $c->getActionError();
+ $c = Ethna_Controller::getInstance();
+ $action_error = $c->getActionError();
if ($name !== null) {
return $action_error->isError($name);
} else {
*/
public static function purgeTmp($prefix, $timeout)
{
- $c =& Ethna_Controller::getInstance();
+ $c = Ethna_Controller::getInstance();
$dh = opendir($c->getDirectory('tmp'));
if ($dh) {
* @access public
* @param object Ethna_Controller &$controller コントローラオブジェクト
*/
- /*
- function Ethna_Plugin_Csrf(&$controller)
- {
- // オブジェクトの設定
- $this->controller =& $controller;
- $this->ctl =& $this->controller;
-
- $this->config =& $controller->getConfig();
- $this->logger =& $this->controller->getLogger();
- }
- */
-
/**
* トークンをViewとローカルファイルにセットする
*
*/
class Ethna_Plugin_Csrf_Session extends Ethna_Plugin_Csrf
{
- /**#@+
- * @access private
- */
-
- /** @var object Ethna_Session セッションオブジェクト */
- //var $session;
-
- /**#@-*/
-
-
- /**
- * Ethna_Plugin_Csrfのコンストラクタ
- *
- * @access public
- * @param object Ethna_Controller &$controller コントローラオブジェクト
- */
- //function __construct($controller)
- //{
- // parent::__construct($controller);
-
- // // オブジェクトの設定
- // $this->session =& $this->controller->getSession();
- //}
-
/**
* トークンをViewとローカルファイルにセットする
*
*/
class Ethna_Plugin_Filter extends Ethna_Plugin_Abstract
{
- /**#@+
- * @access private
- */
-
- /** @var object Ethna_Controller controllerオブジェクト */
- //var $controller;
-
- /** @var object Ethna_Controller controllerオブジェクト($controllerの省略形) */
- //var $ctl;
-
- /** @var object Ethna_Config 設定オブジェクト */
- //var $config;
-
- /** @var object Ethna_Logger ログオブジェクト */
- //var $logger;
-
- /**#@-*/
-
-
- /**
- * Filterのコンストラクタ
- *
- * @access public
- * @param object Ethna_Controller &$controller コントローラオブジェクト
- */
- /*
- function Ethna_Plugin_Filter(&$controller)
- {
- // オブジェクトの設定
- $this->controller =& $controller;
- $this->ctl =& $this->controller;
-
- $this->config =& $controller->getConfig();
- $this->logger =& $this->controller->getLogger();
- }
- */
-
/**
* 実行前フィルタ
*
*/
class Ethna_Plugin_Generator extends Ethna_Plugin_Abstract
{
- /** @var object Ethna_Controller スケルトン生成に使うコントローラ */
- //var $ctl;
-
- /**
- * コンストラクタ
- *
- * @access public
- */
- /*
- function Ethna_Plugin_Generator(&$controller, $type, $name)
- {
- // Ethna_Generatorでpluginを取得するときに使ったコントローラ
- // ex, add-projectではEthna_Controller, add-actionではApp_Controller
- $this->ctl =& $controller;
- }
- */
-
/**
* スケルトンファイルの絶対パスを解決する
*
*/
function perform()
{
- $r =& $this->_getopt(array('basedir=', 'skelfile='));
+ $r = $this->_getopt(array('basedir=', 'skelfile='));
if (Ethna::isError($r)) {
return $r;
}
if ($action_name == null) {
return Ethna::raiseError('action name isn\'t set.', 'usage');
}
- $r =& Ethna_Controller::checkActionName($action_name);
+ $r = Ethna_Controller::checkActionName($action_name);
if (Ethna::isError($r)) {
return $r;
}
- $ret =& $this->_perform('ActionTest', $action_name, $opt_list);
+ $ret = $this->_perform('ActionTest', $action_name, $opt_list);
return $ret;
}
*/
function _perform($target)
{
- $r =& $this->_getopt(array('basedir='));
+ $r = $this->_getopt(array('basedir='));
if (Ethna::isError($r)) {
return $r;
}
$basedir = getcwd();
}
- $r =& Ethna_Generator::generate($target, $basedir, $table_name);
+ $r = Ethna_Generator::generate($target, $basedir, $table_name);
if (Ethna::isError($r)) {
printf("error occurred while generating skelton. please see also following error message(s)\n\n");
return $r;
*/
function perform()
{
- $r =& $this->_getopt(array('basedir=', 'skelfile=', 'gateway='));
+ $r = $this->_getopt(array('basedir=', 'skelfile=', 'gateway='));
if (Ethna::isError($r)) {
return $r;
}
if ($action_name == null) {
return Ethna::raiseError('action name isn\'t set.', 'usage');
}
- $r =& Ethna_Controller::checkActionName($action_name);
+ $r = Ethna_Controller::checkActionName($action_name);
if (Ethna::isError($r)) {
return $r;
}
// add entry point
- $ret =& $this->_perform('EntryPoint', $action_name, $opt_list);
+ $ret = $this->_perform('EntryPoint', $action_name, $opt_list);
if (Ethna::isError($ret) || $ret === false) {
return $ret;
}
// add action (no effects if already exists.)
- $ret =& $this->_perform('Action', $action_name, $opt_list);
+ $ret = $this->_perform('Action', $action_name, $opt_list);
if (Ethna::isError($ret) || $ret === false) {
return $ret;
}
$baseDir = isset($optlist['basedir']) ? $optlist['basedir'] : getcwd();
$name = $arglist[0];
- $r =& Ethna_Generator::generate(
+ $r = Ethna_Generator::generate(
'Test', $baseDir, $skelfile, $name
);
if (Ethna::isError($r)) {
*/
function perform()
{
- $r =& $this->_getopt(array('basedir=', 'skelfile='));
+ $r = $this->_getopt(array('basedir=', 'skelfile='));
if (Ethna::isError($r)) {
return $r;
}
if ($view_name == null) {
return Ethna::raiseError('view name isn\'t set.', 'usage');
}
- $r =& Ethna_Controller::checkViewName($view_name);
+ $r = Ethna_Controller::checkViewName($view_name);
if (Ethna::isError($r)) {
return $r;
}
- $ret =& $this->_perform('ViewTest', $view_name, $opt_list);
+ $ret = $this->_perform('ViewTest', $view_name, $opt_list);
return $ret;
}
*/
function perform()
{
- $r =& $this->_getopt(array('basedir=',
+ $r = $this->_getopt(array('basedir=',
'any-tmp-files', 'smarty', 'pear', 'cachemanager'));
if (Ethna::isError($r)) {
return $r;
list($args,) = $r;
$basedir = isset($args['basedir']) ? realpath(end($args['basedir'])) : getcwd();
- $controller =& Ethna_Handle::getAppController($basedir);
+ $controller = Ethna_Handle::getAppController($basedir);
if (Ethna::isError($controller)) {
return $controller;
}
if (isset($args['smarty']) || isset($args['any-tmp-files'])) {
echo "cleaning smarty caches, compiled templates...";
- $renderer =& $controller->getRenderer();
+ $renderer = $controller->getRenderer();
if (strtolower(get_class($renderer)) == "ethna_renderer_smarty") {
$renderer->engine->clear_all_cache();
$renderer->engine->clear_compiled_tpl();
*/
function perform()
{
- $r =& $this->_getopt(
+ $r = $this->_getopt(
array(
'basedir=',
'type=',
*/
function perform()
{
- $r =& $this->_getopt();
+ $r = $this->_getopt();
if (Ethna::isError($r)) {
return $r;
}
}
// getHandler
- $handler =& $this->eh->getHandler($handle_name);
+ $handler = $this->eh->getHandler($handle_name);
if (Ethna::isError($handler) || $handler === false) {
// command not found
return Ethna::raiseError('command not found.', 'usage');
*/
function &_parseArgList()
{
- $r =& $this->_getopt(
+ $r = $this->_getopt(
array(
'basedir=',
'workdir=',
require_once 'PEAR/PackageFileManager/File.php';
// 引数の評価
- $args =& $this->_parseArgList();
+ $args = $this->_parseArgList();
if (Ethna::isError($args)) {
return $args;
}
// finally make package
PEAR_Command::setFrontendType('CLI');
- $ui =& PEAR_Command::getFrontendObject();
- $config =& PEAR_Config::singleton();
+ $ui = PEAR_Command::getFrontendObject();
+ $config = PEAR_Config::singleton();
$ui->setConfig($config);
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array(&$ui, 'displayFatalError'));
- $cmd =& PEAR_Command::factory('package', $config);
+ $cmd = PEAR_Command::factory('package', $config);
if (PEAR::isError($cmd)) {
return Ethna::raiseError($cmd->getMessage, $cmd->getCode());
}
}
}
- $c =& Ethna_Controller::getInstance();
+ $c = Ethna_Controller::getInstance();
$basedir = $c->getBasedir();
$function = sprintf("%s.%s", isset($bt[$i]['class']) ? $bt[$i]['class'] : 'global', $bt[$i]['function']);
*/
function smarty_function_csrfid($params, &$smarty)
{
- $c =& Ethna_Controller::getInstance();
+ $c = Ethna_Controller::getInstance();
$name = $c->config->get('csrf');
if (is_null($name)) {
$name = 'Session';
}
- $plugin =& $c->getPlugin();
+ $plugin = $c->getPlugin();
$csrf = $plugin->getPlugin('Csrf', $name);
$csrfid = $csrf->get();
$token_name = $csrf->getName();
}
// view object
- $c =& Ethna_Controller::getInstance();
- $view =& $c->getView();
+ $c = Ethna_Controller::getInstance();
+ $view = $c->getView();
if ($view === null) {
return null;
}
return '';
}
- $c =& Ethna_Controller::getInstance();
- $action_error =& $c->getActionError();
+ $c = Ethna_Controller::getInstance();
+ $action_error = $c->getActionError();
$message = $action_error->getMessage($params['name']);
if ($message === null) {
unset($query[$key]);
}
- $c =& Ethna_Controller::getInstance();
- $config =& $c->getConfig();
- $url_handler =& $c->getUrlHandler();
+ $c = Ethna_Controller::getInstance();
+ $config = $c->getConfig();
+ $url_handler = $c->getUrlHandler();
list($path, $path_key) = $url_handler->actionToRequest($action, $query);
if ($path != "") {
/**#@-*/
/**
- * Urlhandlerクラスのコンストラクタ
- *
- * @access public
- * @param object Ethna_Controller $controller コントローラオブジェクト
- */
- /*
- function Ethna_Plugin_Urlhandler(&$controller)
- {
- $this->backend =& $controller->getBackend();
- $this->logger =& $controller->getLogger();
- }
- */
-
- /**
* アクションをユーザリクエストに変換する
*
* @param string $action
/*
function Ethna_Plugin_Validator(&$controller)
{
- $this->backend =& $controller->getBackend();
- $this->logger =& $controller->getLogger();
- $this->action_form =& $controller->getActionForm();
- $this->af =& $this->action_form;
+ $this->backend = $controller->getBackend();
+ $this->logger = $controller->getLogger();
+ $this->action_form = $controller->getActionForm();
+ $this->af = $this->action_form;
}
*/
* @param string $name 変数名
* @return mixed 変数
*/
- function &getProp($name = null)
+ function getProp($name = null)
{
- $property =& $this->engine->variables[$name];
+ $property = $this->engine->variables[$name];
if ($property !== null) {
return $property;
*
* @access public
*/
- function &getProp($name = null)
+ function getProp($name = null)
{
- $property =& $this->engine->get_template_vars($name);
+ $property = $this->engine->get_template_vars($name);
if ($property !== null) {
return $property;
*/
public function __construct()
{
- $this->controller =& Ethna_Controller::getInstance();
+ $this->controller = Ethna_Controller::getInstance();
}
/**
*/
function &getApp()
{
- $action_form =& $this->controller->getActionForm();
+ $action_form = $this->controller->getActionForm();
return $action_form->app_vars;
}
*/
function getErrorCode()
{
- $action_error =& $this->controller->getActionError();
+ $action_error = $this->controller->getActionError();
if ($action_error->count() == 0) {
return null;
}
// 最初の1つを返す
$error_list = $action_error->getErrorList();
- $error =& $error_list[0];
+ $error = $error_list[0];
return $error->getCode();
}
*/
function getErrorMessage()
{
- $action_error =& $this->controller->getActionError();
+ $action_error = $this->controller->getActionError();
if ($action_error->count() == 0) {
return null;
}
*/
public function __construct()
{
- $this->controller =& Ethna_Controller::getInstance();
- $this->config =& $this->controller->getConfig();
+ $this->controller = Ethna_Controller::getInstance();
+ $this->config = $this->controller->getConfig();
$this->action_error = null;
- $this->ae =& $this->action_error;
+ $this->ae = $this->action_error;
$this->gateway = "";
$this->name = $this->controller->getAppId();
$this->namespace = $this->_getNameSpace();
$entry .= " \$this->dispatch();\n";
- $entry .= " \$app =& \$this->getApp();\n";
+ $entry .= " \$app = \$this->getApp();\n";
$entry .= " \$errorcode = \$this->getErrorCode();\n";
$entry .= " \$errormessage = \$this->getErrorMessage();\n";
$entry .= " \$retval = array();\n";
*/
public function __construct($gateway)
{
- $this->controller =& Ethna_Controller::getInstance();
- $this->config =& $this->controller->getConfig();
+ $this->controller = Ethna_Controller::getInstance();
+ $this->config = $this->controller->getConfig();
$this->action_error = null;
- $this->ae =& $this->action_error;
+ $this->ae = $this->action_error;
$this->wsdl = "";
$this->name = $this->controller->getAppId();
$this->namespace = $this->_getNameSpace();
$keys = array_keys($form->form);
}
foreach ($keys as $key) {
- $type_id =& $form->form[$key]['type'];
+ $type_id = $form->form[$key]['type'];
if (is_array($type_id)) {
$type_keys = array_keys($type_id);
$type = "tns:" . Ethna_SOAP_Util::getArrayTypeName($type_id[$type_keys[0]]);
*/
function preforward()
{
- $ctl =& Ethna_Controller::getInstance();
+ $ctl = Ethna_Controller::getInstance();
$em = new Ethna_InfoManager($this->backend);
// cores
header("Pragma: no-cache");
}
- $ctl =& Ethna_Controller::getInstance();
+ $ctl = Ethna_Controller::getInstance();
// cores
$this->af->setApp('app_id', $ctl->getAppId());
function setUp()
{
- $this->plugin =& $this->ctl->getPlugin();
+ $this->plugin = $this->ctl->getPlugin();
// for PHP 5, it's not enable to create instance of abstract class,
// now this is temporary process.
function test_template_dir_exists()
{
- $ctl =& $this->proj->getController();
+ $ctl = $this->proj->getController();
// default locale
$r = $this->proj->runCmd('add-template', array('test'));
if (Ethna::isError($r)) {
$this->fail($r->getMessage());
}
- $this->mock_ctl =& $this->proj->getController();
+ $this->mock_ctl = $this->proj->getController();
$locale_dir = $this->mock_ctl->getDirectory('locale');
$locale = $this->mock_ctl->getLocale();
$this->msg_file = $locale_dir . '/'