Ticket #651: jzendframework.patch

File jzendframework.patch, 3.0 kB (added by bballizlife, 6 months ago)

jzendframework plugin

  • build/manifests/jelix-lib.mn

    old new  
    351351! jacl2.coord.php 
    352352  plugin.xml 
    353353  jacl2.coord.ini.php.dist 
     354   
     355cd lib/jelix/plugins/coord/jzendframework 
     356  jzendframework.coord.php 
     357  plugin.xml 
     358  jzendframework.coord.ini.php.dist 
    354359 
    355360cd lib/jelix/plugins/coord/history 
    356361! history.coord.php 
  • lib/jelix/plugins/coord/jzendframework/jzendframework.coord.php

    old new  
     1<?php 
     2/** 
     3* @package      jelix 
     4* @subpackage   coord_plugin 
     5* @author       Loic Mathaud 
     6* @copyright    2007 Loic Mathaud 
     7* @licence  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file 
     8*/ 
     9 
     10/** 
     11* Jelix plugin to use the Zend Framework library 
     12* 
     13* In order not to load Zend at each action, you need to explicitely activate it ! 
     14* 
     15* Use the $pluginParams property of the controller 
     16* Example : public $pluginParams = array('index' => array('zd.active' => true)); 
     17*/ 
     18class jzendframeworkCoordPlugin implements jICoordPlugin { 
     19     
     20    public $config; 
     21     
     22    /** 
     23    * @param array $config list of configuration parameters 
     24    */ 
     25    public function __construct($config) { 
     26        $this->config = $config; 
     27    } 
     28 
     29    /** 
     30    * Add the ZF library directory to the include_path 
     31    * Include the Zend Loader class to enable the use of Zend_Loader::loadClass() 
     32    */ 
     33    public function beforeAction($params) { 
     34        if (isset($params['zf.active']) && $params['zf.active'] == 'true') { 
     35            set_include_path(get_include_path().PATH_SEPARATOR.$this->config['zendLibPath']); 
     36            include_once($this->config['zendLibPath'].'/Zend/Loader.php'); 
     37        } 
     38        return null; 
     39    } 
     40 
     41    public function beforeOutput() {} 
     42    public function afterProcess() {} 
     43} 
     44 
  • lib/jelix/plugins/coord/jzendframework/jzendframework.coord.ini.php.dist

    old new  
     1;<?php die('');?> 
     2; for security reasons, don't remove or modify the first line 
     3 
     4; edit the realpath to the library directory of the zend framework 
     5zendLibPath = "/path/to/zend/framework/" 
  • lib/jelix/plugins/coord/jzendframework/plugin.xml

    old new  
     1<?xml version="1.0" encoding="iso-8859-1"?> 
     2<plugin name="jzendframework" xmlns="http://jelix.org/ns/plugin/1.0"> 
     3</plugin> 
Download in other formats: Original Format