Re: [fw-general] How to set up dependant dropdowns in form

2008-12-09 Thread Ace Paul

Thank you very much for the reply. I have been looking high and low for a
solution.
I will let you know how I go with this. 
Thanks


Themselves wrote:
> 
> I have spent WAY too much time getting this exact scenario working using
> Zend Dojo forms and an MVC environment, and I plan on building an
> extensive
> article explaining it all soon, but for now, here's the really quick and
> dirty version. I haven't gotten my version perfect yet, I'm still not
> happy
> with the URLs I'm calling to retrieve the data, but that's not a huge
> deal.
> Anyway, on with the show.
> 
> First of all, here's your two form elements.
> 
> $this->addElement('FilteringSelect', 'fk_client_id', array(
> 'label'=> 'Client:',
> 'storeId' => 'clientStore',
> 'storeType'=> 'dojo.data.ItemFileReadStore',
> 'storeParams' => array( 'url' =>
> '/clients/autocomplete/format/ajax?autocomplete=1&str=*',),
> 'autoComplete'   => 'false',
> 'hasDownArrow'   => 'true',
> 'id' => 'fk_client_id',
> ));
> 
> $this->addElement('FilteringSelect', 'fk_client_contact_id',
> array(
> 'label'=> 'Client contact:',
> 'storeId' => 'clientContactStore',
> 'storeType'=> 'dojo.data.ItemFileReadStore',
> 'autoComplete'   => 'false',
> 'hasDownArrow'   => 'true',
> 'id' => 'fk_client_contact_id',
> ));
> 
> Now for the javascript, this has to appear somewhere on the page that
> contains the form.
> 
> dojo.connect(dijit.byId('fk_client_id'), 'onChange', function () {
> dijit.byId('fk_client_contact_id').store = new
> dojo.data.ItemFileReadStore({ url:
> "/clientcontacts/autocomplete/format/ajax?autocomplete=1&fk_client_id=" +
> dijit.byId("fk_client_id").value });
> });
> 
> 
> As for the URLs for the Datastores, they are kind of an exercise for the
> reader, other than to say they obviously should filter correctly on the
> passed parameters, and they have to return JSON. This part was pretty
> annoying, but I eventually found that a function like this returns the
> correct JSON format:
> 
> public function prepareAutoCompletion($data) {
> $items = array();
> foreach ($data as $key => $value) {
> $items[] = array('label' => $value, 'name' => $value, 'key' =>
> $key);
> }
> $final = array(
> 'identifier' => 'key',
> 'items' => $items,
> );
> return $this->encodeJson($final);
> }
> 
> 
> You pass in to the function an array of id => value pairs, and it will
> output the correct JSON for the FilteringSelects. If you use the built in
> AutoCompleteDojo helper, it won't use the id from your table as the value
> that the form submits, which is pretty much useless.
> 
> Oh, and one more trick, for the Edit action, you are going to need to
> include something like this:
> 
> $form->populate($row);
> $form->getElement('fk_client_contact_id')->setStoreParams(array( 'url' =>
> '/clientcontacts/autocomplete/format/ajax?&autocomplete=1&fk_client_id=' .
> $form->getElement('fk_client_id')->getValue() ));
> 
> So that it prepopulates the form correctly.
> 
> I promise I'll write up a really impressive document that spells this
> whole
> thing out in painstaking detail, I'm just absolutely flat out until
> christmas, I haven't had any time!
> 
> 
> On Tue, Dec 9, 2008 at 10:58 AM, Ace Paul <[EMAIL PROTECTED]>
> wrote:
> 
>>
>> I have a form, which I would like to use dependent drop downs in. I can't
>> seem to find anything about it hear, after looking all morning trying to
>> work it out.
>> I have one field "race_country"
>> when an option is selected I would like to show the cities in that
>> country.
>> The following is what I have currently in the form, which will show all
>> countries and all cities.
>> Any help would be great. thanks
>>
>> $table = new Country();
>> foreach ($table->fetchAll() as $c) {
>>$country->addMultiOption($c->country_id, $c->country_name);
>> }
>>  $this->addElement( $country);
>>
>>  $city = new Zend_Form_Element_Select('race_city');
>> $city->setLabel('City')
>> ->setRequired(true);
>>
>> $table = new City();
>> foreach ($table->fetchAll() as $c) {
>>$city->addMultiOption($c->city_id, $c->city_name);
>> }
>>  $this->addElement( $city);
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-set-up-dependant-dropdowns-in-form-tp20907379p20907379.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-set-up-dependant-dropdowns-in-form-tp20907379p20910287.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Test: No default module defined for this application

2008-12-09 Thread Amárandel

Good morning everybody!

I've got a problem which is bothering me for days. I wrote tests and
everything is going fine. But suddenly one test failed with the message
"Zend_Controller_Exception: No default module defined for this application". 

This is the code of my test:

public function testNewAction()
{
$this->dispatch('pppservice/requisition/new');
$request = $this->getRequest();
   $request->setMethod('POST');
$this->view->placeholder('layoutTitle')->set("phpUnit Test Title for
PPPService");
$this->dispatch('pppservice/requisition/new');
$request->setPost( array(
'step' => ''
));
$this->dispatch('pppservice/requisition/new');
$request->setPost( array(
'step' => 'custom'
));
$this->dispatch('pppservice/requisition/new');
}   

I figured out, that this message is only thrown when
$request->setMethod('POST'); is active. But in an other test I only have
written 

public function testCurrentAction()
{
$this->dispatch('pppservice/weekplanner/current');
}

and there is the same error.

I tried to add 
$this->fail(var_export($this->frontController->getControllerDirectory(),
1));  to the failing test and the message I get is:

1) testNewAction(PPPService_RequisitionControllerTest)
array (
  'pppservice' =>
'/home/zeiger/public_html/TrioIntranet/PEP/src/intranet/modules/pppservice/controllers',
  'dashboard' =>
'/home/zeiger/public_html/TrioIntranet/PEP/src/intranet/modules/dashboard/controllers',
)
/home/zeiger/public_html/TrioIntranet/PEP/tests/intranet/modules/pppservice/controllers/RequisitionControllerTest.php:94

I hope someone of you can help me - I think I'm getting crazy sitting day by
day at this problem :/

I don't know if it can help solve the problem, but here is the bootstrap
file and after it there is my testHelper file and the testfile:


index.php


header('content-type: text/html; charset=UTF-8');

set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) .
'/library');

require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();

// start session
Zend_Session::start();

// get the front controller
$front = Zend_Controller_Front::getInstance();

// set up this app as modular one
$front->addModuleDirectory(dirname(__FILE__) . '/intranet/modules');

// FOR DEVELOPMENT ONLY
$front->throwExceptions(true);

// start Zend_Layout
Zend_Layout::startMvc(array(
'layout' => 'default'
  , 'layoutPath' => dirname(__FILE__) . '/intranet/layout/scripts'
));

// fill the registry with some useful data
Zend_Registry::set('mandants', new Zend_Config_Ini(dirname(__FILE__) .
'/intranet/config/application.ini', 'mandants'));

Zend_Registry::set('dbh-maindb',
Zend_Db::factory(new Zend_Config_Ini(dirname(__FILE__) .
'/intranet/config/application.ini', 'maindb-dev')));

Zend_Registry::set('dbh-staffdb',
Zend_Db::factory(new Zend_Config_Ini(dirname(__FILE__) .
'/intranet/config/application.ini', 'staffdb-dev')));

Zend_Registry::set('basePath', dirname($_SERVER['PHP_SELF']));

// pre-configure the table data gateway
Zend_Db_Table_Abstract::setDefaultAdapter('dbh-maindb');

// configure router
$front->getRouter()->addRoute('default',
new Zend_Controller_Router_Route(':module/:controller/:action/*',
array(
'module' => 'dashboard'
  , 'controller' => 'index'
  , 'action' => 'index'
)
));

// now dispatch

try {

$front->dispatch();

} catch(Exception $e) {

throw $e;
## THIS IS ONLY FOR DEVELOPMENT USE!
#echo nl2br( $e->__toString() );

}


testHelper.php


/*
 * Start output buffering
 */
ob_start();

/*
 * Set error reporting to the level to which code must comply.
 */
error_reporting( E_ALL | E_STRICT );

/*
 * Set default timezone
 */
date_default_timezone_set('GMT');

/*
 * Testing environment
 */
define('APPLICATION_ENV', 'testing');

/*
 * Determine the root, library, tests, and models directories
 */
$root= realpath(dirname(__FILE__) . '/../');
$library = $root . '/library';
$tests   = $root . '/tests';
$modules = $root . '/src/intranet/modules/';

/*
 * Prepend the library/, tests/, and models/ directories to the
 * include_path. This allows the tests to run out of the box.
 */
$path = array(
$modules,
$library,
$tests,
get_include_path()
);
set_include_path(implode(PATH_SEPARATOR, $path));

/**
 * Register autoloader
 */
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();

/**
 * Store application root in registry
 */
Zend_Registry::set('testRoot', $root);
Zend_Registry::set('testBootstrap', $root . '/src/index.php');

// get the front controller
$front = Zend_Controller_Front::getInstance();

// set up this app as modular one
$front->addModuleDirectory(dirname(__FILE__) . '/intranet/modules');
$front->setDefaultModule('dashboard');
$front->setControllerDirectory(
array(
'default' =

[fw-general] Zend_File_Transfer proposal, send and receive

2008-12-09 Thread Paweł Chuchmała
Hi.

I don't understand when I should use send() and receive() methods.
I think that send() should send file(s) from place where our application is
to another place.
And receive() should receive file to place where application is.
For example, if I want store at ftp server file from user uploaded by http
post, I do it like that:

$form->file->receive();

$files = new Zend_File_Transfer('FTP', array('user' => 'adam', 'pwd' =>
'sandler', 'server' => 'ftp.myserver.com/public'));
$files->addFiles($form->file->getFileName)
  ->send();

But in examples from proposal we have:
FTP Download:
"The API can also be used for downloads. It will work as wrapper so the user
does not see where the original files is located and ZF will send the file
to the user."
and it use send(). I think it should use receive() to receive file from ftp,
and then send it to user by echoing content or something else, but nod
send() method from FTP adapter.

Kind, regards,
pch

-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


[fw-general] performance of ZF

2008-12-09 Thread valugi

I've read about this performance benchmark and I want to know your opinions.
For most of the people performance is a really important thing. 

http://www.yiiframework.com/performance/
-- 
View this message in context: 
http://www.nabble.com/performance-of-ZF-tp20913061p20913061.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] How to test downwardly compatible Methodes with PHPUnit

2008-12-09 Thread till
On Tue, Dec 9, 2008 at 1:07 AM, Sebastian Hopfe <[EMAIL PROTECTED]> wrote:
> Hi till,
>
> i know that this function is added since a long time. This was only an
> example.
> But how i could write a PHPUnit test - so that i get a CodeCoverage by 100%
> and the test is solved complete?
>
> I mean - the ZF is solicited with a 100% Code Coverage.
>
> How this should work at following issue?
>
> http://framework.zend.com/issues/browse/ZF-5091

I'd (personally) fix it similar to what you proposed.

But personally I could also care less about 5.2.4 and see no benefit
in supporting it, let alone making it a requirement.

Reasons:

a) It's old -- released in August, 2007.
b) 5.2.5 was released as a security update to 5.2.4. ;-) (Point taken,
a lot of distros backported the fixes.)

