Re: [fw-general] Getting any Zend Framework set up in Eclipse & working on Ubuntu

2009-06-17 Thread ksgarrett

It's not the re-write; that's working.  I followed the instructions on this
article

http://devzone.zend.com/node/view/id/70

And found the re-write is working fine, but it's still throwing a missing
controller error -- which is visible in the index page when you run in
Eclipse.  The framework is looking for a controller based on the params
array of the Zend_Controller_Request_Http.  Those params are:

*::_params = Array [3]  
controller = (string:11) ZFMigration
action = (string:6) public  
module = (string:7) default 

This is the path to the default file, but I don't know why it's looking for
this...  What is not configured or set up right?



ksgarrett wrote:
> 
> .. but the re-write is not working. 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Getting-any-Zend-Framework-set-up-in-Eclipse---working-on-Ubuntu-tp24084782p24085417.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Getting any Zend Framework set up in Eclipse & working on Ubuntu

2009-06-17 Thread ksgarrett

I switched to a different workspace and am able to get past this error. 
(It's no longer looking for the Zend library file path that had somehow
gotten linked to a (now invalid) location.) 

Now it's looking for a controller based on my complete directory path, and
it's not skipping over the directories within the webserver that my project
is located within (even though I've got the documents root of the webserver
correctly set to the 'public' folder of my project.I can trace the code
into the Http class, where it gets assigned the path info.  

The weird part is -- it works fine outside of Eclipse - at least displaying
the initial page (whew!), but the re-write is not working.  I've read every
piece of documentation on this -- how do you get re-write to work on Ubuntu
on a virtual webhost?  Is there some trick?  Spending this much time just
getting the Quickstart not working is quite frustrating, especially as
others don't seem to have this issue arghh!  Any ideas?



Hi, I cannot seem to get any of the sample projects working.  I can get it
to work in the browser, and the initial page does show up as expected, but I
cannot run any of it through eclipse, as all I get is an "invalid
controller" message, called from the main index.php: 
$application->bootstrap();


-- 
View this message in context: 
http://www.nabble.com/Getting-any-Zend-Framework-set-up-in-Eclipse---working-on-Ubuntu-tp24084782p24085149.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] JSON Schema Component

2009-06-17 Thread Christoph Dorn
I was wondering if anybody has done any work on a JSON Schema [1] 
component or if there is any interest in such a component.


Christoph

[1] - http://groups.google.com/group/json-schema




[fw-general] Getting any Zend Framework set up in Eclipse & working on Ubuntu

2009-06-17 Thread ksgarrett

Hi, I cannot seem to get any of the sample projects working.  I can get it to
work in the browser, and the initial page does show up as expected, but I
cannot run any of it through eclipse, as all I get is an "invalid
controller" message, called from the main index.php: 
$application->bootstrap();

Here's my error stack.  Is there a special configuration needed for
debugging ZF apps?  I've spent 4 days so far, and I can't get past the
Quickstart.  Help!!  I know it can't be this difficult

  Stack trace: 
  #0
/home/fishpond/workspace-alt/zfproject/library/Zend/Controller/Front.php(945):
Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
Object(Zend_Controller_Response_Http))
#1
/home/fishpond/workspace-alt/zfproject/library/Zend/Application/Bootstrap/Bootstrap.php(77):
Zend_Controller_Front->dispatch()
#2 /home/fishpond/workspace-alt/zfproject/library/Zend/Application.php(328):
Zend_Application_Bootstrap_Bootstrap->run()
#3 /home/fishpond/workspace-alt/zfproject/public/index.php(26):
Zend_Application->run()
#4 {main} 
   
-- 
View this message in context: 
http://www.nabble.com/Getting-any-Zend-Framework-set-up-in-Eclipse---working-on-Ubuntu-tp24084782p24084782.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Autoloader confusion

2009-06-17 Thread Matthew Weier O'Phinney
-- MarkDNA  wrote
(on Wednesday, 17 June 2009, 02:10 PM -0700):
> lightflowmark wrote:
> > I feel I'm missing something with Zend_Loader_Autoload, as I can't make it
> > do what I want!
> > 
> > I think the relevant points are:
> > 1)  my models are are in a models directory and are not prefixed -
> > models/SomeTable.php contains class SomeTable extends
> > Zend_Db_Table_Abstract, etc.
> > 
> > 2) I'm using a 3rd-party library which has it's own autoloader, and also
> > does not use prefixes (DOMPDF), living in /library/DOMPDF
> > 
> > [SNIP]
> > 
> > Cheers,
> > Mark
> > 
> 
> This is a shot in the dark, but have you put  /library/DOMPDF into your
> include path and tried to use the ZF autoloader to load everything?
> 
> ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR .
> 'library/DOMPDF');
> require_once('Zend/Loader/Autoloader.php');
> $autoloader =
> Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true);
> 
> I don't think pushAutoLoader would work if DOMPDF isn't namespaced. Just
> make sure you have your models names different from any DOMPDF class. I tend
> to create wrapper classes for that very reason. Just a suggestion, I'm
> pretty new with the 1.8 autoloader myself!

It will work with or without the namespace. But you need to add the
autoloader either to the spl_autoload registry or to
Zend_Loader_Autoloader in order for it to work; the best situation is to
add it to Zend_Loader_Autoloader, which will ensure it is triggered
prior to any ZF autoloading mechanisms.

You can do it like this:

require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->pushAutoloader('whatever_the_dompdf_autoloader_is');

-- 
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/


Re: [fw-general] How to include the result of a request inside the phtml file ?

2009-06-17 Thread Matthew Weier O'Phinney
-- Juan Felipe Alvarez Saldarriaga  wrote
(on Tuesday, 16 June 2009, 11:56 PM -0500):
> Hey, Matthew, just to know, the action helper will be removed soon ? because
> some people doesn't like it (like action stack :P), the best approach here 
> will
> be create a view helper ?

Yeah, I probably should have mentioned that. :)

Actually, the action helper and the action stack will be sticking around
until 2.0. After that, the recommendation will be to use partials and/or
view helpers to achieve re-usable functionality such as that described
here.


