GithubHelp home page GithubHelp logo

zendframework / zf1 Goto Github PK

View Code? Open in Web Editor NEW
360.0 67.0 790.0 77.12 MB

This project reached its end-of-life on 2016-09-28. Contains conversion of ZF1 subversion repo to git, from version 15234 forward, and only containing master and release-1.12 branches and 1.12 tags.

Home Page: https://framework.zend.com/blog/2016-06-28-zf1-eol.html

License: BSD 3-Clause "New" or "Revised" License

PHP 99.66% Shell 0.02% HTML 0.30% JavaScript 0.01% PowerShell 0.01% Batchfile 0.01% Roff 0.01%

zf1's Introduction

Logo

End-of-Life occurred 28 Sep 2016

This project is no longer maintained, and reached its end of life on 28 Sep 2016; the last public release was 1.12.20.

At this time, the repository has been archived, and is read-only.


Welcome to the Zend Framework 1.12 Release!

Master: Build Status

RELEASE INFORMATION

Zend Framework 1.12.21dev Release. Released on MMM DD, YYYY.

IMPORTANT FIXES FOR 1.12.21

See http://framework.zend.com/changelog for full details.

NEW FEATURES

Zend_Loader changes

A number of autoloaders and autoloader facilities were back ported from ZF2 to provide performant alternatives to those already available in the 1.X releases. These include: Zend_Loader_StandardAutoloader, which improves on Zend_Loader_Autoloader by allowing the ability to specify a specific path to associate with a vendor prefix or namespace; Zend_Loader_ClassMapAutoloader, which provides the ability to use lookup tables for autoloading (which are typically the fastest possible way to autoload); and Zend_Loader_AutoloaderFactory, which can both create and update autoloaders for you, as well as register them with spl_autoload_register().

The Zend_Loader changes were back ported from ZF2 by Matthew Weier O’Phinney

Zend_EventManager

Zend_EventManager is a component that allows you to attach and detach listeners to named events, both on a per-instance basis as well as via shared collections; trigger events; and interrupt execution of listeners.

Zend_EventManager was back ported from ZF2 by Matthew Weier O’Phinney

Zend_Http_UserAgent_Features_Adapter_Browscap

This class provides a features adapter that calls get_browser() in order to discover mobile device capabilities to inject into UserAgent device instances.

