Re: [fw-general] Zend Framework 1.7 is now available!

2008-11-18 Thread Garri Santos
When will the PDF Programmer Reference Guide for 1.7 available for download?

On Mon, Nov 17, 2008 at 10:38 PM, Wil Sinclair [EMAIL PROTECTED] wrote:

 Zend Framework 1.7.0 is now available from the Zend Framework download
 site: http://framework.zend.com/download/latest

 This release introduces many new components and features, including:

 * Zend_Amf with support for AMF0 and AMF3 protocols
 * Dojo Toolkit 1.2.1
 * Support for dijit editor available in the Dojo Toolkit
 * Zend_Service_Twitter
 * ZendX_JQuery in extras library
 * Metadata API in Zend_Cache
 * Google book search API in Zend_Gdata
 * Preliminary support for GData Protocol v2 in Zend_Gdata
 * Support for skip data processing in Zend_Search_Lucene
 * Support for Open Office XML documents in Zend_Search_Lucene indexer
 * Performance enhancements in Zend_Loader, Zend_Controller, and server
  components
 * Zend_Mail_Storage_Writable_Maildir enhancements for mail delivery
 * Zend_Tool in incubator
 * Zend_Text_Table for formatting table using characters
 * Zend_ProgressBar
 * Zend_Config_Writer
 * ZendX_Console_Unix_Process in the extras library
 * Zend_Db_Table_Select support for Zend_Paginator
 * Global parameters for routes
 * Using Chain-Routes for Hostname-Routes via Zend_Config
 * I18N improvements
- Application wide locale for all classes
- Data retrieving methods are now static
- Additional cache handling methods in all I18N classes
- Zend_Translate API simplified
 * File transfer enhancements
- Support for file elements in subforms
- Support for multifile elements
- Support for MAX_FILES_SIZE in form
- Support for breaking validation chain
- Support for translation of failure ,messages
- New IsCompressed, IsImage, ExcludeMimeType, ExcludeExtension
 validators
