[fw-general] Regex Route question

2014-06-16 Thread Antonio Caccese
Hi, i have a routing problem in ZF v1.*

I'm creating an ecommerce site and i want the following routes for
categories:

/subcategory1
/subcategory1/subcategory2
/subcategory1/subcategory2/subcategory3
/subcategory1/subcategory2/subcategory3/../subcategoryN

I removed the default routes from FrontController and i've created this
regex route:

routes.categorie.type = Zend_Controller_Router_Route_Regex
routes.categorie.route = "([a-zA-Z-_0-9\/]*)\/([a-zA-Z-_0-9]+)"
routes.categorie.defaults.module   = catalogo
routes.categorie.defaults.controller = categorie
routes.categorie.defaults.action = view
routes.categorie.defaults.layout = sidebar
routes.categorie.map.1 = subCategories
routes.categorie.map.2 = categoryIdent
routes.categorie.reverse = /%s/%s

This route doesn't match the URL with only one category ( e.g. /category1 ).
Anyone can help me, or suggest a better solution?

Thanks in advance
Antonio


[fw-general] How to share modules between svn projects

2013-10-15 Thread Antonio Caccese
Hi,
i have two or more svn projects in zend studio. Every project is locally
stored in the apache htdocs folder in order to run it on web browsers.

One project is the main CMS and the others projects are extensions of it
for different customers.

I would to share main modules, like core, users of the CMS with the others
projects via SVN so that if i make a change to the core module of the CMS,
this modification is replicated automatically to the others projects. Also,
i would that the projects are still runnable with this external inclusion.

I tried with the svn:externals but i lose miserably.
Anyone can help me?

Hello from Italy.
Antonio


Re: [fw-general] Query Problem

2011-12-29 Thread Antonio Caccese

Sorry friends, i found the problem.

It's a problem of timing since i'am in a transaction.

All right.


Il 29/12/2011 16:24, Antonio Caccese ha scritto:

Hi,

I have the following query:

$sql = "SELECT SUM(quantita - scarico) as giacenza FROM magazzino 
WHERE idArticolo = $idArticolo";

$statement = $this->_db->query($sql);
$row = $statement->fetch();

Finally, i get $row['giacenza']

On my database's client the result of the query is right but fetching 
the result from my application it returns always 0.00


Why?







--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




[fw-general] Query Problem

2011-12-29 Thread Antonio Caccese

Hi,

I have the following query:

$sql = "SELECT SUM(quantita - scarico) as giacenza FROM magazzino WHERE 
idArticolo = $idArticolo";

$statement = $this->_db->query($sql);
$row = $statement->fetch();

Finally, i get $row['giacenza']

On my database's client the result of the query is right but fetching 
the result from my application it returns always 0.00


Why?



--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




Re: [fw-general] Trouble with Zend_Http_Client_Exception

2011-08-02 Thread Antonio Caccese

I solved the problem by formatting the laptop... :)
Bye



Il 02/08/2011 08:43, Antonio Caccese ha scritto:
Thanks for your answer. I checked the two php settings and i didn't 
find any relevant
differences. I made the following test. I removed ZendServer 
installations from both two machines,
downloaded the current version ZendServer 5.1.0 end reinstalled. So 
now the configuration

is the same but the problem is still there.

The only difference between the two PCs is that one is running Win7 32 
bit while the other is running
Win7 64 bit. I tested the application on WinXP 32 bit and the 
application works perfectly.


It could be a ZendServer's problem with 64 bit Operating Systems?

Thanks


Il 01/08/2011 19:30, scs ha scritto:

Hi,
I experienced the same problems recently. Everything was working on my
dev server whereas on the production the response was empty.
I can suggest you to check and compare the php settings (php.ini files
on both servers). We had a different php version on the prod and that
was causing the problem.
The code was halting somewhere due to non-existing modules/extensions
and not giving any errors until we enabled all the error reporting
settings.
Hope this helps.

sas

On Mon, Aug 1, 2011 at 7:32 PM, Antonio 
Caccese  wrote:

Hi,
i get a Zend_Http_Client_Exception "Unable to read response, or 
response is

empty" when  putting objects on Amazon S3.

On my desktop PC all works fine but the same application deployed on my
laptop give me the above exception.
I use ZendServer CE on both PCs with the same configuration and 
resources

limits. The application uses the same
access and secret Keys of my Amazon account.

It's not a temporary problem. It gets me always the same exception.

Any suggestions?


--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com














--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




Re: [fw-general] Trouble with Zend_Http_Client_Exception

2011-08-01 Thread Antonio Caccese
Thanks for your answer. I checked the two php settings and i didn't find 
any relevant
differences. I made the following test. I removed ZendServer 
installations from both two machines,
downloaded the current version ZendServer 5.1.0 end reinstalled. So now 
the configuration

is the same but the problem is still there.

The only difference between the two PCs is that one is running Win7 32 
bit while the other is running
Win7 64 bit. I tested the application on WinXP 32 bit and the 
application works perfectly.


It could be a ZendServer's problem with 64 bit Operating Systems?

Thanks


Il 01/08/2011 19:30, scs ha scritto:

Hi,
I experienced the same problems recently. Everything was working on my
dev server whereas on the production the response was empty.
I can suggest you to check and compare the php settings (php.ini files
on both servers). We had a different php version on the prod and that
was causing the problem.
The code was halting somewhere due to non-existing modules/extensions
and not giving any errors until we enabled all the error reporting
settings.
Hope this helps.

sas

On Mon, Aug 1, 2011 at 7:32 PM, Antonio Caccese  wrote:

Hi,
i get a Zend_Http_Client_Exception "Unable to read response, or response is
empty" when  putting objects on Amazon S3.

On my desktop PC all works fine but the same application deployed on my
laptop give me the above exception.
I use ZendServer CE on both PCs with the same configuration and resources
limits. The application uses the same
access and secret Keys of my Amazon account.

It's not a temporary problem. It gets me always the same exception.

Any suggestions?


--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com










--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




[fw-general] Trouble with Zend_Http_Client_Exception

2011-08-01 Thread Antonio Caccese

Hi,
i get a Zend_Http_Client_Exception "Unable to read response, or response 
is empty" when  putting objects on Amazon S3.


On my desktop PC all works fine but the same application deployed on my 
laptop give me the above exception.
I use ZendServer CE on both PCs with the same configuration and 
resources limits. The application uses the same

access and secret Keys of my Amazon account.

It's not a temporary problem. It gets me always the same exception.

Any suggestions?


--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




Re: [fw-general] StringTrim filter problem

2011-06-20 Thread Antonio Caccese
I tested this issue on my linux production environment and fortunately 
there all works fine.
I am sure that my development environment is well configured with all 
components, php, ide, mysql working in UTF-8.


However, the important thing is that my production environment is ok!



Il 20/06/2011 10:28, Alayn Gortazar ha scritto:

Hi Antonio,

Do you have all the encoding/charset chain controlled? (PHP, Apache, MySQL, 
HTTP/HTML headers, etc.)
I would bet for a encoding problem on your side.




--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




Re: [fw-general] StringTrim filter problem

2011-06-18 Thread Antonio Caccese

Hence,
it maybe a problem of preg_replace usage in StringTrim filter?


Il 17/06/2011 15:10, Alayn Gortazar ha scritto:

As far as I know Zend uses preg_replace to emulate trim's behaviour

- Mensaje original -

Actually, after a bit of thinking, I started to wonder if trim() was
multibyte-friendly.

I did a bit of poking around and found this:
http://osdir.com/ml/php.internationalization/2003-05/msg4.html

You may have to use regex to trim the strings, or supply a list of
characters
not including the null-byte (\0) when trimming your strings.

See if that helps,
-Kizano
//-
Information Security
eMail: asthral...@gmail.com
http://www.markizano.net/

On 06/17/2011 05:37 AM, Antonio Caccese wrote:

Why i have to use iconv if there is the StringTrim filter?

I aspect that StringTrim's behavior is like the native PHP function
trim.

I'm italian and we use accented letters. The StringTrim filter works
fine, for
example, on the string " La città è bella " and returns "La città è
bella" but
if the string is "La città" the filter returns "La citt�" and when
save into the
DB the application throws the Exception:

Message: SQLSTATE[HY000]: General error: 1366 Incorrect string
value: '\xC3' for
column 'column_name' at row 1

I think it is a bug.
ZF version 1.11.3



Il 17/06/2011 00:23, Mark Harris ha scritto:

http://us3.php.net/iconv

Hope this helps :)
//-
Information Security
eMail: asthral...@gmail.com
http://www.markizano.net/

On 06/16/2011 08:45 AM, Antonio Caccese wrote:

Hi,
i'have a problem with the StringTrim filter and accented letter
'à' at the end
of words.
If character 'à' is at the end of the string the filter returns
the bad
character � and when save it in the DB it throws the following
exception:

SQLSTATE[HY000]: General error: 1366 Incorrect string value:
'\xC3' for column
'categoria' at row 1

All is well configured to works with UTF-8, IDE Editor, Database,
page encoding,
ecc.
Any suggestions?





--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




Re: [fw-general] StringTrim filter problem

2011-06-17 Thread Antonio Caccese

Why i have to use iconv if there is the StringTrim filter?

I aspect that StringTrim's behavior is like the native PHP function trim.

I'm italian and we use accented letters. The StringTrim filter works 
fine, for example, on the string "  La città è bella   " and returns "La 
città è bella" but if the string is "La città" the filter returns "La 
citt�" and when save into the DB the application throws the Exception:


Message: SQLSTATE[HY000]: General error: 1366 Incorrect string value: 
'\xC3' for column 'column_name' at row 1


I think it is a bug.
ZF version 1.11.3



Il 17/06/2011 00:23, Mark Harris ha scritto:

http://us3.php.net/iconv

Hope this helps :)
//-
Information Security
eMail: asthral...@gmail.com
http://www.markizano.net/

On 06/16/2011 08:45 AM, Antonio Caccese wrote:

Hi,
i'have a problem with the StringTrim filter and accented letter 'à' 
at the end

of words.
If character 'à' is at the end of the string the filter returns the bad
character � and when save it in the DB it throws the following 
exception:


SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xC3' 
for column

'categoria' at row 1

All is well configured to works with UTF-8, IDE Editor, Database, 
page encoding,

ecc.
Any suggestions?






--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




[fw-general] StringTrim filter problem

2011-06-16 Thread Antonio Caccese

Hi,
i'have a problem with the StringTrim filter and accented letter 'à' at 
the end of words.
If character 'à' is at the end of the string the filter returns the bad 
character � and when save it in the DB it throws the following exception:


SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xC3' for 
column 'categoria' at row 1


All is well configured to works with UTF-8, IDE Editor, Database, page 
encoding, ecc.

Any suggestions?


--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




[fw-general] How to use Zend_Filter_Encrypt in Zend_Form

2011-02-17 Thread Antonio Caccese

Hi,
i would to apply Zend_Filter_Encrypt to a password element in my form.

I try this:

$password = new Zend_Form_Element_Password('password');
$password->setLabel('Password')
   ->addFilter('StringTrim')
   ->addFilter(new Zend_Filter_Encrypt())
   ->addValidators(array(
'Alnum',
array('StringLength', false, array(3, 250))
))
->setRequired(true);


But i get the following message:
*Warning*: mcrypt_generic() [function.mcrypt-generic 
]: An empty 
string was passed in *C:\Program 
Files\Zend\ZendServer\share\ZendFramework\library\Zend\Filter\Encrypt\Mcrypt.php* 
on line *240*


How to automate encryption and descryption from Zend_Form's methods 
getValue and populate?


Thanks
Antonio




[fw-general] Zend_Validate_Hostname and accented character