I know that for RHEL/CentOS, there are unofficial repositories with an
even more current version of PHP.

On Debian there are the unstable and testing branches (most
Debian-people I know recommend unstable even in production). Most
other distros have no issues offering 5.2.4. And in the end, in order
to be able to stick with maintainable software, you could also build
your own RPM/port/deb/whatever.

There's really no reason to stick with an old version of PHP. Unless
you run really, really old software but since we are on a Zend
Framework mailinglist, you can rule that out - sort of. ;-)

Till


Re: [fw-general] How to test downwardly compatible Methodes with PHPUnit

2008-12-09 Thread Ben Scholzen 'DASPRiD'
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

> a) It's old -- released in August, 2007.

Tell that to the IE 6 users :p

...
:  ___   _   ___ ___ ___ _ ___:
: |   \ /_\ / __| _ \ _ (_)   \   :
: | |) / _ \\__ \  _/   / | |) |  :
: |___/_/:\_\___/_| |_|_\_|___/   :
:::
: Web: http://www.dasprids.de :
: E-mail : [EMAIL PROTECTED]   :
: Jabber : [EMAIL PROTECTED] :
: ICQ: 105677955  :
:::
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkk+W88ACgkQ0HfT5Ws789DqLQCgvfpS7MuqlHbhrBvPNq2bLkCn
oB8AoK774m5qsO17Y0MtrPXRBKpLfMeh
=Op/7
-END PGP SIGNATURE-


Re: [fw-general] Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'PluginName' was not found in the registry

2008-12-09 Thread Matthew Weier O'Phinney
-- james.fortune <[EMAIL PROTECTED]> wrote
(on Tuesday, 09 December 2008, 02:18 AM -0800):
> 
> Hi,
> 
> I have a problem that I am really stuck with.
> 
> I have a view helper folder in my library, the path is
> 
> /library/My/helper/
> 
> in my controller class pre dispath function I am adding the path to my view
> using
> 
> $this->view->addHelperPath('My/Helper/', 'My_Helper');

Above, you have "helper", here you have "Helper". Case sensitivity could
very well be the issue...


> Everything works fine in my localhost however when I upload the site to the
> live server I am getting the error message I have shown in the subject.
> 
> Thank you for any help.

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


Re: [fw-general] ZF live settings

2008-12-09 Thread dele454

Any help out there still? I havent being able to resolve it yet!!



dele454 wrote:
> 
> Hi,
> 
> I am trying to move my files over to the remote server but my pages appear
> blank. I have tried everything i know to rectify this from setting my
> include path, config files etc but nothing is working. Checked the apache
> error log file but nothing captured on what am experiencing. not logging
> it.
> 
> I am just attaching all my files here for any help/assistance. Am so tired
> been battling with this since last night and i can't still figure out why
> this is so. Please i will appreciate any help!!! Am on a linux VPS
> platform
> 
> .HTACCESS 
> 
> RewriteEngine on
> RewriteCond %{SCRIPT_FILENAME} !-f
> RewriteCond %{SCRIPT_FILENAME} !-d
> RewriteRule ^(.*)$ index.php/$1
> 
> ExpiresActive On
> ExpiresByType image/gif A0
> ExpiresByType image/png A0
> ExpiresByType image/jpg A0 
> 
> 
> index.php on public_html folder:
> 
> require_once 'Bootstrap.php';
> Bootstrap::run();
> 
> 
> BOOTSTRAP:
> 
> require_once 'Zend/Loader.php';
> require_once 'Zend/Session.php';
> 
> 
> class Bootstrap{
> 
> public static $front = null;
>
> public static function run()
> {
> try {
>   self::setupEnvironment();
>   self::prepare();
>   $response = self::$front->dispatch();
>   self::sendResponse($response);
>   self::$front->dispatch();
>   } catch(Exception $e) {
> 
>
> }
> }
>
> public static function setupEnvironment()
> {
> error_reporting(E_ALL|E_STRICT);
> ini_set('display_errors', true);// should be set to false after
> deployment
> date_default_timezone_set('Africa/Johannesburg');
> }
>
> public static function prepare()
> {
> self::setupController();
> self::setupView();
> }
>
> public static function setupController()
> {
>
>   // load the Zend Components
>   Zend_Loader::registerAutoload();
>   
>   //add the setting declared in settings.ini
>   $config = new Zend_Config_Ini('config/settings.ini', 
> 'development');
> Zend_Registry::set('config', $config);
>   
> //create an instance of the front controller 
>   self::$front = Zend_Controller_Front::getInstance();
> self::$front->throwExceptions(true);
> self::$front->returnResponse(true);
>   
>   
>   // Set the default controller directory:
>   self::$front->setControllerDirectory(array('default' =>
> $config->paths->data . '/controllers', 
>   
>'admin'   => $config->paths->data .
> '/modules/admin/controllers'));   
>   Zend_Layout::startMvc(array('layoutPath' => 
> $config->paths->data .
> '/views/layouts'));
>   
>   
>   // setup database connection variables
>   $params = array(
>   'host' => $config->database->hostname,
>   'username' => $config->database->username,
>   'password' => $config->database->password,
>   'dbname'   => $config->database->database);
>   
>   $db = Zend_Db::factory($config->database->type, $params);
>   Zend_Db_Table_Abstract::setDefaultAdapter($db);
>   Zend_Registry::set('db', $db);
>   
>   
> 
>   
> }
>
> public static function setupView()
> {
> $view = new Zend_View;
>   
>   
> $view->setEncoding('UTF-8');
> $viewRenderer = new
> Zend_Controller_Action_Helper_ViewRenderer($view);
> Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
> }
>
> public static function sendResponse(Zend_Controller_Response_Http
> $response)
> {
> 
>   $response->setHeader('Content-Type', 'text/html; 
> charset=UTF-8', true);
> $response->sendResponse();
> }
>   
>   
> 
> }
> 
> 
> FOLDER STRUCTURE:
>  http://www.nabble.com/file/p20911516/Untitled-1.jpg 
> 
> 
> SETTINGS.INI file:
> 
> [development]
> 
> database.type  = pdo_mysql
> database.hostname   = mydomain.co.za
> database.username   = mydb007
> database.password   = mypass
> database.database   = mydb
> 
> paths.data  = /usr/local/lib/apps
> paths.modules.admin = /usr/local/lib/apps/modules/admin
> 
> 
> PHP>INI file(includes):
> 
> ; UNIX: "/path1:/path2"  
> include_path =
> 

[fw-general] ZF live settings

2008-12-09 Thread dele454

Hi,

I am trying to move my files over to the remote server but my pages appear
blank. I have tried everything i know to rectify this from setting my
include path, config files etc but nothing is working. Checked the apache
error log file but nothing captured on what am experiencing. not logging it.

I am just attaching all my files here for any help/assistance. Am so tired
been battling with this since last night and i can't still figure out why
this is so. Please i will appreciate any help!!! Am on a linux VPS platform

.HTACCESS 

RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1

ExpiresActive On
ExpiresByType image/gif A0
ExpiresByType image/png A0
ExpiresByType image/jpg A0 


index.php on public_html folder:

require_once 'Bootstrap.php';
Bootstrap::run();


BOOTSTRAP:

require_once 'Zend/Loader.php';
require_once 'Zend/Session.php';


class Bootstrap{

public static $front = null;
   
public static function run()
{
try {
self::setupEnvironment();
self::prepare();
$response = self::$front->dispatch();
self::sendResponse($response);
self::$front->dispatch();
} catch(Exception $e) {
  
 
  }
}
   
public static function setupEnvironment()
{
error_reporting(E_ALL|E_STRICT);
ini_set('display_errors', true);// should be set to false after
deployment
date_default_timezone_set('Africa/Johannesburg');
}
   
public static function prepare()
{
self::setupController();
self::setupView();
}
   
public static function setupController()
{
   
// load the Zend Components
Zend_Loader::registerAutoload();

//add the setting declared in settings.ini
$config = new Zend_Config_Ini('config/settings.ini', 
'development');
Zend_Registry::set('config', $config);

//create an instance of the front controller 
self::$front = Zend_Controller_Front::getInstance();
self::$front->throwExceptions(true);
self::$front->returnResponse(true);


// Set the default controller directory:
self::$front->setControllerDirectory(array('default' =>
$config->paths->data . '/controllers', 

   'admin'   => $config->paths->data .
'/modules/admin/controllers')); 
Zend_Layout::startMvc(array('layoutPath' => 
$config->paths->data .
'/views/layouts'));


// setup database connection variables
$params = array(
'host' => $config->database->hostname,
'username' => $config->database->username,
'password' => $config->database->password,
'dbname'   => $config->database->database);

$db = Zend_Db::factory($config->database->type, $params);
Zend_Db_Table_Abstract::setDefaultAdapter($db);
Zend_Registry::set('db', $db);




}
   
public static function setupView()
{
$view = new Zend_View;


$view->setEncoding('UTF-8');
$viewRenderer = new
Zend_Controller_Action_Helper_ViewRenderer($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
}
   
public static function sendResponse(Zend_Controller_Response_Http
$response)
{

$response->setHeader('Content-Type', 'text/html; 
charset=UTF-8', true);
$response->sendResponse();
}



}


FOLDER STRUCTURE:
http://www.nabble.com/file/p20911516/Untitled-1.jpg 


SETTINGS.INI file:

[development]

database.type  = pdo_mysql
database.hostname   = mydomain.co.za
database.username   = mydb007
database.password   = mypass
database.database   = mydb

paths.data  = /usr/local/lib/apps
paths.modules.admin = /usr/local/lib/apps/modules/admin


PHP>INI file(includes):

; UNIX: "/path1:/path2"  
include_path =
".:/usr/lib/php:/usr/local/lib/php:/usr/local/lib/apps:/usr/local/lib/apps/lib:/usr/local/lib/apps/models"

-
dee
-- 
View this message in context: 
http://www.nabble.com/ZF-live-settings-tp20911516p20911516.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] How to test downwardly compatible Methodes with PHPUnit

2008-12-09 Thread Matthew Weier O'Phinney
-- till <[EMAIL PROTECTED]> wrote
(on Tuesday, 09 December 2008, 12:49 PM +0100):
> On Tue, Dec 9, 2008 at 1:07 AM, Sebastian Hopfe <[EMAIL PROTECTED]> wrote:
> > Hi till,
> >
> > i know that this function is added since a long time. This was only an
> > example.
> > But how i could write a PHPUnit test - so that i get a CodeCoverage by 100%
> > and the test is solved complete?
> >
> > I mean - the ZF is solicited with a 100% Code Coverage.
> >
> > How this should work at following issue?
> >
> > http://framework.zend.com/issues/browse/ZF-5091
> 
> I'd (personally) fix it similar to what you proposed.
> 
> But personally I could also care less about 5.2.4 and see no benefit
> in supporting it, let alone making it a requirement.
> 
> Reasons:
> 
> a) It's old -- released in August, 2007.
> b) 5.2.5 was released as a security update to 5.2.4. ;-) (Point taken,
> a lot of distros backported the fixes.)

We have always recommended using the latest stable PHP release. What
we're doing here is specifying the *minimum* PHP version we will
support. The rationale behind the decision for 5.2.4 was based on what
PHP version is shipped with the linux distributions with greatest market
penetration. 5.2.4 is a common baseline, with a few outliers on either
other end (some using 5.2.6, others with earlier versions). 