- Support for FileInfo extension in MimeType validator
 * Zend_Db_Table_Select adapater for Zend_Paginator
 * Support for custom adapters in Zend_Paginator
 * More flexible handling of complex types in Zend_Soap

 In addition, almost three hundred bugs have been fixed:

 http://framework.zend.com/issues/secure/IssueNavigator.jspa?requestId=10
 903

 The Zend Framework team would like to thank everyone who made this
 release possible. As always, our generous ZF community has provided
 countless new features, bug fixes, documentation translations, etc. We'd
 also like to thank Adobe Systems and Wade Arnold for contributing the
 new Zend_Amf component. A big thanks to PHP Belgium and everyone who
 participated in bug hunt day (http://www.bughuntday.org/) and/or the
 Zend Framework bug hunt week. Finally, we'd like to thank all of those
 whom we've forgotten to thank above. :) Once again, we're reminded that
 Zend Framework is about much more than code, it is about community. See
 y'all online.

 ,Wil




-- 
__
Garrizaldy R. Santos
Ubraa Developer
PHP User-Group Philippines Inc.
http://www.phpugph.com
[EMAIL PROTECTED]


[fw-general] ACL Module Plugin?

2008-02-18 Thread Garri Santos
Good Day,

As I was browsing thru Extending ACL to include
Moduleshttp://www.nabble.com/Extend-acl-to-include-modules-td10805801s16154.html#a10805801Darby
said they would consider adding this highly demand integration. Im
wondering when could that be available?

Thanks,
Garri


Re: [fw-general] Autoloading Models

2008-02-14 Thread Garri Santos
On Thu, Feb 14, 2008 at 9:19 PM, Darby Felton [EMAIL PROTECTED] wrote:
 Hi Arthur,

  I probably would not call it the Zend way, but since I'm a Zender,
  I'll share how I have done autoloading model classes using Zend_Loader:

  My bootstrap class sets up the include_path:

  set_include_path($this-getPath('library') . PATH_SEPARATOR .
  get_include_path());

  The class also has a _setupAutoloader() method that runs:

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

  This makes subsequent loading of model classes within the include_path a
  piece of cake:

  new My_Model_User($identity);
  // loads application/library/My/Model/User.php automatically

  Hope this helps!

  Best regards,
  Darby



  Arthur M. Kang wrote:
   What, if any, is the Zend way of autoloading models in the form of
   modules/modulename/models/modelname.php ?  Can the Zend_Loader be used
   to accomplish this and how?
  
   Arthur


Hi Arthur,

This is probably the Ubraa Way He he

   /**
 * Scan controllers and models available in the modules directory.
 *
 * @category Ubraa
 * @package Ubraa_Bootstrap
 * @copyright Copyright (c) 2001-2007 PHP User-Group
Philippines (http://www.phpugph.com)
 * @license http://opensource.org/licenses/osl-3.0.php  Open
Software License (OSL 3.0)
 * @author Garrizaldy Santos [EMAIL PROTECTED]
 * @param string
 * @param string
 * @return array
 */
public function modulesDir($modDir = '', $option = 'controllers')
{
$modules = array();
$filters = array('.', '..', '.svn', '.htaccess', '.htpasswd');

$directories = array_diff(scandir($modDir), $filters);

switch ($option)
{
   case 'models':
   {
   foreach($directories as $module)
{
$modules[] = $modDir . DIRECTORY_SEPARATOR .
$module . DIRECTORY_SEPARATOR . 'models';
}
break;
   }
   case 'controllers':
{
foreach($directories as $module)
{
$modules[$module] = $modDir . 
DIRECTORY_SEPARATOR .
$module . DIRECTORY_SEPARATOR . 'controllers';
}
break;
}
   case 'views':
{
   break;
}
}

return $modules;
}

If I were to include my Models in the include_path i just need to
array_merge() the array return by this helper function and the array
that contains path to my library and the return of get_include_path().

$this-ubraaLibrary = $this-ubraaRoot . DIRECTORY_SEPARATOR . 
'library';

$path = array(
$this-ubraaLibrary,
get_include_path()
);

$models = $this-modulesDir($this-ubraaRoot .
DIRECTORY_SEPARATOR . 'modules', 'models');

$ubraa_path = array_merge($path, $models);

set_include_path(implode(PATH_SEPARATOR, $ubraa_path));

Then just implode() the variable that contains the result of the array_merge().


Garrizaldy R. Santos
Ubraa Developer
PHP User-Group Philippines Inc.
http://www.phpugph.com
[EMAIL PROTECTED]


[fw-general] Zend _Acl Adding resource question

2008-02-12 Thread Garri Santos
Good Day,

I have implemented a modular directory structure.

modules/
admin/
controllers/
IndexController.php
default/
controllers/
IndexController.php

How do I add them as a resource to Zend_Acl?

Cheers,
Garri


Re: [fw-general] Zend _Acl Adding resource question

2008-02-12 Thread Garri Santos
On Tue, Feb 12, 2008 at 4:17 PM, Jason Qi [EMAIL PROTECTED] wrote:
 go here
 http://www.zend.com/en/resources/webinars/framework

 to see Darby's Webinar

 Hope this helps

 Jason.



 Garri Santos [EMAIL PROTECTED] wrote:
  Good Day,

 I have implemented a modular directory structure.

 modules/
  admin/
  controllers/
  IndexController.php
  default/
  controllers/
  IndexController.php

 How do I add them as a resource to Zend_Acl?

 Cheers,
 Garri



  
 Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it
 now.

I have already watched it. It is the basis of the application im
making in ZF but in his example is not set to using modules. In my
example above they are both IndexController though one is Admin_Index.
I thought adding Admin_Index to the resource since that is the objects
name but it can't find it as a resource in Zend_Acl.

Cheers,
Garri


Re: [fw-general] Dispatcher/Bootstrap ZF 1.5 PR

2008-02-05 Thread Garri Santos
Hi!

TIMTOWTDI you can take a look at the sample provided at:
http://www.zend.com/en/resources/webinars/framework
Zend Framework and Access Control Webinar

cheers,
Garri

On Feb 6, 2008 6:15 AM, jmazzi [EMAIL PROTECTED] wrote:

 Hi,

 Could someone post an example of the correct way to create a
 dispatcher/bootstrap for MVC? Is there even a preferred method?
 --
 View this message in context: 
 http://www.nabble.com/Dispatcher-Bootstrap-ZF-1.5-PR-tp15299930s16154p15299930.html
 Sent from the Zend Framework mailing list archive at Nabble.com.




[fw-general] Zend_Config_Xml is not producinf the proper Zend_Config object

2008-02-05 Thread Garri Santos
Good Day,

Im not sure anymore whether it's my xml file or is it Zend_Config_Xml has
the problem. Here's my xml file.

config.xml
?xml version=1.0 encoding=UTF-8 ?
configuration
default
baseurl/ubraa/public/baseurl
database
typepdo_mysql/type
hostlocalhost/host
usernameroot/username
passwordpassword/password
dbnameubraa/dbname
/database
/default
/configuration

After doing this:

$this-config = new Zend_Config_Xml($this-ubraaRoot . DIRECTORY_SEPARATOR .

'configuration' . DIRECTORY_SEPARATOR .
'config.xml', 'default');

The Zend_Db::factory($config-type, $config); is throwing me an error

Adapter parameters must be in an array or a Zend_Config object

I have var_dump($this-config-database) and these is the result:

object(Zend_Config_Xml)#2 (6) {
 [_allowModifications:protected]=
 bool(false)
 [_index:protected]=
 int(0)
 [_count:protected]=
 int(2)
 [_data:protected]=
 array(2) {
   [baseurl]=
   string(13) /ubraa/public
   [database]=
   object(Zend_Config)#4 (6) {
 [_allowModifications:protected]=
 bool(false)
 [_index:protected]=
 int(0)
 [_count:protected]=
 int(5)
 [_data:protected]=
 array(5) {
   [type]=
   string(9) pdo_mysql
   [host]=
   string(9) localhost
   [username]=
   string(4) root
   [password]=
   string(8) password
   [dbname]=
   string(5) ubraa
 }
 [_loadedSection:protected]=
 NULL
 [_extends:protected]=
 array(0) {
 }
   }
 }
 [_loadedSection:protected]=
 string(7) default
 [_extends:protected]=
 array(0) {
 }
}

