Coder Social home page Coder Social logo

zendframework's Introduction

Logo

Welcome to the Zend Framework 3.0 Release!

RELEASE INFORMATION

Zend Framework 3.0.1dev

This is the first maintenance release for the Zend Framework 3 series.

DD MMM YYYY

UPDATES IN 3.0.1

Please see CHANGELOG.md.

SYSTEM REQUIREMENTS

Zend Framework 3 requires PHP 5.6 or later; we recommend using the latest PHP version whenever possible.

INSTALLATION

We no longer recommend installing this package directly. The package is a metapackage that aggregates all components (and/or integrations) originally shipped with Zend Framework; in most cases, you will want a subset, and these may be installed separately; see https://docs.zendframework.com/ for a list of available packages and installation instructions for each.

We recommend using either the zend-mvc skeleton application:

$ composer create-project zendframework/skeleton-application project

or the Expressive skeleton application:

$ composer create-project zendframework/zend-expressive-skeleton project

The primary use case for installing the entire framework is when upgrading from a version 2 release.

If you decide you still want to install the entire framework:

$ composer require zendframework/zendframework

GETTING STARTED

A great place to get up-to-speed quickly is the Zend Framework QuickStart.

The QuickStart covers some of the most commonly used components of ZF. Since Zend Framework is designed with a use-at-will architecture and components are loosely coupled, you can select and use only those components that are needed for your project.

MIGRATION

For detailed information on migration from v2 to v3, please read our Migration Guide.

COMPONENTS

This package is a metapackage aggregating the following components:

CONTRIBUTING

If you wish to contribute to Zend Framework, please read the CONTRIBUTING.md and CODE_OF_CONDUCT.md files.

QUESTIONS AND FEEDBACK

Online documentation can be found at https://docs.zendframework.com/. Questions that are not addressed in the manual should be directed to the relevant repository, as linked above.

If you find code in this release behaving in an unexpected manner or contrary to its documented behavior, please create an issue with the relevant repository, as linked above.

Reporting Potential Security Issues

If you have encountered a potential security vulnerability in Zend Framework, please report it to us at [email protected]. We will work with you to verify the vulnerability and patch it.

When reporting issues, please provide the following information:

  • Component(s) affected
  • A description indicating how to reproduce the issue
  • A summary of the security vulnerability and impact

We request that you contact us via the email address above and give the project contributors a chance to resolve the vulnerability and issue a new release prior to any public exposure; this helps protect Zend Framework users and provides them with a chance to upgrade and/or update in order to protect their applications.

For sensitive email communications, please use our PGP key.

LICENSE

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

ACKNOWLEDGEMENTS

The Zend Framework team would like to thank all the contributors to the Zend Framework project; our corporate sponsor, Zend Technologies / Rogue Wave Software; and you, the Zend Framework user.

Please visit us sometime soon at http://framework.zend.com.

zendframework's People

Contributors

adamlundrigan avatar akrabat avatar b-durand avatar bakura10 avatar blanchonvincent avatar cgmartin avatar dasprid avatar davidwindell avatar denixport avatar evandotpro avatar ezimuel avatar farazdagi avatar freeaqingme avatar jonathanmaron avatar kokx avatar localheinz avatar maks3w avatar marc-mabe avatar mikaelkael avatar ocramius avatar prolic avatar ralphschindler avatar robertbasic avatar samsonasik avatar sasezaki avatar socalnick avatar thinkscape avatar thomasweidner avatar waltertamboer 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  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

zendframework's Issues

Error when creating controller with Zend\Tool

zf2/bin/zf.sh create controller test 1 index

PHP Fatal error: Call to a member function search() on a non-object in /home/vidok/projects/devTools/zf2/library/Zend/Tool/Project/Provider/Controller.php on line 95

Zend\Code\DocBlockScanner doesn't recognize anymore tags without values

Jira Information

Original Issue:ZF2-110
Issue Type:Bug
Reporter:mtorromeo
Created:12/05/11
Assignee:maks3w
Components:Zend\Code\Scanner

Description

Component: Zend\Code (not listed)

The DocBlockScanner doesn't parse anymore tagnames wihout values such as this:

/**

They could be useful to tag code elements with custom tags as I was doing in zf 2.0 dev2

Two Ldap online tests are failing.

Jira Information

Original Issue:ZF2-175
Issue Type:Unit Tests: Problem
Reporter:maks3w
Created:02/24/12
Assignee:maks3w
Components:Zend\Ldap

Description

The following test are failing.

  1. ZendTest\Ldap\BindTest::testRequiresDnWithoutDnBind
    Failed asserting that '0x20: No object found for: (&(objectClass=account)(uid=manager))' contains "Failed to retrieve DN".

  2. ZendTest\Ldap\ChangePasswordTest::testChangePasswordWithUserAccountOpenLDAP
    0x32 (Insufficient access): updating: uid=newuser,ou=test,dc=example,dc=com

This test was executed with the same environment suggested on README-LDAP.txt

SetCookie::getFieldValue() always uses urlencode() for cookie values, even in case they are already encoded

Jira Information

Original Issue:ZF2-108
Issue Type:Bug
Reporter:Denis Voytyuk
Created:12/04/11
Assignee:ralphschindler
Components:Zend\Http

Description

In the following line:

{{$fieldValue = $this->getName() . '=' . urlencode($this->getValue());}}

SetCookie::getFieldValue() ignores the fact that cookies may come already encoded (for example from responses). As a result they are double encoded in this method and become invalid.

OAuth Signature, sign implemented twice causing conflict

Zend\OAuth\Signature @46
Zend\OAuth\Signature\AbstractSignature @92

Method declared in both interface and abstract resulting in:

Fatal error: Can't inherit abstract function Zend\OAuth\Signature::sign() (previously declared abstract in Zend\OAuth\Signature\AbstractSignature) in /home/phil/.../library/Zend/OAuth/Signature/AbstractSignature.php on line 39

Removing from AbstractSignature fixes.

HTTP 308 Resume Incomplete missing in Zend\Http\Response

Jira Information

Original Issue:ZF2-156
Issue Type:Improvement
Reporter:zfChannel
Created:02/08/12
Assignee:ralphschindler
Components:Zend\Http

Description

Zend\Http\Response is missing a constant for HTTP 308 Resume Incomplete. When trying to set this status code, it will throw an Exception.

The solution is to add the following line to the list of constants:
const STATUS_CODE_308 = 308;

This status code is used by Google Docs to upload files, so it might be a good addition.

Add addUseClass Method in ClassGenerator

Jira Information

Original Issue:ZF2-151
Issue Type:Improvement
Reporter:codebe
Created:01/25/12
Assignee:ralphschindler
Components:Zend\Code\Generator

Description

There's no method for adding uses classes in ClassGenerator e.g :

use Zend\Code\Reflection\MethodReflection;

class SomeClass extends MethodReflection {

}

[Zend_Application] Incorrect number of Arguments in calling registerNamespace

In Zend_Application the registerNameSpace is called from the setAutoloaderNamespaces Method.

public function setAutoloaderNamespaces(array $namespaces)   
 {
    $autoloader = $this->getAutoloader();

    foreach ($namespaces as $namespace) {
        $autoloader->registerNamespace($namespace);
    }

    return $this;
}

The autoloader ( Zend\Loader\StandardAutoloader ) is expecting an extra directory argument.
/**
* Register a namespace/directory pair
*
* @param string $namespace
* @param string $directory
* @return StandardAutoloader
*/
public function registerNamespace($namespace, $directory)

Syntax Error w/ Patch

diff --git a/library/Zend/Tool/Framework/Client/Console/Manifest.php b/library/Zend/Tool/Framework/Client/Console/Manifest.php
index 05effe9..76174af 100644
--- a/library/Zend/Tool/Framework/Client/Console/Manifest.php
+++ b/library/Zend/Tool/Framework/Client/Console/Manifest.php
@@ -88,8 +88,8 @@ class Manifest implements RegistryEnabled, MetadataManifestable
         // setup the camelCase to dashed filter to use since cli expects dashed named
         $ccToDashedFilter = new \Zend\Filter\FilterChain();
         $ccToDashedFilter
-            ->attach(new \Zend\Filter\StringToLower());
-            ->attach(new \Zend\Filter\Word\CamelCaseToDash())
+            ->attach(new \Zend\Filter\StringToLower())
+            ->attach(new \Zend\Filter\Word\CamelCaseToDash());
 
         // get the registry to get the action and provider repository
         $actionRepository   = $this->_registry->getActionRepository();

Please merge in :)

Navigation Active class based on router doesn't work

Jira Information

Original Issue:ZF2-126
Issue Type:Bug
Reporter:Jeroen de Lau
Created:12/30/11
Assignee:froschdesign
Components:Zend\Navigation

Description

When using navigation, the active path based on the RouterMatch do not work.

As an example (not sure if the urlHelper and routeMatch are required but it seems to be the only way to get it to work):

