SUPPORT THE WORK

GetWiki

Zend Framework

ARTICLE SUBJECTS
aesthetics  →
being  →
complexity  →
database  →
enterprise  →
ethics  →
fiction  →
history  →
internet  →
knowledge  →
language  →
licensing  →
linux  →
logic  →
method  →
news  →
perception  →
philosophy  →
policy  →
purpose  →
religion  →
science  →
sociology  →
software  →
truth  →
unix  →
wiki  →
ARTICLE TYPES
essay  →
feed  →
help  →
system  →
wiki  →
ARTICLE ORIGINS
critical  →
discussion  →
forked  →
imported  →
original  →
Zend Framework
[ temporary import ]
please note:
- the content below is remote from Wikipedia
- it has been imported raw for GetWiki
{{cleanup rewrite|date=April 2017}}







factoids
AUTHOR=WEBSITE=GITHUB, May 17, 2017, PHP 7| operating system = Cross-platform| license = New BSD licenseweblink}}}}Zend Framework (ZF) is an open source, object-oriented web application framework implemented in PHP 7 and licensed under the New BSD License.WEB,weblink 2009-02-12, Introduction to Zend Framework, ZF Programmer's Reference Guide, The framework is basically a collection of professional PHPWEB,weblink PHP 5 Tutorial, www.w3schools.com, en-US, 2017-02-20, based packages. The framework uses various packages by the use of Composer as part of its package dependency managers; some of them are PHPUnit for testing all packages, Travis CIJOURNAL, 2017-01-19, Travis CI,weblink Wikipedia, en, for continuous Integration Services. Zend Framework provides to users a support of the Model View Controller (MVC)JOURNAL, 2017-02-18, Model–view–controller,weblink Wikipedia, en, in combination with Front Controller solution.Supaartagorn, C. (2011). PHP Framework for database management based on MVC pattern. International Journal of Computer Science & Information Technology (IJCSIT), 3(2), 251-258. MVC implementation in Zend Framework has five main areas. The routerJOURNAL, 2017-02-19, Router (computing),weblink Wikipedia, en, and dispatcher functions to decided which controller to run based on data from URL, and controller functions in combination with the model and view to develop and create the final web page.WEB,weblink Zend Framework - About, Company, Zend, a Rogue Wave, framework.zend.com, 2017-02-05,

License

Zend Framework is licensed under the Open Source Initiative (OSI)-approved New BSD License. For ZFv1 all code contributors must sign a Contributor License Agreement (CLA) based on the Apache Software Foundation’s CLA. The licensing and contribution policies were established to prevent intellectual property issues for commercial ZF users, according to Zend's Andi Gutmans.WEB, Gutmans, Andi, Zend Framework (post is too long so make sure to grab coffee), 2005-10-27,weblink Andi on Web & IT, 2009-02-11, ZF2 and later is CLA free.WEB,weblink Contributor Guide (ZF v1), There is also a longterm support available for the framework (long term support or LTS) for a total duration of 3 years. In order to do this one need to modify the Composer requirement for Zend Framework.WEB,weblink Zend Framework - Long Term Support, Company, Zend, a Rogue Wave, framework.zend.com, 2017-02-06, $ composer require "zendframework/zendframework:~2.4.0"This will result in modification of composer.json file and will pin the semantic version 2.4.0 which will ensure you get updates specifically from 2.4 series. If user want to use a different LTS then they need to specify X.Y.) version.

Zend Framework components and versioning

