Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of git://github.com/zendframework/zf2
Browse files Browse the repository at this point in the history
  • Loading branch information
sgehrig committed Aug 12, 2010
2 parents d46a241 + edeeaff commit cd3deb5
Show file tree
Hide file tree
Showing 105 changed files with 1,013 additions and 336 deletions.
74 changes: 39 additions & 35 deletions INSTALL.txt
@@ -1,68 +1,72 @@
INSTALLATION
------------

Zend Framework requires no special installation steps. Simply download the framework,
extract it to the folder you would like to keep it in, and add the library directory
to your PHP include_path. To use components in the extras library, add the extras/library
directory to your PHP include_path, as well.
If you would like to use Zend_Tool, simply add bin/zf.bat (for Windows) or
bin/zf.sh (for anything else) to your system executable path.
Zend Framework requires no special installation steps. Simply download
the framework, extract it to the folder you would like to keep it in,
and add the library directory to your PHP include_path. To use
components in the extras library, add the extras/library directory to
your PHP include_path as well.

If you would like to use Zend_Tool, simply add "bin/zf.bat" (for Windows)
or "bin/zf.sh" (for anything else) to your system executable path.

SYSTEM REQUIREMENTS
-------------------

Zend Framework requires PHP 5.2.4 or later. Please see the system requirements
appendix for more detailed information:
Zend Framework 2 requires PHP 5.3.1 or later.

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

DEVELOPMENT VERSIONS
--------------------

If you would like to preview enhancements or bug fixes that have not yet been
released, you can obtain the current development version of Zend Framework using one
of the following methods:
If you would like to preview enhancements or bug fixes that have not yet
been released, you can obtain the current development version of Zend
Framework using one of the following methods:

* Using a Git client. Zend Framework is open source software, and the Git
repository used for its development is publicly available. Consider using Git
to get Zend Framework if you already use Git for your application development,
want to contribute back to the framework, or need to upgrade your framework
version very often.
* Using a Git client. Zend Framework is open source software, and the
Git repository used for its development is publicly available.
Consider using Git to get Zend Framework if you already use Git for
your application development, want to contribute back to the
framework, or need to upgrade your framework version very often.

Checking out a working copy is necessary if you would like to directly contribute
to Zend Framework; a working copy can be updated any time using git pull.
Checking out a working copy is necessary if you would like to directly
contribute to Zend Framework; a working copy can be updated any time
using git pull.

To clone the git repository, use the following URL:

git://git.zendframework.com/zf.git
git://git.zendframework.com/zf.git

For more information about Git, please see the official website:

http://www.git-scm.org
http://www.git-scm.org

CONFIGURING THE INCLUDE PATH
----------------------------

Once you have a copy of Zend Framework available, your application will need to
access the framework classes. Though there are several ways to achieve this, your
PHP include_path needs to contain the path to the Zend Framework classes under the
/library directory in this distribution. You can find out more about the PHP
include_path configuration directive here:
Once you have a copy of Zend Framework available, your application will
need to access the framework classes. Though there are several ways to
achieve this, your PHP include_path needs to contain the path to the
Zend Framework classes under the /library directory in this
distribution. You can find out more about the PHP include_path
configuration directive here:

http://www.php.net/manual/en/ini.core.php#ini.include-path
http://www.php.net/manual/en/ini.core.php#ini.include-path

Instructions on how to change PHP configuration directives can be found here:
Instructions on how to change PHP configuration directives can be found
here:

http://www.php.net/manual/en/configuration.changes.php
http://www.php.net/manual/en/configuration.changes.php

GETTING STARTED
---------------

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

http://framework.zend.com/manual/en/learning.quickstart.html
http://framework.zend.com/manual/en/learning.quickstart.html

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.
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.
5 changes: 5 additions & 0 deletions README-DEV.txt
Expand Up @@ -55,6 +55,11 @@ To run tests:

% phpunit --group Zend_Application

This will likely lead to errors, so it's usually best to specify a
specific component in which to run test:

% phpunit --group ZF-XYZ Zend/Application

You can turn on conditional tests with the TestConfiguration.php file.
To do so:

Expand Down
15 changes: 15 additions & 0 deletions README.txt
Expand Up @@ -7,6 +7,14 @@ Zend Framework 2.0.0dev1
THIS RELEASE IS A DEVELOPMENT RELEASE AND NOT INTENDED FOR PRODUCTION USE.
PLEASE USE AT YOUR OWN RISK.

At this time, we have tested all functionality of Zend\Tool, and followed the
Quick Start application instructions, and all functionality works as it did in
the ZF1 series of releases. However, most Zend\Service components have not been
migrated to namespaces, and Zend\Db has not been completely vetted (in favor of
doing a complete refactor). Again, please use at your own risk, and be prepared
for major changes in APIs in the development and alpha milestones prior to the
first beta release.

