Re: [fw-general] zend tool - Cannot redeclare class Zend_Loader in ...

2009-09-25 Thread Raphael Stolt
Hi Bagus,

Regarding your below stated error, this is a known
issue<http://framework.zend.com/issues/browse/ZF-7894>.
It's caused by Zend_Tool loading the DataProvider class/file of PHPUnit into
the include_path twice, as it ends on Provider.

You have two choices two (hot)fix this by reverting to PHPUnit Version
3.3.17 or by applying the 7894.diff attached to the open issue, which simply
excludes the PHPUnit DataProvider from being added to the include_path in
Zend_Tool_Framework_Loader_IncludePathLoader.

Cheers,

Raphael Stolt

Blog:http://raphaelstolt.blogspot.com
Twitter: http://twitter.com/raphaelstolt

2009/9/25 Bagus Nugroho 

>  I got same error when use PHPUnit-3.4.0, but working fine if use
> PHPUnit-3.3.9
> ===
> PHP Fatal error:  Cannot redeclare class
> phpunit_framework_testsuite_dataprovid
> r in C:\Library\PHPUnit\Framework\TestSuite\DataProvider.php on line 64
> PHP Stack trace:
> PHP   1. {main}() C:\PHP\zf.php:0
> PHP   2. zf_main() C:\PHP\zf.php:23
> PHP   3. zf_run() C:\PHP\zf.php:36
> PHP   4. Zend_Tool_Framework_Client_Console::main() C:\PHP\zf.php:214
> PHP   5. Zend_Tool_Framework_Client_Abstract->dispatch()
> C:\Library\Zend\Tool\F
> amework\Client\Console.php:96
> PHP   6. Zend_Tool_Framework_Client_Abstract->initialize()
> C:\Library\Zend\Tool
> Framework\Client\Abstract.php:209
> PHP   7. Zend_Tool_Framework_Loader_Abstract->load()
> C:\Library\Zend\Tool\Frame
> ork\Client\Abstract.php:118
> PHP   8. include_once()
> C:\Library\Zend\Tool\Framework\Loader\Abstract.php:90
> ===
>
> Is any different should be configured if used PHPUnit-3.4.0?
>
>
> Regards,
> bn
>
> --
> *From:* scs [mailto:sasc...@gmail.com]
> *Sent:* Fri 25-Sep-2009 17:55
> *To:* fw-general@lists.zend.com
> *Subject:* [fw-general] zend tool - Cannot redeclare class Zend_Loader in
> ...
>
>  Hello,
> Is it wrong to use zf tool from a different folder with a separate
> library folder (other than the project's library)?
> This is the case:
>
> I always get the same error
> "Fatal error: Cannot redeclare class Zend_Loader in .."
> whenever I try to create a new action or something else.
>
> I have a separate directory for zf tool like below:
> /home/username/zftool/
> /home/username/zftool/bin
> /home/username/zftool/library/Zend/...
>
> I created an alias for zf.sh file on my linux machine so that I can
> call it from anywhere.
>
> With the first creation of a project (/var/www/project/), everything is
> okay.
> But after I upload the library/Zend folders under the project's
> library folder (/var/www/project/application/library),
> it breaks the zf tool's working.
> If I try to create a new controller, action etc., I get the cannot
> redeclare error.
>
> I found a workaround for this:
> I rename the projects library folder (/var/www/project/application/
> library) to something else, and the zf tool works without any error.
>
> However, whenever I need to create something with zf tool, I need to
> rename the library folder and after creation,
> I need to rename it back to its previous name.
>
> Something wrong with me or the zf tool?
>
> thanks
> scs
>


Re: [fw-general] ZF 1.9.3 and phpunit 3.4.0 zf_tool problem

2009-09-22 Thread Raphael Stolt
Hi Benjamin,

Can you provide some tips on how to catch if PHPUnit 3.4.0 is twice in the
include_path and on how to remove it it this is the case? As I had the same
problem and after reverting to one release before PHPUnit 3.4.0 the problem
was gone.

Cheers,

Raphael

2009/9/22 Benjamin Eberlei 

>
> do you have phpunit on your include path twice?
>
> On Tue, 22 Sep 2009 18:06:15 +0200, Ladislav Prskavec
>  wrote:
> > If run zf tool:
> >
> >  >zf version
> >
> > Fatal error: Cannot redeclare class
> > phpunit_framework_testsuite_dataprovider in
> >
>
> /usr/local/zend/share/pear/PEAR/PHPUnit/Framework/TestSuite/DataProvider.php
> >
> > on line 64
> >
> > Using Ubuntu 9.04 with Zend Server CE 4.0.5 (php 5.2.10, tested zf 1.9.2
> > and 1.9.3 )
> >
> > Ladislav
>


Re: [fw-general] Re: Best to use CLI in my ZF 1.9 Application

2009-08-20 Thread Raphael Stolt
Hi Stefan,

You might also take a look at Zend_Tool_Project_Providers which allow you to
create custom providers which handle the scenarios you described in the
first mail. Plus by hooking them into the Zend Tool environment you can call
them as desired via CLI.

Hope that helps a bit.

Cheers,

Raphael Stolt

2009/8/20 Stefan Sturm 

> Hello,
>
> I found this tutorial to setup a cli enviroment:
>
> http://webfractor.wordpress.com/2008/08/14/using-zend-framework-from-the-command-line/
>
> But I would like to use Zend_Application to handle this...
>
> Perhaps somebody can help me on this.
>
> Thanks and greetings,
> Stefan Sturm
>


Re: [fw-general] Is there allready some kind of zf-create script ?

2007-08-26 Thread Raphael Stolt
Hello Everybody,

Finally finished today a basic Phing buildfile ready to create a basic Zend 
Framework project skeleton.

You might read more about it and its features at my current blog post.

Cheers,

Raphael Stolt 

- Original Message - 
From: "Truppe Steven" <[EMAIL PROTECTED]>
To: 
Sent: Friday, August 24, 2007 2:31 AM
Subject: [fw-general] Is there allready some kind of zf-create script ?


> Hi again,
> 
> i wonder if there is a script that creates the basic directory structure
> and files needed for every new zend project.
> 
> i think this would be a nice feature (when it can get a bit customized
> so that the user can set the structure like he wants and the script does
> the needed stuff for the bootstrap file!)
> 
> i haven't found such a tool yet so i start writing one, at the moment
> only for my personal education,
> i hope this will help some people getting started with the zend
> framework much faster.
> 
> maybe someone finds the idea interessting and reply to this message.
> 
> 
> 
> 
> 
> best regards,
> Truppe Steven 


Re: [fw-general] Zend Framework Project Creator

2007-08-05 Thread Raphael Stolt
Hello,

I already thought about implementing something similar via a Phing built
file with targets for:
+ creating the application directory structure
+ generating skeletons for 'start' model and controller
+ getting or svn checkout of the latest Zend Framework version/release
+ setting .htacess
+ generating a basic bootstrap(include ZF, setup logger)
+ automated database integration

Is this a route to go?

Best regards,

Raphael Stolt

- Original Message -
From: "Franziskus Domig" <[EMAIL PROTECTED]>
To: 
Sent: Saturday, August 04, 2007 11:51 PM
Subject: [fw-general] Zend Framework Project Creator


> Hello,
>
> maybe there is someone interested in:
>
> Because I was to lazy to create the whole structure and files for a new
> Zend Framework project every time again, I started thinking about a
> simple script to create the basic structure and files automatically.
>
> I have been busy the last days to create an automated "installer" for a
> new Zend Framework project, which offers currently just some basic
> features but I am working on more features by now.
>
> Currently it is possible to create the application-structure, includes
> the Zend Framework library, adds a configuration file in your
> config-path, creates a individual bootstrap file (index.php) with allows
> you to access a specific database and also creates the basic .htaccess
> RewriteRule.
>
> I am adding currently the feature to add automatic a set of controllers
> with specific actions. Also I am working on creating automatic models
> and creating the specific database-table to it.
>
> If you are interested in:
> [1]Zend Framework Project Creator Website
>
> Regards,
> Franziskus Domig
>
> [1] http://domig.org/ZendFrameworkProjectCreator/Latest



[fw-general] Zend_Registry

2007-04-16 Thread Raphael Stolt

Hello everybody,

Shouldn't Zend_Registry::set('index','value') throw an exception or at least
indicate an intended overwriting, when trying to add a different value to
the same index, or better said to overwrite an already existing value
somewhere in the application. 

Or do I have to explicit check for the index via Zend_Registry::is
Registered('index') and then compare the old value against the new value and
decide the further actions?

Just stumbled over it while glancing at the class source of Zend_Registry.

Best regards,

Raphael Stolt
-- 
View this message in context: 
http://www.nabble.com/Zend_Registry-tf3583670s16154.html#a10013768
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Registry or Global ?

2007-04-16 Thread Raphael Stolt

Hello Yannux,

I would prefer/suggest the use of the ZF registry, as one of it's goal is to
reduce and to abandon the use of 'bad' globals in an application. Regarding
the 'badness' of globals I would like to point you to this blog 
http://blog.case.edu/gps10/2006/07/22/why_global_variables_in_php_is_bad_programming_practice
post .

Best Regards,

Raphael Stolt



Yann Nave wrote:
> 
> Hello everybody,
> 
> I would like to use some of my config.ini parameters in controllers.
> So what the best between :
> 
> index.php
> // load configuration
> $config = new Zend_Config_Ini('config.ini', 'general');
> Zend_Registry::set('config', $config);
> 
> MyController.php
> $config = Zend_Registry::get('config');
> $config->my_param;
> 
> --
> AND
> --
> 
> index.php
> // load configuration
> $config = new Zend_Config_Ini('config.ini', 'general');
> 
> MyController.php
> global config;
> $config->my_param;
> 
> 
> Thanks
> -- 
> Yannux
> http://blog.onbebop.net
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Registry-or-Global---tf3582918s16154.html#a10013362
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Log_Formatter_Xml

2007-04-11 Thread Raphael Stolt
Hello all,

When using the Zend_Log_Formatter_Xml with a customized root element and 
logging to it multiple times there are several root elements and the final xml 
log file is not valid.

Taken from the example 19.3.2. Formatting to XML in the docs a 2 times info log 
results in the following xml log file.

informational messageINFO
informational message 1INFO

I think the log file content should look be something like this.


informational messageINFO
 informational message 1INFO


I set it up via the example stated in the doc. Excerpt from the docs and used 
as an example in bootstrap file.

$writer = new Zend_Log_Writer_Stream('../logs/test.xml');
$formatter = new Zend_Log_Formatter_Xml('log', array('msg' => 'message', 
'level' => 'priorityName'));
$writer->setFormatter($formatter);

$logger = new Zend_Log();
$logger->addWriter($writer);

$logger->info('informational message');
$logger->info('informational message 1');

Am I missing something on logging multiple message collected under a single 
root element?

Thanks for any enlighten hint. Or is this an uncovered issue?

Raphael Stolt
 


Re: [fw-general] zend_session question

2007-04-03 Thread Raphael Stolt

Have you checked the session.save_path in your php.ini. I ran in the same
problem when updating from ZF 0.8 to 0.9.1, because in my php.ini it wasn't
set and so also not writeable. Setting the path would also switch to the use
of file-based session storage and retrieval.

Hope this is a starting point.

Raphael Stolt


Tomek Nowak wrote:
> 
> i wrote a class 
> 
> require_once 'Zend/Session/SaveHandler/Interface.php';
> 
> class Session2 implements  Zend_Session_SaveHandler_Interface
> {
> 
>   public  $maxLifeTime;
> 
>   public  $dbConnect;
> 
>public function __construct($dbConnect,$maxLifeTime = 1500) {
>   $this->dbConnect = $dbConnect;
>   $this->maxLifeTime = $maxLifeTime;
>}
> 
> public function open($save_path, $name){
>$this->gc( $this->maxLifeTime);
>return true;
> }
> 
> 
> public function close() {
>   return true;
> }
> 
> public function read($id){
>   $select = $this->dbConnect->select();
>   $select->from('sessions');
>   $select->where('session_id = ?',$id);
>   $fetch = $this->dbConnect->fetchAll($select);
>   if (count($fetch) == 1) {
>   return stripslashes($fetch[0]['dane']);
>   } else {
>   $dane = 
> array('session_id'=>$id,'last_update'=>date("Y-m-d
> H:i:s"),'dane'=>"");
>   $this->dbConnect->insert('sessions',$dane);
>   return '';
>   }
> }
> 
> public function write($id, $data){
> 
> $this->dbConnect->update('sessions',array('dane'=>addslashes($data),'last_update'=>date("Y-m-d
> H:i:s")),$this->dbConnect->quoteInto('session_id = ?',$id));
>   return true;
> }
> 
> public function destroy($id){
>   $this->dbConnect->delete('sessions',$db->quoteInto('session_id =
> ?',$id));
>   return true;
> }
> 
> public function gc($maxlifetime){
>   $select=$this->dbConnect->select();
>   $select->from('sessions','session_id');
> 
>   $select->where('DATE_ADD(last_update,INTERVAL ? SECOND) <
> now()',$maxlifetime);
>   
> $this->dbConnect->delete('sessions',$this->dbConnect->quoteInto('DATE_ADD(last_update,INTERVAL
> ? SECOND) < now()',$maxlifetime));
>   return true;
> }
> 
> }
> 
> 
> and in index.php i wrote 
> Zend_Session::setSaveHandler(new Session2($db));
> 
> why i have to write something like that 
> Zend_Session::setOptions(array('save_path'=>'/home/test/app/session/'));
> without this i get error 
> exception 'Zend_Session_Exception' with message 'Unwritable
> session.save_path: ' 
> when i am using zend_auth
> 
> sesion should be in  db  with this i t works but i think session is in two
> places ??
> 
> Help 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/zend_session-question-tf3510986s16154.html#a9811258
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Documentation Typo in Zend_Db_Table Relationships Example 9.34

2007-03-21 Thread Raphael Stolt

I guess there are two typos in example 9.34. Fetching the Parent Row using
the Magic Method of the documentation. 

// Use the default reference rule
$reporter  = $bug1->findParentAccount();

// Specify the reference rule
$engineer  = $bug1->findParentAccountByEngineer();

As far as I catched the documentation Account should be in plural to match
the corresponding/defined table class.

// Use the default reference rule
$reporter  = $bug1->findParentAccounts();

// Specify the reference rule
$engineer  = $bug1->findParentAccountsByEngineer();

If I'm right maybe somebody with issue tracker reporting privileges would be
so kind and add this, or otherwise would teach me.

Thanks in advance,

Raphael Stolt
-- 
View this message in context: 
http://www.nabble.com/Documentation-Typo-in-Zend_Db_Table-Relationships-Example-9.34-tf3441004s16154.html#a9594925
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Server_Reflection->getDescription confusion

2007-03-13 Thread Raphael Stolt
Hello Everybody.

Does somebody know why Zend_Server_Reflection_Function_Abstract->getDescription 
returns only a part of the PHPDoclet area and not everything? Does it skip the 
@tags?

When reflecting/retrieving the description of an method with an PHPDoclet area 
I only get back "This is the index action." Which would be okay since this is 
the description. 
But by removing 'This is the index action.' from the PHPDoclet area and calling 
the getDescription method I will get "@return void".

Example method:

/**
 * This is the index action.
 * @return void
 */
public function indexAction() {
$view = Zend::registry('view');
$view->assign('title', 'The title of the application');
echo $view->render('index.php');
}

Reflection using Zend_Server_Reflection:

$class = Zend_Server_Reflection::reflectClass($controller);
$method = new Zend_Server_Reflection_Method($class, new 
ReflectionMethod($controller,'indexAction'));
$description = $method->getDescription();

> This is the index action.

Reflection using ReflectionMethod:

$method = new ReflectionMethod($controller,'indexAction');
$description = $method->getDocComment();

> /**
   * This is the index action.
   * @return void
   */

Is there a way of getting the whole PHPDoclet area by using the 
Zend_Server_Reflection component, or do I have to fall back using 
ReflectionMethod's getDocComment to retrieve it all? Might there 
be a method in 
Zend_Server_Reflection_Method/end_Server_Reflection_Function_Abstract similar 
to ReflectionMethod's getDocComment in the future? 


Thanks for any reply.

Raphael Stolt