> On Tue, Jun 16, 2009 at 4:48 PM, Matthew Weier O'Phinney 
> wrote:
> 
> -- debussy007  wrote
> (on Tuesday, 16 June 2009, 02:12 PM -0700):
> > When rendering the phtml file, I would like to get the result of a
> request
> > and put it in the html :
> >
> > [some html code ...]
> >
> >  >  // put the output of
> >  // $this->baseUrl . '/admin/widgets/' .  $widget . '/page/' .  
> $page
> >  // right here
> >  ?>
> >
> > [some html code ...]
> >
> > Does anyone know how to achieve this ?
> > Thank you for any help !!
> 
> Use the action() view helper, and pass it the module, controller,
> action, and any other parameters.
> 
> --
> Matthew Weier O'Phinney
> Project Lead| matt...@zend.com
> Zend Framework  | http://framework.zend.com/
> 
> 

-- 
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/


Re: [fw-general] Zend_Application_Module_Bootstrap doesn't work with default module

2009-06-17 Thread fab2008


Stratocaster wrote:
> 
> Your main 'Bootstrap.php' file should look something like this:
> 
> class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
> 
> protected function _initAutoload()
> {
> $moduleLoader = new Zend_Application_Module_Autoloader(array(
> 'namespace' => 'Default_',
> 'basePath'  => APPLICATION_PATH.''/modules/default" // (path
> to your 'Default' module)
> ));
> return $moduleLoader;
> } 
> }
> 

Yes, it does work!!!

Now I have to refactor all my module classes to match the new names, but I
think that this will bring a lot of improvements to my code.

Thanks for the advice.

Only one thing on which I'm not glad, before this update my models doesn't
have any prefix, so I had classes like Customers, Orders, etc. In this way
in my controller I can write

$customer = $customers->getById($id);
$customersOrders = $customer->findOrders();

now this become

$customer = $customers->getById($id);
$customersOrders = $customer->findAdmin_Model_DbTable_Orders();

and this is pretty ugly, don't you think??

Last thing, I think this is unnecessary, without this line it still works:


Stratocaster wrote:
> 
> And your 'Application.ini' file should containt these lines:
> 
> resources.frontController.controllerDirectory = APPLICATION_PATH
> "/controllers"
> 

I think, "controllers" is the default value, hence it isn't mandatory to
specify it in application.ini.

-- 
View this message in context: 
http://www.nabble.com/Zend_Application_Module_Bootstrap-doesn%27t-work-with-default-module-tp24062377p24083374.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Get Curl handle ressource when use Zend_Http_Client with Zend_Http_Client_Adapter_Curl

2009-06-17 Thread Benjamin Eberlei
On Tuesday 16 June 2009 06:36:58 pm MARTIN Nicolas wrote:
> Hi all,
>
> I use Zend_Http_Client with Zend_Http_Client_Adapter_Curl and I would like
> to get more informations and so use curl_getinfo($ch) [$ch is handle
> ressource]
> This handle ressource is the _curl property in
> Zend_Http_Client_Adapter_Curl. How get it ?
>
> For the moment I create my own My_Http_Client_Adapter_Curl and add method
>
> class My_Http_Client_Adapter_Curl extends Zend_Http_Client_Adapter_Curl
> {
> public function getInfo()
> {
> return curl_getinfo($this->_curl);
> }
> }
>
> Is it the best way to do?
> Or something can be change directly in the framework in a future release ?
>
> Thanks

hello, 

this cannot be done currently, but would be nice probably. Can you add a 
feature request in Jira Issue Tracker? I'll pick it up then.

greetings,
Benjamin

-- 
Benjamin Eberlei
http://www.beberlei.de


Re: [fw-general] disable magic_quotes_gpc

2009-06-17 Thread MarkDNA


Mantasgl wrote:
> 
> Hi,
> 
> I found that in my hosting company magic_quotes_gpc is on by default.
> 
> I can't turn them off in my .htaccess file, I get internal sever error. I
> used both:
> php_flag magic_quotes_gpc Off
> php_value magic_quotes_gpc Off
> 
> I solved this problem by adding this code in my bootstrap:
> if (get_magic_quotes_gpc()) 
>   {
>   function stripMagicQuotes(&$value)
>   {
>   $value = (is_array($value))
>  ? array_map('stripMagicQuotes', $value)
>  : stripslashes($value);
>   return $value;
>   }
>   stripMagicQuotes($_GET);
>   stripMagicQuotes($_POST);
>   stripMagicQuotes($_COOKIE); 
>   }
> 
> Is this a good tecnique? Maybe there is other solutions?
> 

That's pretty much what the php manual has for the situation. A note - your
stripMagicQuotes() returns a value, so you need: $_GET =
stripMagicQuotes($_GET); and so on.

-Mark

-
Mark Garrett
DNA
Arkadelphia, AR
(Telecommuting to: Rogue River, OR)
-- 
View this message in context: 
http://www.nabble.com/disable-magic_quotes_gpc-tp24081713p24082229.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Autoloader confusion

2009-06-17 Thread MarkDNA


lightflowmark wrote:
> 
> Hi,
> I feel I'm missing something with Zend_Loader_Autoload, as I can't make it
> do what I want!
> 
> I think the relevant points are:
> 1)  my models are are in a models directory and are not prefixed -
> models/SomeTable.php contains class SomeTable extends
> Zend_Db_Table_Abstract, etc.
> 
> 2) I'm using a 3rd-party library which has it's own autoloader, and also
> does not use prefixes (DOMPDF), living in /library/DOMPDF
> 
> [SNIP]
> 
> Cheers,
> Mark
> 

This is a shot in the dark, but have you put  /library/DOMPDF into your
include path and tried to use the ZF autoloader to load everything?

ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR .
'library/DOMPDF');
require_once('Zend/Loader/Autoloader.php');
$autoloader =
Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true);

I don't think pushAutoLoader would work if DOMPDF isn't namespaced. Just
make sure you have your models names different from any DOMPDF class. I tend
to create wrapper classes for that very reason. Just a suggestion, I'm
pretty new with the 1.8 autoloader myself!

-Mark

-
Mark Garrett
DNA
Arkadelphia, AR
(Telecommuting to: Rogue River, OR)
-- 
View this message in context: 
http://www.nabble.com/Autoloader-confusion-tp24030297p24082158.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] disable magic_quotes_gpc