2011-01-20 Thread Antonio Caccese

Hi,
i have the following element in a form.

$localDomain = new Zend_Form_Element_Text('local');
$localDomain ->setFilters(array('StringTrim', 'StringToLower'))
->setDecorators(array('ViewHelper', 'Errors'))
->addValidators(array(
new 
Zend_Validate_Hostname(Zend_Validate_Hostname::ALLOW_LOCAL)

));

With accented characters (à è ì ò ù) the form is validated correctly but 
an empty message is displayed






and the input is't populated again.
Zend Framework version 1.11.2

Any suggestions?

Thanks
Antonio Caccese



[fw-general] How to delete a folder on Amazon S3

2011-01-19 Thread Antonio Caccese

Hi,
i have to delete a folder (not bucket) and all files and folders contained.
I must list all objects in the folder and delete one object per time or 
exists a simpler method?


Thanks



[fw-general] Zend_Mail enable/disable

2011-01-04 Thread Antonio Caccese
Hi, exist a way to enable/disable email sending, for example in 
application.ini?


Thank you



[fw-general] Outlook calendar and PHP

2010-09-16 Thread Antonio Caccese

 Hi,
i'm working on an intranet application. Exist a way to synchronize the 
event in the Outlook calendar and my php based app?
For example if i create an event in my remote calendar i would that i 
get it in my Outlook Client and viceversa.


Thanks



Re: [fw-general] Amazon S3 fails putting objects

2010-08-27 Thread Antonio Caccese

 Il 27/08/2010 17:53, Antonio Caccese ha scritto:

Hi,
i get error when send objects to Amazon S3.
This is my code:

$filename = "name-of-the-file";

$s3 = new Zend_Service_Amazon_S3();

try {
$permissions = array(Zend_Service_Amazon_S3::S3_ACL_HEADER 
=> Zend_Service_Amazon_S3::S3_ACL_PUBLIC_READ);


$s3->putObject(
'bucket-name/' .  $filename,
file_get_contents(PATH_FILES. '/' . $filename),
$permissions
);
} catch (Zend_Service_Amazon_S3_Exception $s3e) {
..
} catch (Zend_Http_Client_Exception $hce) {
..
}


It works fine for small files but fails on files bigger then 1MB.
This is the Exception StackTrace:

Read timed out after 10 seconds

#0 C:Program 
FilesZendZendServershareZendFrameworklibraryZendHttpClientAdapterSocket.php(330): 
Zend_Http_Client_Adapter_Socket->_checkSocketReadTimeout()
#1 C:Program 
FilesZendZendServershareZendFrameworklibraryZendHttpClientAdapterSocket.php(335): 
Zend_Http_Client_Adapter_Socket->read()
#2 C:Program 
FilesZendZendServershareZendFrameworklibraryZendHttpClient.php(992): 
Zend_Http_Client_Adapter_Socket->read()
#3 C:Program 
FilesZendZendServershareZendFrameworklibraryZendServiceAmazonS3.php(581): 
Zend_Http_Client->request('PUT')
#4 C:Program 
FilesZendZendServershareZendFrameworklibraryZendServiceAmazonS3.php(411): 
Zend_Service_Amazon_S3->_makeRequest('PUT', 's3.onweb.it/sit...', 
NULL, Array, ';?Exif??II*...')
#5 C:Program 
FilesZendApache2htdocsrevapplicationmodulescorecontrollersElementiController.php(135): 
Zend_Service_Amazon_S3->putObject('s3.onweb.it/sit...', 
';?Exif??II*...', Array)
#6 C:Program 
FilesZendZendServershareZendFrameworklibraryZendControllerAction.php(513): 
Core_ElementiController->uploadS3Action()
#7 C:Program 
FilesZendZendServershareZendFrameworklibraryZendControllerDispatcherStandard.php(295): 
Zend_Controller_Action->dispatch('uploadS3Action')
#8 C:Program 
FilesZendZendServershareZendFrameworklibraryZendControllerFront.php(954): 
Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), 
Object(Zend_Controller_Response_Http))
#9 C:Program 
FilesZendZendServershareZendFrameworklibraryZendApplicationBootstrapBootstrap.php(97): 
Zend_Controller_Front->dispatch()
#10 C:Program 
FilesZendZendServershareZendFrameworklibraryZendApplication.php(366): 
Zend_Application_Bootstrap_Bootstrap->run()
#11 C:Program FilesZendApache2htdocsrevpublicindex.php(29): 
Zend_Application->run()

