[ruby-it] Help conversione PHP to Ruby
Sandro Paganotti
sandro.paganotti a gmail.com
Ven 26 Dic 2008 23:32:36 CET
Cavoli... allora.. per la classe lunghissima che non hai postato leggo dal
commento
iniziale che è una classe per gestire le Sessioni, da questo (e dal fatto
che è PHP.. potevo
anche arrivarci prima :P ) deduco che tu stia cercando, per il tuo progetto,
di creare
un'applicazione web.
Quindi oltre a Ruby dovresti utilizzare anche un Framework Web (diciamo
Rails).
Per quanto riguarda la classe webui_project_tree in realtà quello che hai
postato
è solo un pezzetto di qualcosa di un 'pò' più grosso (nota, ad esempio che
la classe
eredita da un'altra classe chiamate 'webui' che è nel file webui.class.php)
Comunque, ipotizziamo (come il nome sembra suggerire) che webui sia in
realtà
solo un package per gestire la parte grafica dell'applicazione, a questo
punto potresti
rifare il tutto in ActionView, che è diciamo, la parte di Rails che governa
il layer di
presentazione (la grafica).
In ogni caso.. sai fornirmi un dimensionamento del progetto ? devi per forza
migrare a
Rails ? Sò che esistono alcuni framework web scritti in C++ (
http://www.webtoolkit.eu/wt ad esempio)
che magari potrebbero risparmiarti il task complicato di dover convertire
qualcosa
da un linguaggio che stai imparando ad uno che ancora non padroneggi :D
Spero di esserti stato utile e... in bocca al lupo :D
Sandro
On Fri, Dec 26, 2008 at 9:59 PM, Alessandro Mazzone
<mlafronte5 a hotmail.com>wrote:
> Inizio codice:
>
> <?php
> /**
> * Progetto: ProjectTreeInterface<br>
> * File: webui_project_tree.class.php<br>
> *
> * Descrizione:
> * Gestione dell'interfaccia web per la gestione dell'albero di
> progetto
> *
> * Versione PHP 5.1
> *
> * @category SCOWizard
> * @package ProjectTreeInterface
> * @author Diego Brondo ~@:-] <jbrond a linuxmail.org>
> * @copyright 2007
> * @license http://www.php.net/license/3_01.txt PHP License v3.01
> * @version 0.0.1
> */
>
> if (!defined('__INCLUDE_PATH__'))
> define('__INCLUDE_PATH__', './');
>
> require_once(__INCLUDE_PATH__.'webui.class.php');
>
> class webui_project_tree extends webui {
>
> function __construct() {
> parent::__construct();
> }
>
> function __destruct() {
> parent::__destruct();
> }
>
> private function _generate_project_tree() {
> $node_list = array();
> if (isset($this->_project))
> if (is_array($this->_project))
> for ($i=0,$tot=count($this->_project); $i<$tot; $i++)
> $this->_project[$i]->get_info($node_list);
> // echo '<pre>'; print_r($node_list); echo '</pre>';
> return $node_list;
> }
>
> function webui_project_tree_str() {
> if
>
> (!$this->is_cached('interface'.DIRECTORY_SEPARATOR.'webui_project_tree.tpl',
> $status)) {
> $this->assign('project_tree', $this->_generate_project_tree());
> }
> // return
>
> $this->fetch_template('interface'.DIRECTORY_SEPARATOR.'webui_project_tree.tpl',
> $status, TFALSE, TRUE, -1);
> return
>
> $this->fetch_template('interface'.DIRECTORY_SEPARATOR.'webui_project_tree.tpl',
> $status, TRUE, FALSE, 0);
> }
> }
> // ~@:-]
> ?>
>
> Fine codice
>
> Questa ne è un'altra,ce n'è una lunghissima che non posto se no si
> appesantisce troppo il forum,se vi dico solo il commento iniziale:
> /**
> * Progetto: Session: gestione delle sessioni in PHP<br>
> * File: session.class.php<br>
> *
> * Descrizione:
> * Gestione <em>sontuosa</em> delle sessioni in PHP.
> *
> * Versione PHP 5.1
> *
> * @category Session
> * @package Session
> * @author Diego Brondo ~@:-] <jbrond a linuxmail.org>
> * @copyright 2006
> * @license http://www.php.net/license/3_01.txt PHP License v3.01
> * @version 3.0.1
> *
> * @example session.example.php
> */
> Riuscite a capire se ce n'è una corrispondente in ruby??
>
> Grazie
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Ml mailing list
> Ml a lists.ruby-it.org
> http://lists.ruby-it.org/mailman/listinfo/ml
>
--
http://www.sandropaganotti.com
More information about the Ml
mailing list