2009-06-17 Thread Mantasgl

Hi,

I found that in my hosting company magic_quotes_gpc is on by default.

I can't turn them off in my .htaccess file, I get internal sever error. I
used both:
php_flag magic_quotes_gpc Off
php_value magic_quotes_gpc Off

I solved this problem by adding this code in my bootstrap:
if (get_magic_quotes_gpc()) 
{
function stripMagicQuotes(&$value)
{
$value = (is_array($value))
   ? array_map('stripMagicQuotes', $value)
   : stripslashes($value);
return $value;
}
stripMagicQuotes($_GET);
stripMagicQuotes($_POST);
stripMagicQuotes($_COOKIE); 
}

Is this a good tecnique? Maybe there is other solutions?
-- 
View this message in context: 
http://www.nabble.com/disable-magic_quotes_gpc-tp24081713p24081713.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] should i user Zend_Validate in a class to validate data

2009-06-17 Thread MarkDNA


mnaveed wrote:
> 
> Hi,
> Should I user Zend_Validator in my class to validate data? I will be using
> it in setter methods to verify that the values passed are valid or not. Is
> it the right thing to do?
> 

This depends on how you are getting the info to your action. If this data is
the result of a Zend_Form, then you can use the form itself to validate the
data:

public function getMainEditForm() {
 $mainForm = new Zend_Form();
 .
}

$form = $this->getMainEditForm();
if (!$form->isValid($_POST)) {
// failed validation
}

http://framework.zend.com/manual/en/zend.form.forms.html#zend.form.forms.validation
Manual entry on form Validation 

You will need to 
http://framework.zend.com/manual/en/zend.form.elements.html#zend.form.elements.validators
add validators  to the form elements. I like to use addValidator() in a
fluent interface:

$mainForm->createElement('TextBox',"contactEmail",array("label" => 'Email
Address', "trim"=>true,
'lowercase'=>true,))->setRequired(false)->addValidator("EmailAddress");

HTH,

Mark



-
Mark Garrett
DNA
Arkadelphia, AR
(Telecommuting to: Rogue River, OR)
-- 
View this message in context: 
http://www.nabble.com/should-i-user-Zend_Validate-in-a-class-to-validate-data-tp24070773p24081164.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Putting Zend Framework application online

2009-06-17 Thread Mantasgl

Thank you guys for all the help ;)

My hosting company doesn't allow to put folders outside httpdocs folder and
there no public_html folder. So I have to put everything inside httpdocs
folder.
Is it bad technique to cut out index.php from the httpdocs/public/ folder
and to paste it in httpdocs/ folder?
I did this, modified index.php, also other parts and this works fine.
What do you think about this method?
-- 
View this message in context: 
http://www.nabble.com/Putting-Zend-Framework-application-online-tp24050069p24078677.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Re: Cannot locate the right script

2009-06-17 Thread Vadim Gabriel
Forget the function i showed above. I am now using the viewRenderer action
helper to render the views.

What i did (and worked before)

$this->viewRenderer = new
Zend_Controller_Action_Helper_ViewRenderer($this->view);
$this->viewRenderer->setViewBasePathSpec( MODULE_PATH .
'views/'.$this->views_dir.'/'
)->setViewScriptPathSpec(':controller/:action.:suffix')->setViewSuffix('phtml');

Zend_Controller_Action_HelperBroker::addHelper($this->viewRenderer);

Then inside a controller:

public function indexAction()
{
$this->viewRenderer->render('index');
}

It should load the phtml from:
application/modules/cp/views/default/login/index.phtml
but it tries to load login.phtml and i have no idea why.

I set the path before i initiated the viewrenderer like this:

$this->view->setScriptPath( MODULE_PATH . 'views/'.$this->views_dir.'/' );

As well as stating the correct path in the viewRenderer setViewBasePathSpec
method.

I just want to point out that this worked before when i was using this
directory structure

application/modules/cp/views/scripts/login/index.phtml

So i am not sure why changing the directory structure causes this to break.
Moreover is that the page takes several seconds to load, Probably due to
it's trying to locate the file in the wrong directory. Any one knows why
this is happening? Or does any one know any method that passing a full path
for the required phtml file will load it and parse it as usual? I couldn't
find anything in the manual nor by manually browsing the files.

Thanks.


On Wed, Jun 17, 2009 at 10:30 AM, Vadim Gabriel  wrote:

> I am probably missing something but i am getting the following error:
>
>
> *Fatal error*: Uncaught exception 'Zend_View_Exception' with message
> 'script 'login.phtml' not found in path
> (C:\wamp\www\77workshop\application\modules\cp\views\default\layouts\;C:\wamp\www\77workshop\application\modules\default\views\scripts\;C:\wamp\www\77workshop\application\modules\cp\views\default\)'
> in C:\wamp\www\77workshop\library\Zend\View\Abstract.php:925 Stack trace: #0
> C:\wamp\www\77workshop\library\Zend\View\Abstract.php(828):
> Zend_View_Abstract->_script('login.phtml') #1
> C:\wamp\www\77workshop\library\Zend\Layout.php(787):
> Zend_View_Abstract->render('login.phtml') #2
> C:\wamp\www\77workshop\library\Zend\Layout\Controller\Plugin\Layout.php(142):
> Zend_Layout->render() #3
> C:\wamp\www\77workshop\library\Zend\Controller\Plugin\Broker.php(330):
> Zend_Layout_Controller_Plugin_Layout->postDispatch(Object(Zend_Controller_Request_Http))
> #4 C:\wamp\www\77workshop\library\Zend\Controller\Front.php(947):
> Zend_Controller_Plugin_Broker->postDispatch(Object(Zend_Controller_Request_Http))
> #5 C:\wamp\www\77workshop\public\index. in *
> C:\wamp\www\77workshop\library\Zend\View\Abstract.php* on line *925*
>
>
> I am calling a view by
>
> $this->display('index');
>
> The function:
>
> public function display($name='', $fullPath=false)
> {
> $path = MODULE_PATH . 'views/'. $this->views_dir . '/';
>
> $prefix = $this->_request->controller . '/';
>
> if($name != '')
> {
> $prefix .= $name;
> }
> else
> {
> $prefix .= $this->_request->action;
> }
>
> $prefix .= '/';
>
> if($fullPath === true)
> {
> $prefix = '';
> }
>
> $suffix = '.phtml';
>
> $script = $path . $prefix . $suffix;
>
> return $this->renderScript($script);
> }
>
> So eventually i have the full path to the location of the script. for some
> reason it displays the error above and clearly it calls for the wrong
> script.
> I tried looking for the place it actually calls the login.phtml script
> which is a wrong script to call.
>
> How can i make him call the script i am passing into the renderScript
> function? Or where is it located?
>
> Thanks.
>
> --
> Vincent Gabriel.
> Lead Developer, Senior Support.
> Zend Certified Engineer.
> Zend Framework Certified Engineer.
> -- http://www.vadimg.co.il/
>
>
>
>