Starting with Zend Framework version 2.5, components are split into independently versioned packages and zendframework/zendframework is converted into a Composer meta-package. Framework components introduced after the split are not added to the meta-package.While zendframework/zendframework meta-package release version remains at 3.0.0, it will instruct Composer to install latest compatible versions of the framework components, as per the semantic versioning. Such that zend-mvc component will be installed at its current version 3.1.1, zend-servicemanager at version 3.3.0 and zend-form at version 2.10.2.Zend Framework includes following componentsWEB,weblink Documentation for the ZF components, :{| class="wikitable"|Authentication|Authenticate users via a variety of adapters, and provide the authenticated identity to your application.|Barcode|Programmatically create and render barcodes as images or in PDFs.|Cache|Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output.|Captcha|Generate and validate CAPTCHAs using Figlets, images, ReCaptcha, and more.|Code|Extensions to the PHP Reflection API, static code scanning, and code generation.|Component Installer|Composer plugin for injecting modules and configuration providers into application configuration.|Config|Read and write configuration files.|Config Aggregator|Aggregate and merge configuration from a variety of sources.|Console|Build console applications using getopt syntax or routing, complete with prompts|Crypt|Strong cryptography tools and password hashing.|DB|Database abstraction layer, SQL abstraction, result set abstraction, and RowDataGateway and TableDataGateway implementations.|Debug|Safely dump debug information to HTML.|DI|Automated dependency injection and instance manager.|Diactoros|PSR-7 HTTP message implementations.|DOM|Query HTML and XML documents using XPath or CSS selectors.|Escaper|Securely and safely escape HTML, HTML attributes, JavaScript, CSS, and URLs.|EventManager|Implement events, signal slots, aspects, and observers!|Expressive|PSR-7 middleware in minutes.|Feed|Consume and generate Atom and RSS feeds, and interact with Pubsubhubbub.|File|Locate PHP classfiles.|Filter|Programmatically filter and normalize data and files.|Form|Validate and display simple and complex forms, casting forms to business objects and vice versa.|HAL for PSR-7|Hypertext Application Language (HAL) for PSR-7.|HTTP|HTTP message and header abstractions, and HTTP client implementation. (Not a PSR-7 implementation.)|Hydrator|Serialize objects to arrays, and vice versa.|InputFilter|Normalize and validate input sets from the web, APIs, the CLI, and more, including files.|Internationalization|Provide translations for your application, and filter and validate internationalized values.|JSON|De/Serialize JSON in PHP, including JavaScript expressions.|JSON-RPC Server|JSON-RPC implementation for PHP.|LDAP|Perform LDAP operations, including binding, searching and modifying entries in an LDAP directory.|Loader|Autoloading and plugin loading strategies.|Log|Robust, composite logger with filtering, formatting, and PSR-3 support.|Mail|Parse, create, store, and send email messages, using a variety of storage and transport protocols.|Math|Create cryptographically secure pseudo-random numbers, and manage big integers.|Memory|Manage data in an environment with limited memory.|MIME|Create and parse MIME messages and parts.|Module Manager|Modular application system for zend-mvc applications.|MVC|Zend Framework's event-driven MVC layer, including MVC Applications, Controllers, and Plugins.|MVC-Console integration|Integration between zend-mvc and zend-console.|MVC-i18n integration|Integration between zend-mvc and zend-i18n.|fileprg() plugin|Post/Redirect/Get plugin with file upload handling for zend-mvc controllers.|flashmessenger() plugin|Plugin for creating and exposing flash messages via zend-mvc controllers.|identity() plugin|Plugin for retrieving the current authenticated identity within zend-mvc controllers.|prg() plugin|Post/Redirect/Get plugin for zend-mvc controllers.|Navigation|Manage trees of pointers to web pages in order to build navigation systems.|Paginator|Paginate collections of data from arbitrary sources.|ACL|Create, manage, and query access control lists.|RBAC|Provide and query Role-Based Access Controls for your application.|Problem Details|PSR-7 Problem Details for HTTP API responses and middleware.|ProgressBar|Create and update progress bars in different environments.|PSR-7 Bridge|PSR-7 zend-http message conversions.|Router|Flexible routing system for HTTP and console applications.|Serializer|Serialize and deserialize PHP structures to a variety of representations.|Server|Create Reflection-based RPC servers.|ServiceManager|Factory-Driven Dependency Injection Container|ServiceManager-Di integration|zend-di integration for zend-servicemanager|Session|Object-oriented interface to PHP sessions and storage.|SOAP|Create, serve, and access SOAP applications, and parse and generate WSDL.|Stdlib|SPL extensions, array utilities, error handlers, and more.|Stratigility|PSR-7 middleware foundation for building and dispatching middleware pipelines.|Tag|Manipulate and weight taggable items, and create tag clouds.|Test|Tools to facilitate unit testing of zend-mvc applications.|Text|Create FIGlets and text-based tables.|URI|Object oriented interface to URIs, with facilities for validation.|Validator|Validation classes for a wide range of domains, and the ability to chain validators to create complex validation criteria.|View|Flexible view layer supporting and providing multiple view layers, helpers, and more.|XML-RPC|Fully featured XML-RPC server and client implementations.|XML2JSON|Convert XML documents to JSON.

Installation

Officially supported install method is via Composer package manager.Zend Framework provides meta-package that includes 61 component but recommended way is to install required framework components individually. Composer will resolve and install all additional dependencies.For instance, if you need MVC package, you can install with the following command:$ composer require zendframework/zend-mvcFull list of components is available in Zend Framework documentation.

Anatomy of Zend Framework

Zend Framework follows configuration-over-convention approach and does not impose any particular application structure. Skeleton applications for zend-mvc and zend-expressive are available and provide everything necessary to run applications and to serve as a good starting point.

Recommended MVC application directory structure

ZendSkeletonApplication, skeleton application using Zend Framework MVC layer and module systems, can be installed with:$ composer create-project zendframework/skeleton-application It will create file structure similar to this:/├── config/│ ├── autoload/│ │ ├── global.php│ │ └── local.php.dist│ ├── application.config.php│ └── modules.config.php├── data/│ └── cache/├── module/├── public/│ └── index.php├── vendor/├── composer.json├── composer.lock└── phpunit.xml.distThe config/ directory has application wide configurations. module/ directory contains local modules that are committed along with application. vendor/ contains vendor code and other modules managed independently from the application, content of the folder is normally managed by Composer.Zend Framework module have only one requirement: Module class exists in a module namespace and is autoloadable. Module class provides configuration and initialization logic to application. Recommended module structure is as follows: ├── config/│ └── module.config.php├── src/│ └── Module.php├── test/├── view/├── composer.json└── phpunit.xml.distThe config/ directory holds module configs, src/ directory contains module source code, as defined in PSR-4 autoloading standard, test/ directory contains unit tests for the module and view/ directory holds view scripts.

Creating project structure

Zend framework supports command line input to create structure of directories. We will use command line interface to start creating the directory structure for our project. This will give you complete structural understanding of directories. The interface supports and provides Zend_Tool interface giving a whole host of command functionalities.
  1. Open the command line interface, and change the hellozend directory.
  2. Windows users type: binzfbat create project
  3. Linux/Mac users type: binzf.sh create project
This procedure will create Zend Framework project in a your own specified location. After running Zend_Toll it will create the basic application skeleton.Pope, Keith. Zend Framework 1.8 Web Application Development (1). Olton, GB: Packt Publishing, 2009. ProQuest ebrary. Web. 13 February 2017. This will not only create directory structure but also all the basic elements of the MVC framework. In order to get Apache functionalities the virtual host settings will be as:Listen 8080DocumentRoot /User/keithpope/Sites/hellozend/publicThe basic directory structure created will be somewhat as mentioned in the aforementioned directory structure of Zend Framework with similar explanation. There is another aspect of Zend-Tool which is automatically initialized during installation is bootstrapping. Here the basic purpose is to initialize the request of page by developer. The main entry here created by Zend Framework is the Index file. Index file provides function to handle user request. This is the main entry point for all requests. Following shows the functionalities.
  1. Application-path: defines the path to application directory
  2. Application_Env: changes the application behavior depending on various factors such as how the application is used.
  3. getenv(): checks system environment.
  4. Initialize Zend-Application application: includes Zend-Application and create an instance of it.
  5. Call bootstrap() method coupled with run() method starting MVC.
In general Zend-Tool creates many important directory structures. This system is built upon Rapid Application Development technology. As a general rule of support the framework focuses on coding and project structures instead of focusing on smaller parts.Padilla, A. (2009). Beginning Zend Framework. Apress.
  • Project directory structure
  • Controllers
  • Actions
  • Views
  • Bootstrap file

Controllers

Controller is the main entry to Zend Framework application.Allen, R., Lo, N., & Brown, S. (2009). Zend framework in action. Manning. The front controller handler is main hub for accepting requests and running the accurate actions as requested by the commands. The whole process of requesting and reacting is routing and dispatching (which basically means calling correct methods in a class) which determines the functionality of the code. This is implemented by Zend_Controller_Router_- Interface. The router functionality is to find which actions need to be run and on contrary dispatcher runs those requested actions. The controller in Zend Framework is connected in a diverse array of structural directories, which provides a support to efficient routing. The main entry point and the command controller is the Zend_Controller_Front, this works as a foundation which delegates the work received and sent. The request is shaped and encapsulated with an instance of Zend Controller Request HTTP, as a provider of access to HTTP requests. The HTTP hold all the superglobals of the framework ($_GET, $_POST, $_COOKIE, $_SERVER, and $_ENV) with their relevant paths. Moreover, the controller also provides getParam() functions which enables collection of requested variables.

Actions

Actions are important functionalities. Controllers do not function without Actions. For this purpose we create another method which has action appended in its name and automatically the front controller will recognize it as an action. The Action has init() method which shows its private nature and not accessible by anyone. Following commands are run so that Zend_Tool can create action for us. Through the use of standard dispatcher all functions are named after the action's name and followed by word "Action" appended. This leads to controller action class containing methods like indexAction(), viewAction(), editAction(), and deleteAction().Windows users:
binzf.bat create actions about index
Linux and Mac users:
bin/zf.sh create action about index
An example of forms and actions:WEB,weblink Zend Framework - Issue, Company, Zend, a Rogue Wave, framework.zend.com, 2017-02-14,
namespace AlbumForm;


use ZendFormForm;


class AlbumForm extends Form
{
public function __construct($name = null)
{
// we want to ignore the name passed
parent::__construct('album');


$this->add(array(
'name' => 'id',
'type' => 'Hidden',
));
$this->add(array(
'name' => 'title',
'type' => 'Text',
'options' => array(
'label' => 'Title',
),
));
$this->add(array(
'name' => 'artist',
'type' => 'Text',
'options' => array(
'label' => 'Artist',
),
));
$this->add(array(
'name' => 'submit',
'type' => 'Submit',
'attributes' => array(
'value' => 'Go',
'id' => 'submitbutton',
),
));
}//source: Zend Framework Guide

}

Standard router

Standard router is an important Front Controller tool. Here the main decisions are made in order what module, controller and action are being requested. These are all processed here. The following are defaults structure.
  1. Module
  2. Controller
  3. Actions
The request follows a pattern first information is taken from URL endpoint of HTTP. URI is the end point of the request. URL structure follows as: weblinkThe default router code example:WEB,weblink Zend Framework - Issue, Company, Zend, a Rogue Wave, framework.zend.com, 2017-02-14, // Assuming the following:$ctrl->setControllerDirectory(
array(
'default' => '/path/to/default/controllers',
'news' => '/path/to/news/controllers',
'blog' => '/path/to/blog/controllers'
)
);
Module onlyweblink
module == news
Invalid module maps to controller nameweblink
controller == foo
Module + controllerweblink
module == blog
controller == archive
Module + controller + actionweblink
module == blog
controller == archive
action == list
Module + controller + action + paramsweblink
module == blog
controller == archive
action == list
sort == alpha
date == desc

