Current time: 12-24-2024, 03:04 AM Hello There, Guest! (LoginRegister)


Poll: Do you want to beautify the perl code in the engine?
Yes
No
don't know
[Show Results]
 
Post Reply 
formatting style of the engine parts (perl)
Author Message
mr.x Offline
Development Team
*****
Dev Team

Posts: 232
Joined: Nov 2006
Reputation: 3
Post: #21
RE: formatting style of the engine parts (perl)
Hi,

Quote:I'm actually planning a framework using PEAR and a MVC structure.
If we are talking about a Framework with MVC and Ajax and so on, I like to recommend to use Symfony. I'm very impressed from Symfony. It supports RAD (Rapid Application Development) and would be a good choice.
Symfony supports out-of-the-box Testunit and have some nice Cache algorithms included.

But first of all I think we should wait for the final version 1.0 instead of changing the world .-)

Mr.X
05-12-2008 03:21 AM
Find all posts by this user Quote this message in a reply
Tseng Offline
Junior Member
*

Posts: 21
Joined: Apr 2008
Reputation: 0
Post: #22
RE: formatting style of the engine parts (perl)
mr.x Wrote:Hi,

Quote:I'm actually planning a framework using PEAR and a MVC structure.
If we are talking about a Framework with MVC and Ajax and so on, I like to recommend to use Symfony. I'm very impressed from Symfony. It supports RAD (Rapid Application Development) and would be a good choice.
Symfony supports out-of-the-box Testunit and have some nice Cache algorithms included.

But first of all I think we should wait for the final version 1.0 instead of changing the world .-)

Mr.X

I'm not trying to change the world Tongue I just want to recode the GUI which I will do so or so. I think I''ll just get startet with the main stuff an then post some results to see, that i do not want to reinvent the wheel. And actually I have all "tools" I need with PEAR. Maybe I can post something this evening already. But don't expect to much... just a quick and dirty thing.
05-12-2008 05:10 AM
Find all posts by this user Quote this message in a reply
mr.x Offline
Development Team
*****
Dev Team

Posts: 232
Joined: Nov 2006
Reputation: 3
Post: #23
RE: formatting style of the engine parts (perl)
Hi,

fine. I believe that your work is the first step forward in the right direction for a new GUI.
But from a global perspective it would be fine to use a Framework for further development. May be we should start a new Thread about this.

Mr.X
05-12-2008 06:15 AM
Find all posts by this user Quote this message in a reply
Tseng Offline
Junior Member
*

Posts: 21
Joined: Apr 2008
Reputation: 0
Post: #24
RE: formatting style of the engine parts (perl)
How about the Zend Framework?
05-12-2008 06:50 AM
Find all posts by this user Quote this message in a reply
mr.x Offline
Development Team
*****
Dev Team

Posts: 232
Joined: Nov 2006
Reputation: 3
Post: #25
RE: formatting style of the engine parts (perl)
Hi,

I have tried both. I prefer the Symfony Framework. You are getting fast results and you have a very good documentation. Please take a look into the new php Magazin .-). A CMS in less 1 hour.

Mr.X
05-12-2008 06:59 AM
Find all posts by this user Quote this message in a reply
ergo Offline
Junior Member
*

Posts: 56
Joined: Apr 2008
Reputation: 0
Post: #26
RE: formatting style of the engine parts (perl)
I vote for Zend Framework too - and i would say its better than any other php framework including Symphony. Im not expert on server administration but i have big experience in php developement and i've introduced few projects based on ZF. Another thing that is a plus in case of ZF is that Zend the actuall company behind PHP is supervising the quality of code. Also ZF is faster than Symphony (proven by benchmarks), some big companies like IBM use it.

ZF is BSD licensed so you can freely use it in a GPL project.

"You are getting fast results and you have a very good documentation. Please take a look into the new php Magazin .-). A CMS in less 1 hour."
I can say the same about ZF, but when you compare the classes and possibilities, symfony in its current state is behind already im affraid. And ZF has great docs. Please we are talking about really serious and complex app that needs to work flawlessly, not "1 hour cms", that is not a valid argument imho. Symfony and ZF are probably the best of them all, but i can prove ZF is better, and its not tightly coupled so its a plus.

As a resident on #zftalk i could with some luck convince and bring few more experienced webdevelpers to the project, of course i can help with developement and contribute some code too, altho im rather busy changing my new job to something better.

http://framework.zend.com/

If you guys want to use a Ajax framework, maybe YUI (Yahoo User Library) would be a good choice? Its BSD too, has INSANELY GOOD docs, its quality of widgets is unmatched imho - its fast , has a lot less bugs than dojotoolkit (i know - ive used both), can be served from CDN. ANd it has some widgets that could be very handy for an app like a control panel, like data tables, and tables in YUI are ones of the best of all, jsut compare the docs and examples. THis framework powers YAHOO and is enterprise level.

http://developer.yahoo.com/yui
(This post was last modified: 05-13-2008 07:24 AM by ergo.)
05-13-2008 07:21 AM
Find all posts by this user Quote this message in a reply
RatS Offline
Project Leader
******

Posts: 1,854
Joined: Oct 2006
Reputation: 17
Post: #27
RE: formatting style of the engine parts (perl)
To stop this discussion now I've to tell you something Malte (ephigenie) and me (RatS) thought about a year ago:

When we forked VHCS we made it, because of lazy development and no rights to the community. We had the plan to change it totally and we failed, because we cannot spend time (our freetime) in developing (or better coding and fixing bugs) and organizing this project. Therefore we develop - more or less.

ispCP Omega is a project, planed to be closed in about 5 years and substituted by a totally new control panel: ispCP. However, we need a stable base and patches for Omega to hold a community!
You are talking about frameworks and AJAX. That's great, we've done it, too. And it's planed for ispCP. But this is not the point for ispCP Omega. Omega has to become stable. That's the first aim, we've to reach, with your help.

I hope you'll help us to gain the aim and you have enough stamina to work together with us on ispCP to make it better and more stable than any other existing hosting panel including ispCP Omega.

I appeal to you: do not wast your time in thinking about, how to make developing on ispCP Omega easier. Do not wast your time in recoding or re-factor any line of code
Think about how we can make the existing project stable, fully functional and secure.

Are you with me? Than we can form the team to form the future.

[Edit]

What I've forgotten:

Beautify the PHP- and PERL-Code to make it attractive for others to help us. Think about the guidelines. But do not re-invent the wheel for ispCP Omega
(This post was last modified: 05-13-2008 08:03 AM by RatS.)
05-13-2008 08:02 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ispcomm Offline
Junior Member
*

Posts: 93
Joined: Apr 2008
Reputation: 3
Post: #28
RE: formatting style of the engine parts (perl)
If anybody wants to have a look, there's ticket 1249 with a beautified ispcp-dmn-mngr

rats Wrote:Are you with me? Than we can form the team to form the future.
Still following ;-)

ispcomm.
05-13-2008 10:36 PM
Find all posts by this user Quote this message in a reply
Zothos Offline
Release Manager
*****
Dev Team

Posts: 1,262
Joined: Feb 2007
Reputation: 10
Post: #29
RE: formatting style of the engine parts (perl)
hm not perfect. But a good start Wink


variables should be declared like this.
Code:
<?php
$short            = foo($bar);
$long_variable    = foo($baz);
?>

and arrays:

Code:
$sampleArray = array(
    1, 2, 3, "ispCP",
    $a, $b, $c,
    56.44, $d, 500
);
(This post was last modified: 05-14-2008 01:07 AM by Zothos.)
05-14-2008 01:07 AM
Find all posts by this user Quote this message in a reply
ispcomm Offline
Junior Member
*

Posts: 93
Joined: Apr 2008
Reputation: 3
Post: #30
RE: formatting style of the engine parts (perl)
Let's see. Variables and hashes like this is OK for me:
Code:
my $dmn_name     = @$dmn_data[1];
my $dmn_ip       = @$dmn_data[21];
my $conf_dir     = $main::cfg{'CONF_DIR'};
my $named_db_dir = $main::cfg{'BIND_DB_DIR'};
my $base_svr_ip  = $main::cfg{'BASE_SERVER_IP'};
my $sec_dns_ip   = $main::cfg{'SECONDARY_DNS'};

my %tag_hash = (
    '{DMN_NAME}'          => $dmn_name,
    '{DMN_IP}'            => $dmn_ip,
    '{BASE_SERVER_IP}'    => $base_svr_ip,
    '{SECONDARY_DNS_IP}'  => $sec_dns_ip,
    '{TIMESTAMP}'         => $time2
);
In perl this is acceptable (imho) as it crearly initializes the variables and is readable.
Code:
    my ($entry, $dns2_b, $dns2_e) = ('', '', '');
I'd keep the following structure intact as it shows the templates used and the return values. If I move everything on one line it gets unreadable:
Code:
    ($rs, $entry, $dns2_b, $dns2_e) = get_tpl(
        $tpl_dir,
        'db_e.tpl',
        'db_dns2_b.tpl',
        'db_dns2_e.tpl'
    );
    return $rs if ($rs != 0);
When this type of code becomes bigger, I think it can be written this way:
Code:
    my ($dta_b, $dta_e, $entry_b, $entry_e, $entry) = ('', '', '', '', '');
    (
        $rs,
        $dta_b,
        $dta_e,
        $entry_b,
        $entry_e,
        $entry
    ) = get_tpl(
        $tpl_dir,
        'cfg_dta_b.tpl',
        'cfg_dta_e.tpl',
        'cfg_entry_b.tpl',
        'cfg_entry_e.tpl',
        'cfg_entry.tpl'
    );
Or at maximum this way (which is less readable):
Code:
my ($dta_b, $dta_e, $entry_b, $entry_e, $entry) = ('', '', '', '', '');
(
    $rs,      $dta_b,   $dta_e,
    $entry_b, $entry_e, $entry
) = get_tpl(
    $tpl_dir,
    'cfg_dta_b.tpl',
    'cfg_dta_e.tpl',
    'cfg_entry_b.tpl',
    'cfg_entry_e.tpl',
    'cfg_entry.tpl'
);
I'm using tabs wherever possible. This will allow everybody to set the tab size to their liking (I prefer 3 for example).

Before I go and reformat these 3000+ lines another time, I'd prefer to get your approval first...
05-14-2008 01:40 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)