-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/


Re: [fw-general] Zend_Application_Module_Bootstrap doesn't work with default module

2009-06-17 Thread Stratocaster

Your main 'Bootstrap.php' file should look something like this:

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {

protected function _initAutoload()
{
$moduleLoader = new Zend_Application_Module_Autoloader(array(
'namespace' => 'Default_',
'basePath'  => APPLICATION_PATH.''/modules/default" // (path to
your 'Default' module)
));
return $moduleLoader;
}   
}


And your 'Application.ini' file should containt these lines:

resources.frontController.controllerDirectory = APPLICATION_PATH
"/controllers"
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"

Reply if it works
Cya
-- 
View this message in context: 
http://www.nabble.com/Zend_Application_Module_Bootstrap-doesn%27t-work-with-default-module-tp24062377p24077931.html
Sent from the Zend Framework mailing list archive at Nabble.com.



RE: [fw-general] Problem with raw image output

2009-06-17 Thread Terre Porter
This worked for me.

function indexAction() {

// disable view and layout
Zend_Layout::getMvcInstance()->disableLayout();
$this->_helper->viewRenderer->setNoRender();

// setup realpath to image
$path_to_image = $_SERVER['DOCUMENT_ROOT'].'/images/EQ2_000192.jpg';

// set headers
header("Content-Type: image/jpeg");

// load image
$img = imagecreatefromjpeg($path_to_image);
// adjust quality
imagejpeg($img, NULL ,75);
// free memory used
imagedestroy($img); 

}

Instead of using passed params I just tested with a hardcoded image.

Maybe add in a validate that the image exists, if using params as this other
way could lead to potential code injection with out validation.
//  $img_dir = 'some dir';
//  $image = $this->_getParam('image');
//  $path_to_image = $img_dir . $image;

Also removed the exit as i've disabled the view rendering and the layout
rendering. 

Terre

-Original Message-
From: unlex [mailto:dmitr...@yandex.ru] 
Sent: Wednesday, June 17, 2009 5:37 AM
To: fw-general@lists.zend.com
Subject: [fw-general] Problem with raw image output


Hi,
I have the following problem. i need to output images thumbnails without
saving them to the disk. in other words I need to output raw image directly
to the browser. It's not a difficult task and I've done this many times BUT
not using ZF. But here I have a problem which I can't solve for several
days.

For example, I have the following URL

http://myhost/mymodule/mycontroller/...0617112012.JPG

which should output the thumbnail of the image.

(To simplify the example let's output just this image without thumbnailing
it.)

So I have the following code in myactionAction():
Code:

public function myactionAction()
{
  $this->_helper->viewRenderer->setNoRender();
  $img_dir = 'some dir';
  $image = $this->_getParam('image');
  $path_to_image = $img_dir . $image;
  $img = imagecreatefromjpeg($path_to_image);
  header('Content-type: image/jpeg');
  imagejpeg($img,'',75);
  exit;
}

So, unfortunately, this doesn't works. Browser outputs nothing.
If we don't send a header ( header('Content-type: image/jpeg') browser
outputs image in binary format, so there is not a problem with GD or image
creation. Moreover - if we write like that

imagejpeg($img,'temp.jpg',75);

we successefully get our image in temp.jpg. So saving works fine while
output doesn't work.

Can smb explain why I have such a strange problem?
Thanks in advance...
--
View this message in context:
http://www.nabble.com/Problem-with-raw-image-output-tp24070121p24070121.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Transferring site to 5.0.5 php installation

2009-06-17 Thread Tim Fountain
2009/6/17 Mark Steudel 

> I had to transfer a site from one server to another, and the new server is
> installed with 5.0.5. I'm now getting the following error when I include the
> PDO Mysql adapter:
>
> *Parse error*: syntax error, unexpected T_ARRAY, expecting '&' or
> T_VARIABLE in */netapp/whnas-swamp/s10/s10/01577/
> www.morbern.com/webdocs/Zend/library/Zend/Db/Adapter/Abstract.php* on line
> *238*
>
> I have version 1.5.1 of the framework installed ...


Just in case you didn't see the earlier reply to your message, ZF version
1.5.1 required PHP 5.1.4. The current version of ZF requires PHP 5.2.4 or
greater.

The line you're seeing an error on contains an array type hint for a class
method. This is a PHP feature that was introduced in PHP 5.1. You'll need to
try and persuade your server administrator to upgrade to a more recent
version of PHP, or move the site to a server that has one. Version 5.0.5 is
nearly four years old.

-- 
Tim Fountain
http://tfountain.co.uk/


Re: [fw-general] Problem with raw image output

2009-06-17 Thread Deanna Bonds

unlex wrote:

outside ZF. But I've tried to pass null and this had no effect.

  There is no matter what we pass in this case - '' or null. It works 
fine
I use a view to output an image.  After creating it with gd routines, I 
turn off layouts  and set view->img


This is my view code
  header('Content-Type: image/png');
  header('Cache-control: no-cache, no-store');
  imagepng($this->img);
  imagedestroy($this->img);


[fw-general] Transferring site to 5.0.5 php installation

2009-06-17 Thread Mark Steudel
I had to transfer a site from one server to another, and the new server is
installed with 5.0.5. I'm now getting the following error when I include the
PDO Mysql adapter:

require_once 'Zend/Db.php';
require_once 'Zend/Db/Adapter/Pdo/Mysql.php';


*Parse error*: syntax error, unexpected T_ARRAY, expecting '&' or T_VARIABLE
in */netapp/whnas-swamp/s10/s10/01577/
www.morbern.com/webdocs/Zend/library/Zend/Db/Adapter/Abstract.php* on line *
238*

I have version 1.5.1 of the framework installed ... not sure if upgrading to
the latest would solve this ... I only found one usable reference that this
might be a bug with the php version ... I'm at a bit of a loss ...

Thanks, Mark


Re: [fw-general] How to include the result of a request inside the phtml file ?

2009-06-17 Thread Juan Felipe Alvarez Saldarriaga
Hey, Matthew, just to know, the action helper will be removed soon ? because
some people doesn't like it (like action stack :P), the best approach here
will be create a view helper ?

Saludos.

On Tue, Jun 16, 2009 at 4:48 PM, Matthew Weier O'Phinney
wrote:

> -- debussy007  wrote
> (on Tuesday, 16 June 2009, 02:12 PM -0700):
> > When rendering the phtml file, I would like to get the result of a
> request
> > and put it in the html :
> >
> > [some html code ...]
> >
> >  >  // put the output of
> >  // $this->baseUrl . '/admin/widgets/' .  $widget . '/page/' .  $page
> >  // right here
> >  ?>
> >
> > [some html code ...]
> >
> > Does anyone know how to achieve this ?
> > Thank you for any help !!
>
> Use the action() view helper, and pass it the module, controller,
> action, and any other parameters.
>
> --
> Matthew Weier O'Phinney
> Project Lead| matt...@zend.com
> Zend Framework  | http://framework.zend.com/
>


[fw-general] Custom Filter Question

2009-06-17 Thread Deepak
Related to my previous post on slash(/) on query string, I wanted to
implement my custom filter.

OK I think understand some concept of custom filter. Now I have custom
filter implemented but it is not working.

I have
/application
 /library
   /My
 /Filter
Interface.php
Slash2Comma.php

Basically my idea is to replace the slash(/) with comma (,) and this is
how it looks like

Interface.php
++
setLabel('Search For:');
  $mysearch->setAttrib('size', '30');
  $mysearch->addPrefixPath('My_Filter', 'My/Filter/', 'filter');
  $mysearch->addFilter('Slash2Comma');
  $mysearch->addFilter('StringTrim');
...
...
...
}

+++

Now when I var_dump my query string, it is still the same. What's
wrong with my Slash2Comma code? Any suggestion?

Besides that if i execute query, i am getting SQL error

Sorry I still don't fully understand how to implement this.

Some correction is greatly appreciated.


[fw-general] Which one to choose?

2009-06-17 Thread Erwin Toze
Hi list!

I have to do a cms and I need some inspiration as I'm not a php expert.
But some zf based cms already exist on google code or github
So I'm wondering if you have any advice which one seems to be the more
complete, follows the best practices

Thanks for your help
Erwin


[fw-general] How to remove Page cache? (Was: Page/Core Cache share backend, but cannot remove Pages using Core?)

2009-06-17 Thread Phillip Winn
In further testing, this is a different problem than I'd realized.
$pageCache->remove($key) doesn't remove the key, either. I'm unsure how to
invalidate a page cache now, which makes the cache of dubious benefit.

I know about cancel(), but that seems designed to prevent a page from
caching in the first place, not to invalidate a page already cached.

-- Phillip Winn -- http://blogcritics.org/ -- 214/402-9466 --


On Wed, Jun 17, 2009 at 9:53 AM, Phillip Winn  wrote:

> I've set up both Page caching and Core caching using the same backend:
>
> $pageCache = Zend_Cache::factory('Page', 'Memcached',
> $frontendPageOptions, $backendOptions);
> $pageCache->start();
> $cache = Zend_Cache::factory('BC_Cache_Core', 'Memcached',
> $frontendCoreOptions, $backendOptions, true);
>
> When something happens to change a page, I need to invalidate the pageCache
> entry. I've stuck debug statements into the Page frontend, so I know what
> the keys are (fba2dd7c1183668852ea1667eafc88c0, for instance). Since I
> already have $cache available everywhere, including the model in which I
> determine that the cached page should be cleared, I'm using this to clear
> it:
>
> $cache->remove($key);
>
> Again, debugging demonstrates that the key is correct, matching the key
> that is created/used by pageCache. Since they share a backend, it seems that
> ->remove($key) ought to work with either cache object, but this appears to
> leave the object in place, though other cache keys I remove using the same
> approach immediately before and after that *are* removed.
>
> Since both cache objects share the same backend, can I remove using either
> one, or do I need to store *both* cache frontends in the registry and remove
> from each separately?
>
> -- Phillip Winn -- http://blogcritics.org/ -- 214/402-9466 --
>


[fw-general] question about 3 column layout

2009-06-17 Thread eng. Anatoli Marinov
Hi mates,
First I want to apologies for my questions. The myth be stupid I know
but could not find a good book for latest ZF.

I want to create a simple blog application with latest ZF.
I have a plan to use 3 column layout. First column will contain login
panel and other links. Second will be the panel with real content and
the last one will contain for example last 10 comments ...

How can I use something like:
$this->layout()->leftPanel
$this->layout()->rightPanel
$this->layout()->middleContent

Please hemp me how to start developing this application :)

I also wandering how to create a module for the admin panel. I've read
something mentioned for modules but do not know how to create a
module.


-- 
Best Regards
Anatoli Marinov, MSc


[fw-general] Page/Core Cache share backend, but cannot remove Pages using Core?

2009-06-17 Thread Phillip Winn
I've set up both Page caching and Core caching using the same backend:

$pageCache = Zend_Cache::factory('Page', 'Memcached',
$frontendPageOptions, $backendOptions);
$pageCache->start();
$cache = Zend_Cache::factory('BC_Cache_Core', 'Memcached',
$frontendCoreOptions, $backendOptions, true);