$navigation ['users'] =  array(
                'label'      => 'Users',
                'title'      => 'Users',
                'type'       => 'uri',
                'urlHelper'  => $urlHelper,
                'routeMatch' => $routeMatch
                'order'      => -100, // make sure home is the first page
                'urlHelper'  => $urlHelper
        );
        $navigation ['users']['pages'] = array(
            array(
                'label'      => 'Users',
                'controller' => 'user',
                'action'     => 'index',
                'urlHelper' => $urlHelper,
                'routeMatch' => $routeMatch,
            ),
            array(
                'label'      => 'Roles',
                'controller' => 'role',
                'urlHelper' => $urlHelper,
                'routeMatch' => $routeMatch,
                'action'     => 'index',
            )
  );

If you navigate to /user the active path is not marked. What seems to be happening is that on Zend\Navigation\Page\Mvc line number 148 the active parameter is set to true. However when the function is called a second time the control is passed to the parent Zend\Navigation\AbstractPage this then checks the _active parameter, and ignores the MVC::active property altogether.

Result is that isActive on line 397 Zend\View\Helper\Navigation\Module always returns false. If I add:

$this->_active = true;

On line 149 in Zend\Navigation\Page\Mvc all seems to work

Inexistent injection parameters are ignored

Jira Information

Original Issue:ZF2-184
Issue Type:Bug
Reporter:giorgiosironi
Created:03/01/12
Assignee:ralphschindler
Components:Zend\Di

Description

return array(
    'di' => array(
        'instance' => array(
            'Zend\Mvc\Controller\ActionController' => array(
                'parameters' => array(
                    'broker'       => 'Zend\Mvc\Controller\PluginBroker',
                    'montypythons' =>  'holygrail'
                ),
            )
        )
    )
);

The 'montypythons' parameter is just ignored. I can imagine many people not being noticed of wrong parameters, that do not correspond to any setter. For example my layout was broken because the configuration was using the old parameter baseTemplate instead of the new layoutTemplate.
In my opinion specifying a not existent parameter is like calling an inexistent setter: fatal error. Is this a design choice?

404s ActionController::notFound should not modify the route match

Jira Information

Original Issue:ZF2-223
Issue Type:Bug
Reporter:omerida
Created:03/14/12
Assignee:weierophinney
Components:Zend\Mvc

Description

Raising a 404 in a controller by calling notFound causes the view layer to look for the wrong template.

It shouldn't modify the routematch. Per weirophinney:

"We need to alter this to not modify the route match; it's a bad practice
stemming from the hack we used for view rendering prior to introducing
the new view layer. "

Cannot profile a database query

Jira Information

Original Issue:ZF2-210
Issue Type:Bug
Reporter:rhunwicks
Created:03/09/12
Assignee:ralphschindler
Components:Zend\Db

Description

In ZF1 you could profile a database query, but there currently in ZF2 there is no equivalent to {{$dbAdapter->getProfiler()->setEnabled(true);}}

This prevents you from examining the last query executed (which in turn prevents Zend\Authentication\DbTableTest::testAdapterCanUseModifiedDbSelectObject() from running) and it will also prevent database query timing using Firebug

Better API documentation

Jira Information

Original Issue:ZF2-182
Issue Type:Docs: Improvement
Reporter:Jan Jakeš
Created:02/28/12
Assignee:ralphschindler
Components:

Description

Hi guys!

As a programmer (= a framework user) I'm very dissatisfied with the current API documentation. For me it is a confusing labyrinth with awful design, a browser-killer (yes, using the search feature can really kill your browser) and apparently it doesn't really care about the code integrity. It does not help me with my work as it should.

After a discussion with my colleagues from the PHP community (guys moving around Doctrine, Symfony, Nette, etc.), I've found out that I'm not the only one who finds this API horrible and I decided to contact you this way and propose you a solution that we consider the "top-of-the-range":

Check out an open source tool called ApiGen: http://apigen.org/
Or better - go straight to see the difference between http://framework.zend.com/apidoc/1.11/ and http://apigen.juzna.cz/doc/komola/ZendFramework/. Do you see that?

And here you can check the ZF2 API: http://apigen.juzna.cz/doc/zendframework/zf2/
(Thanks to ApiGen there were discovered some incredible bugs in ZF2 - #857.)

ApiGen is a fresh, elegant tool, which is fast, already supports PHP 5.4 (yes, DocBlox is announcing PHP 5.3 support as something exceptional), still is being improved, has an agile community and starts to gain more and more fame in the PHP community. There's even a first experimental version of cloud-based API doc generating directly from Github (http://apigen.juzna.cz/).

Think about it, guys! ;)

