Skip to end of metadata
Go to start of metadata

<ac:macro ac:name="note"><ac:parameter ac:name="title">Under Construction</ac:parameter><ac:rich-text-body>
<p>This proposal is under construction and is not ready for review.</p></ac:rich-text-body></ac:macro>

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_Core_Paths Component Proposal

Proposed Component Name Zend_Core_Paths
Developer Notes
Proposers Aleksey V. Zapparov
Revision 1.1 - 1 August 2006: Updated from community comments. (wiki revision: 12)

Table of Contents

1. Overview

Complete source code for the implementation is included below in the "Class Skeleton" section.

// Add new path to PHP's 'include_path' configuration option.
static public function includePath($includePath, $isRelative = false)

// This method is pretty similar to (@link Zend::includePath()), except this
// removes given in param path from PHP's 'include_path' configuration option.
static public function excludePath($excludePath)

// Dummy method to correct given path according to system's specified
// directory separator. If given $pathToCorrect is an array, then all
// values in this array will be corrected, and array will be rturned.
static public function correctPath(&$pathToCorrect)

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

Most requirements take the form of "foo will do ...." or "foo will not support ...", although different words and sentence structure might be used. Adding functionality to your proposal is requirements creep (bad), unless listed below. Discuss major changes with your team first, and then open a "feature improvement" issue against this component.

  • This component will correctly reads a developers mind for intent and generate the right configuration file.
  • The generated config file will not support XML, but will provide an extension point in the API.
  • This component will use no more memory than twice the size of all data it contains.
  • This component will include a factory method.
  • This component will not allow subclassing. (i.e. when reviewed, we expect to see "final" keyword in code)
  • This component will only generate data exports strictly complying with RFC 12345.
  • This component will validate input data against formats supported by ZF component Foo.
  • This component will not save any data using Zend_Cache or the filesystem. All transient data will be saved using Zend_Session.

4. Dependencies on Other Framework Components

  • Zend_Exception

5. Theory of Operation

The component is instantiated with a mind-link that ...

6. Milestones / Tasks

Describe some intermediate state of this component in terms of design notes, additional material added to this page, and / code. Note any significant dependencies here, such as, "Milestone #3 can not be completed until feature Foo has been added to ZF component XYZ." Milestones will be required for acceptance of future proposals. They are not hard, and many times you will only need to think of the first three below.

  • Milestone 1: design notes will be published here
  • Milestone 2: Working prototype checked into the incubator supporting use cases #1, #2, ...
  • Milestone 3: Working prototype checked into the incubator supporting use cases #3 and #4.
  • Milestone 4: Unit tests exist, work, and are checked into SVN.
  • Milestone 5: Initial documentation exists.

If a milestone is already done, begin the description with "[DONE]", like this:

  • Milestone #: [DONE] Unit tests ...

7. Class Index

  • Zend_Magic_Exception
  • Zend_Magic (factory class)
  • Zend_Magic_MindProbe
  • Zend_Magic_MindProbe_Intent
  • Zend_Magic_Action
  • Zend_Magic_CodeGen

8. Use Cases


... (see good use cases book)

9. Class Skeletons



Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Feb 22, 2007

    <p>Your <code>includePath()</code> method is way too complicated.</p>

    <ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
    static public function addIncludePath($path)
    // ...clean path...
    // ...verify path...
    set_include_path($path . PATH_SEPARATOR . get_include_path());

    <p>I don't see the benefit to <code>excludePath()</code>.</p>

    <p>Please provide some use cases and flesh out this proposal (even if just to remove placeholder text).</p>

  2. Mar 04, 2007

    <p>IMHO, this feature should be added to the PHP core, not ZF. IMO again, ZF is not here to a workaround or an incubator for missing PHP core features, but it is only a personal opinion, I may be wrong on ZF's goals.</p>

    <p>I also don't see why this feature should go to the Zend class. I would prefer a class providing two static method to add() and remove() a component to/from the include path.</p>

    <p>Another reason why I think that it should go to PHP core is that, in the future, it could deprecate set_include_path(), hiding this PATH_SEPARATOR which should remain hidden. This way, the include path could be managed as an array, which would be much more natural than the current string (with several different separators). As a side effect, considering the include path as an array would make it easier to insert 'stream-wrapped' paths in the include path (as they contain a ':' character).</p>

  3. Mar 07, 2007

    <p>Sorry for my silence.<br />
    I'll describe everything clearly very shortly.<br />
    Yes, PHP have set_include_path() functions.<br />
    This will be a warper for it with some enhancements.<br />
    Excuse me again.</p>