> I know that for RHEL/CentOS, there are unofficial repositories with an
> even more current version of PHP.

Understood. However, for users on managed hosting systems, or with RH
contracts, usage of unofficial repos will violate terms of service.
However, that said, we still upped the minimum supported version. I
personally don't feel that advances in PHP should be held hostage by
distribution vendors. :)

> On Debian there are the unstable and testing branches (most
> Debian-people I know recommend unstable even in production). 

You must know different Debian sysadmins than I do.

> Most other distros have no issues offering 5.2.4. And in the end, in
> order to be able to stick with maintainable software, you could also
> build your own RPM/port/deb/whatever.
> 
> There's really no reason to stick with an old version of PHP. Unless
> you run really, really old software but since we are on a Zend
> Framework mailinglist, you can rule that out - sort of. ;-)

I agree with this in principle. Again, however, we're talking the
minimum *supported* version. We cannot simply specify "current stable"
as the minimum version, as most institutions will upgrade their server
stack much less frequently than their application stack.

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


RE: [fw-general] ZF live settings

2008-12-09 Thread Robert Castley
Your .htaccess file doesn't look right to me.

Have you tried this?

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

 

-Original Message-
From: dele454 [mailto:[EMAIL PROTECTED] 
Sent: 09 December 2008 12:33
To: fw-general@lists.zend.com
Subject: Re: [fw-general] ZF live settings


Any help out there still? I havent being able to resolve it yet!!



dele454 wrote:
> 
> Hi,
> 
> I am trying to move my files over to the remote server but my pages 
> appear blank. I have tried everything i know to rectify this from 
> setting my include path, config files etc but nothing is working. 
> Checked the apache error log file but nothing captured on what am 
> experiencing. not logging it.
> 
> I am just attaching all my files here for any help/assistance. Am so 
> tired been battling with this since last night and i can't still 
> figure out why this is so. Please i will appreciate any help!!! Am on 
> a linux VPS platform
> 
> .HTACCESS
> 
> RewriteEngine on
> RewriteCond %{SCRIPT_FILENAME} !-f
> RewriteCond %{SCRIPT_FILENAME} !-d
> RewriteRule ^(.*)$ index.php/$1
> 
> ExpiresActive On
> ExpiresByType image/gif A0
> ExpiresByType image/png A0
> ExpiresByType image/jpg A0
> 
> 
> index.php on public_html folder:
> 
> require_once 'Bootstrap.php';
> Bootstrap::run();
> 
> 
> BOOTSTRAP:
> 
> require_once 'Zend/Loader.php';
> require_once 'Zend/Session.php';
> 
> 
> class Bootstrap{
> 
> public static $front = null;
>
> public static function run()
> {
> try {
>   self::setupEnvironment();
>   self::prepare();
>   $response = self::$front->dispatch();
>   self::sendResponse($response);
>   self::$front->dispatch();
>   } catch(Exception $e) {
> 
>
> }
> }
>
> public static function setupEnvironment()
> {
> error_reporting(E_ALL|E_STRICT);
> ini_set('display_errors', true);// should be set to false 
> after deployment
> date_default_timezone_set('Africa/Johannesburg');
> }
>
> public static function prepare()
> {
> self::setupController();
> self::setupView();
> }
>
> public static function setupController()
> {
>
>   // load the Zend Components
>   Zend_Loader::registerAutoload();
>   
>   //add the setting declared in settings.ini
>   $config = new Zend_Config_Ini('config/settings.ini',
'development');
> Zend_Registry::set('config', $config);
>   
> //create an instance of the front controller 
>   self::$front = Zend_Controller_Front::getInstance();
> self::$front->throwExceptions(true);
> self::$front->returnResponse(true);
>   
>   
>   // Set the default controller directory:
>   self::$front->setControllerDirectory(array('default' => 
> $config->paths->data . '/controllers',
>
'admin'   => $config->paths->data .
> '/modules/admin/controllers'));   
>   Zend_Layout::startMvc(array('layoutPath' =>
$config->paths->data .
> '/views/layouts'));
>   
>   
>   // setup database connection variables
>   $params = array(
>   'host' => $config->database->hostname,
>   'username' => $config->database->username,
>   'password' => $config->database->password,
>   'dbname'   => $config->database->database);
>   
>   $db = Zend_Db::factory($config->database->type, $params);
>   Zend_Db_Table_Abstract::setDefaultAdapter($db);
>   Zend_Registry::set('db', $db);
>   
>   
> 
>   
> }
>
> public static function setupView()
> {
> $view = new Zend_View;
>   
>   
> $view->setEncoding('UTF-8');
> $viewRenderer = new
> Zend_Controller_Action_Helper_ViewRenderer($view);
> Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
> }
>
> public static function sendResponse(Zend_Controller_Response_Http
> $response)
> {
> 
>   $response->setHeader('Content-Type', 'text/html;
charset=UTF-8', true);
> $response->sendResponse();
> }
>   
>   
> 
> }
> 
> 
> FOLDER STRUCTURE:
>  http://www.nabble.com/file/p20911516/Untitled-1.jpg
> 
> 
> SETTINGS.INI file:
> 
> [development]
> 
> database.type

[fw-general] Basic steps to create custom url usinig custom routes?

2008-12-09 Thread Neriodavid(Wei Dai)
Hi,
   I have an old project which built on ZF 1.5; at the time I didn't dig
into the custom routes too deep, just use the default configuration.
   Right now, the client ask for changing some urls to the way he want; the
urls may contain French. I knew the custom routes can probably do it. Since
in the past few months, I am studying on the eZ Publish Framework and eZ
Components, so havn't use ZF for a while. I wonder if somebody can give me
some simple instructions to configure the custom routes, without change the
existing module, controller and action names.


  Thanks very much!

David.


Re: [fw-general] How to test downwardly compatible Methodes with PHPUnit

2008-12-09 Thread till
On Tue, Dec 9, 2008 at 2:24 PM, Matthew Weier O'Phinney
<[EMAIL PROTECTED]> wrote:
> -- till <[EMAIL PROTECTED]> wrote
> (on Tuesday, 09 December 2008, 12:49 PM +0100):
>> I know that for RHEL/CentOS, there are unofficial repositories with an
>> even more current version of PHP.
>
> Understood. However, for users on managed hosting systems, or with RH
> contracts, usage of unofficial repos will violate terms of service.
> However, that said, we still upped the minimum supported version. I
> personally don't feel that advances in PHP should be held hostage by
> distribution vendors. :)

I'm not really in that situation, but I think that if you're paying
for it, shouldn't you be in a position to request updates? Otherwise
you're wasting budget on something that doesn't seem worth the money.
;-)

>> Most other distros have no issues offering 5.2.4. And in the end, in
>> order to be able to stick with maintainable software, you could also
>> build your own RPM/port/deb/whatever.
>>
>> There's really no reason to stick with an old version of PHP. Unless
>> you run really, really old software but since we are on a Zend
>> Framework mailinglist, you can rule that out - sort of. ;-)
>
> I agree with this in principle. Again, however, we're talking the
> minimum *supported* version. We cannot simply specify "current stable"
> as the minimum version, as most institutions will upgrade their server
> stack much less frequently than their application stack.

If the minimum supported version is such a concern, then why is the
version raised because of the test suite? Correct me if I'm wrong, but
last time I checked I didn't build my application to run on the test
suite, but I build my application to run on the framework code.

Point taken, they are tied together and I also see that QA depends on it.

So if the minimum version is really [your] (or Zend's) concern, then
the process makes no sense. The minimum required should be 5.2.1
(because of Zend_File). Features required by the test suite should be
backported in the testsuite, in userland.

Till


Re: [fw-general] Routing: actions as first element of path

2008-12-09 Thread jkendall


rutt wrote:
> 
> Basically, if the first element of the path is a valid controller, then
> the request should be dispatched to that controller.  If not, it should be
> dispatched to RootController.  
> 

Not sure if this will get you where you want to go, but my first thought was
setting up a plugin to test whether or not a request was dispatchable, and
setting the controller to 'root' if it isn't dispatchable.

class My_Controller_Plugin_Example extends Zend_Controller_Plugin_Abstract {
  
  public function preDispatch(Zend_Controller_Request_Abstract $request) {

$frontController = Zend_Controller_Front::getInstance();
$isDispatchable  =
$frontController->getDispatcher()->isDispatchable($request);

if (!$isDispatchable) {
  $controller = 'root';
  $request->setControllerName($controller);
}

  }
}


-
Jeremy Kendall --  http://www.jeremykendall.net http://www.jeremykendall.net 
-- 
View this message in context: 
http://www.nabble.com/Routing%3A-actions-as-first-element-of-path-tp20908784p20913704.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] How to test downwardly compatible Methodes with PHPUnit

2008-12-09 Thread till
On Tue, Dec 9, 2008 at 12:51 PM, Ben Scholzen 'DASPRiD'
<[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>> a) It's old -- released in August, 2007.
>
> Tell that to the IE 6 users :p

=) Point well taken! But I'm also not a network administrator running
Windows. ;-)

My point was, when you're building an application now, there is no
good reason to build it on a PHP version from 2007. Especially because
more recent versions of PHP are available in the major distributions.

I can already see 2009 from here. ;-)

Till


Re: [fw-general] Zend_File_Transfer proposal, send and receive

2008-12-09 Thread Thomas Weidner

There are always 2 directions.
Upload and Download.

Upload means that the server receives a file from a foreign destination. 
Therefor the method is called receive.
Download means that the server sends a file to a foreign destination. 
Therefor the method is called send.


When you don't want to send a file to the client you can still echo it 
(display), but this is no download.
Zend_File_Transfer does only handle file transfer and not file displaying 
needs.


Beside that the FTP adapter is not coded for now so there is no need to 
hassle about it. :-)


Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

- Original Message - 
From: "Paweł Chuchmała" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, December 09, 2008 10:43 AM
Subject: [fw-general] Zend_File_Transfer proposal, send and receive



Hi.

I don't understand when I should use send() and receive() methods.
I think that send() should send file(s) from place where our application 
is

to another place.
And receive() should receive file to place where application is.
For example, if I want store at ftp server file from user uploaded by http
post, I do it like that:

$form->file->receive();

$files = new Zend_File_Transfer('FTP', array('user' => 'adam', 'pwd' =>
'sandler', 'server' => 'ftp.myserver.com/public'));
$files->addFiles($form->file->getFileName)
 ->send();

But in examples from proposal we have:
FTP Download:
"The API can also be used for downloads. It will work as wrapper so the 
user

does not see where the original files is located and ZF will send the file
to the user."
and it use send(). I think it should use receive() to receive file from 
ftp,

and then send it to user by echoing content or something else, but nod
send() method from FTP adapter.

Kind, regards,
pch

--
Paweł Chuchmała
pawel.chuchmala at gmail dot com





Re: [fw-general] performance of ZF

2008-12-09 Thread Matthew Weier O'Phinney
-- valugi <[EMAIL PROTECTED]> wrote
(on Tuesday, 09 December 2008, 03:40 AM -0800):
> 
> I've read about this performance benchmark and I want to know your opinions.
> For most of the people performance is a really important thing. 
> 
> http://www.yiiframework.com/performance/

Old news; search the archives.