Notice that the Zend_Config produce by the Zend_Config_Xml is missing
params w/c should contain a correct Zend_Config Object like this:
$configuration = new Zend_Config(
   array(
   'database' = array(
   'adapter' = 'Mysqli',
   'params' = array(
   'dbname' = 'test',
   'username' = 'webuser',
   'password' = 'secret',
   )
   )
   )
);

object(Zend_Config)#32 (6) {
 [_allowModifications:protected]=
 bool(false)
 [_index:protected]=
 int(0)
 [_count:protected]=
 int(1)
 [_data:protected]=
 array(1) {
   [database]=
   object(Zend_Config)#40 (6) {
 [_allowModifications:protected]=
 bool(false)
 [_index:protected]=
 int(0)
 [_count:protected]=
 int(2)
 [_data:protected]=
 array(2) {
   [adapter]=
   string(6) Mysqli
   [params]=
   object(Zend_Config)#43 (6) {
 [_allowModifications:protected]=
 bool(false)
 [_index:protected]=
 int(0)
 [_count:protected]=
 int(3)
 [_data:protected]=
 array(3) {
   [dbname]=
   string(4) test
   [username]=
   string(7) webuser
   [password]=
   string(6) secret
 }
 [_loadedSection:protected]=
 NULL
 [_extends:protected]=
 array(0) {
 }
   }
 }
 [_loadedSection:protected]=
 NULL
 [_extends:protected]=
 array(0) {
 }
   }
 }
 [_loadedSection:protected]=
 NULL
 [_extends:protected]=
 array(0) {
 }
}


Thanks,
Garri


Re: [fw-general] Zend_Config_Xml is not producinf the proper Zend_Config object

2008-02-05 Thread Garri Santos
On Feb 6, 2008 10:52 AM, Simon Mundy [EMAIL PROTECTED] wrote:

 Hi Garri, you need to wrap it in a Zend_Config

 $this-config = new Zend_Config(new Zend_Config_Xml($this-ubraaRoot .
 DIRECTORY_SEPARATOR .
 'configuration' . DIRECTORY_SEPARATOR .
 'config.xml', 'default'));

 Cheers!

  $this-config = new Zend_Config_Xml($this-ubraaRoot .
  DIRECTORY_SEPARATOR .
  'configuration' . DIRECTORY_SEPARATOR .
  'config.xml', 'default');

 --

 Simon Mundy | Director | PEPTOLAB

 

 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654
 4124
 http://www.peptolab.com


Hi Simon!

Thanks for the fast reply, but unfortunately it still doesn't work for me?
It is still throwing up the error
Adapter parameters must be in an array or a Zend_Config object

cheers,
Garri


Re: [fw-general] Zend_Config_Xml is not producinf the proper Zend_Config object

