Re: [fw-general] Performance and Example of Enterprice Applications

2010-09-03 Thread info
Thank you very much, friends. I'm sure that i will persuade my boss.
Antonio


> -- i...@antoniocaccese.it  wrote
> (on Friday, 03 September 2010, 03:05 PM +0200):
>> i have a problem. I'm an applications developer (zend framework based)
>> since 2 years. I'm italian.
>>
>> Well. Now i'm working since 2 days in a software house that want to
>> change
>> its mode to approch at software development. The goal of the factory is
>> develop software more manageable and faster, so that every developer can
>> update/upgrade/refactor the code indipendently from who write it.
>>
>> Obviously, i suggested Zend Framework, but the boss stop me because its
>> staff tested Mangento and found it very slow.
>>
>> How i can persuade my boss and the other employes to adopt Zend
>> Framework?
>
> Magento _uses_ *SOME* ZF components, but is not built on ZF's MVC at
> all. As such, it's like comparing a Toyota Matrix to a Pontiac Vibe --
> they both use some of the same parts and have similar outward
> appearance, but they're discrete products, with different engines under
> the hood.
>
>> I'm looking for other application examples, open source or not, that
>> make
>> massive use of Zend Framework (MVC) but i found only old projects, dead
>> cms projects, and application written only for educational purposes.
>>
>> Can you give me a list (at least 4-5) sample of enterprise applications
>> like Magento (it can be cms, wiki, crm, e-commerce, e-learning, and so),
>> if they exists? We want to make a more in-depth analisys of complexity
>> and
>> performances of the framework, based on real applications with a lot of
>> web accesses and large amounts of data.
>
> Unfortunately, many companies don't like to publicize what they have
> built their solutions on. I *can* say that I've heard of sites built
> using Zend Framework by every major US television media company, the
> Library of Congress, several other government sites, and more.
>
> Hopefully we can get some folks to talk about specific projects on this
> thread, however.
>
> --
> Matthew Weier O'Phinney
> Project Lead| matt...@zend.com
> Zend Framework  | http://framework.zend.com/
> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>





[fw-general] Performance and Example of Enterprice Applications

2010-09-03 Thread info
Hi friends,
i have a problem. I'm an applications developer (zend framework based)
since 2 years. I'm italian.

Well. Now i'm working since 2 days in a software house that want to change
its mode to approch at software development. The goal of the factory is
develop software more manageable and faster, so that every developer can
update/upgrade/refactor the code indipendently from who write it.

Obviously, i suggested Zend Framework, but the boss stop me because its
staff tested Mangento and found it very slow.

How i can persuade my boss and the other employes to adopt Zend Framework?

I'm looking for other application examples, open source or not, that make
massive use of Zend Framework (MVC) but i found only old projects, dead
cms projects, and application written only for educational purposes.

Can you give me a list (at least 4-5) sample of enterprise applications
like Magento (it can be cms, wiki, crm, e-commerce, e-learning, and so),
if they exists? We want to make a more in-depth analisys of complexity and
performances of the framework, based on real applications with a lot of
web accesses and large amounts of data.

Thank you very much!
Antonio




[fw-general] .htaccess and Download Route Problem

2010-06-16 Thread info

Hi,
in my application i have a the classic .htaccess file like:

SetEnv APPLICATION_ENV development
RewriteEngine on
RewriteRule  
!\.(js|ico|gif|jpg|jpeg|png|css|txt|rtf|pdf|doc|docx|xls|xlsx|ppt|pptx|mov|mpg|mp3|mp4|mpeg|avi|wmv|wmx|xml)$  
index.php



Then, in the router I added the following routing rule:

$download = new Zend_Controller_Router_Route(
   :language/download/:filename',
  array(
 'module' => 'core',
 'controller' => 'file',
 'action' => 'download'
  ),
  array(
 'language' => '[a-z]{2}'
  )
);

This rule should match Url like these:

/it/download/caccese_4c18db4b97171.pdf
/en/download/another_name_of_a_file.doc

but i get a not found error:

Not Found
The requested URL /it/download/caccese_4c18db4b97171.pdf was not found  
on this server.



There is a way to change htaccess to fix this or there is another solution?