Basically, the methodology is suspect, and the ZF app that was used was
really poorly conceived. Since then, we've also done some performance
profiling and benchmarking of our own, made a few improvements, and
released the beginning of a performance appendix to the manual.

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


Re: [fw-general] performance of ZF

2008-12-09 Thread till
On Tue, Dec 9, 2008 at 12:40 PM, valugi <[EMAIL PROTECTED]> wrote:
>
> I've read about this performance benchmark and I want to know your opinions.
> For most of the people performance is a really important thing.
>
> http://www.yiiframework.com/performance/

The yii benchmark has been discussed extensively:
http://www.nabble.com/Framework-speed-shotoutquestion-td19914787.html

I've also blogged about performance improvements:
http://till.vox.com/library/post/zendframework-performance.html
http://till.vox.com/library/post/zendframework-performance-ii.html

Recently, a performance guide has been added to the manual as well:
http://framework.zend.com/manual/en/performance.html

Cheers,
Till


Re: [fw-general] generic view for Json contextSwitch

2008-12-09 Thread Ralikwen

Yep, since I couldn't find a good context based solution I do that. Still I
think its a pity - context is a good concept, but without the ability to
specify a generic view its less useful to me.



DASPRiD wrote:
> 
> 
> When you just want to send JSON, and not render a view, why don't you
> simply use $this->_helper->json(); ?
> 
> 

-- 
View this message in context: 
http://www.nabble.com/generic-view-for-Json-contextSwitch-tp20631627p20912496.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'PluginName' was not found in the registry

2008-12-09 Thread james.fortune

Hi,

I have a problem that I am really stuck with.

I have a view helper folder in my library, the path is

/library/My/helper/

in my controller class pre dispath function I am adding the path to my view
using

$this->view->addHelperPath('My/Helper/', 'My_Helper');

Everything works fine in my localhost however when I upload the site to the
live server I am getting the error message I have shown in the subject.

Thank you for any help.

Regards

John

-- 
View this message in context: 
http://www.nabble.com/Zend_Loader_PluginLoader_Exception%27-with-message-%27Plugin-by-name-%27PluginName%27-was-not-found-in-the-registry-tp20911986p20911986.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] No Dojo grid view helper

2008-12-09 Thread Guillaume Oriol

AFAIK, there is no View Helper for dojox.grid.Grid.
Is there such a class incubating at this time?

If not what would be the starting point to create it?
Create My_Dojo_View_Helper_Grid and extends what class (Dijit)?
What existing class could I use as a model?

Thanks

-
Guillaume ORIOL
Sofware architect
Technema
-- 
View this message in context: 
http://www.nabble.com/No-Dojo-grid-view-helper-tp20915645p20915645.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] How to test downwardly compatible Methodes with PHPUnit

2008-12-09 Thread Matthew Weier O'Phinney
-- till <[EMAIL PROTECTED]> wrote
(on Tuesday, 09 December 2008, 02:50 PM +0100):
> On Tue, Dec 9, 2008 at 2:24 PM, Matthew Weier O'Phinney
> <[EMAIL PROTECTED]> wrote:
> > -- till <[EMAIL PROTECTED]> wrote
> > (on Tuesday, 09 December 2008, 12:49 PM +0100):
> >> I know that for RHEL/CentOS, there are unofficial repositories with an
> >> even more current version of PHP.
> >
> > Understood. However, for users on managed hosting systems, or with RH
> > contracts, usage of unofficial repos will violate terms of service.
> > However, that said, we still upped the minimum supported version. I
> > personally don't feel that advances in PHP should be held hostage by
> > distribution vendors. :)
> 
> I'm not really in that situation, but I think that if you're paying
> for it, shouldn't you be in a position to request updates? Otherwise
> you're wasting budget on something that doesn't seem worth the money.
> ;-)
> 
> >> Most other distros have no issues offering 5.2.4. And in the end, in
> >> order to be able to stick with maintainable software, you could also
> >> build your own RPM/port/deb/whatever.
> >>
> >> There's really no reason to stick with an old version of PHP. Unless
> >> you run really, really old software but since we are on a Zend
> >> Framework mailinglist, you can rule that out - sort of. ;-)
> >
> > I agree with this in principle. Again, however, we're talking the
> > minimum *supported* version. We cannot simply specify "current stable"
> > as the minimum version, as most institutions will upgrade their server
> > stack much less frequently than their application stack.
> 
> If the minimum supported version is such a concern, then why is the
> version raised because of the test suite? Correct me if I'm wrong, but
> last time I checked I didn't build my application to run on the test
> suite, but I build my application to run on the framework code.
> 
> Point taken, they are tied together and I also see that QA depends on it.

> So if the minimum version is really [your] (or Zend's) concern, then
> the process makes no sense. The minimum required should be 5.2.1
> (because of Zend_File). Features required by the test suite should be
> backported in the testsuite, in userland.

The test suite is the tip of the iceberg; there are features we've
either not implemented or implemented sub-optimally because we were
unable to utilize PHP 5.2.X only features (some features of Reflection
come to mind in particular). This was a good time to up the minimum
version; it made testing simpler in several places, and provides a path
for us to start taking advantage of newer features prior to tackling
5.3.0 features. And it also made sense to up the version to something
more recent than 5.2.1, to encourage users to begin upgrading to newer
versions of PHP.

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


Re: [fw-general] No Dojo grid view helper

2008-12-09 Thread Matthew Weier O'Phinney
-- Guillaume Oriol <[EMAIL PROTECTED]> wrote
(on Tuesday, 09 December 2008, 06:27 AM -0800):
> AFAIK, there is no View Helper for dojox.grid.Grid.
> Is there such a class incubating at this time?
> 
> If not what would be the starting point to create it?
> Create My_Dojo_View_Helper_Grid and extends what class (Dijit)?
> What existing class could I use as a model?

Roy from the Studio team and I will be working on such a component for
1.8. Currently, It's relatively easy to accomplish -- create your grid
markup, tie it to a data store that point to a ZF controller action.
In that action pull from your model, and push the results into a
Zend_Dojo_Data object and echo it.

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


[fw-general] ignore case sensitivity for urls

2008-12-09 Thread Jan Pieper
Hi guys,

today we thought about how to ignore case sensitivity for urls to allow ~/Foo 
and ~/foo to load "Foo"-module. We tried to overwrite all methods that returns 
uppercase module name to allow ignoring case sensitivity but now we need to 
extend Zend_Controller_Front and it is very complex because it is a singleton 
and without late static binding I think we won´t get happy with overwriting it.

There is already a jira ticket but the reporter modified the zend framework 
code:
http://framework.zend.com/issues/browse/ZF-4119

So, is there a chance to disable case sensitive module names?

-- Jan
-- 
Sensationsangebot verlängert: GMX FreeDSL - Telefonanschluss + DSL 
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a


Re: [fw-general] Zend_File_Transfer proposal, send and receive

2008-12-09 Thread Paweł Chuchmała
I have questions ho implement some methods.

I want to send file to MogileFs system. I write adapter for it. Scnario is:

1. receive file via user form (http_adapter::receive())
2. add file to my adapter: $file->addFile($form->file->getFileName());
3. add filters: $file->addFilter('Rename', '/something\c:\veryStrange/');
4. send it to MogileFs: $file->send().

I write send() method and first question: should I apply filters before
send?
Another problem. File in MogileFS are stored in flat structure. There are'nt
directories, filenames, etc. I can't use
method Zend_File_Transfer_Adapter_Abstract::_filter(), because it use
dirname() and filename() to choose destination and name.
I cant use Zend_Filter_File_Rename, cause it work on files in system. If I
receive file it's ok. But if I want send it somewhere,
I want to change only array that describe my file.

Filenames (for true I should say 'virtual filenames') in MogileFs nad Amazon
S3 can be like point 3. above, so if I want send file to them, shouldn't be
validated as file for store in 'traditional' file systems.

How I can do this, in Zend Framework convention?

regards,
pch



2008/12/9 Thomas Weidner <[EMAIL PROTECTED]>

> There are always 2 directions.
> Upload and Download.
>
> Upload means that the server receives a file from a foreign destination.
> Therefor the method is called receive.
> Download means that the server sends a file to a foreign destination.
> Therefor the method is called send.
>
> When you don't want to send a file to the client you can still echo it
> (display), but this is no download.
> Zend_File_Transfer does only handle file transfer and not file displaying
> needs.
>
> Beside that the FTP adapter is not coded for now so there is no need to
> hassle about it. :-)
>
> Greetings
> Thomas Weidner, I18N Team Leader, Zend Framework
> http://www.thomasweidner.com
>
> - Original Message - From: "Paweł Chuchmała" <
> [EMAIL PROTECTED]>
> To: 
> Sent: Tuesday, December 09, 2008 10:43 AM
> Subject: [fw-general] Zend_File_Transfer proposal, send and receive
>
>
>
>  Hi.
>>
>> I don't understand when I should use send() and receive() methods.
>> I think that send() should send file(s) from place where our application
>> is
>> to another place.
>> And receive() should receive file to place where application is.
>> For example, if I want store at ftp server file from user uploaded by http
>> post, I do it like that:
>>
>> $form->file->receive();
>>
>> $files = new Zend_File_Transfer('FTP', array('user' => 'adam', 'pwd' =>
>> 'sandler', 'server' => 
>> 'ftp.myserver.com/public')
>> );
>> $files->addFiles($form->file->getFileName)
>>  ->send();
>>
>> But in examples from proposal we have:
>> FTP Download:
>> "The API can also be used for downloads. It will work as wrapper so the
>> user
>> does not see where the original files is located and ZF will send the file
>> to the user."
>> and it use send(). I think it should use receive() to receive file from
>> ftp,
>> and then send it to user by echoing content or something else, but nod
>> send() method from FTP adapter.
>>
>> Kind, regards,
>> pch
>>
>> --
>> Paweł Chuchmała
>> pawel.chuchmala at gmail dot com
>>
>>
>


-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


Re: [fw-general] Zend_File_Transfer proposal, send and receive

2008-12-09 Thread Thomas Weidner

Pawel,

I don't get the point.

You said that the user uploads the file via HTTP to the server.
So it's stored on the server as real file.

Then you said that you can not filter because the file is not stored on the 
server ?


I don't know any extension which stored a uploaded file directly on Mogile 
or any other filesystem beside that where PHP resists. I think you completly 
misunderstood how the file transfer generally works.


Related to filtering itself the order is fixed:
validation -> filter -> send
or
validation->receive->filter
or
validation -> receive -> filter -> send

All other handlings would not work when using different adapters.
But you should be aware of one thing... the download handling is not 
integrated for now so it is possible that it changes due to other needs of 
integrated adapters. (Not the method itself but probably how things work 
internally).


Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

- Original Message - 
From: "Paweł Chuchmała" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, December 09, 2008 4:02 PM
Subject: Re: [fw-general] Zend_File_Transfer proposal, send and receive



I have questions ho implement some methods.

I want to send file to MogileFs system. I write adapter for it. Scnario 
is:


1. receive file via user form (http_adapter::receive())
2. add file to my adapter: $file->addFile($form->file->getFileName());
3. add filters: $file->addFilter('Rename', '/something\c:\veryStrange/');
4. send it to MogileFs: $file->send().

I write send() method and first question: should I apply filters before
send?
Another problem. File in MogileFS are stored in flat structure. There 
are'nt