Browscap (http://browsers.garykeith.com/) is an open project dedicated to collecting an disseminating a “database” of browser capabilities. PHP has built-in support for using these files via the get_browser() function. This function requires that your php.ini provides a browscap entry pointing to the PHP-specific php_browscap.ini file which is available at http://browsers.garykeith.com/stream.asp?PHP_BrowsCapINI.

Zend_Http_UserAgent_Features_Adapter_Browscap was created by Matthew Weier O’Phinney

Zend_Mobile_Push

Zend_Mobile_Push is a component for implementing push notifications for the 3 major push notification platforms (Apple (Apns), Google (C2dm) and Microsoft (Mpns).

Zend_Mobile_Push was contributed by Mike Willbanks.

Zend_Gdata_Analytics

Zend_Gdata_Analytics is an extension to Zend_Gdata to allow interaction with Google’s Analytics Data Export API. This extension does not encompass any major changes in the overall operation of Zend_Gdata components.

Zend_Gdata_Analytics was contributed by Daniel Hartmann.

Removed features

Zend_Http_UserAgent_Features_Adapter_WurflApi

Due to the changes in licensing of WURFL, we have removed the WurflApi adapter. We will be providing the WurflApi adapter to ScientiaMobile so that users of WURFL will still have that option.

Bug Fixes

In addition, over 200 reported issues in the tracker have been fixed. We’d like to particularly thank Adam Lundrigan, Frank Brückner and Martin Hujer for their efforts in making this happen. Thanks also to the many people who ran the ZF1 unit tests and reported their results!

For a complete list of closed issues beginning with 1.12.3, visit:

MIGRATION NOTES

A detailed list of migration notes may be found at:

http://framework.zend.com/manual/en/migration.html

SYSTEM REQUIREMENTS

Zend Framework requires PHP 5.2.11 or later. Please see our reference guide for more detailed system requirements:

http://framework.zend.com/manual/en/requirements.html

INSTALLATION

Please see INSTALL.md.

REPOSITORY HISTORY

This repository was created based on the release-1.12 branch of a Subversion repository, http://framework.zend.com/svn/framework/standard/. It contains a subset of the project history, dating from between the 1.5.0 and 1.6.0 releases, and only contains the tags for the 1.12 series. If you would like an older version, you may access the subversion repository linked above, or download an older version from http://framework.zend.com/downloads/archives.

CONTRIBUTING

Please see README-GIT.md and DEVELOPMENT_README.md.

QUESTIONS AND FEEDBACK

Online documentation can be found at http://framework.zend.com/manual. Questions that are not addressed in the manual should be directed to the appropriate mailing list:

If you find code in this release behaving in an unexpected manner or contrary to its documented behavior, please create an issue in the Zend Framework issue tracker at:

If you would like to be notified of new releases, you can subscribe to the fw-announce mailing list by sending a blank message to:

LICENSE

The files in this archive are released under the Zend Framework license. You can find a copy of this license in LICENSE.txt.

ACKNOWLEDGEMENTS

The Zend Framework team would like to thank all the contributors to the Zend Framework project, our corporate sponsor, and you, the Zend Framework user. Please visit us sometime soon at http://framework.zend.com.

zf1's People

Contributors

a-lucas avatar adeelnawaz avatar akrabat avatar bartko-s avatar bkendig-disney avatar croensch avatar dragonbe avatar erdraug avatar ezimuel avatar foxel avatar froschdesign avatar gelolabs avatar graywolf avatar holtkamp avatar itscaro avatar ivan-ponomarev avatar jeremyquinton avatar mhujer avatar mlocati avatar nicolas-grekas avatar ondram avatar prolic avatar siad007 avatar slamdunk avatar stevehill1981 avatar thomaswunderlich avatar till avatar tomasfejfar avatar waipeng avatar weierophinney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zf1's Issues

Zend_Cache_Frontend_Page . Whitelist for Superglobals to be used when making the cacheid.

Jira Information

Original Issue:ZF-12411
Issue Type:Improvement
Reporter:Frank Ruske
Created:09/08/12
Assignee:Alexander Veremyev
Components:Zend_Cache

Description

Hi,

I had the following problem when working with Zend_Cache_Frontend_Page:

We have a multilingual webseite. The user gets the webseite displayed based on a language cookie set on his client.
For this reason we have to use the COOKIE values to generate the hash id else only one language version would be cached.

When using the Fullpage Cache it was not enough for us to generate the Key based on the _COOKIE superglobal using this options:

frontend.options.regexps.1.make_id_with_cookie_variables = true
frontend.options.default_options.cache_with_cookie_variables = true

The problem here is that there are also other COOKIES (or superglobals) which may change with every request but are totally irelevant for our full page cache.
For example Google Analytics changes it COOKIE values every request. Thus there was 0% Cache hits.

I have implemented a whitelist to use together with Zend_Cache_Frontend_Page.

Find below my adjustments. Maybe you can consider using it, if not maybe anyone else will run into the same problem.

In Zend_Cache_Frontend_Page:

    protected $_specificOptions = array(
        'http_conditional' => false,
        'debug_header' => false,
        'content_type_memorization' => false,
        'memorize_headers' => array(),
        'default_options' => array(
            'cache_with_get_variables' => false,
            'cache_with_post_variables' => false,
            'cache_with_session_variables' => false,
            'cache_with_files_variables' => false,
            'cache_with_cookie_variables' => false,
            'make_id_with_get_variables' => true,
            'make_id_with_get_whitelist' => false, //new option
            'make_id_with_post_variables' => true,
            'make_id_with_post_whitelist' => false, //new option
            'make_id_with_session_variables' => true,
            'make_id_with_session_whitelist' => false, //new option
            'make_id_with_files_variables' => true,
            'make_id_with_files_whitelist' => false,  //new option
            'make_id_with_cookie_variables' => true,
            'make_id_with_cookie_whitelist' => false, //new option
            'cache' => true,
            'specific_lifetime' => false,
            'tags' => array(),
            'priority' => null
        ),
        'regexps' => array()
    );

Zend_Cache_Frontend_Page::_makePartialId() got a new parameter $whitelist

    /**
     * Make a partial id depending on options
     *
     * @param  string $arrayName Superglobal array name
     * @param  bool   $bool1     If true, cache is still on even if there are some variables in the superglobal array
     * @param  bool   $bool2     If true, we have to use the content of the superglobal array to make a partial id
     * @param  mixed  $whitelist  If an array with more then one index then only use the defined indexes to create cache
     * @return string|false Partial id (string) or false if the cache should have not to be used
     */
    protected function _makePartialId($arrayName, $bool1, $bool2, $whitelist = false)
    {
        switch ($arrayName) {
            case 'Get':
                $var = $_GET;
                break;
            case 'Post':
                $var = $_POST;
                break;
            case 'Session':
                if (isset($_SESSION)) {
                    $var = $_SESSION;
                } else {
                    $var = null;
                }
                break;
            case 'Cookie':
                if (isset($_COOKIE)) {
                    $var = $_COOKIE;
                } else {
                    $var = null;
                }
                break;
            case 'Files':
                $var = $_FILES;
                break;
            default:
                return false;
        }
        if ($bool1) {
            if ($bool2) {
                // We have a whitelist so only return the defined indexes.
                if (true === is_array($whitelist) && count($whitelist) > 0) {
                    $tmpArray = array();

                    foreach ($whitelist as $index) {
                        if (true === isset($var[$index])) {
                            $tmpArray[$index] = $var[$index];
                        }
                    }

                    if (count($tmpArray) > 0) {
                        return serialize($tmpArray);
                    }
                    return '';
                }

                return serialize($var);
            }
            return '';
        }
        if (count($var) > 0) {
            return false;
        }
        return '';
    }

Zend_Cache_Frontend_Page::_makeId() calls self::_makePartialId() and thus has to be adjusted too

    protected function _makeId()
    {
        $tmp = $_SERVER['REQUEST_URI'];

        $array = explode('?', $tmp, 2);
        $tmp = $array[0];
        foreach (array('Get', 'Post', 'Session', 'Files', 'Cookie') as $arrayName) {

            $tmp2 = $this->_makePartialId(
                        $arrayName,
                        $this->_activeOptions['cache_with_' . strtolower($arrayName) . '_variables'],
                        $this->_activeOptions['make_id_with_' . strtolower($arrayName) . '_variables'],
                        $this->_activeOptions['make_id_with_' . strtolower($arrayName) . '_whitelist']
                    );

            if ($tmp2===false) {
                return false;
            }

            $tmp = $tmp . $tmp2;
        }

        return md5($tmp);
    }

Now you can easly define which GET, POST, COOKIE,SERVER or FILES indexes should be used to generate the Cache id.

   frontend.options.regexps.1.make_id_with_cookie_variables = true
    frontend.options.default_options.cache_with_cookie_variables = true
    frontend.options.regexps.1.make_id_with_cookie_whitelist[] = "languageCookie"
    frontend.options.regexps.1.make_id_with_cookie_whitelist[] = "usernameCookie"

Adding informing methods on Zend_Db_Select

Jira Information

Original Issue:ZF-12448
Issue Type:Improvement
Reporter:Murilo Carvalho
Created:10/19/12
Assignee:
Components:Zend_Db_Select

Description

Zend_Db_Select should have methods to inform some things about the query created so far,
like I have a query and depending on some parameters it can add where clauses or join some tables to it,
and I got to a point where i wanna know if I already concatenate something to the query before, it would be nice to have methods on the class that would inform that like something isTableJoined($tableName) returning a boolean

Zend_Session error handlers should test current error reporting level (for @-silenced-functions)

Jira Information

Original Issue:ZF-12494
Issue Type:Bug
Reporter:Claude Duvergier
Created:01/02/13
Assignee:
Components:Zend_Session

Description

Somewhere in my code I'm storing a {{Zend_Ldap_Node}} into Session. I've just upgraded this application from ZF 1.10 to ZF 1.12 and since then I'm getting
bq. Uncaught exception 'Zend_Session_Exception' with message 'session has already been started by session.auto-start or session_start()'"

h3. Errors

Call stack is complaining about an already started Session:
||#||Time||Memory||Function||Location||
|1|0.0061|343536|{main}( )|..\index.php:0|
|2|0.2549|11626392|Zend_Application->run( )|..\index.php:38|
|3|0.2549|11626392|Zend_Application_Bootstrap_Bootstrap->run( )|..\Application.php:366|
|4|0.2552|11626448|Zend_Controller_Front->dispatch( ???, ??? )|..\Bootstrap.php:97|
|5|0.4126|15116600|Zend_Controller_Plugin_Broker->preDispatch( ??? )|..\Front.php:941|
|6|0.4162|15164720|Zend_Controller_Plugin_ErrorHandler->preDispatch( ??? )|..\Broker.php:309|
|7|0.4163|15164720|Zend_Controller_Plugin_ErrorHandler->_handleError( ??? )|..\ErrorHandler.php:212|

But variables in local scope (#7) (xDebug infos) shows a {{Zend_Session_Exception}} with a message related to {{unserialize()}} and {{Zend_Ldap_Converter::fromLdapUnserialize()}}:
{quote}
Zend_Session::start() - D:_ Libraries\Zend Framework 1.12.1\library\Zend\Ldap\Converter.php(Line:395): Error #8 unserialize() [function.unserialize]: Error at offset 0 of 174474 bytes
D:_ Libraries\Zend Framework 1.12.1\library\Zend\Ldap\Converter.php(Line:395): Error #8 unserialize() [function.unserialize]: Error at offset 0 of 174474 bytes
D:_ Libraries\Zend Framework 1.12.1\library\Z'...
{quote}

h3. Code analysis

After some deep tests I've determined that the error handlers that {{Zend_Session::start()}} uses (namely {{Zend_Session_Exception::handleSessionStartError()}} are fired when {{Zend_Ldap_Converter::fromLdapUnserialize()}} tries to unserialize a value despite the whole unserialize-failure management in place (id. ignoring {{unserialize()}} error messages with the @ error control operator).
Then a {{Zend_Session_Exception}} is thrown by {{Zend_Session::start()}} with the {{Zend_Session_Exception::$sessionStartError}} message that {{unserialize()}} sent.

h3. Reproduction code

With LDAP involved, I thought it would be hard to reproduce, but the problem would occurs anytime a @-silenced function/method called during {{Zend_Session}} is in error.
I've set up a whole new ZF project with ZF CLI Tool and tried to reproduce the scenario as simply as possible using a model implementing {{__wakeup()}} and a {{Zend_Controller_Action}} to test it.
See code on Gist: https://gist.github.com/4440257

h3. Fix proposal

According to [Error Control Operators PHP documentation|http://php.net/manual/language.operators.errorcontrol.php], custom error handlers are expected to be called in such cases, but [{{error_reporting()}}|http://php.net/manual/function.error-reporting.php] can be used to test if the error was supposed to be ignored (was preceded by @).

See patch proposal on Gist: https://gist.github.com/4440268

Bootstrap param is missing in Zend_Controller_Front

Jira Information

Original Issue:ZF-12508
Issue Type:Bug
Reporter:Angel K
Created:01/16/13
Assignee:
Components:Zend_Test_PHPUnit

Description

Module: Zend_Test_PHPUnit

 public function setUp()
    {
        $this->bootstrap = new \Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.xml');
        parent::setUp();
    }

Then

\Zend_Controller_Front::getInstance()->getParam('bootstrap') is null

Content Length Inserted Into Content When No Content-Length Header Is Set

Jira Information

Original Issue:ZF-12407
Issue Type:Bug
Reporter:Jordan Phillips
Created:09/06/12
Assignee:Shahar Evron
Components:Zend_Http_Client

Description

After the first 8192 characters of a response in which no Content-Length header is set, a hexadecimal code indicating the length of the next chunk of characters is inserted into the response body. For example, after the first 8192 characters, the hexadecimal code 2000 is inserted into the body. 2000 converted to decimal is 8192, indicating that 8192 more characters are in the next chunk. After that chunk, the hexadecimal code inserted is 26, which is 38 decimal. This indicates that the last chunk of the response body is 38 characters.

I have found that the buffer limit happens in Zend_Http_Client_Adapter_Socket::read (line 465 - see snippet below):

// Fallback: just read the response until EOF
} else {

    do {
        if($this->out_stream) {
            if(@stream_copy_to_stream($this->socket, $this->out_stream) == 0) {
                  $this->_checkSocketReadTimeout();
                  break;   
             }
        }  else {
            $buff = @fread($this->socket, 8192);
            if ($buff === false || strlen($buff) === 0) {
                $this->_checkSocketReadTimeout();
                break;
            } else {
                $response .= $buff;
            }
        }

    } while (feof($this->socket) === false);

    $this->close();
}

I have not been able to find where the chunk length is being inserted into the response. The workaround for us was to add the Content-Length header, but it seems that there is still a bug since the chunk length should not be inserted into the response.

Zend_Validate_Hostname doesn't handle ccTLD .рф

Jira Information

Original Issue:ZF-12425
Issue Type:Bug
Reporter:Martin Fuxa
Created:09/24/12
Assignee:Thomas Weidner
Components:Zend_Validate

Description

This is valid TLD and domain
http://en.wikipedia.org/wiki/.%D1%80%D1%84
but Zend_Validate_Hostname doesn't handle it well.

$zvh = new Zend_Validate_Hostname;
if (!$zvh->isValid('президент.рф')) {
foreach ($zvh->getMessages() as $m) { echo $m,PHP_EOL; }
}

'президент.рф' appears to be a DNS hostname but cannot match TLD against known list
'президент.рф' does not appear to be a valid local network name

Make debug_header configurable and/or add real HTTP debug_header

Jira Information

Original Issue:ZF-12406
Issue Type:Improvement
Reporter:Frank Ruske
Created:09/05/12
Assignee:Alexander Veremyev
Components:Zend_Cache

Description

Proposal: Make it possible to set different cache debug_headers or disable them based on regexps.

Also it would be cool if you can add an http header and not only

cause this breaks json responses for example.


$frontendOptions = array(
'lifetime' => 10,
'debug_header' => true,
'regexps' => array(
'^/json/$' => array('debug_header' => false), // im an json response no debug header please
'^/json2/$' => array('debug_header_http' => 'x-header-zendcache'), // im an json response and thus i got a real http debug header
)
);


Would be nice to have this possibility for phpunit / selenium etc.

Zend_Mail_Protocol_Smtp must use context to bind specific IP.

Jira Information

Original Issue:ZF-12489
Issue Type:Improvement
Reporter:Federico Gon
Created:12/20/12
Assignee:Dolf Schimmel (Freeaqingme)
Components:Zend_Mail

Description

If you have a more than 1 IP in your server, you can't really know which IP Zend_Mail_Protocol_Smtp will use.

Solution: Use stream_context_set_params to set "bindto" param

application.ini:

resources.mail.transport.bindto    = "xxx.xxx.xxx.xxx" ; Setting the IP or the port to 0 will let the system choose the IP and/or port. (http://php.net/manual/en/context.socket.php)

Code:
class: Zend_Mail_Protocol_Smtp


// new property
protected $_bindto = null;

    public function __construct($host = '127.0.0.1', $port = null, array $config = array())
    {
        ...

        if(isset($config['bindto']) && !empty($config['bindto']))
        {
            $this->_bindto = $config['bindto'];
        }
        else
        {
            $this->_bindto = gethostbyname(gethostname());
        }

        parent::__construct($host, $port);
    }


    protected function _connect($remote)
    {
        $errorNum = 0;
        $errorStr = '';

        // open connection

/* Here use de new property to build a context */
        $context = null;
        if(!is_null($this->_bindto))
        {
            $opts = array('socket' => array('bindto' => $this->_bindto));
            $context = stream_context_create($opts);
        }

        $this->_socket = @stream_socket_client($remote, $errorNum, $errorStr, self::TIMEOUT_CONNECTION, STREAM_CLIENT_CONNECT, $context);

        if ($this->_socket === false) {
            if ($errorNum == 0) {
                $errorStr = 'Could not open socket';
            }
            /**
             * @see Zend_Mail_Protocol_Exception
             */
            require_once 'Zend/Mail/Protocol/Exception.php';
            throw new Zend_Mail_Protocol_Exception($errorStr);
        }

        if (($result = $this->_setStreamTimeout(self::TIMEOUT_CONNECTION)) === false) {
            /**
             * @see Zend_Mail_Protocol_Exception
             */
            require_once 'Zend/Mail/Protocol/Exception.php';
            throw new Zend_Mail_Protocol_Exception('Could not set stream timeout');
        }

        return $result;
    }

Zend_Loader_ClassMapAutoloader is not auto included when using Zend_Loader_AutoloaderFactory::factory

Jira Information

Original Issue:ZF-12398
Issue Type:Bug
Reporter:BinaryKitten
Created:08/31/12
Assignee:Matthew Weier O'Phinney
Components:Zend_Loader

Description

When using the new Zend_Loader_AutoloaderFactory with ClassMap Autoloader before the Standard Autoloader, the application falls over with the error:

Autoloader class "Zend_Loader_ClassMapAutoloader" not loaded
include 'Zend/Loader/AutoloaderFactory.php';
 $config = array(
        'Zend_Loader_ClassMapAutoloader' => array(
            './library/autoload_classmap.php',
            './application/autoload_classmap.php'
        ),
        'Zend_Loader_StandardAutoloader' => array(
            'prefixes' => array(
                'My_'       => 'My',
                'Zend_'     => 'Zend',
                'ZendX_'    => 'ZendX',
            ),
            'fallback_autoloader' => true,
        ),
    );

    Zend_Loader_AutoloaderFactory::factory($config);

Adding the following:

include 'Zend/Loader/ClassMapAutoloader.php';

before the

Zend_Loader_AutoloaderFactory::factory($config);
``` line fixes the issue.

Zend Tool 'zf' command has erroneous use of Windows' HOMEPATH variable

Jira Information

Original Issue:ZF-12394
Issue Type:Bug
Reporter:Chris Kings-Lynne
Created:08/30/12
Assignee:Ralph Schindler
Components:Zend_Tool

Description

This is the search order for zf, from the --setup argument:

    Home Directory:
        - ZF_HOME, then HOME (*nix), then HOMEPATH (windows)

For me, it's falling back to HOMEPATH, however these are my (default) Windows 7 variables:

HOMEDRIVE=U:
HOMEPATH=\

With that combination of variables, it cannot create or find its configuration files as it is NOT taking the U: bit into account, and also it fails anyway trying to create it in C:.

delete tag in picasa photo error

Jira Information

Original Issue:ZF-12504
Issue Type:Bug
Reporter:Rodolfo Van Kurczyn
Created:01/09/13
Assignee:froschdesign
Components:Zend_Gdata

Description

When use the function for delete tag in picasa photo

deleteTag($client, $user, $album, $photo, $tagContent);

this happens:

Fatal error:
Uncaught exception 'Zend_Gdata_App_InvalidArgumentException' with message 'You must specify an URI to which to post.' in Zend/Gdata/App.php:623

Stack trace:

#0 Zend/Gdata.php(219): Zend_Gdata_App->performHttpRequest('DELETE', NULL, Array, '', NULL, NULL)
#1 Zend/Gdata/App.php(957): Zend_Gdata->performHttpRequest('DELETE', NULL, Array, '', NULL, NULL)
#2 Zend/Gdata/Photos.php(572): Zend_Gdata_App->delete(NULL)
#3 public_html/autenticate_zend.php(130): Zend_Gdata_Photos->deleteTagEntry(NULL, false)
#4 public_html/autenticate_zend.php(83): deleteTag(Object(Zend_Gdata_HttpClient), 'google account', 'password', '576764976912403...', 'hola mundo')
#5 {main} thrown in Zend/Gdata/App.php on line 623

"session has already been started by session.auto-start or session_start()" error message is misleading

Jira Information

Original Issue:ZF-12438
Issue Type:Improvement
Reporter:Vestigal
Created:10/09/12
Assignee:Ralph Schindler
Components:Zend_Session

Description

On Ubuntu, garbage collection for sessions is taken care of by a cron job, rather than within PHP. If one downloads the PHP packages from Ubuntu's repository, then session.gc_probability in php.ini is set to 0, so PHP never runs the garbage collection for sessions. Unfortunately, if one changes session.gc_probability to something else, then one randomly encounters errors when the session garbage collection is run.

The error is something like this:

Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'session has already been started by session.auto-start or session_start()' in /asps/www/library/Zend/Session.php:462
Stack trace: #0 /asps/www/library/Zend/Session/Namespace.php(143): Zend_Session::start(true)
             #1 /asps/www/library/Zend/Auth/Storage/Session.php(87): Zend_Session_Namespace->_construct('Zend_Auth')
             #2 /asps/www/library/Zend/Auth.php(91): Zend_Auth_Storage_Session->_construct()
             #3 /asps/www/library/Zend/Auth.php(141): Zend_Auth->getStorage()
             #4 /asps/www/application/layouts/scripts/layout.phtml(8): Zend_Auth->hasIdentity()
             ...

The issue appears to be that garbage collection is failing, and this causes Zend Framework to think that a session has already been started. The easiest way to test this that I've found is to set session.gc_probability to 1 and session.gc_divisor to 1, so that the error is triggered every time one tries to start a session. With the default values, the error usually only shows up once every hundred times the page loads. Of course, you'll need to be testing this on Ubuntu with one of their PHP packages to see this error.

It would be nice if errors could not be thrown in this case, or if the error message could be more descriptive. It took awhile to track down the cause of this error, but I eventually found the answer on [Stack Overflow|http://stackoverflow.com/a/7979354/862204].

Invalid bind-variable name(mysqli)

Jira Information

Original Issue:ZF-12460
Issue Type:Bug
Reporter:Milan Krupa
Created:11/06/12
Assignee:Ralph Schindler
Components:Zend_Db

Description

If there is an escaped newline ({{\\n}}), followed by datetime (and probably by anything containing colon) in the query,
Zend_Db_Statement throws exception Invalid bind-variable name.

It is caused by {{Zend_Db_Statement::stripQuoted}}, which adjusts sql for example to

SELECT * FROM  WHERE (data LIKE 'foo\nbar2012-01-01 9:45:12')

instead of

SELECT * FROM  WHERE (data LIKE ) AND (datetime > )

Example of failing code:

$sql    = "SELECT * FROM `example` WHERE (data LIKE 'foo\\nbar') AND (datetime > '2012-01-01 9:45:12')";
$result = $db->fetchAll($sql);

And this is the example table:

CREATE TABLE `example` (
 `id` int(11),
 `data` text,
 `datetime` datetime
);

Regression when empty request is sent to Zend_Soap_Server in ZF 1.12.0

Jira Information

Original Issue:ZF-12436
Issue Type:Bug
Reporter:indy2kro
Created:10/08/12
Assignee:Alexander Veremyev
Components:Zend_Soap_Server

Description

Steps to reproduce:

  • Send an empty request to a SOAP server

Expected results:

  • Invalid XML error returned

Note: This is the actual error returned by ZF 1.11.13 for example.

Actual results:

  • SOAP-ERROR: Parsing WSDL: Couldn't load from ... : failed to load external entity

Example script:

<?php
require_once('Service.php');

require_once('Zend/Soap/Server.php');

$wsdl = __DIR__ . '/wsdl.xml';

$soapServer = new Zend_Soap_Server($wsdl);

$soapServer->setClass('Service');
$soapServer->handle();

Result from ZF 1.12.0:

PHP Warning:  SoapServer::SoapServer(): I/O warning : failed to load external entity "/home/test/wsdl.xml" in /usr/share/php/Zend/Soap/Server.php on line 811
PHP Fatal error:  SOAP-ERROR: Parsing WSDL: Couldn't load from '/home/test/wsdl.xml' : failed to load external entity "/home/test/wsdl.xml"
 in /usr/share/php/Zend/Soap/Server.php on line 811
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>WSDL</faultcode><faultstring>SOAP-ERROR: Parsing WSDL: Couldn't load from '/home/test/wsdl.xml' : failed to load external entity "/home/test/wsdl.xml"
</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

Result from ZF 1.11.13:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>Sender</faultcode><faultstring>Invalid XML</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

Zend_Date API loses 7 hours from 18 Jan 2038 07:14 AM to 19 Jan 2038 02:15 PM

Jira Information

Original Issue:ZF-12456
Issue Type:Bug
Reporter:Harry Tarnz
Created:10/28/12
Assignee:Thomas Weidner
Components:Zend_Date

Description

7 hours seem to "disappear" (actually, an earlier range of time is repeated) from 18 Jan 2038 07:14 AM to 19 Jan 2038 02:15 PM. We are in time zone Los Angeles, so we are GMT -7 hours, so we think that's where the problem arises. If we switch to time zone GMT, there is no such offset. We theorize (but have not checked) that other time zones may have similar problems.

The result of leaving such a condition in (whether the result of a bug or even by design) could mean the catastrophic failure of some IT systems in 25 years, around January 18-19, 2038. In fact, we have a mission critical system that would have eventually failed with significant consequences had we not tested for and uncovered this situation. (We are currently employing a workaround.)

EXAMPLE

This code:

$d = new Zend_Date('01/18/2038 07:14 PM');
echo $d . '
';
$d = new Zend_Date('01/18/2038 07:15 PM');
echo $d . '
';
$d = new Zend_Date('01/19/2038 02:14 AM');
echo $d . '
';
$d = new Zend_Date('01/19/2038 02:15 AM');
echo $d . '
';

produces this output:

Jan 18, 2038 7:14:00 PM
Jan 18, 2038 12:15:00 PM
Jan 18, 2038 7:14:00 PM
Jan 19, 2038 3:15:00 AM

NOTES:

  1. We would expect that any sequence of "$d = new Zend_Date('some date'); echo $d . '
    ';" would produce a result consistent with the input date string.
  2. The "Jan 18, 2038 12:15:00 PM" should have been the minute after "7:14:00 PM", or "7:15:00 PM". Instead, it is seven hours earlier.
  3. Similarly, the "Jan 18, 2038 7:14:00 PM" should have been the minute before "Jan 19, 2038 3:15:00 PM", or "Jan 19, 2038 3:14:00 PM". Instead, it is seven hours earlier.
  4. The time range from "Jan 18, 2038 12:15:00 PM" to the same day at "7:14:00 PM" is repeated twice.
  5. The issue probably doesn't occur exactly at seconds = 00, but the minute is the most discrete level of our test.
  6. Also, on and after "Jan 19, 2038 3:15:00 AM", the time is now off by +1 hour.

We are currently using Zend Framework 2.3.0.

Thank you for the timesaving Zend and the wonderful Zend Date API. Good luck on the resolution.

CLONE - UTF8 character encoding for Zend_Json_Encoder

Jira Information

Original Issue:ZF-12482
Issue Type:Improvement
Reporter:lequocdat
Created:12/05/12
Assignee:Benjamin Eberlei
Components:Zend_Json

Description

Zend_Json_Encoder does not support encoding of UTF8 characters.

Zend_Json_Encoder::encode('Отладочный')

yields

"Отладочный"

instead of the following which is generated with json_encode() which does support UTF8 characters

"\u041e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0439"

Add update method order parameter

Jira Information

Original Issue:ZF-12474
Issue Type:New Feature
Reporter:noisnaaria
Created:11/26/12
Assignee:
Components:Zend_Db

Description

It is not possible to run a query link this:

UPDATE t SET id = id + 1 ORDER BY id DESC;


                  EXAMPLE OF USE

UPDATE t SET id = id + 1;

For example, if the table contains 1 and 2 in the id column
and 1 is updated to 2 before 2 is updated to 3, an error occurs.
To avoid this problem, add an ORDER BY clause to cause the rows
with larger id values to be updated before those with smaller values:

UPDATE t SET id = id + 1 ORDER BY id DESC;


It would be nice to have an extra param to specify order:

$db->update($table, $where, $order);

Zend_Service_Rackspace_Files getObjects returns up to 10000 objects

Jira Information

Original Issue:ZF-12434
Issue Type:Bug
Reporter:luigif
Created:10/02/12
Assignee:Matthew Weier O'Phinney
Components:

Description

{{getObjects}} by default only returns a list of up to 10000 items.

The Rackspace docs say :

"The system will return a maximum of 10,000 Object names per request. To retrieve subsequent Object names, another request must be made with a 'marker' parameter. The marker indicates where the last list left off and the system will return Object names greater than this marker, up to 10,000 again. Note that the 'marker' value should be URL encoded prior to sending the HTTP request. If 10,000 is larger than desired, a 'limit' parameter may be given. If the number of Object names returned equals the limit given (or 10,000 if no limit is given), it can be assumed there are more Object names to be listed. If the container name list is exactly divisible by the limit, the last request will simply have no content."

If we want {{getObjects}} to return the complete list we need to play with the {{marker}} parameter but still a maximum of 10000 objects is returned.

I would suggest to specify in the documentation for {{getObjects}} that a list with a maximum of 10000 objects is returned.

Writing session to table on request close fails over multiple servers

Jira Information

Original Issue:ZF-12485
Issue Type:Bug
Reporter:Cosmin Budrica
Created:12/07/12
Assignee:Ralph Schindler
Components:Zend_Session

Description

Scenario: Same user, same browser, sends multiple ajax requests to the server at the same time. Requests are being balanced by a load balancer, and sent to multiple servers, with the same database as storage.

Error: "PHP Fatal Error: Exception thrown without a stack frame in Unknown on line 0" - very helpful of course

Issue: The code that finds the session in the database and updates or inserts it is not doing this in one go.

$rows = call_user_func_array(array(&$this, 'find'), $this->_getPrimary($id));

if (count($rows)) {
   $data[$this->_lifetimeColumn] = $this->_getLifetime($rows->current());

   if ($this->update($data, $this->_getPrimary($id, self::PRIMARY_TYPE_WHERECLAUSE))) {
       $return = true;
   }  
} else {
   $data[$this->_lifetimeColumn] = $this->_lifetime;

   if ($this->insert(array_merge($this->_getPrimary($id, self::PRIMARY_TYPE_ASSOC), $data))) {
       $return = true;
   }
}

Problem is, that anywhere between the find and insert, other servers might have already inserted that session, resulting this particular request to fail, with a real error message of: Duplicate entry on primary key "$session id".

My solution for the time being was to wrap this up in a database transaction, but all that code there should translate into something like:

$rows = $dbAdapter->findOrCreate($this->_getPrimary($id), $data);

and let the adapter(mysql, postgres, oracle, whatever) decide what the best method of inserting or updating is. For example, on mysql, most probably an INSERT () ON DUPLICATE KEY UPDATE would be the best solution.

PS: this is going on in Zend Framework 2 also.

CLONE - DB2 on i5 fails because of table and column names quoting

Jira Information

Original Issue:ZF-12458
Issue Type:Bug
Reporter:Stephen McMahon
Created:10/30/12
Assignee:Ralph Schindler
Components:Zend_Db_Adapter_Db2

Description

The following script was used:

echo 'Version:- '.Zend_Version::VERSION.'<br /><br />';

$stmt = $db->select()->from('psvf.STOCK')->where( 'VIN = ?' , 'ZZZ');

var_dump($stmt->__toString());

echo '<br />';

$test = $db->fetchAll($stmt,2);

It fails with the following result:

Version:- 1.11.10

string(73) "SELECT "HYOLABR".* FROM "psvf"."HYOLABR" AS "HYOLABR" WHERE (VIN = 'ZZZ')" 

Fatal error: Uncaught exception 'Zend_Db_Statement_Db2_Exception' with message 'HYOLABR in "psvf" type *FILE not found. SQLCODE=-204' in /usr/local/zendsvr/share/ZendFramework/library/Zend/Db/Statement/Db2.php:69 Stack trace: #0 /usr/local/zendsvr/share/ZendFramework/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Db2->_prepare('SELECT "HYOLABR...') #1 /usr/local/zendsvr/share/ZendFramework/library/Zend/Db/Adapter/Db2.php(238): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Db2), 'SELECT "HYOLABR...') #2 /usr/local/zendsvr/share/ZendFramework/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Db2->prepare('SELECT "HYOLABR...') #3 /usr/local/zendsvr/share/ZendFramework/library/Zend/Db/Adapter/Abstract.php(736): Zend_Db_Adapter_Abstract->query(Object(Zend_Db_Select), 2) #4 /www/zendsvr/htdocs/PSIwarranty/zendtest.php(24): Zend_Db_Adapter_Abstract->fetchAll(Object(Zend_Db_Select), 2) #5 {main} thrown in /usr/local/zendsvr/share/ZendFramework/library/Zend/Db/Statement/Db2.php on line 69

The following script works OK:

$stmt = "select * from psvf.STOCK where VIN = 'ZZZ'";

$prepare = $db->query($stmt);

$result = $db->fetchAll($stmt);

Trying to clone a Zend_Date object but it returns a different date (and even time)

Jira Information

Original Issue:ZF-12432
Issue Type:Bug
Reporter:Prueba Prueba
Created:10/01/12
Assignee:Thomas Weidner
Components:Zend_Date

Description

I been coding some functions in a project that requires operations with dates. In one of the functions i got a problem with an operation and trying to figure it out what happened i found this issue.

When i create a Zend_Date object and try to clone it to perform some operations on the cloned object (and keep the original object "as is") i get a different date when i invoke "getDate" function. Here is an example:

$d = new Zend_Date('2012-04-01', 'yyyy-MM-dd');
echo $d . '; ' . $d->getDate();

$d displays "Apr 1, 2012 12:00:00 AM" but $d->getDate() displays "Apr 2, 2012 12:00:00 AM"

The issue is not all the time, in the next code the date part is cloned correctly (except the time part that is supposed to be 00:00:00):

$d = new Zend_Date('2012-04-23', 'yyyy-MM-dd');
echo $d . '; ' . $d->getDate();

$d displays "Apr 23, 2012 12:00:00 AM" but $d->getDate() displays "Apr 23, 2012 11:00:00 PM"

I though that the problem was the "date format" so i tried a different approach, but it still change the cloned date:

$d = Zend_Date::now();
$d->setMonth(1)->setDay(1);
echo $d . '; ' . $d->getDate()

$d displays "Jan 1, 2012 9:40:15 PM" but $d->getDate() displays "Jan 2, 2012 12:00:00 AM"

Any ideas?

PluginLoader file cache and scalability

Jira Information

Original Issue:ZF-12478
Issue Type:Performance Improvement
Reporter:Ryan Graciano
Created:11/28/12
Assignee:Matthew Weier O'Phinney
Components:Zend_Loader

Description

Upon moving to an architecture that is more dependent on helpers than before, we have noticed a substantial decrease in site performance. After doing some benchmarking, enabling the PluginLoaderCache has given us a substantial performance boost (~15%), but we are noticing that it is still inefficient:

  • PluginLoader has no persistent cache across requests mapping name to classname, so it needs to loop through prefixes and check class_exists() on every one, every time, until it finds the helper it needs.
  • The filesystem is hit on every prefix (see ZF-11426), resulting in many disk accesses. This is especially pronounced in larger codebases.
  • The includeFileCache requires that every helper be loaded up front in one big file on every request. This is not scalable for large codebases with many helpers.

We have a couple of potential solutions -

A) Give us an option to auto-load these classes. This could be done by replacing the includeFileCache with a classNameCache which maps $name => $className. Rather than loop through each prefix/name combo with class_exists, and then going to the disk on each one, we could check the name array for $name, return the $className, then allow the auto-loader to manage the class loading.

B) Allow the user to replace PluginLoader entirely with our own logic. I don't think we're the only ones who have a reason to do this: http://stackoverflow.com/questions/11849531/how-do-i-replace-pluginloader-in-zend-framework

Long Timezones in Zend_Date constructor ignored with custom date format

Jira Information

Original Issue:ZF-12390
Issue Type:Bug
Reporter:George Steel
Created:08/28/12
Assignee:Thomas Weidner
Components:Zend_Date

Description

When creating a date in a specific timezone using a custom date string and format specifier, if the timezone contains underscore or dashes, the timezone is ignored.

date_default_timezone_set('Europe/London');
$customDateString = '2/9/2012 13:11:00 America/Los_Angeles';
$customFormat = 'd/M/yyyy H:m:s zzzz';
$date = new Zend_Date($customDateString, $customFormat);
echo $date->toString(Zend_Date::RFC_850) . PHP_EOL;
// Expected Result: Sunday, 02-Sep-12 13:11:00 America/Los_Angeles
//   Actual Result: Sunday, 02-Sep-12 13:11:00 Europe/London

/**
 * Workaround
 */
$date = new Zend_Date;
$date->setTimezone('America/Los_Angeles');
$date->set($customDateString, $customFormat);
echo $date->toString(Zend_Date::RFC_850) . PHP_EOL;
// Returns: Sunday, 02-Sep-12 13:11:00 America/Los_Angeles

When creating a date using any other timezone that matches /[:alpha:]/[:alpha:]/ there is no issue.

Fatal Error: Uncaught exception 'Zend_Session_Exception' with message 'Zend_Session::start()

Jira Information

Original Issue:ZF-12391
Issue Type:Docs: Problem
Reporter:Tony Perez
Created:08/29/12
Assignee:
Components:Zend_Session

Description

I inherited a website. I know nothing about php or framework. I keep getting this error stating the failure to write session data files. Please verify the current setting of session.save path is correct. I really appreciate some valuable guidance on this matter.

Cannot validate Date if end-user uses custom HTTP_ACCEPT_LANGUAGE

Jira Information

Original Issue:ZF-12403
Issue Type:Bug
Reporter:PowerKiKi
Created:09/04/12
Assignee:Thomas Weidner
Components:Zend_Date Zend_Locale Zend_Validate

Description

Date validation throw exception if the end-user enter custom values for HTTP_ACCEPT_LANGUAGE which are used internally in Zend_Locale. Those values are 'root', 'auto' and 'browser'.

I believe those internal values should never be accepted from end-user. However I can't wrap my mind around Zend_Locale well enough to provide a patch for that.

Here is a test script to be used via CLI (so we can manually set HTTP_ACCEPT_LANGUAGE):

require_once('Zend/Version.php');
require_once('Zend/Locale.php');
require_once('Zend/Registry.php');
require_once('Zend/Validate/Date.php');

if (php_sapi_name() != 'cli')
    die('must run as CLI script');

// Extends Zend_Locale, so we can reset its state between tests
class Zend_LocaleReset extends Zend_Locale {
    public static function reset() {
        self::$_auto = null;
        self::$_browser = null;
        self::$_environment = null;
    }
}

function test($accept) 
{
    Zend_LocaleReset::reset();
    $_SERVER['HTTP_ACCEPT_LANGUAGE'] = $accept;

    $locale = new Zend_Locale();
    Zend_Registry::set('Zend_Locale', $locale);

    echo $accept . "\t=>\t" . $locale->getLanguage() . ': ';
    try {
        $validator = new Zend_Validate_Date(array('format' => 'Y-m-d'));
        $validator->isValid('2012-08-08');
        echo 'OK';
    } catch (Exception $exc) {
        echo $exc->getMessage();
    }
    echo PHP_EOL;

}

echo 'Zend Version: ' . Zend_Version::VERSION . PHP_EOL . PHP_EOL;
test(null);
test('');
test('en');
test('en-US,en;q=0.8,ko;q=0.6');
test('fr');
test('non valid string');
test('root');
test('auto');
test('browser');
test('environment');

It will output the following:

Zend Version: 1.11.0dev

=> en: OK
=> en: OK


en  =>  en: OK
en-US,en;q=0.8,ko;q=0.6 =>  en: OK
fr  =>  fr: OK
non valid string    =>  en: OK
root    =>  root: The locale '' is no known locale
auto    =>  root: The locale '' is no known locale
browser =>  root: The locale '' is no known locale
environment =>  en: OK

Zend_Gdata_YouTube_PlaylistVideoEntry::getVideoId() gives wrong id

Jira Information

Original Issue:ZF-12461
Issue Type:Bug
Reporter:Scotepi
Created:11/06/12
Assignee:Trevor Johns
Components:Zend_Gdata

Description

When using playlists to list videos using Zend_Gdata_YouTube_PlaylistVideoEntry the getVideoId() returns the playlist video id instead of the actual video id.

$playlist = $yt->getPlaylistVideoFeed('https://gdata.youtube.com/feeds/api/playlists/PLB64B76A0570E8A46');
foreach ($playlist as $i=>$video) {
    echo $video->getVideoId() . ' ' . $video->getVideoTitle() ."\n";
}

This looks like an upstream issue with Zend_Gdata_YouTube_VideoEntry::getVideoId()

Zend_HTTP_Client can send a mal-formed GET request that causes PHP to hang for 10 seconds

Jira Information

Original Issue:ZF-12509
Issue Type:Bug
Reporter:Dagan Henderson
Created:01/17/13
Assignee:
Components:Zend_Http_Client

Description

At least some versions of PHP have a bug that causes scripts to hang for 10 seconds after calling file_get_contents('php://input') for a request with a content-length header value that exceeds the actual content length. (see https://bugs.php.net/bug.php?id=64014) This bug is present in the most current PHP package on Ubuntu 12.04.1 LTS.

Using Zend_Http_Client, if setRawData() called on a request that is not a POST, PUT or DELETE request, a content-length header will be inserted by _prepareHeaders() but the content will not be included in the request, thus triggering a 10 second delay in the server processing the request.

Zend_Db_Table_Abstract::delete does not delete from dependent table

Jira Information

Original Issue:ZF-12412
Issue Type:Bug
Reporter:Tomasz Zimnicki
Created:09/09/12
Assignee:Ralph Schindler
Components:Zend_Db_Table

Description

Although cascade deleting is executed from Zend_Db_Table_Abstract::delete it will not delete from dependent table. While calling _cascadeDelete on dependent table it's class name is passed as parent's table.
Zend_Db_Table_Abstract::delete should be:

    public function delete($where)
    {
        $depTables = $this->getDependentTables();
        if (!empty($depTables)) {
            $resultSet = $this->fetchAll($where);
            if (count($resultSet) > 0 ) {
                foreach ($resultSet as $row) {
                    /**
                     * Execute cascading deletes against dependent tables
                     */
                    foreach ($depTables as $tableClass) {
                        $t = self::getTableFromString($tableClass, $this);
                        $t->_cascadeDelete(get_class($this), $row->getPrimaryKey());
                    }
                }
            }
        }

        $tableSpec = ($this->_schema ? $this->_schema . '.' : '') . $this->_name;
        return $this->_db->delete($tableSpec, $where);
    }

improve RSA functionality

Jira Information

Original Issue:ZF-12472
Issue Type:Improvement
Reporter:Ad Jails
Created:11/21/12
Assignee:Pádraic Brady
Components:Zend_Crypt

Description

This would break BC but phpseclib's Crypt_RSA seems much more feature packed then the RSA implementation in ZF. PEAR's own Crypt_RSA has deprecated itself in favor of phpseclib's implementation.

Among other features phpseclib's Crypt_RSA supports... more key formats, key conversion, PSS signing and OAEP encryption.

Date displaying 2012/12/31

Jira Information

Original Issue:ZF-12499
Issue Type:Bug
Reporter:Erembert Dubal Teddy
Created:01/04/13
Assignee:
Components:Zend_Date

Description

The problem is about displaying of the 2012/12/31

For exemple :
$date = new Zend_Date('2012-12-31', 'Y-MM-dd');

echo $date->toString();
// 31 déc. 2012 00:00:00 my locale is FR it's good

echo $date->toString('Y-MM-dd');
// 2013-12-31 the result it's false

BBcode renderer can't render string with incorrect brackets

Jira Information

Original Issue:ZF-12408
Issue Type:Bug
Reporter:Olivier MELLINGER
Created:09/07/12
Assignee:Pieter Kokx
Components:Zend_Markup

Description

echo $bbcode->render('poijgsz;oih [ioda hgij [gdsjag;acheck [url=http://google.fr]link[/url]  [b]formatted text[/b]  [i]this is italics[/i]');

will render


of course, this text is malformed because some brackets are opened without being closed.
But I don't understand why in that case, these brackets aren't just displayed like that and the rest of the text rendered correctly.

Zend_Gdata_YouTube_VideoEntry::getVideoTags() broken

Jira Information

Original Issue:ZF-12416
Issue Type:Bug
Reporter:Scotepi
Created:09/11/12
Assignee:Trevor Johns
Components:Zend_Gdata

Description

{{getVideoTags()}} always returns a blank array because Zend_Gdata_Media_Extension_MediaKeywords doesn't have the tag data.

The tags are in Zend_Gdata_App_Extension_Category along with the category and other information. The only way to tell tags from category's apart is by using the scheme.

Some who is a bit better with Zend could come up with a more elegant solution but this is the basic code I used to get the tags:

$tags = array();
foreach ($video->getCategory() as $category) {
    if ($category->getScheme() == 'http://gdata.youtube.com/schemas/2007/keywords.cat') {
        $tags[] = $category->getTerm();
    }
}

I am using the latest SVN version 25051 at the time of posting.

Error when uploading via Zend_Gdata behind proxy

Jira Information

Original Issue:ZF-12475
Issue Type:Bug
Reporter:Chris Grice
Created:11/27/12
Assignee:Trevor Johns
Components:Zend_Gdata

Description

When using Zend_Gdata to upload to youtube while behind a proxy, Zend_Gdata_HttpAdapterStreamingProxy throws a fatal error:

Fatal error: Call to undefined method Zend_Gdata_MediaMimeStream::hasData() in Zend/Gdata/HttpAdapterStreamingProxy.php on line 118

Using the implementation of the same functionality in Zend_Gdata_HttpAdapterStreamingSocket the upload completes successfully.

I.e replacing the lines from 118 to 124:

     while ($body->hasData()) {
        if (! @fwrite($this->socket, $body->read(self::CHUNK_SIZE))) {
            require_once 'Zend/Http/Client/Adapter/Exception.php';
            throw new Zend_Http_Client_Adapter_Exception(
                'Error writing request to server');
        }
    }

with the following:

    $chunk = $body->read(self::CHUNK_SIZE);
    while ($chunk !== FALSE) {
        if (! @fwrite($this->socket, $chunk)) {
            require_once 'Zend/Http/Client/Adapter/Exception.php';
            throw new Zend_Http_Client_Adapter_Exception(
                'Error writing request to server');
        }
        $chunk = $body->read(self::CHUNK_SIZE);
    }
    $body->closeFileHandle();

fixes the issue.

'HTML E-Mail' part of the Zend Mail documentation 404s

Jira Information

Original Issue:ZF-12470
Issue Type:Docs: Problem
Reporter:tfountain
Created:11/16/12
Assignee:Dolf Schimmel (Freeaqingme)
Components:Zend_Mail

Description

The HTML Email part of the Zend Mail documentation currently 404s: http://framework.zend.com/manual/1.12/en/zend.mail.html-mails.html

This page is linked to from the main Zend Mail table of contents (http://framework.zend.com/manual/1.12/en/zend.mail.html). I've selected 1.12 as the affected version but I think this is a general problem.

Comments on the Zend_Mail docs page suggest this has been an issue for a while.

Zend_Soap_Client has no 'exceptions' flag.

Jira Information

Original Issue:ZF-12468
Issue Type:Bug
Reporter:Lewis Wright
Created:11/14/12
Assignee:
Components:Zend_Soap_Client

Description

The Zend_Soap_Client class does not allow the SoapClient option 'exceptions' to be changed. Further to this, it doesn't actually enable it by default, meaning that if there's a SoapFault then a fatal error is thrown.

Please add the Scottish Gaelic (gd) locale to Zend_Locale

Jira Information

Original Issue:ZF-12454
Issue Type:Improvement
Reporter:njh
Created:10/24/12
Assignee:Thomas Weidner
Components:Zend_Locale

Description

Please add gd.xml to the Zend Framework, which is in CLDR version 22:
http://unicode.org/cldr/trac/browser/tags/release-22/common/main/gd.xml

Also, the language 'gd' is described as 'Gaelic' in Zend_Locale_Data_Translation, whereas the label in en.xml is Scottish Gaelic:
http://framework.zend.com/svn/framework/standard/trunk/library/Zend/Locale/Data/en.xml

isLast not working as expected in Zend_Service_Amazon_SimpleDb_Page

Jira Information

Original Issue:ZF-12389
Issue Type:Bug
Reporter:kasperpedersen
Created:08/27/12
Assignee:Enrico Zimuel
Components:Zend_Service_Amazon

Description

The isLast method on Zend_Service_Amazon_SimpleDb_Page-objects checks wether the NextToken is null or not, when determining wether or not it is the last page for the query.

However, the Zend_Service_Amazon_SimpleDb sets the NextToken to an empty string, if there is no NextToken, so the isLast method doesn't work as intended.

As I see it could be fixed either in Zend_Service_Amazon_SimpleDb or Zend_Service_Amazon_SimpleDb_Page. I don't know which would be better for the framework.

PgSQL lastInsertId() incorrect in a transaction

Jira Information

Original Issue:ZF-12484
Issue Type:Bug
Reporter:Vestigal
Created:12/06/12
Assignee:Ralph Schindler
Components:Zend_Db

Description

When one calls lastInsertId() without any parameters inside a transaction that has not yet been committed, an incorrect value is returned.

To reproduce:

$this->getAdapter()->beginTransaction();
$this->insert(); // We assume that the table has a primary key named 'id' that is automatically incremented.
var_dump($this->getAdapter()->lastInsertId()); // Returns false

If one calls lastInsertId() with both parameters, then the correct value is returned. I.E.

var_dump($this->getAdapter()->lastInsertId($this->_name, 'id')); // Prints a number, like 23, which is what we would expect.

I tested this using Postgres, but it could be an issue in other adapters, as well.

Swaped values when using Zend_Date::get() with Zend_Date::YEAR or Zend_Date::YEAR_SHORT

Jira Information

Original Issue:ZF-12510
Issue Type:Bug
Reporter:Mário Pereira
Created:01/18/13
Assignee:
Components:Zend_Date

Description

When trying to retrieve the year part of a Zend_Date, the constants Zend_Date::YEAR and Zend_Date::YEAR_SHORT return each others value.

Code sample:

$today = new Zend_Date(); // assume it is 2013-01-18 11:00:00
$year = $today->get(Zend_Date::YEAR); // $year should be "2013", it is "13"
$shortYear = $today->get(Zend_Date::YEAR_SHORT); // $yearShort should be "13", it is "2013"

Cache Backend memcache und libmemcached do not store raw data

Jira Information

Original Issue:ZF-12396
Issue Type:Improvement
Reporter:Frank Ruske
Created:08/31/12
Assignee:Alexander Veremyev
Components:Zend_Cache

Description

In Zend_Cache_Backend_Libmemcached::save() and Zend_Cache_Backend_Memcached::save()

You will find the following line:

$result = @$this->_memcache->set($id, array($data, time(), $lifetime), $lifetime);

The Problem is that there will always an array be stored at the memcache server.
There should be an option to store a raw string since automatic_serialization has no affect here.

My hotfix is to remove time() and $lifetime. Since this results in problems for the session memcached handler i use an custom backend for the fix.

$result = $this->_memcache->set($id, $data, $lifetime);

In my setup im reading values stored in memcached directly using the NGINX memcached extension and the $request_uri as memcache key.
If the memcache server has a key matching the $request_uri then the content is directly delivered to the user.
This response will include time() and $lifetime values stored in memcache by the Zend Framework Backend Class. Only if the NGINX memcached Extension has no cache hit the php-fpm backend is called.

Zend_Pdf_Font::getLineHeight returns 0 on custom font

Jira Information

Original Issue:ZF-12502
Issue Type:Bug
Reporter:Bavo Janss
Created:01/08/13
Assignee:
Components:Zend_Pdf

Description

When loading the standard MS Font 'Arial Narrow Bold' using Zend_Pdf_Font::fontWithPath() the font metrics are wrong; Zend_Pdf_Font::getLineHeight() returns 0.
All the other fonts of the 'Arial Narrow' (regular, italic, bold-italic) family are ok.

Zend_Translate Adapter Gettext

Jira Information

Original Issue:ZF-12426
Issue Type:Bug
Reporter:Florian Blasel
Created:09/25/12
Assignee:
Components:Zend_Translate

Description

Hi
When using domain translation, translation will not work because translation string are not found when using e.g.:

$l->_d('myDomain', 'translate me');

The reason seems to be in the parser of the *.mo files in Zend_Translate_Adapter_Gettext.

Using poedit or xgettext to create *.mo files or:

xgettext --language=PHP --force-po -o /tmp/message.po --from-code=UTF-8 --keyword=_d:1c,2 some/files

example of po file:

<code>-->--
msgctxt "coredomain"
msgid "Invalid class name \"%1$s\""
msgstr "Ungueltiger Klassenname \"%1$s\""
--<--</code>

printr shows:

<code>-->--
[_data:Zend_Translate_Adapter_Gettext:private] => Array
(
    [de_DE] => Array
    (
        [coredomainInvalid class name "%1$s"] => Ungueltiger Klassenname "%1$s"
-------------------^ a special char as delimiter (i havent find out yet!)
    )
--<--</code>

An altern. description (in google with only one match): "http://zend-framework-community.634137.n4.nabble.com/Translating-messages-with-context-td1593226.html"

A solution without "msgctxt":
Check "http://www.gnu.org/software/gettext/manual/gettext.html#xgettext-Invocation" -> "5.1.6 Language specific options" -> "--keyword" section and update the settings in poedit:
-->--```
For PHP: _, gettext, dgettext:2, dcgettext:2, ngettext:1,2, dngettext:2,3, dcngettext:2,3.





Zend_CodeGenerator_Php_Property_DefaultValue produces unexpected results when using ARRAYS

Jira Information

Original Issue:ZF-12423
Issue Type:Bug
Reporter:Jacek Kobus
Created:09/18/12
Assignee:Ralph Schindler
Components:Zend_CodeGenerator

Description

While trying to set an array containing keys like "value", "type" it wrongly interprets it as configuration options.

$test = array (
    'id' =>
    array (
        'SCHEMA_NAME' => NULL,
        'TABLE_NAME' => 'user_token',
        'COLUMN_NAME' => 'id',
    ),
    'value' =>
    array (
        'SCHEMA_NAME' => NULL,
        'TABLE_NAME' => 'user_token',
        'COLUMN_NAME' => 'value',
    ),
    'type' =>
    array (
        'SCHEMA_NAME' => NULL,
        'DATA_TYPE' => 'varchar',
        'COLUMN_NAME' => 'type',
    ),
);


$class = new Zend_CodeGenerator_Php_Class(array(
    'name' => 'test',
    'properties' => array(
        array('name' => '_metadata', 'visiblity' => 'protected', 'defaultValue' => $test)
    ),
));

While trying to do a workaround I also found that multidimensional arrays are not handled propely as well (#ZF-9440).

$class = new Zend_CodeGenerator_Php_Class(array(
    'name' => 'test',
    'properties' => array(
        array('name' => '_metadata', 'visiblity' => 'protected', 'defaultValue' =>
        new Zend_CodeGenerator_Php_Property_DefaultValue(array(
            'value' => $test,
            'type' => Zend_CodeGenerator_Php_Property_DefaultValue::TYPE_ARRAY
        ))
        )
    ),
));

Passing an exception as the message to Zend_Log_Writer_Db raises an exception

Jira Information

Original Issue:ZF-12435
Issue Type:Bug
Reporter:Andrew Ballard
Created:10/04/12
Assignee:froschdesign
Components:Zend_Log

Description

The other log writers allow you to pass an instance of an exception as the message for logging. In particular, Zend_Log_Writer_Firebug even has a formatter that renders in a way that is easy to read when debugging XmlHttpRequests. However, I get an exception in Zend_Log_Writer_Db because the message is an object:

exception 'Zend_Db_Statement_Sqlsrv_Exception' with message 'An invalid PHP type for parameter 4 was specified.' in ..\library\Zend\Db\Statement\Sqlsrv.php:206 
Stack trace: 
#0 ..\library\Zend\Db\Statement.php(320): Zend_Db_Statement_Sqlsrv->_execute(Array) 
#1 ..\library\Zend\Db\Adapter\Abstract.php(479): Zend_Db_Statement->execute(Array) 
#2 ..\library\Zend\Db\Adapter\Sqlsrv.php(380): Zend_Db_Adapter_Abstract->query('INSERT INTO "Ap...', Array) 
#3 ..\library\Zend\Log\Writer\Db.php(143): Zend_Db_Adapter_Sqlsrv->insert('ApplicationLog', Array) 
#4 ..\library\Zend\Log\Writer\Abstract.php(85): Zend_Log_Writer_Db->_write(Array) 
#5 ..\library\Zend\Log.php(428): Zend_Log_Writer_Abstract->write(Array) 
#6 [internal function]: Zend_Log->log(Object(Exception), 3) 
#7 ..\library\My\Controller\Plugin\Log.php(212): call_user_func_array(Array, Array) 
#8 [internal function]: My_Controller_Plugin_Log->__call('log', Array) 
#9 [internal function]: My_Controller_Plugin_Log->log(Object(Exception), 3) 
#10 ..\library\My\Controller\Action\Helper\Log.php(27): call_user_func_array(Array, Array) 
#11 ..\application\controllers\ErrorController.php(52): My_Controller_Action_Helper_Log->__call('log', Array) 
#12 ..\application\controllers\ErrorController.php(52): My_Controller_Action_Helper_Log->log(Object(Exception), 3) 
#13 ..\library\Zend\Controller\Action.php(516): ErrorController->errorAction() 
#14 ..\library\Zend\Controller\Dispatcher\Standard.php(295): Zend_Controller_Action->dispatch('errorAction') 
#15 ..\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) 
#16 ..\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch() 
#17 ..\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run() 
#18 ..\public\index.php(126): Zend_Application->run() 
#19 \{main\}

I can pass the exception in as a string, but then it is more difficult to read in Firebug. I'm also not sure if this problem is specific to the database adapter I am using (Zend_Db_Adapter_Sqlsrv) since I don't have another database/adapter I can test right now.

I think a change in Zend_Log_Writer_Db::_write() should fix it but I don't know if it might raise other issues:

    /**
     * Write a message to the log.
     *
     * @param  array  $event  event data
     * @return void
     * @throws Zend_Log_Exception
     */
    protected function _write($event)
    {
        if ($this->_db === null) {
            // require_once 'Zend/Log/Exception.php';
            throw new Zend_Log_Exception('Database adapter is null');
        }

        if ($this->_columnMap === null) {
            $dataToInsert = $event;
        } else {
            $dataToInsert = array();
            foreach ($this->_columnMap as $columnName => $fieldKey) {
-                $dataToInsert[$columnName] = $event[$fieldKey];

+               if ('info' == $fieldKey && (is_object($event[$fieldKey]) || is_array($event[$fieldKey]))) {
+                   $dataToInsert[$columnName] = Zend_Debug::dump($event[$fieldKey], gettype($event[$fieldKey]), true);
+               } else {
+                   $dataToInsert[$columnName] = $event[$fieldKey];
+               }
            }
        }

        $this->_db->insert($this->_table, $dataToInsert);
    }

I tried to resolve this by extending Zend_Log_Writer_Db to override the _write method, but all of the properties are marked private instead of protected for some reason. As a result, getting it to work would have required duplicating the entire class. (If they truly need to be private, perhaps the class should be final?)

Zend_Config_Yaml does not parse embedded PHP

Jira Information

Original Issue:ZF-12487
Issue Type:Bug
Reporter:digitalprecision
Created:12/16/12
Assignee:
Components:Zend_Config

Description

In using {{sfYaml::load($fileUri)}} I have become accustomed to embedding PHP code, specifically constants, within my Yaml files. Running {{sfYaml::load}} natively handles the embedded PHP fine, but when I attempt to use Zend_Config_Yaml with 'decoder' passed in as an option, the embedded PHP code gets treated as a string of text.

After looking at the source code, it appears that line: 169 is the culprit. The file_get_contents call parses the yaml file as a string with no regard to embedded php code, instead it should use output buffering like {{sfYaml::load()}} does.

Example:

$config = new Zend_Config_Yaml($fileUri, 'nav', array('yaml_decoder' => array('sfYaml', 'load')));

$nav = new Zend_Navigation($config);

var_dump($nav->toArray());
array (size=1)
  'nav' => 
    array (size=2)
      'Admin' => 
        array (size=5)
          'groups' => string '<?php echo UserPlugin_Api_Group::ID_ADMIN . PHP_EOL ?>' (length=54)
          'render_if' => string 'logged_in' (length=9)
          'label' => string 'Admin' (length=5)
          'uri' => string '@fakeUri' (length=8)
          'pages' => 
Notice the 'groups' line, instead of: {{'groups' => string '<?php echo UserPlugin_Api_Group::ID_ADMIN . PHP_EOL ?>'}}, it should read: {{'groups' => int '1'}}

To maintain the ability to parse embedded PHP code, I'd suggest adding a check to see if the {{yamlDecoder === array(__CLASS__, 'decode')}}, if so, then use file_get_contents, if not let the passed in callback handle the parsing of the yaml file.

Zend_Validate_Hostname doesn't handle IDN for .UA

Jira Information

Original Issue:ZF-12413
Issue Type:Bug
Reporter:Martin Fuxa
Created:09/10/12
Assignee:Thomas Weidner
Components:Zend_Validate

Description

From 2012-06-01 UA have IDN support, see
https://hostmaster.ua/policy/?com.ua

For example
xn--80aaac0cakkgdth0g.com.ua
is valid + registered domain, you can check it by "Search domain name" at hostmaster.ua website.

But actual bugy result is
$zvh = new Zend_Validate_Hostname;
if (!$zvh->isValid('самобраночкка.com.ua')) {
foreach ($zvh->getMessages() as $m) {
echo $m,PHP_EOL;
}
}

'самобраночкка.com.ua' appears to be a DNS hostname but cannot match against hostname schema for TLD 'ua'
'самобраночкка.com.ua' does not appear to be a valid local network name

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.