Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable require once call #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Zend Framework 1 for Composer
=============================

This package is a part of the Zend Framework 1. Each component was separated and put into its own composer package. Some modifications were made for improved [Composer](http://getcomposer.org/) integration. This package can also be found at [Packagist](http://packagist.org/packages/zf1).
This package is a part of the Zend Framework 1. Each component was separated and put into its own composer package. Some modifications were made for improved [Composer](http://getcomposer.org/) integration. This package can also be found at [Packagist](http://packagist.org/packages/zf1s).

## Why?

Expand All @@ -10,13 +10,11 @@ This package is a part of the Zend Framework 1. Each component was separated and
**Autoloading!** Explicit `require_once` calls in the source code has been commented out to rely on composer autoloading, this reduces the number of included files to a minimum.

**Migration!** Zend Framework 2 has been around for a while now, and migrating all your projects takes a lot of time. Using these packages makes it easier to migrate each component separately. Also, some packages doesn't exist in zf2 (such as the zend-search-lucene), now you can continue using that package without requiring the entire framework.

If you're using major parts of the framework, I would recommend checking out the [zendframework1 package](https://github.com/bombayworks/zendframework1), which contains the entire framework optimized for composer usage.


## How to use

Add `"zf1/zend-application": "~1.12"` to the require section of your composer.json, include the composer autoloader and you're good to go.
Add `"zf1s/zend-application": "~1.12"` to the require section of your composer.json, include the composer autoloader and you're good to go.

## Broken dependencies?

Dependencies have been set automatically based on the [requirements from the zend framework manual](http://framework.zend.com/manual/1.12/en/requirements.introduction.html), if you find any broken dependencies please submit an issue.
Dependencies have been set automatically based on the [requirements from the zend framework manual](http://framework.zend.com/manual/1.12/en/requirements.introduction.html), if you find any broken dependencies please submit a pull request.
16 changes: 12 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "zf1/zend-application",
"name": "zf1s/zend-application",
"description": "Zend Framework 1 Application package",
"keywords": [
"framework",
Expand All @@ -11,15 +11,23 @@
"license": "BSD-3-Clause",
"require": {
"php": ">=5.2.11",
"zf1/zend-exception": "self.version",
"zf1/zend-controller": "self.version"
"zf1s/zend-exception": "^1.12",
"zf1s/zend-controller": "^1.12"
},
"autoload": {
"psr-0": {
"Zend_Application": "library/"
}
},
"suggest": {
"zf1/zend-config": "Used in special situations or with special adapters"
"zf1s/zend-config": "Used in special situations or with special adapters"
},
"replace": {
"zf1/zend-application": "^1.12"
},
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
}
}
9 changes: 6 additions & 3 deletions library/Zend/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,18 @@ class Zend_Application
*
* @param string $environment
* @param string|array|Zend_Config $options String path to configuration file, or array/Zend_Config of configuration options
* @param bool $suppressNotFoundWarnings Should warnings be suppressed when a file is not found during autoloading?
* @throws Zend_Application_Exception When invalid options are provided
* @return void
*/
public function __construct($environment, $options = null)
public function __construct($environment, $options = null, $suppressNotFoundWarnings = null)
{
$this->_environment = (string) $environment;

require_once 'Zend/Loader/Autoloader.php';
$this->_autoloader = Zend_Loader_Autoloader::getInstance();
// see https://github.com/zf1/zend-application/pull/2 for discussion
// require_once 'Zend/Loader/Autoloader.php';
// $this->_autoloader = Zend_Loader_Autoloader::getInstance();
// $this->_autoloader->suppressNotFoundWarnings($suppressNotFoundWarnings);

if (null !== $options) {
if (is_string($options)) {
Expand Down