Utility methods

The Zend Framework also provides some utility methods. Following are some utility methods provided in the framework.
{{mono|_forward()}}: it is used to call action
_forward{$action, $controller = null, $module = null, array $params = null}
; {{mono|$actions}}: string, action required ; {{mono|$controller}}: optional string parameter and is place where controller is in. ; {{mono|$module}}: string, has module in which we have the controller. ; {{mono|$params}}: array, user parameter
Another method is the redirect utility method. This is the opposite of aforementioned -forward() method. _redirect() performs HTPP in redirection in creation of a new request. _redirect() methods accepts two arguments namely $url, and $options.Furthermore, Action Helpers are also a way to provide extra functionalities within the framework. Action helpers are useful when there is a need to provide functionality between controllers.//application/controllers/IndexController.phppublic function init(){
$this->_helper->viewRenderer->setNoRender();
}During initialization phase of IndexController and ContactController, viewReader is called and noRender flag is called on the view object. The lack of this process creates an error in our application.

View directories

Zend Framework provides the view framework to our project and controller and actions are automatically provided to our application. Inside the Zend Framework in view folder we observe the following folders.
  1. View
  2. Helpers
  3. Scripts
  4. Contacts
  5. errors
  6. index
In order to create a view we follow:
'Hello world',
));
$view->setTemplate('foo/baz-bat/do-something-crazy');
return $view;
}
}