directories, filenames, etc. I can't use
method Zend_File_Transfer_Adapter_Abstract::_filter(), because it use
dirname() and filename() to choose destination and name.
I cant use Zend_Filter_File_Rename, cause it work on files in system. If I
receive file it's ok. But if I want send it somewhere,
I want to change only array that describe my file.

Filenames (for true I should say 'virtual filenames') in MogileFs nad 
Amazon
S3 can be like point 3. above, so if I want send file to them, shouldn't 
be

validated as file for store in 'traditional' file systems.

How I can do this, in Zend Framework convention?

regards,
pch



2008/12/9 Thomas Weidner <[EMAIL PROTECTED]>


There are always 2 directions.
Upload and Download.

Upload means that the server receives a file from a foreign destination.
Therefor the method is called receive.
Download means that the server sends a file to a foreign destination.
Therefor the method is called send.

When you don't want to send a file to the client you can still echo it
(display), but this is no download.
Zend_File_Transfer does only handle file transfer and not file displaying
needs.

Beside that the FTP adapter is not coded for now so there is no need to
hassle about it. :-)

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

- Original Message - From: "Paweł Chuchmała" <
[EMAIL PROTECTED]>
To: 
Sent: Tuesday, December 09, 2008 10:43 AM
Subject: [fw-general] Zend_File_Transfer proposal, send and receive



 Hi.


I don't understand when I should use send() and receive() methods.
I think that send() should send file(s) from place where our application
is
to another place.
And receive() should receive file to place where application is.
For example, if I want store at ftp server file from user uploaded by 
http

post, I do it like that:

$form->file->receive();

$files = new Zend_File_Transfer('FTP', array('user' => 'adam', 'pwd' =>
'sandler', 'server' => 
'ftp.myserver.com/public')

);
$files->addFiles($form->file->getFileName)
 ->send();

But in examples from proposal we have:
FTP Download:
"The API can also be used for downloads. It will work as wrapper so the
user
does not see where the original files is located and ZF will send the 
file

to the user."
and it use send(). I think it should use receive() to receive file from
ftp,
and then send it to user by echoing content or something else, but nod
send() method from FTP adapter.

Kind, regards,
pch

--
Paweł Chuchmała
pawel.chuchmala at gmail dot com







--
Paweł Chuchmała
pawel.chuchmala at gmail dot com





Re: [fw-general] ignore case sensitivity for urls

2008-12-09 Thread Matthew Weier O'Phinney
-- Jan Pieper <[EMAIL PROTECTED]> wrote
(on Tuesday, 09 December 2008, 03:48 PM +0100):
> today we thought about how to ignore case sensitivity for urls to
> allow ~/Foo and ~/foo to load "Foo"-module. We tried to overwrite all
> methods that returns uppercase module name to allow ignoring case
> sensitivity but now we need to extend Zend_Controller_Front and it is
> very complex because it is a singleton and without late static binding
> I think we won´t get happy with overwriting it.
> 
> There is already a jira ticket but the reporter modified the zend framework 
> code:
> http://framework.zend.com/issues/browse/ZF-4119
> 
> So, is there a chance to disable case sensitive module names?

Not for the default use case.

However, a couple things to note about your approach.

First, you *can* extend Zend_Controller_Front; simply override the
__construct() and getInstance() methods.  Then, simply make sure that
the first call to getInstance() is done on your extending class -- all
subsequent calls to Zend_Controller_Front::getInstance() will then get
an instance of your extending class.

Second, you're looking at the wrong pieces of code anyways. You should
be looking in the dispatcher and ViewRenderer, which is where resolution
occurs (the former resolves the name to a class and path, the latter
resolves it for view-related classes).

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


[fw-general] Dojo SimpleTextarea

2008-12-09 Thread Daniel Latter
Hi,

I am having trouble trying to render a Dojo SimpleTextarea as per the
Manual.

I am using this require:

->requireModule("dijit.form.SimpleTextarea");
and this in my form class:

$this->addElement(

'SimpleTextarea',

'simpletextarea',

array(

'label' => 'SimpleTextarea',

'required' => true,

'style' => 'width: 80em; height: 25em;',

)

);

I have no trouble using the text area that grows but with this one I get a
plugin error??

Plugin by name SimpleTextarea was not found in the registry...

Maybe I am using the incorrect require but I dont think so?

can someone please shed light?

Thanks


[fw-general] Fatal error while trying to insert to db.

2008-12-09 Thread bytte

I'm trying to move more code from my controllers to my models. For an insert
action I'm doing this:

class Toestellen extends Zend_Db_Table_Abstract {

(...)
public function addItem()
{
$data = array(
'naam'  => $this->_formData['naam'],
'nummer'=> $this->_formData['nummer'],
'speelplein_id' => $this->_speelplein,
'created_dt'=> date('Y-m-d H:i:s'),
'type'  => $this->_type
); 
$this->insert($data);   
return $this->getLastInsertId();
}

(...)
}

However I get this error: Fatal error: Call to a member function
describeTable() on a non-object in
/Users/bytte/Sites/speelokee-test/library/Zend/Db/Table/Abstract.php on line
696

Do you know what's wrong?
-- 
View this message in context: 
http://www.nabble.com/Fatal-error-while-trying-to-insert-to-db.-tp20917866p20917866.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Dojo SimpleTextarea

2008-12-09 Thread Matthew Weier O'Phinney
-- Daniel Latter <[EMAIL PROTECTED]> wrote
(on Tuesday, 09 December 2008, 04:09 PM +):
> I am having trouble trying to render a Dojo SimpleTextarea as per the Manual.

Unfortunately, the manual is built from trunk, but the SimpleTextarea
support won't be released until 1.8.0.

You can grab it from current trunk if you need it, however.

> I am using this require:
> 
> ->requireModule("dijit.form.SimpleTextarea");
> 
> and this in my form class:
>  
> $this->addElement(
> 
> 'SimpleTextarea',
> 
> 'simpletextarea',
> 
> array(
> 
> 'label' => 'SimpleTextarea',
> 
> 'required' => true,
> 
> 'style' => 'width: 80em; height: 25em;',
> 
> )
> 
> );
> 
> I have no trouble using the text area that grows but with this one I get a
> plugin error??
> 
> Plugin by name SimpleTextarea was not found in the registry...
> 
> Maybe I am using the incorrect require but I dont think so?
> 
> can someone please shed light?
> 
> Thanks
> 

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


[fw-general] noob-question: increment integer in db

2008-12-09 Thread Markus Hausammann
Hi

I would like to increment an integer column in my db.

What I've tried is this:

 

$row = $this->findDependentRowset('ParamsUser')->current();

$row->pointer = 'pointer + 1';

$row->save();

 

Obviously it doesn't work, how could I do it?

Thanks!

Markus

 

PS I sent this question to fw-db but it didn't deliver.so forgive if it
should deliver later and be duplicate.



Re: [fw-general] noob-question: increment integer in db

2008-12-09 Thread Jan Pieper
I don´t know Zend_Db_Table very well but try this:

[...]
++$row->pointer;
$row->save();

 Original-Nachricht 
> Datum: Tue, 9 Dec 2008 18:20:42 +0200
> Von: "Markus Hausammann" <[EMAIL PROTECTED]>
> An: fw-general@lists.zend.com
> Betreff: [fw-general] noob-question: increment integer in db

> Hi
> 
> I would like to increment an integer column in my db.
> 
> What I've tried is this:
> 
>  
> 
> $row = $this->findDependentRowset('ParamsUser')->current();
> 
> $row->pointer = 'pointer + 1';
> 
> $row->save();
> 
>  
> 
> Obviously it doesn't work, how could I do it?
> 
> Thanks!
> 
> Markus
> 
>  
> 
> PS I sent this question to fw-db but it didn't deliver.so forgive if it
> should deliver later and be duplicate.
> 

-- 
Sensationsangebot verlängert: GMX FreeDSL - Telefonanschluss + DSL 
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a


Re: [fw-general] Dojo SimpleTextarea

2008-12-09 Thread Daniel Latter
ok will grab it from trunk, thanks for the quick response!

Thank You
Daniel Latter


2008/12/9 Matthew Weier O'Phinney <[EMAIL PROTECTED]>

> -- Daniel Latter <[EMAIL PROTECTED]> wrote
> (on Tuesday, 09 December 2008, 04:09 PM +):
> > I am having trouble trying to render a Dojo SimpleTextarea as per the
> Manual.
>
> Unfortunately, the manual is built from trunk, but the SimpleTextarea
> support won't be released until 1.8.0.
>
> You can grab it from current trunk if you need it, however.
>
> > I am using this require:
> >
> > ->requireModule("dijit.form.SimpleTextarea");
> >
> > and this in my form class:
> >
> > $this->addElement(
> >
> > 'SimpleTextarea',
> >
> > 'simpletextarea',
> >
> > array(
> >
> > 'label' => 'SimpleTextarea',
> >
> > 'required' => true,
> >
> > 'style' => 'width: 80em; height: 25em;',
> >
> > )
> >
> > );
> >
> > I have no trouble using the text area that grows but with this one I get
> a
> > plugin error??
> >
> > Plugin by name SimpleTextarea was not found in the registry...
> >
> > Maybe I am using the incorrect require but I dont think so?
> >
> > can someone please shed light?
> >
> > Thanks
> >
>
> --
> Matthew Weier O'Phinney
> Software Architect   | [EMAIL PROTECTED]
> Zend Framework   | http://framework.zend.com/
>


AW: [fw-general] noob-question: increment integer in db

2008-12-09 Thread Markus Hausammann
it works, that's amazing, I don't get the principle behind this operation
but it works :)

-Ursprüngliche Nachricht-
Von: Jan Pieper [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 9. Dezember 2008 18:24
An: Markus Hausammann; fw-general@lists.zend.com
Betreff: Re: [fw-general] noob-question: increment integer in db

I don´t know Zend_Db_Table very well but try this:

[...]
++$row->pointer;
$row->save();

 Original-Nachricht 
> Datum: Tue, 9 Dec 2008 18:20:42 +0200
> Von: "Markus Hausammann" <[EMAIL PROTECTED]>
> An: fw-general@lists.zend.com
> Betreff: [fw-general] noob-question: increment integer in db

> Hi
> 
> I would like to increment an integer column in my db.
> 
> What I've tried is this:
> 
>  
> 
> $row = $this->findDependentRowset('ParamsUser')->current();
> 
> $row->pointer = 'pointer + 1';
> 
> $row->save();
> 
>  
> 
> Obviously it doesn't work, how could I do it?
> 
> Thanks!
> 
> Markus
> 
>  
> 
> PS I sent this question to fw-db but it didn't deliver.so forgive if it
> should deliver later and be duplicate.
> 

-- 
Sensationsangebot verlängert: GMX FreeDSL - Telefonanschluss + DSL 
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a



Re: [fw-general] Routing: actions as first element of path

2008-12-09 Thread rutt

Ah, interesting.  With one small tweak to set the action, this seems to work:

public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$frontController = Zend_Controller_Front::getInstance();
$isDispatchable  =
$frontController->getDispatcher()->isDispatchable($request);

if (!$isDispatchable) {
$controller = 'root';
$action = $request->getControllerName();

$request->setControllerName($controller);
$request->setActionName($action);
}
}