When something happens to change a page, I need to invalidate the pageCache
entry. I've stuck debug statements into the Page frontend, so I know what
the keys are (fba2dd7c1183668852ea1667eafc88c0, for instance). Since I
already have $cache available everywhere, including the model in which I
determine that the cached page should be cleared, I'm using this to clear
it:

$cache->remove($key);

Again, debugging demonstrates that the key is correct, matching the key that
is created/used by pageCache. Since they share a backend, it seems that
->remove($key) ought to work with either cache object, but this appears to
leave the object in place, though other cache keys I remove using the same
approach immediately before and after that *are* removed.

Since both cache objects share the same backend, can I remove using either
one, or do I need to store *both* cache frontends in the registry and remove
from each separately?

-- Phillip Winn -- http://blogcritics.org/ -- 214/402-9466 --


Re: [fw-general] Problem with raw image output

2009-06-17 Thread unlex



Mon Zafra wrote:
> 
> From http://php.net/imagejpeg, it says you need to pass null as the second
> arg if you want to skip it but need to specify the quality. An empty
> string
> is not the same as null. Try imagejpeg($img,null,75);   
> 

There is no matter what we pass in this case - '' or null. It works fine
outside ZF. But I've tried to pass null and this had no effect.

-- 
View this message in context: 
http://www.nabble.com/Problem-with-raw-image-output-tp24070121p24075226.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Problem with raw image output

2009-06-17 Thread Mon Zafra
>From http://php.net/imagejpeg, it says you need to pass null as the second
arg if you want to skip it but need to specify the quality. An empty string
is not the same as null. Try imagejpeg($img,null,75);

   -- Mon


On Wed, Jun 17, 2009 at 5:37 PM, unlex  wrote:

>
> Hi,
> I have the following problem. i need to output images thumbnails without
> saving them to the disk. in other words I need to output raw image directly
> to the browser. It's not a difficult task and I've done this many times BUT
> not using ZF. But here I have a problem which I can't solve for several
> days.
>
> For example, I have the following URL
>
> http://myhost/mymodule/mycontroller/...0617112012.JPG
>
> which should output the thumbnail of the image.
>
> (To simplify the example let's output just this image without thumbnailing
> it.)
>
> So I have the following code in myactionAction():
> Code:
>
> public function myactionAction()
> {
>  $this->_helper->viewRenderer->setNoRender();
>  $img_dir = 'some dir';
>  $image = $this->_getParam('image');
>  $path_to_image = $img_dir . $image;
>  $img = imagecreatefromjpeg($path_to_image);
>  header('Content-type: image/jpeg');
>  imagejpeg($img,'',75);
>  exit;
> }
>
> So, unfortunately, this doesn't works. Browser outputs nothing.
> If we don't send a header ( header('Content-type: image/jpeg') browser
> outputs image in binary format, so there is not a problem with GD or image
> creation. Moreover - if we write like that
>
> imagejpeg($img,'temp.jpg',75);
>
> we successefully get our image in temp.jpg. So saving works fine while
> output doesn't work.
>
> Can smb explain why I have such a strange problem?
> Thanks in advance...
> --
> View this message in context:
> http://www.nabble.com/Problem-with-raw-image-output-tp24070121p24070121.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


[fw-general] Field not updating when textbox have space

2009-06-17 Thread jigen7

hello I've got a problem here i manage to do a code where i displays the rows
of a table then i'd put them in an textbox so user can edit it. i manage to
get the code where you update all the rows once a button is pressed but the
problem is when a text with a space is inputted the row is not updated. 