Sponsor and partners

Zend Technologies, co-founded by PHP core contributors Andi Gutmans and Zeev Suraski, is the corporate sponsor of Zend Framework.WEB, 2009-02-11,weblink History of PHP and related projects, The PHP Group, Technology partners include IBM,NEWS, LaMonica, Martin, IBM backs open-source Web software,weblink 2009-02-11, cnet.com, 2005-02-25, Google,WEB, Kernel, Sean Michael, Google Data Joins PHP Zend Framework,weblink 2009-02-11, internetnews.com, 2006-12-20, Microsoft,WEB, Krill, Paul, Microsoft, Zend boost PHP for Windows,weblink 2009-02-11, infoworld.com, 2006-10-31, Adobe Systems,WEB, Potter, Mike, Adobe Contributing AMF Support to Zend Framework, 2009-02-11,weblink" title="web.archive.org/web/20090207073623weblink">weblink 2014-05-21, The Official Flex Team Blog, and StrikeIron.WEB,weblink StrikeIron Featured Partners, 2009-02-11,

Features

Zend Framework features include:WEB, About Zend Framework,weblink 2009-02-11,

Development of applications

Zend Framework applications can run on any PHP stack that fulfills the technical requirements. Zend Technologies provides a PHP stack, Zend Server (or Zend Server Community Edition), which is advertised to be optimized for running Zend Framework applications. Zend Server includes Zend Framework in its installers, along with PHP and all required extensions. According to Zend Technologies, Zend Server provides improved performance for PHP and especially Zend Framework applications through opcode acceleration and several caching capabilities, and includes application monitoring and diagnostics facilities.WEB,weblink Zend site, Zend.com, May 17, 2017, Zend Studio is an IDE that includes features specifically to integrate with Zend Framework. It provides an MVC view, MVC code generation based on Zend_Tool (a component of the Zend Framework), a code formatter, code completion, parameter assist, and more.WEB,weblink Download Zend Studio - IDE, PHP profiler, mobile, unit testing & more, www.Zend.com, May 17, 2017, Zend Studio is not free software, whereas the Zend Framework and Zend Server Community Edition are free. Zend Server is compatible with common debugging tools such as Xdebug. Other developers may want to use a different PHP stack and another IDE such as Eclipse PDT which works well together with Zend Server. A pre configured, free version of Eclipse PDT with Zend Debug is available on the Zend web site.