jkendall wrote:
> 
> 
> rutt wrote:
>> 
>> Basically, if the first element of the path is a valid controller, then
>> the request should be dispatched to that controller.  If not, it should
>> be dispatched to RootController.  
>> 
> 
> Not sure if this will get you where you want to go, but my first thought
> was setting up a plugin to test whether or not a request was dispatchable,
> and setting the controller to 'root' if it isn't dispatchable.
> 
> class My_Controller_Plugin_Example extends Zend_Controller_Plugin_Abstract
> {
>   
>   public function preDispatch(Zend_Controller_Request_Abstract $request) {
> 
> $frontController = Zend_Controller_Front::getInstance();
> $isDispatchable  =
> $frontController->getDispatcher()->isDispatchable($request);
> 
> if (!$isDispatchable) {
>   $controller = 'root';
>   $request->setControllerName($controller);
> }
> 
>   }
> }
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Routing%3A-actions-as-first-element-of-path-tp20908784p20918121.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] No Dojo grid view helper

2008-12-09 Thread Guillaume Oriol

Thank you for the advice.
When do you expect to release the 1.8 version?


Matthew Weier O'Phinney-3 wrote:
> 
> -- Guillaume Oriol <[EMAIL PROTECTED]> wrote
> (on Tuesday, 09 December 2008, 06:27 AM -0800):
>> AFAIK, there is no View Helper for dojox.grid.Grid.
>> Is there such a class incubating at this time?
>> 
>> If not what would be the starting point to create it?
>> Create My_Dojo_View_Helper_Grid and extends what class (Dijit)?
>> What existing class could I use as a model?
> 
> Roy from the Studio team and I will be working on such a component for
> 1.8. Currently, It's relatively easy to accomplish -- create your grid
> markup, tie it to a data store that point to a ZF controller action.
> In that action pull from your model, and push the results into a
> Zend_Dojo_Data object and echo it.
> 
> -- 
> Matthew Weier O'Phinney
> Software Architect   | [EMAIL PROTECTED]
> Zend Framework   | http://framework.zend.com/
> 
> 


-
Guillaume ORIOL
Sofware architect
Technema
-- 
View this message in context: 
http://www.nabble.com/No-Dojo-grid-view-helper-tp20915645p20918182.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_File_Transfer proposal, send and receive

2008-12-09 Thread Paweł Chuchmała
On Tue, Dec 9, 2008 at 16:19, Thomas Weidner <[EMAIL PROTECTED]> wrote:

> Pawel,
>
> I don't get the point.
>
> You said that the user uploads the file via HTTP to the server.
> So it's stored on the server as real file.

Then you said that you can not filter because the file is not stored on the
> server ?
>

Yes, it's stored, but I want to send it to Mogile storage and delete form
server.


> I don't know any extension which stored a uploaded file directly on Mogile
> or any other filesystem beside that where PHP resists. I think you completly
> misunderstood how the file transfer generally works.
>

I don't know too, that's why I want first receive file via http adapter, and
then send it to Mogile via my adapter. Two diffrent adapters.


> Related to filtering itself the order is fixed:
> validation -> filter -> send
> or
> validation->receive->filter
> or
> validation -> receive -> filter -> send


Ok, how I can do:
validation -> receive -> filter -> send
when I want receive and send via different adapters?
I think, I must break it:
1 adapter:
validation -> receive (filter is unnecessary, cause I send file and delete
from server)
2 adapter
filter -> send

I don't understand how filters from release 1.7.0 can work with send().
Forget about Mogile, take ftp, where filesystem have directories etc. What
is misiing or behave dofferent, what I must to write or rewrite to receive
file via one adapter and send it by another?


> All other handlings would not work when using different adapters.
> But you should be aware of one thing... the download handling is not
> integrated for now so it is possible that it changes due to other needs of
> integrated adapters. (Not the method itself but probably how things work
> internally).
>

I know, that's why I want to do more similary as it will be done in
framework.

>
> Greetings
> Thomas Weidner, I18N Team Leader, Zend Framework
> http://www.thomasweidner.com
>
> - Original Message - From: "Paweł Chuchmała" <
> [EMAIL PROTECTED]>
> To: 
> Sent: Tuesday, December 09, 2008 4:02 PM
> Subject: Re: [fw-general] Zend_File_Transfer proposal, send and receive
>
>
>  I have questions ho implement some methods.
>>
>> I want to send file to MogileFs system. I write adapter for it. Scnario
>> is:
>>
>> 1. receive file via user form (http_adapter::receive())
>> 2. add file to my adapter: $file->addFile($form->file->getFileName());
>> 3. add filters: $file->addFilter('Rename', '/something\c:\veryStrange/');
>> 4. send it to MogileFs: $file->send().
>>
>> I write send() method and first question: should I apply filters before
>> send?
>> Another problem. File in MogileFS are stored in flat structure. There
>> are'nt
>> directories, filenames, etc. I can't use
>> method Zend_File_Transfer_Adapter_Abstract::_filter(), because it use
>> dirname() and filename() to choose destination and name.
>> I cant use Zend_Filter_File_Rename, cause it work on files in system. If I
>> receive file it's ok. But if I want send it somewhere,
>> I want to change only array that describe my file.
>>
>> Filenames (for true I should say 'virtual filenames') in MogileFs nad
>> Amazon
>> S3 can be like point 3. above, so if I want send file to them, shouldn't
>> be
>> validated as file for store in 'traditional' file systems.
>>
>> How I can do this, in Zend Framework convention?
>>
>> regards,
>> pch
>>
>>
>>
>> 2008/12/9 Thomas Weidner <[EMAIL PROTECTED]>
>>
>>  There are always 2 directions.
>>> Upload and Download.
>>>
>>> Upload means that the server receives a file from a foreign destination.
>>> Therefor the method is called receive.
>>> Download means that the server sends a file to a foreign destination.
>>> Therefor the method is called send.
>>>
>>> When you don't want to send a file to the client you can still echo it
>>> (display), but this is no download.
>>> Zend_File_Transfer does only handle file transfer and not file displaying
>>> needs.
>>>
>>> Beside that the FTP adapter is not coded for now so there is no need to
>>> hassle about it. :-)
>>>
>>> Greetings
>>> Thomas Weidner, I18N Team Leader, Zend Framework
>>> http://www.thomasweidner.com
>>>
>>> - Original Message - From: "Paweł Chuchmała" <
>>> [EMAIL PROTECTED]>
>>> To: 
>>> Sent: Tuesday, December 09, 2008 10:43 AM
>>> Subject: [fw-general] Zend_File_Transfer proposal, send and receive
>>>
>>>
>>>
>>>  Hi.
>>>

 I don't understand when I should use send() and receive() methods.
 I think that send() should send file(s) from place where our application
 is
 to another place.
 And receive() should receive file to place where application is.
 For example, if I want store at ftp server file from user uploaded by
 http
 post, I do it like that:

 $form->file->receive();

 $files = new Zend_File_Transfer('FTP', array('user' => 'adam', 'pwd' =>
 'sandler', 'server' => 
 'ftp.myserver.com/public'
 )

[fw-general] Empty logfiles

2008-12-09 Thread debussy007

Hi, 

on every request, I specify the logfile to use for logging, because the file
to use depends on time (I have one logfile per hour). 


$logger = new Zend_Log();
$writer = new Zend_Log_Writer_Stream($path . "logfile-" . date("Ymd-H") .
".log");
$logger->addWriter($writer);


The problem is that even if I don't log anything, a logfile will be created. 
I'll have a bunch of empty logfiles for each hour. 

How can I avoid this ?

Thank you for any kind help.
-- 
View this message in context: 
http://www.nabble.com/Empty-logfiles-tp20918479p20918479.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_File_Transfer proposal, send and receive

2008-12-09 Thread Matthew Ratzloff
Paweł,
Perhaps I'm misunderstanding, but I'm guessing you won't be able to do this
because Zend Framework does not model the file system.  At my company, our
platform used to use MogileFS, but we transitioned to POSIX-compatible file
storage; we recommend OCFS2 to our clients now.

(Side note: I would really recommend transitioning away from MogileFS if you
can, because it has some significant drawbacks, not the least of which is
its poor performance, especially under high load.)

Anyway, we had to abstract out file system access such that we could have a
POSIX adapter or a MogileFS adapter (for backwards compatibility).  Zend
Framework should do something similar, and in fact I may propose something
to that effect at some point.  Zend Framework can approach this in a few
different ways: modeling an individual file (Zend_File_Interface), which is
good for OO; modeling a file system (Zend_File_System_Interface), which is
better for performance; or do both, and let the user decide which is
appropriate.

-Matt

2008/12/9 Paweł Chuchmała <[EMAIL PROTECTED]>

> I have questions ho implement some methods.
>
> I want to send file to MogileFs system. I write adapter for it. Scnario is:
>
> 1. receive file via user form (http_adapter::receive())
> 2. add file to my adapter: $file->addFile($form->file->getFileName());
> 3. add filters: $file->addFilter('Rename', '/something\c:\veryStrange/');
> 4. send it to MogileFs: $file->send().
>
> I write send() method and first question: should I apply filters before
> send?
> Another problem. File in MogileFS are stored in flat structure. There
> are'nt directories, filenames, etc. I can't use
> method Zend_File_Transfer_Adapter_Abstract::_filter(), because it use
> dirname() and filename() to choose destination and name.
> I cant use Zend_Filter_File_Rename, cause it work on files in system. If I
> receive file it's ok. But if I want send it somewhere,
> I want to change only array that describe my file.
>
> Filenames (for true I should say 'virtual filenames') in MogileFs nad
> Amazon S3 can be like point 3. above, so if I want send file to them,
> shouldn't be validated as file for store in 'traditional' file systems.
>
> How I can do this, in Zend Framework convention?
>
> regards,
> pch
>
>
>
> 2008/12/9 Thomas Weidner <[EMAIL PROTECTED]>
>
> There are always 2 directions.
>> Upload and Download.
>>
>> Upload means that the server receives a file from a foreign destination.
>> Therefor the method is called receive.
>> Download means that the server sends a file to a foreign destination.
>> Therefor the method is called send.
>>
>> When you don't want to send a file to the client you can still echo it
>> (display), but this is no download.
>> Zend_File_Transfer does only handle file transfer and not file displaying
>> needs.
>>
>> Beside that the FTP adapter is not coded for now so there is no need to
>> hassle about it. :-)
>>
>> Greetings
>> Thomas Weidner, I18N Team Leader, Zend Framework
>> http://www.thomasweidner.com
>>
>> - Original Message - From: "Paweł Chuchmała" <
>> [EMAIL PROTECTED]>
>> To: 
>> Sent: Tuesday, December 09, 2008 10:43 AM
>> Subject: [fw-general] Zend_File_Transfer proposal, send and receive
>>
>>
>>
>>  Hi.
>>>
>>> I don't understand when I should use send() and receive() methods.
>>> I think that send() should send file(s) from place where our application
>>> is
>>> to another place.
>>> And receive() should receive file to place where application is.
>>> For example, if I want store at ftp server file from user uploaded by
>>> http
>>> post, I do it like that:
>>>
>>> $form->file->receive();
>>>
>>> $files = new Zend_File_Transfer('FTP', array('user' => 'adam', 'pwd' =>
>>> 'sandler', 'server' => 
>>> 'ftp.myserver.com/public')
>>> );
>>> $files->addFiles($form->file->getFileName)
>>>  ->send();
>>>
>>> But in examples from proposal we have:
>>> FTP Download:
>>> "The API can also be used for downloads. It will work as wrapper so the
>>> user
>>> does not see where the original files is located and ZF will send the
>>> file
>>> to the user."
>>> and it use send(). I think it should use receive() to receive file from
>>> ftp,
>>> and then send it to user by echoing content or something else, but nod
>>> send() method from FTP adapter.
>>>
>>> Kind, regards,
>>> pch
>>>
>>> --
>>> Paweł Chuchmała
>>> pawel.chuchmala at gmail dot com
>>>
>>>
>>
>
>
> --
> Paweł Chuchmała
> pawel.chuchmala at gmail dot com
>