Cheers!
Jan

Add example for custom controller plugin registration

Jira Information

Original Issue:ZF2-232
Issue Type:Docs: Improvement
Reporter:Mat Berchtold
Created:03/20/12
Assignee:weierophinney
Components:Zend\Mvc

Description

In the documentation (documentation/manual/en/module_specs tree) chapter: 12.7.1. Controllers, something similar to the following can be added:

12.7.1.4 Custom Plugins Registration

The partial configuration below shows how to register custom plugins with the PluginLoader in the module configuration file:

return array(
   'di' => array(
        'instance' => array(
            'Zend\Mvc\Controller\PluginLoader' => array(
                'parameters' => array(
                    'map' => array(
                        'custom' => 'SomeCustomModule\CustomPlugin',
                ),
            ),
        ),
   ),
);

CLONE - Tags should be emulated when they are not supported

Jira Information

Original Issue:ZF2-137
Issue Type:Docs: Improvement
Reporter:marc-mabe
Created:01/09/12
Assignee:marc-mabe
Components:Zend\Cache

Description

Actually the documentation notes TAGS as best variant to be used for cleaning cache entries.
This is only the case for 2 or 3 of the supported backends.

All backends which do not support tags should emulate tags within Zend_Cache when possible.

JsonModel cannot be used as layout during rendering

Jira Information

Original Issue:ZF2-213
Issue Type:Bug
Reporter:yonman
Created:03/11/12
Assignee:weierophinney
Components:Zend\View

Description

My use case required I create a compound Json response, part of which is a standard json wrapper to variable json content.

During an application event I called the overrode the default view model:

$layout = new \Zend\View\Model\JsonModel(array(... variables... and a captureTo placeholder));
$e->setViewModel($layout);

And added the JsonStrategy

$view->events()->attach($locator->get ( 'Zend\View\Strategy\JsonStrategy' ), 100);

In my controller I returned a different JsonModel with its own parameters, fully expecting to see the array I introduced in the controller output in the captureTo placeholder ... but this doesn't work.

A quick look in JsonRenderer:115-124 shows why:

        if ($nameOrModel instanceof Model) {
            if ($nameOrModel instanceof Model\JsonModel) {
                $values = $nameOrModel->serialize();
            } else {
                $values = $this->recurseModel($nameOrModel);
                $values = Json::encode($values);
            }

            return $values;
        }

If a JsonModel is sent to the renderer directly, it is serialized. This serialization completely ignores its children (it does, however, parse internal variables). Seems to me this kind of shoots my use case in the foot and requires a phtml view script always wrap the json output ... which is weird.

recurseModel works as expected, though I seemed to have a hard time having the children rendered anywhere but a variable named "content".

Sending multiple Mails with Zend\Mime\Part (resource based content) failed

Description

Using Zend\Mail with Zend\Mime\Part multipart stream based content, multiple calls of Zend\Mail\Transport\Smtp::send results in incomplete mail transmission.
Currently, on every call of Zend\Mail\Transport\Smtp::send the content of each part is captured by using Zend\Mime\Part::getContent(), but this function directly gets the stream content by using stream_get_contents(...). When using Resource based content (e.g. create by fopen) only the first readout works. On the second call the filepointer is pointed to the end of the file and stream_get_contents() will return an empty string which results in an empty Part of the Message.

Example

$sendTo = array('[email protected]', '[email protected]', '[email protected]');

// message
$message = new Zend\Mail\Message();
...

// SMTP
$transport = new Zend\Mail\Transport\Smtp();

// string based content
$text = new Zend\Mime\Part('text...');
...

// resource based stream content
$pdf = new Zend\Mime\Part(fopen('test.pdf', 'r'));
...

// set content
$body->setParts(array($text, $pdf));
$message->setBody($body);

// send mails - first mail will be delivered correctly. second+third mail will be transmitted without the $pdf content
foreach ($sendTo as $dst){ 
  $message->setBcc($dst); $transport->send($message); 
}

Possible Solution

  • Zend\Mime\Part::getContent - a flag should be added, that indicates the stream content is read yet. In this case a "cached" version of the stream content should be returned.
  • Or (the simple way) rewind($this->content) should be called before stream_get_contents to reset the file pointer

ZFVersion: 2.0.2

Bug in Zend\SignalSlot\Signals

Hi,
I think, I found a bug in \Zend\SignalSlot\Signals. Contradicting to it's documentation emitUntil() does not return a ResponseCollection in every case. Instead it returns null if there are no signals, which leads to a "Fatal error: Call to a member function last() on a non-object in /.../zf2/library/Zend/Session/SessionManager.php on line 339", because it relies on retrieving a ResponseCollection. This could be easily fixed to match the documentation by removing lines 84 - 86:
if (empty($this->_signals[$signal])) {
return;
}

PS: I have never forked a git project. Can I fork it, fix it myself and create a pull request?

Rendering layout and view scripts fails with executable Phar archive applications

Hello ZF Developers,

I think there is a problem with the Layout+View script path when using a PHAR archive.

I developed a sample ZF application and created a phar file of it. Then I tried to run the application from the phar file and got an exception "'Script "xxx" not found in path (xxxxx)',, this exception is thrown in line 270 in Zend/View/TemplatePathStack.php.

The problem is that SplFileInfo::getRealPath() returns FALSE if there is a protocol name like "phar://" in the file name.

A fix required 3 changes in 2 files you can see below. I marked the fixes with a START and END line including a number [x], so it makes it easier to referer to it in discussions.

I tested it with ZF 2.0 + PHP 5.3.2 + Ubuntu 10.04.1

Original File:
https://github.com/zendframework/zf2/blob/master/library/Zend/View/PhpRenderer.php

public function render($name, $vars = null)
{
// find the script file name using the parent private method
$this->file = $this->resolver($name);

    // [1] START FIX ++++++++++++++++++++++++++++++++++++++++++++++++++++++
    if (!is_file($this->file)) {
        $this->file = $this->resolver($name) . '/' . $name;

        if (!is_file($this->file)) {
            $this->file = $this->resolver($name) . '/' . basename($name);
        }
    }
    // [1] END FIX +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    unset($name); // remove $name from local scope

    if (null !== $vars) {
        $this->varsCache = $this->vars();
        $this->setVars($vars);
    }

    unset($vars); // remove $vars from local scope

    ob_start();
    include $this->file;
    $content = ob_get_clean();

    if (null !== $this->varsCache) {
        $this->setVars($this->varsCache);
        $this->varsCache = null;
    }

    return $this->getFilterChain()->filter($content); // filter output
}

Original File:
https://github.com/zendframework/zf2/blob/master/library/Zend/View/TemplatePathStack.php

public function getScriptPath($name)
{
    if ($this->isLfiProtectionOn() && preg_match('#\.\.[\\\/]#', $name)) {
        $e = new Exception('Requested scripts may not include parent directory traversal ("../", "..\\" notation)');
        throw $e;
    }

    if (!count($this->paths)) {
        $e = new Exception('No view script directory set; unable to determine location for view script');
        throw $e;
    }

    $paths   = PATH_SEPARATOR;
    foreach ($this->paths as $path) {
        // [2] START FIX ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
        //$file = new SplFileInfo($path . $name);
        $file = new SplFileInfo($path . basename($name));
        if (!$file->isReadable()) {            
            $file = new SplFileInfo($path . $name);
        }
        // [2] END FIX +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

        if ($file->isReadable()) {
            // Found! Return it.
            // [3] START FIX +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
            //$filePath = $file->getRealPath();
            $filePath = (false !== $file->getRealPath()) ? $file->getRealPath() : $file->getPath();
            // [3] END FIX ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

            if ($this->useStreamWrapper()) {
                // If using a stream wrapper, prepend the spec to the path
                $filePath = 'zend.view://' . $filePath;
            }

            return $filePath;
        }

        $paths .= $path . PATH_SEPARATOR;
    }

    $e = new Exception(sprintf(
        'Script "%s" not found in path (%s)',
        $name, trim($paths, PATH_SEPARATOR)
    ));
    throw $e;
}

Multipart type respected in Zend\Mail\Message::setBody

Jira Information

Original Issue:ZF2-196
Issue Type:Improvement
Reporter:Piotrek Rybałtowski
Created:03/07/12
Assignee:maks3w
Components:Zend\Mail

Description

When calling Zend\Mail\Message::setBody providing a Mime Message object with multipart, in line 414 any multipart settings in Mime Message are ignored and multipart/mixed is put in statically. I guess multipart/alternative would be used more often to not display HTML and plain text version at one time, but the most ideal situation would be to have it set as an option.

Thanks!

Missing Exception.php class.

Not sure if this is an issue but im getting

"PHP Fatal error: Class 'Zend\Exception' not found" . Looking at the file structure the Exception class is not present.

I'm using zendframework-zf2-release-2.0.0dev2 snapshot.

Zend Dependency Injection param containing "://" is recognized as stream wrapper

Jira Information

Original Issue:ZF2-120
Issue Type:Bug
Reporter:insekticid
Created:12/12/11
Assignee:ralphschindler
Components:Zend\Di

Description

module.config.php example

array( 'instance' => array( 'Doctrine\MongoDB\Connection' => array( 'parameters' => array( 'server' => 'mongodb://127.0.0.1:27017/db', 'options' => array(), ) ) ), ), Result is Warning: stream_resolve_include_path() [function.stream-resolve-include-path]: Unable to find the wrapper "mongodb" - did you forget to enable it when you configured PHP? in library\Zend\Loader\StandardAutoloader.php on line 304 Problem is here https://github.com/zendframework/zf2/blob/master/library/Zend/Di/Di.php#L495 elseif (is_string($iConfigCurValue) && $this->definitions->hasClass($iConfigCurValue)) hasClass() will call class_exists() https://github.com/zendframework/zf2/blob/master/library/Zend/Di/Definition/RuntimeDefinition.php#L91 and result is warning from StandardAutoloader my quickfix is closure ``` 'Doctrine\MongoDB\Connection' => array( 'parameters' => array( 'server' => (function () {return 'mongodb://127.0.0.1:27017/db';}), 'options' => array(), ) ) ```

Semicolon syntax error

/library/Zend/Tool/Framework/Client/Console/Manifest.php on line 92

It is writing:
$ccToDashedFilter
->attach(new \Zend\Filter\StringToLower());
->attach(new \Zend\Filter\Word\CamelCaseToDash())

must be:
$ccToDashedFilter
->attach(new \Zend\Filter\StringToLower())
->attach(new \Zend\Filter\Word\CamelCaseToDash());

Search/Lucene : problem with Lucene:create

Hello

This following code doesn't work :
$document = new Document();
$index = Lucene::create($filePath);
$document->addField(Field::keyword($name, $value, 'UTF-8'));
$document->addField(Field::text($name, $value, 'UTF-8'));
$index->addDocument($document);

A notice is displayed :

Notice: Uninitialized string offset: 0 in /zend/library/Zend/Search/Lucene/Storage/File/AbstractFile.php on line 96

But the file "segments_1" exists and contains something.
If I write the following code, it's working better with several displayed notice :

$document = new Document();
try{
    $index = Lucene::create($filePath);
} catch (Exception $e) {
    $index = Lucene::open($filePath);
}
$document->addField(Field::keyword($name, $value, 'UTF-8'));
$document->addField(Field::text($name, $value, 'UTF-8'));
$index->addDocument($document);

Best regards,

Zend/File/ClassFileLocater.php namespace + T_HALT_COMPILER bug

When using 'ClassFileLocater' and trying to parse a file looking like this:
<?php
namespace a {
class b { }
}
It will see b as part of the namespace.
This can be fixed by adding || '{' === $token to the if on line 102.

When using 'ClassFileLocater' and trying to parse a file looking like this:
<?php
// code
__halt_compiler();
// more code
The classlocator will also analyse the // more code.
This can be fixed by adding case T_HALT_COMPILER: return false. to the switch on line 93.

Zend\Di ignores default parameters values

Jira Information

Original Issue:ZF2-142
Issue Type:Bug
Reporter:rafalwrzeszcz
Created:01/16/12
Assignee:ralphschindler
Components:Zend\Di

Description

When method parameter has default value it is ignored by Zend\Di and it passes {{NULL}} if parameter is not defined explicitly. As an example try creating {{Zend\Authentication\Storage\Session}} without any parameters defined in Di configuration - it's constructor allows to create instance without passing any parameter and assigns default values then. But Di sees no parameter values in configuration and passes {{NULL}}, which overrides default values.

I think Di should check if parameter is specified explicitly to {{NULL}} in instance manager configuration and if not, do not pass anything (even NULL).

Problem lies in library/Zend/Di/Di.php at line 616 (commit 9bd4f0a):

{{$resolvedParams[$index] = null;}} should assign default parameter vlaue if not explicitly specified by Di definition.

Missing 'use' in Zend\Db\Statement\Mysqli

I've been playing around with ZF2 and received the following error:

PHP Fatal error: Class 'Zend\Db\Statement\Db\Db' not found in */library/Zend/Db/Statement/Mysqli.php on line 288

Can be fixed by adding:

use Zend\Db;

to Zend/Db/Statement/Mysqli.php

AJAX-ready sessions

Jira Information

Original Issue:ZF2-141
Issue Type:Improvement
Reporter:Mehran Ziadloo
Created:01/14/12
Assignee:ralphschindler
Components:Zend\Session

Description

Due to asynchronous nature of AJAX requests, it's probable for two requests of same client race each other for a session data. ZendFramework has already included the prefect implementation for JSON-RPC and XML-RPC servers. Any RPC server is useless without exclusive access to session data. I believe the following functionalities is what is missing right now in Zend_Session and/or Zend/Session classes:

  • Exclusive inter-request access to each session namespace.
  • Specifying the access type prior loading a namespace. Access types include: read-only, read & write. And for namespaces loaded as read-only, changing any part of session should throw an exception. I believe that it's obvious that read-only accesses share their locks while read & write accesses hold an exclusive one.

Suggestions for implementation:
One can save each namespace in different file and lock it using flock when sessions are to be saved as files. As for the sessions in database, the database engine should lock the namespace record which MySQL supports.

Please let me know if I can be of any help. I'll be glad to know if my proposal is feasible or not.

Regards,
Mehran Ziadloo

Add Backslashes to core function and constants calls

Jira Information

Original Issue:ZF2-227
Issue Type:Performance Improvement
Reporter:Maksym Sliesarenko
Created:03/18/12
Assignee:ralphschindler
Components:

Description

Replace all code like:

namespace 'Zend\Blabla';
...
$time = time();

...

echo PHP_EOL;

...

to this way

namespace 'Zend\Blabla';
...
$time = \time();

...

echo \PHP_EOL;

...

It will increase the performance and security. Because php first looks for function in current namespace.

Function overloading example:


namespace Zend\Date {
    function is_object($date) {
        echo "Zend Date constructor is called with param {$date}";exit;
    }
}


namespace Foo {

require_once 'zf2/library/Zend/Loader/AutoloaderFactory.php';
\Zend\Loader\AutoloaderFactory::factory(array('Zend\Loader\StandardAutoloader' => array()));

$date = new \Zend\Date\Date('2012-03-18');

}

iterating over a Zend_Config

Jira Information

Original Issue:ZF2-10
Issue Type:Bug
Reporter:meugen
Created:03/23/09
Assignee:DASPRiD
Components:Zend\Config

Description

There are two xml-files.

<?xml version="1.0" encoding="utf-8" ?>
<root>
    <files>
        <file id="index" location="index.html" />
        <file id="main_css" location="css/main.css" />
        <file id="main_js" location="js/main.js" />
    </files>
</root>

and

<?xml version="1.0" encoding="utf-8" ?>
<root>
    <files>
        <file id="index" location="index.html" />
    </files>
</root>

and the sample code:

<?php
    require_once 'Zend/Config.php';
    require_once 'Zend/Config/Xml.php';

    $config = new Zend_config_xml('/path/to/config.xml');
    foreach ($config->files->file as $value)
        echo 'id: '.$value->id.'<br />location: '.
            htmlspecialchars($value->location).'<hr />';
?>

If the {{/path/to/config.xml}} to substitute {{config1.xml}}, then everything works correctly. But if you substitute {{config2.xml}} error

Notice: Trying to get property of non-object in D:\www\index.php on line 7

How can I iterate all items {{file}}, if their number is not known in advance (one or more than one)?

Zend_Json_Server only allows error codes RESERVED for JSON-RPC implementation

Jira Information

Original Issue:ZF2-181
Issue Type:Bug
Reporter:adamlundrigan
Created:02/26/12
Assignee:ralphschindler
Components:Zend\Json

Description

Zend_Json_Server (ZF1) currently only allows errors in range(-32099, -32000). For ZFv2, the implementation should be changed to adhere to the spec:

  • Error code can be any integer
  • Codes in range(-32700,-32000) are reserved for protocol implementation

See: ZF-11991 for more information. Thanks to [~448191] for raising the ZFv1 issue.

ConfigListener relies on GLOB_BRACE which is not supported in all filesystems

Jira Information

Original Issue:ZF2-243
Issue Type:Bug
Reporter:yonman
Created:03/29/12
Assignee:DASPRiD
Components:Zend\ModuleManager

Description

GLOB_BRACE is used for a glob() call in the ConfigListener when merging configurations.
This dependency cannot be met on all operating systems, particularly AIX (IBMi).

An application using the ConfigListener fails with a fatal error:

[27-Mar-2012 17:53:34] PHP Warning: glob() expects parameter 2 to be long, string given in /usr/local/zendsvr/gui.new/vendor/ZendFramework/library/Zend/Module/Listener/ConfigListener.php on line 233

[27-Mar-2012 17:53:34] PHP Catchable fatal error: Argument 1 passed to Zend\Config\Factory::fromFiles() must be an array, null given, called in /usr/local/zendsvr/gui.new/vendor/ZendFramework/library/Zend/Module/Listener/ConfigListener.php on line 233 and defined in /usr/local/zendsvr/gui.new/vendor/ZendFramework/library/Zend/Config/Factory.php on line 93```

Locale files missing

Local files expected to be found in folder: library/Zend/Locale/Data/main but they are missing.

Zend\View\Resolver\TemplatePathStack suffix behavior is too restrictive for multiple suffixes

Jira Information

Original Issue:ZF2-193
Issue Type:Patch
Reporter:yonman
Created:03/04/12
Assignee:weierophinney
Components:Zend\View

Description

In a project where view scripts can come in multiple flavors (.pjson, .pxml, .phtml), the current defaultSuffix behavior is too restrictive and cannot be easily modified on-the-fly.

I have an application which has a UI and API calls that may return different formats of responses (json and xml). I named the view scripts .p so as to keep my controllers uniform and only change the suffix in the renderer (back in beta 2). To make things a bit more complex, I some times call these view scripts into rendering by using the Partial View Helper using their true filename (such as 'IssueWebAPI/monitorGetIssues.pjson'). I work around this issue by naming the file .pjson.phtml, which seems inelegant.

The original behaviour fails to work in beta 3, seems to be because of lines 316-320 in Zend/View/Resolver/TemplatePathStack.php

// Ensure we have the expected file extension
$defaultSuffix = $this->getDefaultSuffix();
if (pathinfo($name, PATHINFO_EXTENSION) != $defaultSuffix) {;
   $name .= '.' . $defaultSuffix;
}

No matter which suffix I specify (excpet for phtml), .phtml is always appended to the file-name and the resolver fails to retrieve the file.

Instead, I suggest the following behavior:

// Ensure we have the expected file extension
$defaultSuffix = $this->getDefaultSuffix();
if (pathinfo($name, PATHINFO_EXTENSION) == '') {
    $name .= '.' . $defaultSuffix;
}

This behaviour attaches the default suffix if no suffix was specified (the desired behaviour) but leaves the file-name alone if some other suffix is in place

Zend_Feed_Reader_Feed_AbstractFeed sorting

Jira Information

Original Issue:ZF2-127
Issue Type:Improvement
Reporter:xobb
Created:01/03/12
Assignee:ralphschindler
Components:Zend\Feed

Description

Zend_Feed_Reader_Feed_AbstractFeed extend the ArrayObject to have uasort method that will allow sorting feed entries for the feed.

Example, if I want to sort the feed by date or by category I would call the uasort($feed, 'mySortingCallback');

Mvc/Router/Http/Segment.php escapes valid chars

Jira Information

Original Issue:ZF2-205
Issue Type:Bug
Reporter:Henning Panke
Created:03/08/12
Assignee:DASPRiD
Components:Zend\Mvc\Router

Description

Mvc/Router/Http/Segment.php escapes valid segment chars by using urlencode.

urlencode/urldecode and rawurlencode/rawurldecode escapes more chars than necessary.
These functions return ??a string in which all non-alphanumeric characters except -_. have been replaced??
http://php.net/manual/en/function.urlencode.php

RFC 3986 allows much more chars in path segments.
http://tools.ietf.org/html/rfc3986#appendix-A

use Zend\Mvc\Router\Http\Segment;
$segment = new Segment('/:dada');
$rendered = $segment->assemble(array('dada'=>'Hello World!'));
echo $rendered;

This should return {{/Hello World!}} but returns instead {{/Hello+World%21}}.

Zend\Application\AbstractBootstrap foreach() warning

Using the application bootstrap with config returns
Warning: Invalid argument supplied for foreach() in /path/to/Zend/Application/AbstractBootstrap.php on line 156

Changing line 155 in Zend\Application\AbstractBootstrap from
} elseif ('resources' == $key) {
to
} elseif ('resources' === $key) {

seems to solve it.

append to capture

Jira Information

Original Issue:ZF2-233
Issue Type:New Feature
Reporter:vahid sohrabloo
Created:03/21/12
Assignee:weierophinney
Components:Zend\View

Description

In my project I want to render two view model in one capture. like render N model in content capture. I dont found any way to render this.
Sorry for my bad english

Remove PHP_VERSION dependancy code

In some part, such as Zend\Loader\StandardAutoloader->fileExists method, you use PHP_VERSION to split code functionality: this should be done only when is strictly necessary, like version specific known bug.

Instead, use direct functionality test (like function_exists), so you made version-independent code, and you are really sure the behaviour or functionality exists.

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.