*prechod na novsiu verziu ZF
[sport-group.git] / library / Zend / Tool / Project / Context / Zf / PublicIndexFile.php
blob035c2967321492b08421a7cf9dc20a7d85e74864
1 <?php
2 /**
3 * Zend Framework
5 * LICENSE
7 * This source file is subject to the new BSD license that is bundled
8 * with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://framework.zend.com/license/new-bsd
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
13 * to license@zend.com so we can send you a copy immediately.
15 * @category Zend
16 * @package Zend_Tool
17 * @subpackage Framework
18 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: PublicIndexFile.php 16971 2009-07-22 18:05:45Z mikaelkael $
23 /**
24 * @see Zend_Tool_Project_Context_Filesystem_File
26 require_once 'Zend/Tool/Project/Context/Filesystem/File.php';
28 /**
29 * This class is the front most class for utilizing Zend_Tool_Project
31 * A profile is a hierarchical set of resources that keep track of
32 * items within a specific project.
34 * @category Zend
35 * @package Zend_Tool
36 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
37 * @license http://framework.zend.com/license/new-bsd New BSD License
39 class Zend_Tool_Project_Context_Zf_PublicIndexFile extends Zend_Tool_Project_Context_Filesystem_File
42 /**
43 * @var string
45 protected $_filesystemName = 'index.php';
47 /**
48 * getName()
50 * @return string
52 public function getName()
54 return 'PublicIndexFile';
57 /**
58 * getContents()
60 * @return string
62 public function getContents()
64 $codeGenerator = new Zend_CodeGenerator_Php_File(array(
65 'body' => <<<EOS
66 // Define path to application directory
67 defined('APPLICATION_PATH')
68 || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
70 // Define application environment
71 defined('APPLICATION_ENV')
72 || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
74 // Ensure library/ is on include_path
75 set_include_path(implode(PATH_SEPARATOR, array(
76 realpath(APPLICATION_PATH . '/../library'),
77 get_include_path(),
78 )));
80 /** Zend_Application */
81 require_once 'Zend/Application.php';
83 // Create application, bootstrap, and run
84 \$application = new Zend_Application(
85 APPLICATION_ENV,
86 APPLICATION_PATH . '/configs/application.ini'
88 \$application->bootstrap()
89 ->run();
90 EOS
91 ));
92 return $codeGenerator->generate();