here the view code 
table as $tables) : ?>






   viewAccess('deletecategory','')){?>

 





   viewAccess('editcategory','')){?>



then here's my controller action code 

if ($button == 'Update') { 

foreach ($this->_request->getPost('row') as $id => $row) {
$string = "
\$curr_model->updateSelect_{$table}($row[id],$row[editid],$row[value],$row[wt]);";
eval($string);
}
$this->_redirect('/admin/crview/crit/'.$table);
}


-- 
View this message in context: 
http://www.nabble.com/Field-not-updating-when-textbox-have-space-tp24072465p24072465.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] How to include the result of a request inside the phtml file ?

2009-06-17 Thread debussy007

Thank you !! Very powerful !!



Matthew Weier O'Phinney-3 wrote:
> 
> -- debussy007  wrote
> (on Tuesday, 16 June 2009, 02:12 PM -0700):
>> When rendering the phtml file, I would like to get the result of a
>> request
>> and put it in the html :
>> 
>> [some html code ...]
>> 
>> >  // put the output of 
>>  // $this->baseUrl . '/admin/widgets/' .  $widget . '/page/' .  $page
>>  // right here
>>  ?>
>> 
>> [some html code ...]
>> 
>> Does anyone know how to achieve this ?
>> Thank you for any help !!
> 
> Use the action() view helper, and pass it the module, controller,
> action, and any other parameters.
> 
> -- 
> Matthew Weier O'Phinney
> Project Lead| matt...@zend.com
> Zend Framework  | http://framework.zend.com/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-include-the-result-of-a-request-inside-the-phtml-file---tp24062971p24071953.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Loader_Autoloader: Must I rewrite all my class and instances?

2009-06-17 Thread Mon Zafra
You can add application/models to your include path and set the fallback
flag

set_include_path(get_include_path() . PATH_SEPARATOR .
'../application/models');
$autoloader->setFallbackAutoloader(true);

   -- Mon


On Wed, Jun 17, 2009 at 3:03 PM, Alessandro Camilli wrote:

>
> In my folder ../application/models/
> there are many classes.
>
> With the new behavior of zf 1.8.3 :
> In my bootstrap:
>
> require_once 'Zend/Loader/Autoloader.php';
> $autoloader = Zend_Loader_Autoloader::getInstance();
>
> $autoloader->registerNamespace('My');
> $autoloader->registerNamespace('i5');
>
>
> $resourceLoader= new Zend_Loader_Autoloader_Resource(array(
>'basePath'  =>  APPLICATION_DIRECTORY . '/',
>'namespace' => '',
>'resourceTypes' =>  array(
>'models' => array(
>'path' => 'models/',
>'namespace' => 'Model'
>),
>'forms' =>  array(
>'path'  => 'forms/',
>'namespace' => 'Form'
>),
>)
> ));
>
> Must I class change in models?
> from
> class User {}
> to
> class Model_User
>
> and after all my instances?
> from
> user = new User()
> to
> user = new Model_User()
>
>
> --
> View this message in context:
> http://www.nabble.com/Zend_Loader_Autoloader%3A-Must-I-rewrite-all-my-class-and-instances--tp24068063p24068063.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


[fw-general] should i user Zend_Validate in a class to validate data

2009-06-17 Thread mnaveed

Hi,
Should I user Zend_Validator in my class to validate data? I will be using
it in setter methods to verify that the values passed are valid or not. Is
it the right thing to do?


-- 
View this message in context: 
http://www.nabble.com/should-i-user-Zend_Validate-in-a-class-to-validate-data-tp24070773p24070773.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Problem with raw image output

2009-06-17 Thread unlex

Hi,
I have the following problem. i need to output images thumbnails without
saving them to the disk. in other words I need to output raw image directly
to the browser. It's not a difficult task and I've done this many times BUT
not using ZF. But here I have a problem which I can't solve for several
days.

For example, I have the following URL

http://myhost/mymodule/mycontroller/...0617112012.JPG

which should output the thumbnail of the image.

(To simplify the example let's output just this image without thumbnailing
it.)

So I have the following code in myactionAction():
Code:

public function myactionAction()
{
  $this->_helper->viewRenderer->setNoRender();
  $img_dir = 'some dir';
  $image = $this->_getParam('image');
  $path_to_image = $img_dir . $image;
  $img = imagecreatefromjpeg($path_to_image);
  header('Content-type: image/jpeg');
  imagejpeg($img,'',75);
  exit;
}

So, unfortunately, this doesn't works. Browser outputs nothing.
If we don't send a header ( header('Content-type: image/jpeg') browser
outputs image in binary format, so there is not a problem with GD or image
creation. Moreover - if we write like that

imagejpeg($img,'temp.jpg',75);

we successefully get our image in temp.jpg. So saving works fine while
output doesn't work.

Can smb explain why I have such a strange problem?
Thanks in advance...
-- 
View this message in context: 
http://www.nabble.com/Problem-with-raw-image-output-tp24070121p24070121.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Testing Zend controllers

2009-06-17 Thread mfuller

I'm trying to create a controller test. When I run the test I get 
Zend_Controller_Exception: No default module defined for this application
... library/Zend/Controller/Dispatcher/Standard.php:380
... library/Zend/Controller/Dispatcher/Standard.php:203
... library/Zend/Controller/Dispatcher/Standard.php:237
... library/Zend/Controller/Front.php:934
... library/Zend/Test/PHPUnit/ControllerTestCase.php:170
...
tests/unit/application/modules/person/controllers/PersonControllerTest.php:18 

When I go to localhost/public/person/person/ via a browser everything works
fine.

This is how I run my tests: phpunit --verbose --bootstrap  {absolute path to
bootstrape file}

I know it's loading the bootstrap file because of the echo 'BOOTSTRAP TEST';
which is displayed.

My test class
class PersonControllerTest extends Zend_Test_PHPUnit_ControllerTestCase {

public function testRedirectForUnknownAction() {
$this->dispatch('/person/person');
}
}

My bootstrap file:
db);
Zend_Db_Table::setDefaultAdapter($db);

// setup controller
$frontController = Zend_Controller_Front::getInstance();
$frontController->throwExceptions(true);
$frontController->setControllerDirectory(APP_DIR . 'controllers');
$frontController->addModuleDirectory(APP_DIR . 'modules');
$frontController->setDefaultModule('default');

PHP: 5.2.5 on MAMP
Zend Framework: 1.7.8
PHPUnit: 3.3.17

Thanks!
-- 
View this message in context: 
http://www.nabble.com/Testing-Zend-controllers-tp24068771p24068771.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] TinyMce editor

2009-06-17 Thread Dalibor Karlović
On Wednesday 17 June 2009 01:44:36 Juan Felipe Alvarez Saldarriaga wrote:
> Hey, what about FCKEditor ? I love the "browse server files" feature.

It's Dojo vs. the others all over again. :) IMHO, a component should be chosen 
and included in Standard with interfaces and base classes written (let's say 
its TinyMCE) while FCK, MarkItUp and any other could/should end up in Extras, 
written against previously defined interfaces.

>
> On Tue, Jun 16, 2009 at 7:19 AM, Sergio Rinaudo 
wrote:
> > The only html capabilities I want to give to my users is bold,
> > underlined, italic and coloured text, and also  tag to add images (
> > clicking an image from the media library ), and with markitup I can get
> > all of this, as you can see in this example implementation
> >
> > http://markitup.jaysalvat.com/examples/interaction/
> >
> > I don't want to say 'MarkItUp is better, forget all the rest', but I
> > noticed it is very fast, very simple to customize, any textarea can be
> > enabled/disabled runtime ( maybe also in tinymce, but I don't know how..
> > ), and this helped me a lot implement it in my multilanguage editor ( I
> > have more instances of the same form, only one is displayed, and only in
> > this one markitup is enabled )
> >
> > It just worked for me :)
> > Bye
> >
> >
> > Sergio Rinaudo
> >
> >> Date: Tue, 16 Jun 2009 03:37:43 -0700
> >> From: matt.cocka...@hotmail.co.uk
> >> To: fw-general@lists.zend.com
> >> Subject: Re: [fw-general] TinyMce editor
> >>
> >>
> >> I'm inclined to agree with Jurian. Im not familiar with MarkItUp but
> >> haveing
> >> looked at the website I know that I dont want users to have to need a
> >> knowledge of any form of mark up language in order to get the results
> >> they want. With that as the premise for using wysiwyg I can think of a
> >> lot of editors that fit that criteria a lot better than MarkItUp
> >>
> >> Jurian Sluiman wrote:
> >> > Well MarkItUp is a different editor. While TinyMCE is a wysiwyg
> >> > editor, MarkItUp implies you have knowledge of the markup language.
> >> >
> >> > I can't expect all my visitors know html or the wiki syntax. While
> >> > MarkItUp
> >> > has a fast and simple interface, for advanced editing TinyMCE is imho
> >> > better.
> >> >
> >> > Sergio Rinaudo wrote:
> >> >>> In the end I choose Markitup! for my application,
> >> >>> that I think is hundred times simpler than TinyMce
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/TinyMce-editor-tp23544383p24051703.html
> >> Sent from the Zend Framework mailing list archive at Nabble.com.
> >
> > 
> > Personalizza Messenger 2009. Scegli la grafica che ti rappresenta meglio!