2008-02-05 Thread Garri Santos
On Feb 6, 2008 2:44 PM, Eric Coleman [EMAIL PROTECTED] wrote:

 Zend_Db::factory() can take a native Config Object.

 The config object below, would be used like so:

 $config = Zend_Config_Xml('my-config.xml', 'application');
 $db = Zend_Db::factory($config-database);

 Note, the profiler line should also work ;)


 ?xml version=1.0 encoding=UTF-8?
 myapp
   application
 debug1/debug

 database
 adapterPDO_MYSQL/adapter
 initQueryset names 'utf8';/initQuery

 params
 hostlocalhost/host
 usernameeric/username
 passwordmypass/password
 dbnamedevel/dbname
 profiler1/profiler
 /params
 /database

   /application
 /myapp

 Regards,
 Eric




 On Feb 6, 2008, at 1:20 AM, Garri Santos wrote:

  On Feb 6, 2008 11:33 AM, Garri Santos
  [EMAIL PROTECTED] wrote:
 
  On Feb 6, 2008 11:22 AM, Matthew Weier O'Phinney [EMAIL PROTECTED]
  wrote:
 
  -- Garri Santos [EMAIL PROTECTED] wrote
  (on Wednesday, 06 February 2008, 10:43 AM +0800):
  Good Day,
 
  Im not sure anymore whether it's my xml file or is it
  Zend_Config_Xml
  has the
  problem. Here's my xml file.
 
  config.xml
  ?xml version=1.0 encoding=UTF-8 ?
  configuration
  default
  baseurl/ubraa/public/baseurl
  database
  typepdo_mysql/type
  hostlocalhost/host
  usernameroot/username
  passwordpassword/password
  dbnameubraa/dbname
  /database
  /default
  /configuration
 
  After doing this:
 
  $this-config = new Zend_Config_Xml($this-ubraaRoot .
  DIRECTORY_SEPARATOR .
  'configuration' . DIRECTORY_SEPARATOR .
  'config.xml', 'default');
 
  The Zend_Db::factory($config-type, $config); is throwing me an
  error
 
  Um... shouldn't that be
 
Zend_Db::factory($config-database-type, $config-database);
 
  ?
 
  Based on the structure of your XML, you're not pulling from the
  correct
  location in the config...
 
 
  Adapter parameters must be in an array or a Zend_Config object
 
  I have var_dump($this-config-database) and these is the result:
 
  object(Zend_Config_Xml)#2 (6) {
  [_allowModifications:protected]=
  bool(false)
  [_index:protected]=
  int(0)
  [_count:protected]=
  int(2)
  [_data:protected]=
  array(2) {
[baseurl]=
string(13) /ubraa/public
[database]=
object(Zend_Config)#4 (6) {
  [_allowModifications:protected]=
  bool(false)
  [_index:protected]=
  int(0)
  [_count:protected]=
  int(5)
  [_data:protected]=
  array(5) {
[type]=
string(9) pdo_mysql
[host]=
string(9) localhost
[username]=
string(4) root
[password]=
string(8) password
[dbname]=
string(5) ubraa
  }
  [_loadedSection:protected]=
  NULL
  [_extends:protected]=
  array(0) {
  }
}
  }
  [_loadedSection:protected]=
  string(7) default
  [_extends:protected]=
  array(0) {
  }
  }
 
  Notice that the Zend_Config produce by the Zend_Config_Xml is
  missing
  params
  w/c should contain a correct Zend_Config Object like this:
  $configuration = new Zend_Config(
array(
'database' = array(
'adapter' = 'Mysqli',
'params' = array(
'dbname' = 'test',
'username' = 'webuser',
'password' = 'secret',
)
)
)
  );
 
  object(Zend_Config)#32 (6) {
  [_allowModifications:protected]=
  bool(false)
  [_index:protected]=
  int(0)
  [_count:protected]=
  int(1)
  [_data:protected]=
  array(1) {
[database]=
object(Zend_Config)#40 (6) {
  [_allowModifications:protected]=
  bool(false)
  [_index:protected]=
  int(0)
  [_count:protected]=
  int(2)
  [_data:protected]=
  array(2) {
[adapter]=
string(6) Mysqli
[params]=
object(Zend_Config)#43 (6) {
  [_allowModifications:protected]=
  bool(false)
  [_index:protected]=
  int(0)
  [_count:protected]=
  int(3)
  [_data:protected]=
  array(3) {
[dbname]=
string(4) test
[username]=
string(7) webuser
[password]=
string(6) secret
  }
  [_loadedSection:protected]=
  NULL
  [_extends:protected]=
  array(0) {
  }
}
  }
  [_loadedSection:protected]=
  NULL
  [_extends:protected]=
  array(0) {
  }
}
  }
  [_loadedSection:protected]=
  NULL
  [_extends:protected]=
  array(0) {
  }
  }
 
 
  Thanks,
  Garri
 
  --
  Matthew Weier O'Phinney
  PHP Developer| [EMAIL PROTECTED]
  Zend - The PHP Company   | http://www.zend.com/
 
 
  Hi Matthew,
 
  I have tried your suggestion but still no luck. Here's the part
  that uses
  $this-config.
 
 public function getDb()
 {
 if (null