#12 {main}


How can fix it?
Thanks

Antonio



Now i notice a strange behaviour. I'm sending a file to amazon s3 by an 
ajax request. By Firebug i see that the request return the following 
html page:


|
||
||200 OK
||
||OK
||The server is temporarily unable to service your
||request due to maintenance downtime or capacity
||problems. Please try again later.
||


The file is correctly sent to Amazon S3 but the requests fails.

Please help me!



|

|

|



[fw-general] Amazon S3 fails putting objects

2010-08-27 Thread Antonio Caccese

 Hi,
i get error when send objects to Amazon S3.
This is my code:

$filename = "name-of-the-file";

$s3 = new Zend_Service_Amazon_S3();

try {
$permissions = array(Zend_Service_Amazon_S3::S3_ACL_HEADER 
=> Zend_Service_Amazon_S3::S3_ACL_PUBLIC_READ);


$s3->putObject(
'bucket-name/' .  $filename,
file_get_contents(PATH_FILES. '/' . $filename),
$permissions
);
} catch (Zend_Service_Amazon_S3_Exception $s3e) {
..
} catch (Zend_Http_Client_Exception $hce) {
..
}


It works fine for small files but fails on files bigger then 1MB.
This is the Exception StackTrace:

Read timed out after 10 seconds

#0 C:Program 
FilesZendZendServershareZendFrameworklibraryZendHttpClientAdapterSocket.php(330): 
Zend_Http_Client_Adapter_Socket->_checkSocketReadTimeout()
#1 C:Program 
FilesZendZendServershareZendFrameworklibraryZendHttpClientAdapterSocket.php(335): 
Zend_Http_Client_Adapter_Socket->read()
#2 C:Program 
FilesZendZendServershareZendFrameworklibraryZendHttpClient.php(992): 
Zend_Http_Client_Adapter_Socket->read()
#3 C:Program 
FilesZendZendServershareZendFrameworklibraryZendServiceAmazonS3.php(581): Zend_Http_Client->request('PUT')
#4 C:Program 
FilesZendZendServershareZendFrameworklibraryZendServiceAmazonS3.php(411): Zend_Service_Amazon_S3->_makeRequest('PUT', 
's3.onweb.it/sit...', NULL, Array, ';?Exif??II*...')
#5 C:Program 
FilesZendApache2htdocsrevapplicationmodulescorecontrollersElementiController.php(135): 
Zend_Service_Amazon_S3->putObject('s3.onweb.it/sit...', 
';?Exif??II*...', Array)
#6 C:Program 
FilesZendZendServershareZendFrameworklibraryZendControllerAction.php(513): 
Core_ElementiController->uploadS3Action()
#7 C:Program 
FilesZendZendServershareZendFrameworklibraryZendControllerDispatcherStandard.php(295): 
Zend_Controller_Action->dispatch('uploadS3Action')
#8 C:Program 
FilesZendZendServershareZendFrameworklibraryZendControllerFront.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), 
Object(Zend_Controller_Response_Http))
#9 C:Program 
FilesZendZendServershareZendFrameworklibraryZendApplicationBootstrapBootstrap.php(97): 
Zend_Controller_Front->dispatch()
#10 C:Program 
FilesZendZendServershareZendFrameworklibraryZendApplication.php(366): 
Zend_Application_Bootstrap_Bootstrap->run()
#11 C:Program FilesZendApache2htdocsrevpublicindex.php(29): 
Zend_Application->run()

#12 {main}


How can fix it?
Thanks

Antonio