Code, documentation, and test standards

Code contributions to Zend Framework are subject to rigorous code, documentation, and test standards. All code must meet ZF’s coding standards and unit tests must reach 80% code coverage before the corresponding code may be moved to the release branch.WEB, July 1, 2006, Zend Framework Contributor Guide,weblink July 14, 2008,

Simple cloud API

On September 22, 2009, Zend Technologies announcedWEB, Simple Cloud API Press Release,weblink 2009-11-05, yes,weblink" title="web.archive.org/web/20091201014623weblink">weblink December 1, 2009, that it would be working with technology partners including Microsoft, IBM, Rackspace, Nirvanix, and GoGrid along with the Zend Framework community to develop a common API to cloud application services called the Simple Cloud API. This project is part of Zend Framework and will be hosted on the Zend Framework website,WEB, Zend Framework website,weblink 2009-11-05, but a separate site called simplecloud.orgsimplecloud.org has been launched to discuss and download the most current versions of the API.The Simple Cloud API and several Cloud Services are included in Zend Framework. The adapters to popular cloud services have reached production quality.

Hello World: file by file

In order to create Hello World program, there are multiple steps including:
  • First create four files within the directory structure. These files are bootstrap file, an Apache Control file (.htaccess), a controller file and a view controller for the view.
  • Second a copy of Zend Framework need to be developed. With the growth of complexity, additional code is required which will provide the functionality and that is relative small and focuses on the benefits of MVC system. Regarding the process in more detail, the bootstrap file is initialization in one form or another.