Re: [fw-general] Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'PluginName' was not found in the registry

2008-12-09 Thread james.fortune

That was it thanks for the reply i hate it when it turns out to be something
simple

james.fortune wrote:
> 
> Hi,
> 
> I have a problem that I am really stuck with.
> 
> I have a view helper folder in my library, the path is
> 
> /library/My/helper/
> 
> in my controller class pre dispath function I am adding the path to my
> view using
> 
> $this->view->addHelperPath('My/Helper/', 'My_Helper');
> 
> Everything works fine in my localhost however when I upload the site to
> the live server I am getting the error message I have shown in the
> subject.
> 
> Thank you for any help.
> 
> Regards
> 
> John
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Zend_Loader_PluginLoader_Exception%27-with-message-%27Plugin-by-name-%27PluginName%27-was-not-found-in-the-registry-tp20911986p20919441.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Newbie question regarding parameters in the url

2008-12-09 Thread Julian102

Thank you for the reply it was very helpful.

Im still a little confused however because I dont understand why by default
parameters would persist surely in most situations you would not want them
to.

Do you know if I am right in saying its good practice to use the views url
helper when creating links.



Michael Crumm wrote:
> 
> Julian,
> 
> I'm going to try and provide some help, please let me know if you need
> further explanation.
> 
> First, from the API Docs:
> 
> Zend_View_Helper_Url
> 
> url (line 46)
> 
> Generates an url given the name of a route.
> 
>- return: Url for the link href attribute.
>- access: public
> 
>  string url ([ $urlOptions = array()], [mixed $name = null], [bool $reset
> =
> false], [ $encode = true])
> 
>- array $urlOptions: Options passed to the assemble method of the Route
>object.
>- mixed $name: The name of a Route to use. If null it will use the
>current Route
>- bool $reset: Whether or not to reset the route defaults with those
>provided
>-  $encode
> 
> the value you are going to be interested in is '$reset'.  Set this to true
> on links where parameters should not persist.
> 
> -
> Example:
> 
>  "'index','action'=>'index'),
> null, false) ?>">I persist params 
>  "'index','action'=>'index'))
> ?>">So do I. 
>  "'index','action'=>'index'),
> null, true) ?>">I don't 
> 
> Hope this points you in the right direction!
> 
> -Mike
> 
> 
> On Mon, Dec 8, 2008 at 11:41 AM, Julian102 <[EMAIL PROTECTED]> wrote:
> 
>>
>> Hello,
>>
>> Im new to zend framework and i am having difficulty understanding how
>> parameters are used in the url.
>>
>> Currently I am making urls using the following code -
>>
>>
>> $this->url(array('controller'=>'controllername','action'=>'actionname','paramname'=>'paramvalue'))
>>
>> The problem is the parameter is staying in the url in everypage I go to
>> following navigating to the page created using the previous code.
>>
>> I realise that this is probably a ridicuously simple question but I need
>> to
>> be certain that I understand why this is happening as its quite a
>> fundamental part of the framework
>>
>> Any help would be greatly appreciated
>>
>> Thank You
>>
>> Julian
>> --
>> View this message in context:
>> http://www.nabble.com/Newbie-question-regarding-parameters-in-the-url-tp20899971p20899971.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Newbie-question-regarding-parameters-in-the-url-tp20899971p20919675.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Newbie quesiton - How do queries that join multiple tables fit into the model in the MVC

2008-12-09 Thread Julian102

Hello,

I am new to the mvc pattern and zend framework.

I understand that a class in the model is normally associated with a table
in the database and that all my sql queries should be in the model so that i
do not get a fat controller.

I am now confused because my application requires a query which joins three
tables. Can anyone explain to me how I would fit this query into my
applicaiton.

Thank you for your time.




-- 
View this message in context: 
http://www.nabble.com/Newbie-quesiton---How-do-queries-that-join-multiple-tables-fit-into-the-model-in-the-MVC-tp20919944p20919944.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Newbie quesiton - How do queries that join multiple tables fit into the model in the MVC

2008-12-09 Thread Bill Karwin


On Dec 9, 2008, at 9:54 AM, Julian102 wrote:

I understand that a class in the model is normally associated with a  
table

in the database ...


Whoah there. I don't know where you get that idea.

The relationship between a Model class and a Table class (or multiple  
Table classes) is HAS-A, rather than IS-A.


See my blog for more of my comments on this.

Or don't trust my opinion, but read Martin Fowler's discussion of the  
Anemic Domain Model antipattern.


Regards,
Bill Karwin



Re: [fw-general] PHP version requirement

2008-12-09 Thread Jack Sleight
Wow, that's fantastic, how did you get that list?
Thanks!

2008/12/8 till <[EMAIL PROTECTED]>:
> Zend_File seems to lead the list, but only with 5.2.1, not 5.2.4.
>
> And if anyone cares, here are the version requirements per component
> (tests not included):
>
> Zend_Acl: 5.0.0
> Zend_Amf: 5.0.0
> Zend_Auth: 5.0.0
> Zend_Cache: 5.0.0
> Zend_Captcha: 5.1.0
> Zend_Config: 5.0.0
> Zend_Console: 5.0.0
> Zend_Controller: 5.0.0
> Zend_Currency: 5.0.0
> Zend_Date: 5.1.0
> Zend_Db: 5.1.0
> Zend_Debug: 5.0.0
> Zend_Dojo: 5.0.0
> Zend_Dom: 5.0.0
> Zend_Exception: 4.0.0
> Zend_Feed: 5.1.1
> Zend_File: 5.2.1 (!)
> Zend_Filter: 5.1.0
> Zend_Form: 5.0.0
> Zend_Gdata: 5.1.0
> Zend_Http: 5.1.0
> Zend_InfoCard: 5.0.0
> Zend_Json: 5.0.0
> Zend_Layout: 5.0.0
> Zend_Ldap: 5.1.0
> Zend_Loader: 5.1.2
> Zend_Locale: 5.0.0
> Zend_Log: 5.0.0
> Zend_Mail: 5.1.0
> Zend_Measure: 5.0.0
> Zend_Memory: 5.0.0
> Zend_Mime: 5.0.0
> Zend_OpenId: 5.2.0
> Zend_Paginator: 5.0.0
> Zend_Pdf: 5.0.0
> Zend_ProgressBar: 5.0.0
> Zend_Registry: 5.0.0
> Zend_Request: 5.0.0
> Zend_Rest: 5.0.0
> Zend_Search: 5.0.0
> Zend_Server: 5.0.0
> Zend_Service: 5.0.0
> Zend_Session: 5.0.0
> Zend_Soap: 5.0.0
> Zend_Test: 5.0.0
> Zend_Text: 5.0.0
> Zend_TimeSync: 5.0.0
> Zend_Translate: 5.0.0
> Zend_Uri: 5.0.0
> Zend_Validate: 5.1.0
> Zend_Version: 5.0.0
> Zend_View: 5.0.0
> Zend_Wildfire: 5.0.0
> Zend_XmlRpc: 5.0.0
>
> Cheers,
> Till
>



-- 
Jack


Re: [fw-general] PHP version requirement

2008-12-09 Thread till
On Tue, Dec 9, 2008 at 7:01 PM, Jack Sleight <[EMAIL PROTECTED]> wrote:
> Wow, that's fantastic, how did you get that list?
> Thanks!

PHP_CompatInfo[1]. I'll post some source code later this week. :-)

Till

[1]: http://pear.php.net/package/PHP_CompatInfo


RE: [fw-general] ZF live settings

2008-12-09 Thread dele454

Still looking for help. I think despite the fact that i have my ZF included
the php.ini file i dont think it is seeing any of my ZF file still. I am in
the process of deleting all the ZF folders, refreshing my home page doesnt
even give an warning of a component missing or so. which is strange!!