NEW FEATURES
------------

Expand All @@ -24,6 +32,13 @@ INSTALLATION

Please see INSTALL.txt.

CONTRIBUTING
------------

If you wish to contribute to Zend Framework 2.0, please make sure you have
signed a CLA (http://framework.zend.com/cla), and please read both the
README-DEV.txt and README-GIT.txt file.

QUESTIONS AND FEEDBACK
----------------------

Expand Down
3 changes: 2 additions & 1 deletion library/Zend/Amf/Server.php
Expand Up @@ -270,7 +270,8 @@ protected function _checkAcl($object, $function)
return true;
}
if($object) {
$class = is_object($object) ? get_class($object) : $object;
$isObject = is_object($object);
$class = ($isObject) ? get_class($object) : $object;
if(!$this->_acl->hasResource($class)) {
$this->_acl->addResource(new \Zend\Acl\Resource\GenericResource($class));
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Application/Module/Bootstrap.php
Expand Up @@ -118,7 +118,7 @@ public function getModuleName()
{
if (empty($this->_moduleName)) {
$class = get_class($this);
if (preg_match('/^([a-z][a-z0-9]*)_/i', $class, $matches)) {
if (preg_match('/^([a-z][a-z0-9]*)\\\\/i', $class, $matches)) {
$prefix = $matches[1];
} else {
$prefix = $class;
Expand Down
8 changes: 5 additions & 3 deletions library/Zend/Application/Resource/Modules.php
Expand Up @@ -25,6 +25,8 @@
*/
namespace Zend\Application\Resource;

use Zend\Application\Exception as Exception;

/**
* Module bootstrapping resource
*
Expand Down Expand Up @@ -72,7 +74,7 @@ public function init()
$default = $front->getDefaultModule();
$curBootstrapClass = get_class($bootstrap);
foreach ($modules as $module => $moduleDirectory) {
$bootstrapClass = $this->_formatModuleName($module) . '_Bootstrap';
$bootstrapClass = $this->_formatModuleName($module) . '\Bootstrap';
if (!class_exists($bootstrapClass, false)) {
$bootstrapPath = dirname($moduleDirectory) . '/Bootstrap.php';
if (file_exists($bootstrapPath)) {
Expand All @@ -81,14 +83,14 @@ public function init()
if (($default != $module)
&& !class_exists($bootstrapClass, false)
) {
throw new xception(sprintf(
throw new Exception(sprintf(
$eMsgTpl, $module, $bootstrapClass
));
} elseif ($default == $module) {
if (!class_exists($bootstrapClass, false)) {
$bootstrapClass = 'Bootstrap';
if (!class_exists($bootstrapClass, false)) {
throw new xception(sprintf(
throw new Exception(sprintf(
$eMsgTpl, $module, $bootstrapClass
));
}
Expand Down
1 change: 1 addition & 0 deletions library/Zend/Controller/Action.php
Expand Up @@ -280,6 +280,7 @@ public function getViewScript($action = null, $noController = null)
$dispatcher = Front::getInstance()->getDispatcher();
$wordDelimiters = $dispatcher->getWordDelimiter();
$pathDelimiters = $dispatcher->getPathDelimiter();
$pathDelimiters = array($pathDelimiters, '_');
$this->_delimiters = array_unique(array_merge($wordDelimiters, (array) $pathDelimiters));
}

Expand Down
22 changes: 16 additions & 6 deletions library/Zend/Controller/Action/Helper/FlashMessenger.php
Expand Up @@ -23,7 +23,8 @@
* @namespace
*/
namespace Zend\Controller\Action\Helper;
use Zend\Session;
use Zend\Session,
Zend\Stdlib\SplQueue;

/**
* Flash Messenger - implement session-based messages
Expand Down Expand Up @@ -77,8 +78,15 @@ public function __construct()
{
if (!self::$_session instanceof Session\Container) {
self::$_session = new Session\Container($this->getName());

// Should not modify the iterator while iterating; aggregate
// namespaces so they may be deleted after retrieving messages.
$namespaces = array();
foreach (self::$_session as $namespace => $messages) {
self::$_messages[$namespace] = $messages;
$namespaces[] = $namespace;
}
foreach ($namespaces as $namespace) {
unset(self::$_session->{$namespace});
}
}
Expand Down Expand Up @@ -133,11 +141,13 @@ public function addMessage($message)
self::$_session->setExpirationHops(1, null, true);
}

if (!is_array(self::$_session->{$this->_namespace})) {
self::$_session->{$this->_namespace} = array();
if (!isset(self::$_session->{$this->_namespace})
|| !(self::$_session->{$this->_namespace} instanceof SplQueue)
) {
self::$_session->{$this->_namespace} = new SplQueue();
}

self::$_session->{$this->_namespace}[] = $message;
self::$_session->{$this->_namespace}->push($message);

return $this;
}
Expand All @@ -160,7 +170,7 @@ public function hasMessages()
public function getMessages()
{
if ($this->hasMessages()) {
return self::$_messages[$this->_namespace];
return self::$_messages[$this->_namespace]->toArray();
}

return array();
Expand Down Expand Up @@ -201,7 +211,7 @@ public function hasCurrentMessages()
public function getCurrentMessages()
{
if ($this->hasCurrentMessages()) {
return self::$_session->{$this->_namespace};
return self::$_session->{$this->_namespace}->toArray();
}

return array();
Expand Down
9 changes: 1 addition & 8 deletions library/Zend/Controller/Action/Helper/Redirector.php
Expand Up @@ -299,7 +299,7 @@ public function setGotoSimple($action, $controller = null, $module = null, array
$params['action'] = $action;

$router = $this->getFrontController()->getRouter();
$url = $router->assemble($params, 'default', true);
$url = $router->assemble($params, 'application', true);

$this->_redirect($url);
}
Expand Down Expand Up @@ -477,13 +477,6 @@ public function gotoUrlAndExit($url, array $options = array())
*/
public function redirectAndExit()
{
if ($this->getCloseSessionOnExit()) {
// Close session, if started
if (isset($_SESSION) && !empty($_SESSION)) {
session_write_close();
}
}

$this->getResponse()->sendHeaders();
exit();
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Controller/Action/Helper/ViewRenderer.php
Expand Up @@ -345,7 +345,7 @@ protected function _generateDefaultPrefix()
}

$module = $this->getModule();
if ('default' == $module) {
if ('application' == $module) {
return $default;
}

Expand Down
6 changes: 3 additions & 3 deletions library/Zend/Controller/Dispatcher/AbstractDispatcher.php
Expand Up @@ -57,7 +57,7 @@ abstract class AbstractDispatcher implements Dispatcher
* Default module
* @var string
*/
protected $_defaultModule = 'default';
protected $_defaultModule = 'application';

/**
* Front Controller instance
Expand All @@ -76,7 +76,7 @@ abstract class AbstractDispatcher implements Dispatcher
* Path delimiter character
* @var string
*/
protected $_pathDelimiter = '_';
protected $_pathDelimiter = '\\';

/**
* Response object to pass to action controllers, if any
Expand Down Expand Up @@ -248,7 +248,7 @@ protected function _formatName($unformatted, $isAction = false)
$segments[$key] = str_replace(' ', '', ucwords($segment));
}

return implode('_', $segments);
return implode('\\', $segments);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Controller/Dispatcher/Standard.php
Expand Up @@ -177,7 +177,7 @@ public function formatModuleName($unformatted)
*/
public function formatClassName($moduleName, $className)
{
return $this->formatModuleName($moduleName) . '_' . $className;
return $this->formatModuleName($moduleName) . '\\' . $className;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions library/Zend/Controller/Router/Rewrite.php
Expand Up @@ -91,14 +91,14 @@ class Rewrite extends AbstractRouter
*/
public function addDefaultRoutes()
{
if (!$this->hasRoute('default')) {
if (!$this->hasRoute('application')) {
$dispatcher = $this->getFrontController()->getDispatcher();
$request = $this->getFrontController()->getRequest();

require_once 'Zend/Controller/Router/Route/Module.php';
$compat = new Route\Module(array(), $dispatcher, $request);

$this->_routes = array_merge(array('default' => $compat), $this->_routes);
$this->_routes = array_merge(array('application' => $compat), $this->_routes);
}

return $this;
Expand Down Expand Up @@ -456,7 +456,7 @@ public function assemble($userParams, $name = null, $reset = false, $encode = tr
try {
$name = $this->getCurrentRouteName();
} catch (Exception $e) {
$name = 'default';
$name = 'application';
}
}

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Db/Table/AbstractRow.php
Expand Up @@ -834,7 +834,7 @@ protected function _postDelete()
*/
protected function _prepareReference(AbstractTable $dependentTable, AbstractTable $parentTable, $ruleKey)
{
$parentTableName = (get_class($parentTable) === 'Zend_Db_Table') ? $parentTable->getDefinitionConfigName() : get_class($parentTable);
$parentTableName = (get_class($parentTable) === 'Zend\Db\Table') ? $parentTable->getDefinitionConfigName() : get_class($parentTable);
$map = $dependentTable->getReference($parentTableName, $ruleKey);

if (!isset($map[AbstractTable::REF_COLUMNS])) {
Expand Down

0 comments on commit cd3deb5

Please sign in to comment.