[fw-general] Zend_Controller_Router_Route: Could not find a translator

2010-06-02 Thread info
I am developing a multilanguage application. In the bootstrap there is  
the routes setup:


protected function _initRoutes() {

$this->bootstrap('frontController');
$router = $this->frontController->getRouter();

// PAGES ROUTE
$page = new Zend_Controller_Router_Route(
':language/:ident',
array(
'module' => 'core',
'controller' => 'pagine',
'action' => 'view'
),
array(
'ident' => '[a-zA-Z-_0-9]{3,}',
'language' => '[a-z]{2}'
)
);

$registrazione = new Zend_Controller_Router_Route(
':language/@utenti/@registrati',
array(
'module' => 'core',
'controller' => 'utenti',
'action' => 'registrazione'
),
array(
'language' => '[a-z]{2}'
)
);

$router->addRoute('page', $page);
$router->addRoute('registrazione', $registrazione);

.
}


In the bootstrap, I cannot set the default translator to  
Zend_Controller_Router_Route (for translated segments) because i don't  
know the language parameter in the request object.
I get the language parameter in Multilanguage Plugin during the  
"routeShutdown":


class Activa_Controller_Plugin_Multilanguage extends  
Zend_Controller_Plugin_Abstract {


public function routeShutdown(Zend_Controller_Request_Abstract $request) {
$language = $request->getParam("language");
$locale   = new Zend_Locale($language);

$translate = new Zend_Translate('array',  
APPLICATION_PATH.'/config/lang/'.$language.'.php', $locale);


Zend_Registry::set('Zend_Locale', $locale);
Zend_Registry::set('Zend_Translate', $translate);

Zend_Controller_Router_Route::setDefaultTranslator($translate);

// BUT NOW IS TOO LATE

}

When i type the address "http://servername/it/utenti/registrati"; i get  
the exception with the message "Could not find a translator".


How can i fix it?
Antonio (Italy)


[fw-general] Zend_Navigation question?

2010-04-21 Thread info
Hi, i am using zend-navigation to render my menu but the html template  
i am using has a span inside a like this:



  
 
Home
 
  

  
 
Contact
 
  

   .
   .




Is possible generate this html with Zend_Navigation?


[fw-general] Get View object inside a controller plugin

2010-03-30 Thread info

Hi,
how i can get the view object from a controller plugin?

Now i put Zend_View in the Registry during the bootstrap, but i am  
asking myself if exists a better method.


Antonio


[fw-general] Find Route from a generic URL?

2010-03-10 Thread info

Hi,
i need a way to get the route name and the params from an Url of the  
application.


For example, if i have the following route...

 $page = new Zend_Controller_Router_Route(
 '/:ident',
 array(
   'module'  => 'core',
   'controller' => 'pagine',
   'action' => 'view',
   'language' => 'it'
 ),
 array(
   'ident' => '[a-zA-Z-_0-9]{3,}'
 )
 );
 $router->addRoute('pagina', $page);

...and i have the URL "/contatti" then i would know that the matched  
route is "pagina" and the parameters are ident=contatti and language=it


Is possible ask this directly to the router?

Antonio from Italy



[fw-general] Generate complex html in ViewHelper

2010-03-01 Thread info

Hi, i need to generate complex html in some viewHelpers.
Now i am using heredoc notation but i am looking for a best solution.
Some tips?

Here is an example of a viewHelper i am using:

getIdForEditor();

		$textArea = $this->view->formTextarea('textarea_'.$id_elemento,  
$elemento->testo, array('style' => 'width: 910px;',  
'class'=>'tinymce'));


$html =  <<
$textArea
Salva
Annulla

HTML;
return $html;
}
}



[fw-general] Multilanguage Router

2010-02-17 Thread info

I am looking for a good solution for multilanguage sites.
I found different approaches:

http://www.zendcasts.com/introducing-zend_translate/2009/11/
http://www.m4d3l-network.com/2009/06/29/add-language-route-to-your-zend-framework-project/
http://robertbasic.com/blog/chaining-routes-in-zend-framework/

but i have some problems creating routes for my site.


I would like to use the standard router and my custom routes.
Some example:

Standard router

domain.com/   =>  core/index/index , language=it
domain.com/en   =>  core/index/index , language=en
domain.com/en/core   =>  core/index/index , language=en
domain.com/en/core/about   =>  core/about/index , language=en
*core is the name of default module

Custom routes

domain.com/page-name   =>  core/page/view, language=it, ident=page-name
domain.com/en/another-pagename   =>  core/page/view, language=en,  
ident=another-pagename
* "page-name" and "another-pagename" are unique strings i use to  
retrive pages from DB


domain.com/gallery/album-title   =>  gallery/album/view , language=it,  
ident=album-title
domain.com/en/gallery/another-album-title   =>  gallery/album/view ,  
language=en, ident=album-title


Is there on internet some tutorial or resource to achieve a similar routing?
I hope, someone can help me.

Thank, Antonio







Re: [fw-general] encoding problem in ajax request

2010-02-04 Thread info

My problem is with ajax requests that must return html and not JSON.
So, if i receive a string from POST like "La vita è bella" and save it  
into DB without apply utf8_decode i'll get a string like "La vita ù  
bella".


I'm looking for an automatically method or best practise to deal with it.

Thank you for answer.



Citando Nicolas Grevet :


Yeah, that's what we did.
But it would be great if Zend_Json_Encoder could automate the process.
Auto-encode in the encoder, auto-decode in the decoder. But well,
there's much more important things to do for the moment.

Dmitry Dulepov a écrit :

Hi!

On 4 Feb 2010, at 11:03, Nicolas Grevet wrote:
We have the same problem in french, we're using ISO/IEC 8859-15.   
By the way, I've yet to hear about a way to change string encoding  
 in javascript.


Theoretically you can but practically you can't. PHP expects UTF-8   
in json_decode and json_encode. UTF-8 is a default encoding for   
JSON in all browsers. And MSIE fails if you append "charset" header  
 to content type for JSON. So you are much safer with UTF-8 in json.



Dmitry Dulepov
Twitter: http://twitter.com/dmitryd/
Web: http://dmitry-dulepov.com/









[fw-general] encoding problem in ajax request

2010-02-03 Thread info

Hi,
I am italian and so i use ISO-8859-1 encoding to support accented  
character (à è ì ò ù).


In a controller i use ajaxContext for some actions. In these actions i  
need to apply utf8_decode for all text fields in POST otherwise the  
accented characters become like è à ì ù à in the DB.


How can i fix this? How can i use ajaxContext?

Thanks


[fw-general] Zend_Decorator Mission (im?)possible

2010-01-19 Thread info

I would like to get a similar form:


   
  I'm an error message!
  
 Username:
 

 

 Password:
 

 

 
 

 
  
   




How do i get it with Decorators? I try with the following code but  
something still missing:


 1.  - that wraps all elements inside the form.
 2. I'm an error message! -  
error message.



 'dd')),
'Errors',
array('Label', array('tag' => 'dt'))
 );

 protected $_buttonElementDecorator = array(
'ViewHelper',
array('HtmlTag', array('tag' => 'dd')),
'Label'
 );


public function init() {

$username = new Zend_Form_Element_Text('username');
$username->setFilters(array('StringTrim', 'StringToLower'))
 ->setLabel('Username:')
 ->setRequired(true)
 ->setDecorators($this->_standardElementDecorator)
 ->setAttrib('class', 'txt');

$password = new Zend_Form_Element_Password('password');
$password->setFilters(array('StringTrim'))
 ->setLabel('Password:')
 ->setRequired(true)
 ->setDecorators($this->_standardElementDecorator)
 ->setAttrib('class', 'txt');

$submit = new Zend_Form_Element_Submit('accedi');
$submit->setLabel('Accedi')
   ->setIgnore(true)
   ->setDecorators($this->_buttonElementDecorator)
 ->setAttrib('class', 'button');

$this->addElements(array($username, $password, $submit));

$this->setDecorators(array(
'FormElements',
array('HtmlTag', array('tag' => 'dl')),
array('Description', array('placement' => 'prepend', 
'class' => 'error')),
array('Form', array('class' => 'basic'))
));
}
}