rcastley wrote:
> 
> You will need the AllowOverride set to All so that the .htaccess can be
> picked up in your application directory.
>  
> Also check the DirectoryIndex had index.php appended to it as well.
>  
> - Robert
> 
>   _  
> 
> From: Dele [mailto:[EMAIL PROTECTED] 
> Sent: 09 December 2008 15:49
> To: Robert Castley; fw-general@lists.zend.com
> Subject: RE: [fw-general] ZF live settings
> 
> 
> Thanks I removed the references to Expires, still nothing. Do you think
> this
> could help adding it to the Virtual Host declarations :
>  
> AllowOverride All
> Options All
>  
> Because I have it for my local version on my apache config file. Thanks
> for
> all your help
>  
>  
> Regards
>  
> Dele
>  
> (C) 071 673 4130  (E) [EMAIL PROTECTED]  (S) dee454
>  
> "Start by doing what's necessary; then do what's possible; and suddenly
> you
> are doing the impossible. "- St. Francis of Assisi.
> 
> Disclaimer: This email and any files transmitted with it are confidential
> and intended solely for the use of the individual or entity to whom they
> are
> addressed. If you have received this email in error please notify the
> system
> manager. This message contains confidential information and is intended
> only
> for the individual named. If you are not the named addressee you should
> not
> disseminate, distribute or copy this e-mail. Please notify the sender
> immediately by e-mail if you have received this e-mail by mistake and
> delete
> this e-mail from your system. If you are not the intended recipient you
> are
> notified that disclosing, copying, distributing or taking any action in
> reliance on the contents of this information is strictly prohibited.
>  
> From: Robert Castley [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, December 09, 2008 5:40 PM
> To: Dele; fw-general@lists.zend.com
> Subject: RE: [fw-general] ZF live settings
>  
> Sometimes you are not allow to put apache module configurations in
> .htaccess.
>  
> Try also removing the references to Expires* and just use the .htaccess
> content I sent previously.
>  
> - Robert
>  
>   _  
> 
> From: Dele [mailto:[EMAIL PROTECTED] 
> Sent: 09 December 2008 15:14
> To: Robert Castley; fw-general@lists.zend.com
> Subject: RE: [fw-general] ZF live settings
> Thanks for the feedback Robert. I replaced the .htaccess file you sent me
> with the one I currently have. Still nothing L
>  
> Regards
>  
> Dele
>  
> (C) 071 673 4130  (E) [EMAIL PROTECTED]  (S) dee454
>  
> "Start by doing what's necessary; then do what's possible; and suddenly
> you
> are doing the impossible. "- St. Francis of Assisi.
> 
> Disclaimer: This email and any files transmitted with it are confidential
> and intended solely for the use of the individual or entity to whom they
> are
> addressed. If you have received this email in error please notify the
> system
> manager. This message contains confidential information and is intended
> only
> for the individual named. If you are not the named addressee you should
> not
> disseminate, distribute or copy this e-mail. Please notify the sender
> immediately by e-mail if you have received this e-mail by mistake and
> delete
> this e-mail from your system. If you are not the intended recipient you
> are
> notified that disclosing, copying, distributing or taking any action in
> reliance on the contents of this information is strictly prohibited.
>  
> From: Robert Castley [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, December 09, 2008 3:28 PM
> To: dele454; fw-general@lists.zend.com
> Subject: RE: [fw-general] ZF live settings
>  
> Your .htaccess file doesn't look right to me. 
> Have you tried this? 
> RewriteEngine On 
> RewriteCond %{REQUEST_FILENAME} -s [OR] 
> RewriteCond %{REQUEST_FILENAME} -l [OR] 
> RewriteCond %{REQUEST_FILENAME} -d 
> RewriteRule ^.*$ - [NC,L] 
> RewriteRule ^.*$ index.php [NC,L] 
>   
> -Original Message- 
> From: dele454 [mailto:[EMAIL PROTECTED]
>  ] 
> Sent: 09 December 2008 12:33 
> To: fw-general@lists.zend.com 
> Subject: Re: [fw-general] ZF live settings 
>  
> Any help out there still? I havent being able to resolve it yet!! 
>  
> dele454 wrote: 
>> 
>> Hi, 
>> 
>> I am trying to move my files over to the remote server but my pages 
>> appear blank. I have tried everything i know to rectify this from 
>> setting my include path, config files etc but nothing is working. 
>> Checked the apache error log file but nothing captured on what am 
>> experiencing. not logging it. 
>> 
>> I am just attaching all my files here for any help/assistance. Am so 
>> tired been battling with this since last night and i can't still 
>> figure out why this is so. Please i will

Re: [fw-general] Fatal error while trying to insert to db.

2008-12-09 Thread Matthew Weier O'Phinney
-- bytte <[EMAIL PROTECTED]> wrote
(on Tuesday, 09 December 2008, 08:18 AM -0800):
> 
> I'm trying to move more code from my controllers to my models. For an insert
> action I'm doing this:
> 
> class Toestellen extends Zend_Db_Table_Abstract {
> 
> (...)
> public function addItem()
>   {
>   $data = array(
>   'naam'  => $this->_formData['naam'],
>   'nummer'=> $this->_formData['nummer'],
>   'speelplein_id' => $this->_speelplein,
>   'created_dt'=> date('Y-m-d H:i:s'),
>   'type'  => $this->_type
>   ); 
>   $this->insert($data);   
>   return $this->getLastInsertId();
>   }
> 
> (...)
> }
> 
> However I get this error: Fatal error: Call to a member function
> describeTable() on a non-object in
> /Users/bytte/Sites/speelokee-test/library/Zend/Db/Table/Abstract.php on line
> 696
> 
> Do you know what's wrong?

Did you instantiate a DB adapter and pass it to
Zend_Db_Table_Abstract::setDefaultAdapter()?

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


Re: [fw-general] No Dojo grid view helper

2008-12-09 Thread Matthew Weier O'Phinney
-- Guillaume Oriol <[EMAIL PROTECTED]> wrote
(on Tuesday, 09 December 2008, 08:36 AM -0800):
> 
> Thank you for the advice.
> When do you expect to release the 1.8 version?

Sometime in Q1 of 2009. No specific date set yet.

> Matthew Weier O'Phinney-3 wrote:
> > 
> > -- Guillaume Oriol <[EMAIL PROTECTED]> wrote
> > (on Tuesday, 09 December 2008, 06:27 AM -0800):
> >> AFAIK, there is no View Helper for dojox.grid.Grid.
> >> Is there such a class incubating at this time?
> >> 
> >> If not what would be the starting point to create it?
> >> Create My_Dojo_View_Helper_Grid and extends what class (Dijit)?
> >> What existing class could I use as a model?
> > 
> > Roy from the Studio team and I will be working on such a component for
> > 1.8. Currently, It's relatively easy to accomplish -- create your grid
> > markup, tie it to a data store that point to a ZF controller action.
> > In that action pull from your model, and push the results into a
> > Zend_Dojo_Data object and echo it.

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


RE: [fw-general] ZF live settings

2008-12-09 Thread dele454

I have been able to narrow my problem down to the Zend_registerAutoload not
working and i think it is because of this from the reference doc:

The Zend_Loader class contains a method you can register with the PHP SPL
autoloader. Zend_Loader::autoload() is the callback method. As a
convenience, Zend_Loader provides the registerAutoload() function to
register its autoload() method. If the spl_autoload  extension is not
present in your PHP environment, then the registerAutoload() method throws a
Zend_Exception. 

I have checked through my php.ini file and http.conf file for the
spl_autoload extension but i cant find it anywhere. I was able to nail it on
the autoload because when i do something like this in my boostrap file
(assuming this is the only function i have there - just for testing):


require_once 'Zend/Loader.php';
require_once 'Zend/Session.php';


class Bootstrap{

public static $front = null;
   
public static function run()
{ 

$date = new Zend_Date();

// Output of the desired date
print $date->get();
}


I get fatal error: Fatal error: Class 'Zend_Date' not found in
/usr/local/lib/apps/Bootstrap.php on line 14

But as soon as i add it as an include


require_once 'Zend/Loader.php';
require_once 'Zend/Session.php';
require_once 'Zend/Date.php';


class Bootstrap{

public static $front = null;
   
public static function run()
{ 

$date = new Zend_Date();

// Output of the desired date
print $date->get();
}

Date is echoed out :(

Do i need to ask my host to recompile php with the spl_autoload module?
Advice please i feel am so close into BREAKING THIS!!!






rcastley wrote:
> 
> You will need the AllowOverride set to All so that the .htaccess can be
> picked up in your application directory.
>  
> Also check the DirectoryIndex had index.php appended to it as well.
>  
> - Robert
> 
>   _  
> 
> From: Dele [mailto:[EMAIL PROTECTED] 
> Sent: 09 December 2008 15:49
> To: Robert Castley; fw-general@lists.zend.com
> Subject: RE: [fw-general] ZF live settings
> 
> 
> Thanks I removed the references to Expires, still nothing. Do you think
> this
> could help adding it to the Virtual Host declarations :
>  
> AllowOverride All
> Options All
>  
> Because I have it for my local version on my apache config file. Thanks
> for
> all your help
>  
>  
> Regards
>  
> Dele
>  
> (C) 071 673 4130  (E) [EMAIL PROTECTED]  (S) dee454
>  
> "Start by doing what's necessary; then do what's possible; and suddenly
> you
> are doing the impossible. "- St. Francis of Assisi.
> 
> Disclaimer: This email and any files transmitted with it are confidential
> and intended solely for the use of the individual or entity to whom they
> are
> addressed. If you have received this email in error please notify the
> system
> manager. This message contains confidential information and is intended
> only
> for the individual named. If you are not the named addressee you should
> not
> disseminate, distribute or copy this e-mail. Please notify the sender
> immediately by e-mail if you have received this e-mail by mistake and
> delete
> this e-mail from your system. If you are not the intended recipient you
> are
> notified that disclosing, copying, distributing or taking any action in
> reliance on the contents of this information is strictly prohibited.
>  
> From: Robert Castley [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, December 09, 2008 5:40 PM
> To: Dele; fw-general@lists.zend.com
> Subject: RE: [fw-general] ZF live settings
>  
> Sometimes you are not allow to put apache module configurations in
> .htaccess.
>  
> Try also removing the references to Expires* and just use the .htaccess
> content I sent previously.
>  
> - Robert
>  
>   _  
> 
> From: Dele [mailto:[EMAIL PROTECTED] 
> Sent: 09 December 2008 15:14
> To: Robert Castley; fw-general@lists.zend.com
> Subject: RE: [fw-general] ZF live settings
> Thanks for the feedback Robert. I replaced the .htaccess file you sent me
> with the one I currently have. Still nothing L
>  
> Regards
>  
> Dele
>  
> (C) 071 673 4130  (E) [EMAIL PROTECTED]  (S) dee454
>  
> "Start by doing what's necessary; then do what's possible; and suddenly
> you
> are doing the impossible. "- St. Francis of Assisi.
> 
> Disclaimer: This email and any files transmitted with it are confidential
> and intended solely for the use of the individual or entity to whom they
> are
> addressed. If you have received this email in error please notify the
> system
> manager. This message contains confidential information and is intended
> only
> for the individual named. If you are not the named addressee you should
> not
> disseminate, distribute or copy this e-mail. Please notify the sender
> immediately by e-mail if you have received this e-mail by mistake and
> delete
> this e-mail from your system. If you are not the intended recipient you
> are
> notified that disclosing, copying, distributing

[fw-general] Zend_View URL Helper example

2008-12-09 Thread Aniketto

Hi all,
Can somebody point me to good example of using Zend_View URL Helper on net.
I googled a lot but didnt get anything.

Aniket
-- 
View this message in context: 
http://www.nabble.com/Zend_View-URL-Helper-example-tp20930067p20930067.html
Sent from the Zend Framework mailing list archive at Nabble.com.



RE: [fw-general] ZF live settings

2008-12-09 Thread dele454

When i put a try and catch block in my setupController function. I get this
error on my webpage:


Error parsing config/settings.ini on line 6 as well as 

Fatal error: Call to a member function dispatch() on a non-object in
/usr/local/lib/apps/Bootstrap.php on line 18

line 18 looks like this

$response = self::$front->dispatch();


public static function setupController()
{
   try{
// load the Zend Components
Zend_Loader::registerAutoload();
$date = new Zend_Date();

  // Output of the desired date
   echo $date->get();



//add the setting declared in settings.ini
$config = new Zend_Config_Ini('config/settings.ini', 
'development');
Zend_Registry::set('config', $config);

//create an instance of the front controller 
self::$front = Zend_Controller_Front::getInstance();
self::$front->throwExceptions(true);
self::$front->returnResponse(true);





// Set the default controller directory:
self::$front->setControllerDirectory(array('default' =>
$config->paths->data . '/controllers', 

   'admin'   => $config->paths->data .
'/modules/admin/controllers')); 
Zend_Layout::startMvc(array('layoutPath' => 
$config->paths->data .
'/views/layouts'));


// setup database connection variables
$params = array(
'host' => $config->database->hostname,
'username' => $config->database->username,
'password' => $config->database->password,
'dbname'   => $config->database->database);

$db = Zend_Db::factory($config->database->type, $params);
Zend_Db_Table_Abstract::setDefaultAdapter($db);
Zend_Registry::set('db', $db);


}
catch(Exception $e) {
 echo  $e->getMessage();

}



}

and settings.ini looks like this:

development]
>
> database.type  = pdo_mysql
> database.hostname   = mydomain.co.za
> database.username   = mydb007
> database.password   = mypass
> database.database   = mydb
>
> paths.data  = /usr/local/lib/apps
> paths.modules.admin = /usr/local/lib/apps/modules/admin 


is this a permission issue on Linux from my bootstrap file?




-
dee
-- 
View this message in context: 
http://www.nabble.com/ZF-live-settings-tp20911516p20930232.html
Sent from the Zend Framework mailing list archive at Nabble.com.



RE: [fw-general] ZF live settings

2008-12-09 Thread dele454

putting a double quote around the db password. took the error away but then
am still getting blank pages  :(

database.password   = "jserjs<=tusju72"

-
dee
-- 
View this message in context: 
http://www.nabble.com/ZF-live-settings-tp20911516p20930394.html
Sent from the Zend Framework mailing list archive at Nabble.com.