Next it needs to be ensured the environment is correct and that there are no errors, followed by setting date and time for tracking functionality. In order to set up date and time many procedures can be followed; for example the method data_default_timezone_set() can get called and Zend assumes that default directory will include the phd path. The Zend Framework does not depend on any specific file, but helper classes are helpful in this case. Following are some examples:
  • Zend_Loader::loadClass() the main purpose here is to correct file for the supplied class name.
  • Following this the underscores are converted into directory-specific structures. As a result, the code lines Zend_Loader::loadClass('Zend_Controller_Front'); and include_once 'Zend/Controller/Front.php'; show similar results.
  • Zend_Debug::dump() functions in terms of debugging information and is focused on formatted var_dump() output. Finally the bootstrap runs the front controller and initializes it. The design pattern used by Zend_Controller_Front is the Singleton design and getInstance() is used to get the single instance.

Current development

Zend Framework 3.0 was released on June 28, 2016. It includes new components like a JSON RPC server, a XML to JSON converter, PSR-7 functionality, and compatibility with PHP 7. Zend Framework 3.0 runs up to 4 times faster than Zend Framework 2, and the packages have been decoupled to allow for greater reuse.WEB, zendframework,weblink Zend Framework 3 Released!, 2016-06-28, 2016-10-12, The contributors of Zend Framework are actively encouraging the use of Zend Framework version 3.x. The stated end of life for Zend Framework 1 is 2016-09-28, and for Zend Framework 2 is 2018-03-31. The first development release of Zend Framework 2.0 was released on August 6, 2010.WEB, Zend Framework 2.0.0dev1,weblink 2010-08-06, 2010-09-04, Changes made in this release were the removal of require_once statements, migration to PHP 5.3 namespaces, a refactored test suite, a rewritten ZendSession, and the addition of the new ZendStdlib. The second development release was on November 3, 2010.WEB, Zend Framework 2.0.0dev2,weblink 2011-11-03, 2011-03-18, The first stable release of Zend Framework 2.0 was released 5 September 2012.WEB,weblink Zend Framework 2.0.0 STABLE Released! - Zend Framework - Zend Framework, Framework.zend.com, September 5, 2012, June 14, 2013,

See also

References

{{Reflist|2}}

External links

{{PHP}}{{Application frameworks}}{{Authority control}}

- content above as imported from Wikipedia
- "Zend Framework" does not exist on GetWiki (yet)
- time: 11:06am EDT - Tue, Sep 25 2018
[ this remote article is provided by Wikipedia ]
LATEST EDITS [ see all ]
GETWIKI 09 MAY 2016
GETWIKI 18 OCT 2015
M.R.M. Parrott
Biographies
GETWIKI 20 AUG 2014
GETWIKI 19 AUG 2014
GETWIKI 18 AUG 2014
Wikinfo
Culture
CONNECT