-- 
Dado


[fw-general] Cannot locate the right script

2009-06-17 Thread Vadim Gabriel
I am probably missing something but i am getting the following error:


*Fatal error*: Uncaught exception 'Zend_View_Exception' with message 'script
'login.phtml' not found in path
(C:\wamp\www\77workshop\application\modules\cp\views\default\layouts\;C:\wamp\www\77workshop\application\modules\default\views\scripts\;C:\wamp\www\77workshop\application\modules\cp\views\default\)'
in C:\wamp\www\77workshop\library\Zend\View\Abstract.php:925 Stack trace: #0
C:\wamp\www\77workshop\library\Zend\View\Abstract.php(828):
Zend_View_Abstract->_script('login.phtml') #1
C:\wamp\www\77workshop\library\Zend\Layout.php(787):
Zend_View_Abstract->render('login.phtml') #2
C:\wamp\www\77workshop\library\Zend\Layout\Controller\Plugin\Layout.php(142):
Zend_Layout->render() #3
C:\wamp\www\77workshop\library\Zend\Controller\Plugin\Broker.php(330):
Zend_Layout_Controller_Plugin_Layout->postDispatch(Object(Zend_Controller_Request_Http))
#4 C:\wamp\www\77workshop\library\Zend\Controller\Front.php(947):
Zend_Controller_Plugin_Broker->postDispatch(Object(Zend_Controller_Request_Http))
#5 C:\wamp\www\77workshop\public\index. in *
C:\wamp\www\77workshop\library\Zend\View\Abstract.php* on line *925*


I am calling a view by

$this->display('index');

The function:

public function display($name='', $fullPath=false)
{
$path = MODULE_PATH . 'views/'. $this->views_dir . '/';

$prefix = $this->_request->controller . '/';

if($name != '')
{
$prefix .= $name;
}
else
{
$prefix .= $this->_request->action;
}

$prefix .= '/';

if($fullPath === true)
{
$prefix = '';
}

$suffix = '.phtml';

$script = $path . $prefix . $suffix;

return $this->renderScript($script);
}

So eventually i have the full path to the location of the script. for some
reason it displays the error above and clearly it calls for the wrong
script.
I tried looking for the place it actually calls the login.phtml script which
is a wrong script to call.

How can i make him call the script i am passing into the renderScript
function? Or where is it located?

Thanks.

-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/


Re: [fw-general] Fwd: Transferring site to 5.0.5 php installation

2009-06-17 Thread Ben Scholzen 'DASPRiD'
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

You need at least version 5.1.4 or later, source:

http://framework.zend.com/svn/framework/standard/branches/release-1.5/documentation/manual/en/ref/requirements.xml

Any newer ZF version depends on an even higher PHP version.
...
:  ___   _   ___ ___ ___ _ ___:
: |   \ /_\ / __| _ \ _ (_)   \   :
: | |) / _ \\__ \  _/   / | |) |  :
: |___/_/:\_\___/_| |_|_\_|___/   :
:::
: Web: http://www.dasprids.de :
: E-mail : m...@dasprids.de   :
: Jabber : jab...@dasprids.de :
: ICQ: 105677955  :
:::


Mark Steudel schrieb:
> Sorry if this is a duplicate wasn't fully signed up on the list before I
> sent this 
> 
> I had to transfer a site from one server to another, and the new server
> is installed with 5.0.5. I'm now getting the following error when I
> include the PDO Mysql adapter:
> 
> require_once 'Zend/Db.php';
> require_once 'Zend/Db/Adapter/Pdo/Mysql.php';
> 
> 
> *Parse error*: syntax error, unexpected T_ARRAY, expecting '&' or
> T_VARIABLE in
> */netapp/whnas-swamp/s10/s10/01577/www.morbern.com/webdocs/Zend/library/Zend/Db/Adapter/Abstract.php
> *
> on line *238*
> 
> I have version 1.5.1 of the framework installed ... not sure if
> upgrading to the latest would solve this ... I only found one usable
> reference that this might be a bug with the php version ... I'm at a bit
> of a loss ...
> 
> Thanks, Mark
> 
> 
> 
> -- 
> 
> -
> Mark Steudel
> P: 206.375.7244
> msteu...@gmail.com 
> 
> . : Work : .
> http://www.mindfulinteractive.com
> 
> . : Play : .
> http://www.steudel.org/blog
> 
> 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAko4mHEACgkQ0HfT5Ws789AYawCeNBQxmyErsevXAIL7KJedasYU
OacAoMMxEGZDSpd3cRP4KK+qOIWFNW0j
=DENR
-END PGP SIGNATURE-


[fw-general] Zend_Loader_Autoloader: Must I rewrite all my class and instances?

2009-06-17 Thread Alessandro Camilli

In my folder ../application/models/
there are many classes.

With the new behavior of zf 1.8.3 :
In my bootstrap:

require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();

$autoloader->registerNamespace('My');
$autoloader->registerNamespace('i5');


$resourceLoader= new Zend_Loader_Autoloader_Resource(array(
'basePath'  =>  APPLICATION_DIRECTORY . '/',
'namespace' => '',
'resourceTypes' =>  array(
'models' => array(
'path' => 'models/',
'namespace' => 'Model'
),
'forms' =>  array(
'path'  => 'forms/',
'namespace' => 'Form'
),
)
));

Must I class change in models?
from 
class User {}
to
class Model_User

and after all my instances?
from 
user = new User()
to
user = new Model_User()


-- 
View this message in context: 
http://www.nabble.com/Zend_Loader_Autoloader%3A-Must-I-rewrite-all-my-class-and-instances--tp24068063p24068063.html
Sent from the Zend Framework mailing list archive at Nabble.com.