Skip to content

Commit

Permalink
Merge branch 'livedocx-2.0' of http://github.com/jonathanmaron/zf2 in…
Browse files Browse the repository at this point in the history
…to merges/jonathanmaron-livedocx

Conflicts:
	library/Zend/Application/Resource/Modules.php
	library/Zend/Loader.php
	library/Zend/Loader/PluginLoader.php
	library/Zend/Locale/Format.php
	library/Zend/Log/Filter/Priority.php
	library/Zend/Navigation/Page/Mvc.php
	library/Zend/Session/Configuration/SessionConfiguration.php
	library/Zend/Tool/Project/Context/Zf/ActionMethod.php
	library/Zend/View/AbstractView.php
  • Loading branch information
weierophinney committed Nov 2, 2010
2 parents 3addea5 + 4c2bc44 commit 2396268
Show file tree
Hide file tree
Showing 113 changed files with 7,536 additions and 525 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
nbproject
demos/Zend/Service/LiveDocx/DemoConfiguration.php

74 changes: 35 additions & 39 deletions INSTALL.txt
Original file line number Diff line number Diff line change
@@ -1,72 +1,68 @@
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 2 requires PHP 5.3.1 or later.
Zend Framework requires PHP 5.2.4 or later. Please see the system requirements
appendix for more detailed information:

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: 0 additions & 5 deletions README-DEV.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ 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
7 changes: 0 additions & 7 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Bootstrap.php';


use Zend\Date\Date;
use Zend\Service\LiveDocx\MailMerge;

$mailMerge = new MailMerge();

$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);

/**
* Image Source:
* iStock_000003413016Medium_business-man-with-hands-up.jpg
*/
$photoFilename = 'dailemaitre.jpg';

if (!$mailMerge->imageExists($photoFilename)) {
$mailMerge->uploadImage($photoFilename);
}

$mailMerge->setLocalTemplate('template.docx');

$mailMerge->assign('name', 'Daï Lemaitre')
->assign('company', 'Megasoft Co-operation')
->assign('date', Date::now()->toString(Date::DATE_LONG))
->assign('image:photo', $photoFilename);

$mailMerge->createDocument();

$document = $mailMerge->retrieveDocument('pdf');

file_put_contents('document.pdf', $document);

$mailMerge->deleteImage($photoFilename);

unset($mailMerge);
Binary file not shown.
30 changes: 30 additions & 0 deletions demos/Zend/Service/LiveDocx/MailMerge/images/delete-all.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Bootstrap.php';


use Zend\Service\LiveDocx\Helper;
use Zend\Service\LiveDocx\MailMerge;

Helper::printLine(
PHP_EOL . 'Deleting All Remotely Stored Images' .
PHP_EOL .
PHP_EOL
);

$mailMerge = new MailMerge();

$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);

$counter = 1;
foreach ($mailMerge->listImages() as $result) {
printf('%d) %s', $counter, $result['filename']);
$mailMerge->deleteImage($result['filename']);
print(' - DELETED.' . PHP_EOL);
$counter++;
}

print(PHP_EOL);

unset($mailMerge);
31 changes: 31 additions & 0 deletions demos/Zend/Service/LiveDocx/MailMerge/images/download.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Bootstrap.php';


use Zend\Service\LiveDocx\Helper;
use Zend\Service\LiveDocx\MailMerge;

Helper::printLine(
PHP_EOL . 'Downloading Remotely Stored Images' .
PHP_EOL .
PHP_EOL
);

$mailMerge = new MailMerge();

$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);

$counter = 1;
foreach ($mailMerge->listImages() as $result) {
printf('%d) %s', $counter, $result['filename']);
$image = $mailMerge->downloadImage($result['filename']);
file_put_contents('downloaded-' . $result['filename'], $image);
print(' - DOWNLOADED.' . PHP_EOL);
$counter++;
}

print(PHP_EOL);

unset($mailMerge);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions demos/Zend/Service/LiveDocx/MailMerge/images/image-exists.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Bootstrap.php';


use Zend\Service\LiveDocx\Helper;
use Zend\Service\LiveDocx\MailMerge;

Helper::printLine(
PHP_EOL . 'Checking For Remotely Stored Images' .
PHP_EOL .
PHP_EOL
);

$mailMerge = new MailMerge();

$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);

print('Checking whether an image is available... ');
if (true === $mailMerge->imageExists('image-01.png')) {
print('EXISTS. ');
} else {
print('DOES NOT EXIST. ');
}
print('DONE' . PHP_EOL);

print(PHP_EOL);

unset($mailMerge);
24 changes: 24 additions & 0 deletions demos/Zend/Service/LiveDocx/MailMerge/images/list.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Bootstrap.php';


use Zend\Service\LiveDocx\Helper;
use Zend\Service\LiveDocx\MailMerge;

Helper::printLine(
PHP_EOL . 'Remotely Stored Images' .
PHP_EOL .
PHP_EOL . 'The following images are currently stored on the LiveDocx server:' .
PHP_EOL .
PHP_EOL
);

$mailMerge = new MailMerge();

$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);

print(Helper::listDecorator($mailMerge->listImages()));

unset($mailMerge);
30 changes: 30 additions & 0 deletions demos/Zend/Service/LiveDocx/MailMerge/images/upload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Bootstrap.php';


use Zend\Service\LiveDocx\Helper;
use Zend\Service\LiveDocx\MailMerge;

Helper::printLine(
PHP_EOL . 'Uploading Locally Stored Images to Server' .
PHP_EOL .
PHP_EOL
);

$mailMerge = new MailMerge();

$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);

print('Uploading image... ');
$mailMerge->uploadImage('image-01.png');
print('DONE.' . PHP_EOL);

print('Uploading image... ');
$mailMerge->uploadImage('image-02.png');
print('DONE.' . PHP_EOL);

print(PHP_EOL);

unset($mailMerge);
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

$formats->template = $mailMerge->getTemplateFormats();
$formats->document = $mailMerge->getDocumentFormats();
$formats->image = $mailMerge->getImageFormats();
$formats->image = $mailMerge->getImageExportFormats();

$cache->save($formats, $cacheId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
Helper::arrayDecorator($mailMerge->getDocumentFormats()), PHP_EOL);

printf("Supported IMAGE file formats (output) : %s%s",
Helper::arrayDecorator($mailMerge->getImageFormats()), PHP_EOL);
Helper::arrayDecorator($mailMerge->getImageExportFormats()), PHP_EOL);

print PHP_EOL;

Expand Down
2 changes: 1 addition & 1 deletion demos/Zend/Service/LiveDocx/check-environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@

try {
$microtime = microtime(true);
$mailMerge = new Zend_Service_LiveDocx_MailMerge(
$mailMerge = new MailMerge(
array (
'username' => DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME,
'password' => DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD
Expand Down
12 changes: 4 additions & 8 deletions library/Zend/Amf/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,18 +272,14 @@ protected function _checkAcl($object, $function)
return true;
}
if($object) {
$isObject = is_object($object);
$class = ($isObject) ? get_class($object) : $object;
$class = is_object($object)?get_class($object):$object;
if(!$this->_acl->hasResource($class)) {
$this->_acl->addResource(new \Zend\Acl\Resource\GenericResource($class));
}
if (method_exists($object, 'initAcl')) {
$call = array($object, "initAcl");
if(is_callable($call) && !call_user_func($call, $this->_acl)) {
// if initAcl returns false, no ACL check
if ($isObject && $object->initAcl($this->_acl)) {
return true;
} elseif ($class::initAcl($this->_acl)) {
return true;
}
return true;
}
} else {
$class = null;
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Application/Module/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,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
Loading

0 comments on commit 2396268

Please sign in to comment.