Mage_Compiler - Version 1.6.0.0

Version Notes

1.6.0.0

Download this release

Release Info

Developer Magento Core Team
Extension Mage_Compiler
Version 1.6.0.0
Comparing to
See all releases


Version 1.6.0.0

app/code/core/Mage/Compiler/Block/Process.php ADDED
@@ -0,0 +1,199 @@
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
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@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Compiler
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ /**
29
+ * Manage currency block
30
+ *
31
+ * @category Mage
32
+ * @package Mage_Compiler
33
+ * @author Magento Core Team <core@magentocommerce.com>
34
+ */
35
+ class Mage_Compiler_Block_Process extends Mage_Adminhtml_Block_Template
36
+ {
37
+ /**
38
+ * Compilation process object
39
+ *
40
+ * @var Mage_Compiler_Model_Process
41
+ */
42
+ protected $_process;
43
+ protected $_validationResult;
44
+
45
+
46
+ protected function _construct()
47
+ {
48
+ $this->_process = Mage::getModel('compiler/process');
49
+ $this->_validationResult = $this->_process->validate();
50
+ return parent::_construct();
51
+ }
52
+
53
+ /**
54
+ * Get compilation process object
55
+ *
56
+ * @return Mage_Compiler_Model_Process
57
+ */
58
+ public function getProcess()
59
+ {
60
+ return $this->_process;
61
+ }
62
+
63
+ protected function _prepareLayout()
64
+ {
65
+ $this->setChild('run_button',
66
+ $this->getLayout()->createBlock('adminhtml/widget_button')
67
+ ->setData(array(
68
+ 'label' => Mage::helper('compiler')->__('Run Compilation Process'),
69
+ 'onclick' => 'compilationForm.submit();',
70
+ 'class' => 'save'
71
+ )));
72
+
73
+ if (defined('COMPILER_INCLUDE_PATH')) {
74
+ $this->setChild('change_status_button',
75
+ $this->getLayout()->createBlock('adminhtml/widget_button')
76
+ ->setData(array(
77
+ 'label' => Mage::helper('compiler')->__('Disable'),
78
+ 'onclick' => 'setLocation(\'' . $this->getUrl('*/compiler_process/disable') . '\')',
79
+ 'class' => 'save'
80
+ )));
81
+ } else {
82
+ $this->setChild('change_status_button',
83
+ $this->getLayout()->createBlock('adminhtml/widget_button')
84
+ ->setData(array(
85
+ 'label' => Mage::helper('compiler')->__('Enable'),
86
+ 'onclick' => 'setLocation(\'' . $this->getUrl('*/compiler_process/enable') . '\')',
87
+ 'class' => 'save'
88
+ )));
89
+ }
90
+
91
+ return parent::_prepareLayout();
92
+ }
93
+
94
+ /**
95
+ * Get page header text
96
+ *
97
+ * @return string
98
+ */
99
+ protected function getHeader()
100
+ {
101
+ return Mage::helper('compiler')->__('Compilation');
102
+ }
103
+
104
+ public function getChangeStatusButtonHtml()
105
+ {
106
+ if ($this->getCollectedFilesCount()) {
107
+ return $this->getChildHtml('change_status_button');
108
+ }
109
+ return '';
110
+ }
111
+
112
+ /**
113
+ * Get html code of rum button
114
+ *
115
+ * @return string
116
+ */
117
+ protected function getRunButtonHtml()
118
+ {
119
+ return $this->getChildHtml('run_button');
120
+ }
121
+
122
+ /**
123
+ * Get process run url
124
+ *
125
+ * @return string
126
+ */
127
+ public function getRunFormAction()
128
+ {
129
+ return $this->getUrl('*/compiler_process/recompile');
130
+ }
131
+
132
+ /**
133
+ * Check if compilation proecss is allowed
134
+ *
135
+ * @return bool
136
+ */
137
+ public function canRunCompilation()
138
+ {
139
+ return empty($this->_validationResult);
140
+ }
141
+
142
+ /**
143
+ * Get messages block
144
+ *
145
+ * @return Mage_Core_Block_Messages
146
+ */
147
+ public function getMessagesBlock()
148
+ {
149
+ $block = $this->getLayout()->createBlock('core/messages');
150
+ foreach ($this->_validationResult as $message) {
151
+ $block->addError($message);
152
+ }
153
+ return $block;
154
+ }
155
+
156
+ public function getCompilationList()
157
+ {
158
+ return $this->getProcess()->getCompileClassList();
159
+ }
160
+
161
+ public function arrToSting($arr)
162
+ {
163
+ return implode("\n", $arr);
164
+ }
165
+
166
+ public function getCompilerState()
167
+ {
168
+ if ($this->getCollectedFilesCount() > 0) {
169
+ return $this->__('Compiled');
170
+ } else {
171
+ return $this->__('Not Compiled');
172
+ }
173
+ }
174
+
175
+ public function getCompilerStatus()
176
+ {
177
+ if (defined('COMPILER_INCLUDE_PATH')) {
178
+ return $this->__('Enabled');
179
+ } else {
180
+ return $this->__('Disabled');
181
+ }
182
+ }
183
+
184
+ public function getCollectedFilesCount()
185
+ {
186
+ if (!$this->hasData('collected_files_count')) {
187
+ $this->setData('collected_files_count', $this->getProcess()->getCollectedFilesCount());
188
+ }
189
+ return $this->_getData('collected_files_count');
190
+ }
191
+
192
+ public function getCompiledFilesCount()
193
+ {
194
+ if (!$this->hasData('compiled_files_count')) {
195
+ $this->setData('compiled_files_count', $this->getProcess()->getCompiledFilesCount());
196
+ }
197
+ return $this->_getData('compiled_files_count');
198
+ }
199
+ }
app/code/core/Mage/Compiler/Helper/Data.php ADDED
@@ -0,0 +1,36 @@
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
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@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Compiler
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Compiler main helper
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Compiler
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_Compiler_Helper_Data extends Mage_Core_Helper_Abstract
35
+ {
36
+ } // Class Mage_Api_Helper_Data End
app/code/core/Mage/Compiler/Model/Process.php ADDED
@@ -0,0 +1,451 @@
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
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@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Compiler
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Compilation process model
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Compiler
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+
35
+ class Mage_Compiler_Model_Process
36
+ {
37
+ protected $_compileDir = null;
38
+ protected $_includeDir = null;
39
+ protected $_statDir = null;
40
+ protected $_compileConfig = null;
41
+ protected $_includePaths = array();
42
+ protected $_processedClasses= array();
43
+
44
+ protected $_controllerFolders = array();
45
+
46
+ public function __construct($options=array())
47
+ {
48
+ if (isset($options['compile_dir'])) {
49
+ $this->_compileDir = $options['compile_dir'];
50
+ } else {
51
+ $this->_compileDir = Mage::getBaseDir() . DS . 'includes';
52
+ }
53
+ $this->_includeDir = $this->_compileDir . DS . 'src';
54
+ $this->_statDir = $this->_compileDir . DS . 'stat';
55
+ }
56
+
57
+ /**
58
+ * Get compilation config
59
+ *
60
+ * @return Mage_Core_Model_Config_Base
61
+ */
62
+ public function getCompileConfig()
63
+ {
64
+ if ($this->_compileConfig === null) {
65
+ $this->_compileConfig = Mage::getConfig()->loadModulesConfiguration('compilation.xml');
66
+ }
67
+ return $this->_compileConfig;
68
+ }
69
+
70
+ /**
71
+ * Get allowed include paths
72
+ *
73
+ * @return array
74
+ */
75
+ protected function _getIncludePaths()
76
+ {
77
+ if (empty($this->_includePaths)) {
78
+ $originalPath = Mage::registry('original_include_path');
79
+ /**
80
+ * Exclude current dirrectory include path
81
+ */
82
+ if ($originalPath == '.') {
83
+ $path = get_include_path();
84
+ } else {
85
+ $path = str_replace($originalPath, '', get_include_path());
86
+ }
87
+
88
+ $this->_includePaths = explode(PS, $path);
89
+ foreach ($this->_includePaths as $index => $path) {
90
+ if (empty($path) || $path == '.') {
91
+ unset($this->_includePaths[$index]);
92
+ }
93
+ }
94
+ }
95
+ return $this->_includePaths;
96
+ }
97
+
98
+ /**
99
+ * Copy directory
100
+ *
101
+ * @param string $source
102
+ * @param string $target
103
+ * @return Mage_Compiler_Model_Process
104
+ */
105
+ protected function _copy($source, $target, $firstIteration = true)
106
+ {
107
+ if (is_dir($source)) {
108
+ $dir = dir($source);
109
+ while (false !== ($file = $dir->read())) {
110
+ if (($file[0] == '.')) {
111
+ continue;
112
+ }
113
+ $sourceFile = $source . DS . $file;
114
+ if ($file == 'controllers') {
115
+ $this->_controllerFolders[] = $sourceFile;
116
+ continue;
117
+ }
118
+
119
+ if ($firstIteration) {
120
+ $targetFile = $target . DS . $file;
121
+ } else {
122
+ $targetFile = $target . '_' . $file;
123
+ }
124
+ $this->_copy($sourceFile, $targetFile, false);
125
+ }
126
+ } else {
127
+ if (strpos(str_replace($this->_includeDir, '', $target), '-')
128
+ || !in_array(substr($source, strlen($source)-4, 4), array('.php'))) {
129
+ return $this;
130
+ }
131
+ copy($source, $target);
132
+ }
133
+ return $this;
134
+ }
135
+
136
+ /**
137
+ * Copy Zend Locale data to compilation folter
138
+ *
139
+ * @param string $destDir
140
+ * @return Mage_Compiler_Model_Process
141
+ */
142
+ protected function _copyZendLocaleData($destDir)
143
+ {
144
+ $source = Mage::getBaseDir('lib').DS.'Zend'.DS.'Locale'.DS.'Data';
145
+ $dir = dir($source);
146
+ while (false !== ($file = $dir->read())) {
147
+ if (($file[0] == '.')) {
148
+ continue;
149
+ }
150
+ $sourceFile = $source . DS . $file;
151
+ $targetFile = $destDir . DS . $file;
152
+ copy($sourceFile, $targetFile);
153
+ }
154
+ return $this;
155
+ }
156
+
157
+ /**
158
+ * Copy controllers with folders structure
159
+ *
160
+ * @param string $basePath base include path where files are located
161
+ * @return Mage_Compiler_Model_Process
162
+ */
163
+ protected function _copyControllers($basePath)
164
+ {
165
+ foreach ($this->_controllerFolders as $path) {
166
+ $relPath = str_replace($basePath, '', $path);
167
+ $relPath = trim($relPath, DS);
168
+ $arrDirs = explode(DS, $relPath);
169
+ $destPath = $this->_includeDir;
170
+ foreach ($arrDirs as $dir) {
171
+ $destPath.= DS.$dir;
172
+ $this->_mkdir($destPath);
173
+ }
174
+ $this->_copyAll($path, $destPath);
175
+ }
176
+ return $this;
177
+ }
178
+
179
+ /**
180
+ * Copy all files and subfolders
181
+ *
182
+ * @param string $source
183
+ * @param string $target
184
+ * @return Mage_Compiler_Model_Process
185
+ */
186
+ protected function _copyAll($source, $target)
187
+ {
188
+ if (is_dir($source)) {
189
+ $this->_mkdir($target);
190
+ $dir = dir($source);
191
+ while (false !== ($file = $dir->read())) {
192
+ if (($file[0] == '.')) {
193
+ continue;
194
+ }
195
+ $sourceFile = $source . DS . $file;
196
+ $targetFile = $target . DS . $file;
197
+ $this->_copyAll($sourceFile, $targetFile);
198
+ }
199
+ } else {
200
+ if (!in_array(substr($source, strlen($source)-4, 4), array('.php'))) {
201
+ return $this;
202
+ }
203
+ copy($source, $target);
204
+ }
205
+ return $this;
206
+ }
207
+
208
+ /**
209
+ * Create directory if not exist
210
+ *
211
+ * @param string $dir
212
+ * @return string
213
+ */
214
+ protected function _mkdir($dir)
215
+ {
216
+ if (!is_dir($dir)) {
217
+ mkdir($dir);
218
+ @chmod($dir, 0777);
219
+ }
220
+ return $dir;
221
+ }
222
+
223
+ /**
224
+ * Copy files from all include directories to one.
225
+ * Lib files and controllers files will be copied as is
226
+ *
227
+ * @return Mage_Compiler_Model_Process
228
+ */
229
+ protected function _collectFiles()
230
+ {
231
+ $paths = $this->_getIncludePaths();
232
+ $paths = array_reverse($paths);
233
+ $destDir= $this->_includeDir;
234
+ $libDir = Mage::getBaseDir('lib');
235
+
236
+ $this->_mkdir($destDir);
237
+ foreach ($paths as $path) {
238
+ $this->_controllerFolders = array();
239
+ $this->_copy($path, $destDir);
240
+ $this->_copyControllers($path);
241
+ if ($path == $libDir) {
242
+ $this->_copyAll($libDir, $destDir);
243
+ }
244
+ }
245
+
246
+ $destDir.= DS.'Data';
247
+ $this->_mkdir($destDir);
248
+ $this->_copyZendLocaleData($destDir);
249
+ return $this;
250
+ }
251
+
252
+ public function getCollectedFilesCount()
253
+ {
254
+ return count(glob($this->_includeDir.DS.'*'));
255
+ }
256
+
257
+ public function getCompiledFilesCount()
258
+ {
259
+ return count(glob($this->_includeDir.DS.Varien_Autoload::SCOPE_FILE_PREFIX.'*'));
260
+ }
261
+
262
+ public function getCompileClassList()
263
+ {
264
+ $arrFiles = array();
265
+ $statDir = $this->_statDir;
266
+ $statFiles= array();
267
+ if (is_dir($statDir)) {
268
+ $dir = dir($statDir);
269
+ while (false !== ($file = $dir->read())) {
270
+ if (($file[0] == '.')) {
271
+ continue;
272
+ }
273
+ $statFiles[str_replace('.csv', '', $file)] = $this->_statDir.DS.$file;
274
+ }
275
+ }
276
+
277
+ foreach ($this->getCompileConfig()->getNode('includes')->children() as $code => $config) {
278
+ $classes = $config->asArray();
279
+ if (is_array($classes)) {
280
+ $arrFiles[$code] = array_keys($classes);
281
+ } else {
282
+ $arrFiles[$code] = array();
283
+ }
284
+
285
+ $statClasses = array();
286
+ if (isset($statFiles[$code])) {
287
+ $statClasses = explode("\n", file_get_contents($statFiles[$code]));
288
+ $popularStatClasses = array();
289
+ foreach ($statClasses as $index => $classInfo) {
290
+ $classInfo = explode(':', $classInfo);
291
+ $popularStatClasses[$classInfo[1]][] = $classInfo[0];
292
+ }
293
+ ksort($popularStatClasses);
294
+ $statClasses = array_pop($popularStatClasses);
295
+ unset($statFiles[$code]);
296
+ }
297
+ $arrFiles[$code] = array_merge($arrFiles[$code], $statClasses);
298
+ $arrFiles[$code] = array_unique($arrFiles[$code]);
299
+ sort($arrFiles[$code]);
300
+ }
301
+
302
+ foreach($statFiles as $code => $file) {
303
+ $classes = explode("\n", file_get_contents($file));
304
+ $popularStatClasses = array();
305
+ foreach ($classes as $index => $classInfo) {
306
+ $classInfo = explode(':', $classInfo);
307
+ $popularStatClasses[$classInfo[1]][] = $classInfo[0];
308
+ }
309
+ ksort($popularStatClasses);
310
+ $arrFiles[$code] = array_pop($popularStatClasses);
311
+ }
312
+ foreach ($arrFiles as $scope=>$classes) {
313
+ if ($scope != 'default') {
314
+ foreach ($classes as $index => $class) {
315
+ if (in_array($class, $arrFiles['default'])) {
316
+ unset($arrFiles[$scope][$index]);
317
+ }
318
+ }
319
+ }
320
+ }
321
+ return $arrFiles;
322
+ }
323
+
324
+ /**
325
+ * Compile classes code to files
326
+ *
327
+ * @return Mage_Compiler_Model_Process
328
+ */
329
+ protected function _compileFiles()
330
+ {
331
+ $classesInfo = $this->getCompileClassList();
332
+
333
+ foreach ($classesInfo as $code => $classes) {
334
+ $classesSorce = $this->_getClassesSourceCode($classes, $code);
335
+ file_put_contents($this->_includeDir.DS.Varien_Autoload::SCOPE_FILE_PREFIX.$code.'.php', $classesSorce);
336
+ }
337
+ return $this;
338
+ }
339
+
340
+ protected function _getClassesSourceCode($classes, $scope)
341
+ {
342
+ $sortedClasses = array();
343
+ foreach ($classes as $className) {
344
+ $implements = array_reverse(class_implements($className));
345
+ foreach ($implements as $class) {
346
+ if (!in_array($class, $sortedClasses) && !in_array($class, $this->_processedClasses) && strstr($class, '_')) {
347
+ $sortedClasses[] = $class;
348
+ if ($scope == 'default') {
349
+ $this->_processedClasses[] = $class;
350
+ }
351
+ }
352
+ }
353
+ $extends = array_reverse(class_parents($className));
354
+ foreach ($extends as $class) {
355
+ if (!in_array($class, $sortedClasses) && !in_array($class, $this->_processedClasses) && strstr($class, '_')) {
356
+ $sortedClasses[] = $class;
357
+ if ($scope == 'default') {
358
+ $this->_processedClasses[] = $class;
359
+ }
360
+ }
361
+ }
362
+ if (!in_array($className, $sortedClasses) && !in_array($className, $this->_processedClasses)) {
363
+ $sortedClasses[] = $className;
364
+ if ($scope == 'default') {
365
+ $this->_processedClasses[] = $className;
366
+ }
367
+ }
368
+ }
369
+
370
+ $classesSource = "<?php\n";
371
+ foreach ($sortedClasses as $className) {
372
+ $file = $this->_includeDir.DS.$className.'.php';
373
+ if (!file_exists($file)) {
374
+ continue;
375
+ }
376
+ $content = file_get_contents($file);
377
+ $content = ltrim($content, '<?php');
378
+ $content = rtrim($content, "\n\r\t?>");
379
+ $classesSource.= $content;
380
+ }
381
+ return $classesSource;
382
+ }
383
+
384
+ public function clear()
385
+ {
386
+ $this->registerIncludePath(false);
387
+ if (is_dir($this->_includeDir)) {
388
+ mageDelTree($this->_includeDir);
389
+ }
390
+ return $this;
391
+ }
392
+
393
+ /**
394
+ * Run compilation process
395
+ *
396
+ * @return Mage_Compiler_Model_Process
397
+ */
398
+ public function run()
399
+ {
400
+ $this->_collectFiles();
401
+ $this->_compileFiles();
402
+ $this->registerIncludePath();
403
+ return $this;
404
+
405
+ }
406
+
407
+ /**
408
+ * Enable or disable include path constant definition in compiler config.php
409
+ *
410
+ * @param bool $flag
411
+ * @return Mage_Compiler_Model_Process
412
+ */
413
+ public function registerIncludePath($flag = true)
414
+ {
415
+ $file = $this->_compileDir.DS.'config.php';
416
+ if (is_writeable($file)) {
417
+ $content = file_get_contents($file);
418
+ $content = explode("\n", $content);
419
+ foreach ($content as $index => $line) {
420
+ if (strpos($line, 'COMPILER_INCLUDE_PATH')) {
421
+ if ($flag) {
422
+ $content[$index] = ltrim($line, '#');
423
+ } else {
424
+ $content[$index] = '#'.$line;
425
+ }
426
+ }
427
+ }
428
+ file_put_contents($file, implode("\n", $content));
429
+ }
430
+ return $this;
431
+ }
432
+
433
+ /**
434
+ * Validate if compilation process is allowed
435
+ *
436
+ * @return array
437
+ */
438
+ public function validate()
439
+ {
440
+ $result = array();
441
+ if (!is_writeable($this->_compileDir)) {
442
+ $result[] = Mage::helper('compiler')->__('Directory "%s" must be writeable', $this->_compileDir);
443
+ }
444
+ $file = $this->_compileDir.DS.'config.php';
445
+ if (!is_writeable($file)) {
446
+ $result[] = Mage::helper('compiler')->__('File "%s" must be writeable', $file);
447
+ }
448
+ return $result;
449
+ }
450
+
451
+ }
app/code/core/Mage/Compiler/controllers/Adminhtml/Compiler/ProcessController.php ADDED
@@ -0,0 +1,114 @@
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
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@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Compiler
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Compiler process controller
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Compiler
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_Compiler_Adminhtml_Compiler_ProcessController extends Mage_Adminhtml_Controller_Action
35
+ {
36
+ protected $_compiler = null;
37
+
38
+ public function preDispatch()
39
+ {
40
+ parent::preDispatch();
41
+ }
42
+
43
+ /**
44
+ * Get compiler process object
45
+ *
46
+ * @return Mage_Compiler_Model_Process
47
+ */
48
+ protected function _getCompiler()
49
+ {
50
+ if ($this->_compiler === null) {
51
+ $this->_compiler = Mage::getModel('compiler/process');
52
+ }
53
+ return $this->_compiler;
54
+ }
55
+ public function indexAction()
56
+ {
57
+ $this->_title($this->__('System'))->_title($this->__('Tools'))->_title($this->__('Compilation'));
58
+
59
+ $this->loadLayout();
60
+ $this->_setActiveMenu('system/tools');
61
+ $this->renderLayout();
62
+ }
63
+
64
+ public function runAction()
65
+ {
66
+ try {
67
+ $this->_getCompiler()->run();
68
+ Mage::getSingleton('adminhtml/session')->addSuccess(
69
+ Mage::helper('compiler')->__('The compilation has completed.')
70
+ );
71
+ } catch (Mage_Core_Exception $e) {
72
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
73
+ } catch (Exception $e) {
74
+ Mage::getSingleton('adminhtml/session')->addError(
75
+ Mage::helper('compiler')->__('Compilation error')
76
+ );
77
+ }
78
+ $this->_redirect('*/*/');
79
+ }
80
+
81
+ public function recompileAction()
82
+ {
83
+ /**
84
+ * Add redirect heades before clear compiled sources
85
+ */
86
+ $this->_redirect('*/*/run');
87
+ $this->_getCompiler()->clear();
88
+ $this->getResponse()->sendHeaders();
89
+ exit;
90
+ }
91
+
92
+ public function disableAction()
93
+ {
94
+ $this->_getCompiler()->registerIncludePath(false);
95
+ Mage::getSingleton('adminhtml/session')->addSuccess(
96
+ Mage::helper('compiler')->__('Compiler include path is disabled.')
97
+ );
98
+ $this->_redirect('*/*/');
99
+ }
100
+
101
+ public function enableAction()
102
+ {
103
+ $this->_getCompiler()->registerIncludePath();
104
+ Mage::getSingleton('adminhtml/session')->addSuccess(
105
+ Mage::helper('compiler')->__('Compiler include path is enabled.')
106
+ );
107
+ $this->_redirect('*/*/');
108
+ }
109
+
110
+ protected function _isAllowed()
111
+ {
112
+ return Mage::getSingleton('admin/session')->isAllowed('system/tools/compiler');
113
+ }
114
+ }
app/code/core/Mage/Compiler/controllers/ProcessController.php ADDED
@@ -0,0 +1,40 @@
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
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@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Compiler
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ require_once 'Mage/Compiler/controllers/Adminhtml/Compiler/ProcessController.php';
28
+
29
+ /**
30
+ * Compiler process controller
31
+ *
32
+ * @category Mage
33
+ * @package Mage_Compiler
34
+ * @author Magento Core Team <core@magentocommerce.com>
35
+ * @deprecated after 1.4.2.0 Mage_Compiler_Adminhtml_Compiler_ProcessController is used
36
+ */
37
+ class Mage_Compiler_ProcessController extends Mage_Compiler_Adminhtml_Compiler_ProcessController
38
+ {
39
+
40
+ }
app/code/core/Mage/Compiler/etc/adminhtml.xml ADDED
@@ -0,0 +1,65 @@
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Mage
23
+ * @package Mage_Compiler
24
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <config>
29
+ <acl>
30
+ <resources>
31
+ <admin>
32
+ <children>
33
+ <system>
34
+ <children>
35
+ <tools>
36
+ <children>
37
+ <compiler translate="title" module="compiler">
38
+ <title>Compilation</title>
39
+ <sort_order>0</sort_order>
40
+ </compiler>
41
+ </children>
42
+ </tools>
43
+ </children>
44
+ </system>
45
+ </children>
46
+ </admin>
47
+ </resources>
48
+ </acl>
49
+
50
+ <menu>
51
+ <system>
52
+ <children>
53
+ <tools>
54
+ <children>
55
+ <compiler translate="title" module="compiler">
56
+ <title>Compilation</title>
57
+ <sort_order>1000</sort_order>
58
+ <action>adminhtml/compiler_process</action>
59
+ </compiler>
60
+ </children>
61
+ </tools>
62
+ </children>
63
+ </system>
64
+ </menu>
65
+ </config>
app/code/core/Mage/Compiler/etc/compilation.xml ADDED
@@ -0,0 +1,405 @@
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Mage
23
+ * @package Mage_Compiler
24
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <config>
29
+ <includes>
30
+ <default>
31
+ <Zend_Db_Statement_Pdo/>
32
+
33
+ <Zend_Loader/>
34
+ <Zend_Json/>
35
+ <Zend_Filter_Interface/>
36
+
37
+ <Zend_Db_Statement_Interface/>
38
+ <Zend_Db_Statement/>
39
+ <Zend_Db_Select/>
40
+ <Zend_Db_Profiler/>
41
+ <Zend_Db_Expr/>
42
+ <Zend_Db_Adapter_Pdo_Mysql/>
43
+ <Zend_Db_Adapter_Pdo_Abstract/>
44
+ <Zend_Db_Adapter_Abstract/>
45
+ <Zend_Db/>
46
+ <Zend_Controller_Response_Http/>
47
+ <Zend_Controller_Response_Abstract/>
48
+ <Zend_Controller_Request_Http/>
49
+ <Zend_Controller_Request_Abstract/>
50
+ <Zend_Cache_Core/>
51
+ <Zend_Cache_Backend_Interface/>
52
+ <Zend_Cache_Backend/>
53
+ <Zend_Cache/>
54
+
55
+ <Varien_Simplexml_Element/>
56
+ <Varien_Simplexml_Config/>
57
+ <Varien_Object/>
58
+ <Varien_Filter_Template_Tokenizer_Parameter/>
59
+ <Varien_Filter_Template_Tokenizer_Abstract/>
60
+ <Varien_Filter_Template/>
61
+ <Varien_Event_Observer_Collection/>
62
+ <Varien_Event_Observer/>
63
+ <Varien_Event_Collection/>
64
+ <Varien_Event/>
65
+ <Varien_Db_Select/>
66
+ <Varien_Db_Adapter_Pdo_Mysql/>
67
+ <Varien_Data_Collection_Db/>
68
+ <Varien_Data_Collection/>
69
+
70
+ <Mage_Wishlist_Helper_Data/>
71
+ <Mage_Wishlist_Block_Links/>
72
+
73
+ <Mage_Tag_Model_Tag/>
74
+ <Mage_Tag_Model_Resource_Tag/>
75
+ <Mage_Tag_Model_Resource_Popular_Collection/>
76
+ <Mage_Tag_Block_Popular/>
77
+
78
+ <Mage_Rss_Helper_Data/>
79
+
80
+ <Mage_Reports_Model_Session/>
81
+ <Mage_Reports_Model_Event/>
82
+ <Mage_Reports_Block_Product_Viewed/>
83
+ <Mage_Reports_Block_Product_Compared/>
84
+ <Mage_Reports_Block_Product_Abstract/>
85
+
86
+ <Mage_Poll_Model_Poll_Answer/>
87
+ <Mage_Poll_Model_Poll/>
88
+ <Mage_Poll_Model_Resource_Poll_Answer_Collection/>
89
+ <Mage_Poll_Model_Resource_Poll_Answer/>
90
+ <Mage_Poll_Model_Resource_Poll/>
91
+ <Mage_Poll_Block_ActivePoll/>
92
+
93
+ <Mage_Page_Block_Template_Links/>
94
+ <Mage_Page_Block_Switch/>
95
+ <Mage_Page_Block_Html_Header/>
96
+ <Mage_Page_Block_Html_Head/>
97
+ <Mage_Page_Block_Html_Footer/>
98
+ <Mage_Page_Block_Html_Breadcrumbs/>
99
+ <Mage_Page_Block_Html/>
100
+
101
+ <Mage_Newsletter_Block_Subscribe/>
102
+
103
+ <Mage_Log_Model_Visitor/>
104
+ <Mage_Log_Model_Resource_Visitor/>
105
+
106
+ <Mage_GoogleOptimizer_Model_Observer/>
107
+ <Mage_GoogleOptimizer_Helper_Data/>
108
+ <Mage_GoogleOptimizer_Block_Code_Page/>
109
+ <Mage_GoogleOptimizer_Block_Code/>
110
+ <Mage_GoogleAnalytics_Block_Ga/>
111
+
112
+ <Mage_Customer_Model_Session/>
113
+ <Mage_Customer_Model_Observer/>
114
+ <Mage_Customer_Model_Group/>
115
+ <Mage_Customer_Model_Config_Share/>
116
+ <Mage_Customer_Helper_Data/>
117
+
118
+ <Mage_Contacts_Helper_Data/>
119
+
120
+ <Mage_Cms_Model_Page/>
121
+ <Mage_Cms_Model_Resource_Page/>
122
+ <Mage_Cms_Model_Block/>
123
+ <Mage_Cms_Helper_Page/>
124
+ <Mage_Cms_Controller_Router/>
125
+ <Mage_Cms_Block_Page/>
126
+ <Mage_Cms_Block_Block/>
127
+
128
+ <Mage_Checkout_Model_Session/>
129
+ <Mage_Checkout_Model_Cart/>
130
+ <Mage_Checkout_Helper_Data/>
131
+ <Mage_Checkout_Helper_Cart/>
132
+ <Mage_Checkout_Block_Links/>
133
+ <Mage_Checkout_Block_Cart_Sidebar/>
134
+ <Mage_Checkout_Block_Cart_Abstract/>
135
+
136
+ <Mage_CatalogSearch_Helper_Data/>
137
+
138
+ <Mage_Catalog_Model_Session/>
139
+ <Mage_Catalog_Model_Category/>
140
+ <Mage_Catalog_Model_Abstract/>
141
+ <Mage_Catalog_Helper_Product_Compare/>
142
+ <Mage_Catalog_Helper_Map/>
143
+ <Mage_Catalog_Helper_Data/>
144
+ <Mage_Catalog_Block_Product_Abstract/>
145
+ <Mage_Catalog_Block_Navigation/>
146
+
147
+ <Mage_Core_Model_Website/>
148
+ <Mage_Core_Model_Url_Rewrite/>
149
+ <Mage_Core_Model_Url/>
150
+ <Mage_Core_Model_Translate_Inline/>
151
+ <Mage_Core_Model_Translate_Expr/>
152
+ <Mage_Core_Model_Translate/>
153
+ <Mage_Core_Model_Store_Group/>
154
+ <Mage_Core_Model_Store/>
155
+ <Mage_Core_Model_Session_Abstract_Varien/>
156
+ <Mage_Core_Model_Session_Abstract/>
157
+ <Mage_Core_Model_Session/>
158
+ <Mage_Core_Model_Resource_Type_Db_Pdo_Mysql/>
159
+ <Mage_Core_Model_Resource_Type_Db/>
160
+ <Mage_Core_Model_Resource_Type_Abstract/>
161
+ <Mage_Core_Model_Resource_Abstract/>
162
+ <Mage_Core_Model_Resource/>
163
+ <Mage_Core_Model_Resource_Website_Collection/>
164
+ <Mage_Core_Model_Resource_Website/>
165
+ <Mage_Core_Model_Resource_Url_Rewrite/>
166
+ <Mage_Core_Model_Resource_Store_Group_Collection/>
167
+ <Mage_Core_Model_Resource_Store_Group/>
168
+ <Mage_Core_Model_Resource_Store_Collection/>
169
+ <Mage_Core_Model_Resource_Store/>
170
+ <Mage_Core_Model_Resource_Design/>
171
+ <Mage_Core_Model_Resource_Db_Collection_Abstract/>
172
+ <Mage_Core_Model_Resource_Abstract/>
173
+ <Mage_Core_Model_Message_Collection/>
174
+ <Mage_Core_Model_Message/>
175
+ <Mage_Core_Model_Locale/>
176
+ <Mage_Core_Model_Layout_Update/>
177
+ <Mage_Core_Model_Layout_Element/>
178
+ <Mage_Core_Model_Layout/>
179
+ <Mage_Core_Model_Email_Template_Filter/>
180
+ <Mage_Core_Model_Design_Package/>
181
+ <Mage_Core_Model_Design/>
182
+ <Mage_Core_Model_Cookie/>
183
+ <Mage_Core_Model_Config_Options/>
184
+ <Mage_Core_Model_Config_Element/>
185
+ <Mage_Core_Model_Config_Data/>
186
+ <Mage_Core_Model_Config_Base/>
187
+ <Mage_Core_Model_Config/>
188
+ <Mage_Core_Model_App_Area/>
189
+ <Mage_Core_Model_App/>
190
+ <Mage_Core_Model_Abstract/>
191
+ <Mage_Core_Helper_Url/>
192
+ <Mage_Core_Helper_String/>
193
+ <Mage_Core_Helper_Js/>
194
+ <Mage_Core_Helper_Data/>
195
+ <Mage_Core_Helper_Abstract/>
196
+ <Mage_Core_Controller_Varien_Router_Standard/>
197
+ <Mage_Core_Controller_Varien_Router_Default/>
198
+ <Mage_Core_Controller_Varien_Router_Admin/>
199
+ <Mage_Core_Controller_Varien_Router_Abstract/>
200
+ <Mage_Core_Controller_Varien_Front/>
201
+ <Mage_Core_Controller_Varien_Action/>
202
+ <Mage_Core_Controller_Response_Http/>
203
+ <Mage_Core_Controller_Request_Http/>
204
+ <Mage_Core_Controller_Front_Action/>
205
+ <Mage_Core_Block_Text_List/>
206
+ <Mage_Core_Block_Text/>
207
+ <Mage_Core_Block_Template/>
208
+ <Mage_Core_Block_Profiler/>
209
+ <Mage_Core_Block_Messages/>
210
+ <Mage_Core_Block_Abstract/>
211
+ <Mage_Eav_Model_Config/>
212
+ <Mage_Eav_Model_Entity/>
213
+ <Mage_Eav_Model_Entity_Abstract/>
214
+ <Mage_Eav_Model_Entity_Attribute/>
215
+ <Mage_Eav_Model_Entity_Attribute_Abstract/>
216
+ <Mage_Eav_Model_Entity_Attribute_Interface/>
217
+ <Mage_Eav_Model_Entity_Interface/>
218
+ <Mage_Eav_Model_Entity_Type/>
219
+ <Mage_Eav_Model_Resource_Entity_Attribute/>
220
+ <Mage_Eav_Model_Resource_Entity_Type/>
221
+ <Mage_Eav_Model_Resource_Entity_Attribute_Collection/>
222
+ <Mage_Eav_Model_Entity_Attribute_Backend_Default/>
223
+ <Mage_Eav_Model_Entity_Attribute_Backend_Datetime/>
224
+ <Mage_Eav_Model_Entity_Attribute_Backend_Time_Created/>
225
+ <Mage_Eav_Model_Entity_Attribute_Backend_Time_Updated/>
226
+ </default>
227
+
228
+ <cms>
229
+ <Mage_Page_Helper_Data/>
230
+ <Mage_Page_Helper_Layout/>
231
+ <Mage_Page_Model_Config/>
232
+ </cms>
233
+
234
+ <catalog>
235
+ <Mage_Catalog_Block_Breadcrumbs/>
236
+ <Mage_Catalog_Helper_Category_Flat/>
237
+ <Mage_Catalog_Helper_Output/>
238
+ <Mage_Catalog_Helper_Product_Flat/>
239
+ <Mage_Catalog_Model_Config/>
240
+ <Mage_Catalog_Model_Design/>
241
+ <Mage_Catalog_Model_Product/>
242
+ <Mage_Catalog_Model_Product_Status/>
243
+ <Mage_Catalog_Model_Product_Visibility/>
244
+ <Mage_Catalog_Model_Resource_Eav_Attribute/>
245
+ <Mage_Catalog_Model_Resource_Abstract/>
246
+ <Mage_Catalog_Model_Resource_Category_Flat/>
247
+ <Mage_Catalog_Model_Resource_Collection_Abstract/>
248
+ <Mage_Catalog_Model_Resource_Config/>
249
+ <Mage_Catalog_Model_Resource_Product/>
250
+ <Mage_Catalog_Model_Resource_Product_Collection/>
251
+ <Mage_Eav_Model_Entity_Collection_Abstract/>
252
+ <Mage_Eav_Model_Entity_Interface/>
253
+ <Mage_Eav_Model_Entity_Type/>
254
+ <Mage_Eav_Model_Resource_Entity_Attribute/>
255
+ <Mage_Eav_Model_Resource_Entity_Type/>
256
+ </catalog>
257
+
258
+ <checkout>
259
+ <Mage_CatalogIndex_Model_Resource_Abstract/>
260
+ <Mage_CatalogIndex_Model_Resource_Price/>
261
+ <Mage_CatalogIndex_Model_Price/>
262
+ <Mage_CatalogInventory_Model_Resource_Stock/>
263
+ <Mage_CatalogInventory_Model_Resource_Stock_Item/>
264
+ <Mage_CatalogInventory_Model_Resource_Stock_Item_Collection/>
265
+ <Mage_CatalogInventory_Model_Resource_Stock_Status/>
266
+ <Mage_CatalogInventory_Model_Observer/>
267
+ <Mage_CatalogInventory_Model_Stock/>
268
+ <Mage_CatalogInventory_Model_Stock_Item/>
269
+ <Mage_CatalogInventory_Model_Stock_Status/>
270
+ <Mage_CatalogRule_Helper_Data/>
271
+ <Mage_CatalogRule_Model_Resource_Rule/>
272
+ <Mage_CatalogRule_Model_Observer/>
273
+ <Mage_CatalogRule_Model_Rule_Condition_Product/>
274
+ <Mage_Catalog_Block_Product_Price/>
275
+ <Mage_Catalog_Helper_Product_Flat/>
276
+ <Mage_Catalog_Model_Config/>
277
+ <Mage_Catalog_Model_Product/>
278
+ <Mage_Catalog_Model_Product_Attribute_Backend_Media/>
279
+ <Mage_Catalog_Model_Product_Attribute_Backend_Price/>
280
+ <Mage_Catalog_Model_Product_Attribute_Backend_Startdate/>
281
+ <Mage_Catalog_Model_Product_Attribute_Backend_Tierprice/>
282
+ <Mage_Catalog_Model_Product_Attribute_Backend_Urlkey/>
283
+ <Mage_Catalog_Model_Product_Link/>
284
+ <Mage_Catalog_Model_Product_Media_Config/>
285
+ <Mage_Catalog_Model_Product_Option/>
286
+ <Mage_Catalog_Model_Product_Status/>
287
+ <Mage_Catalog_Model_Product_Type/>
288
+ <Mage_Catalog_Model_Product_Type_Abstract/>
289
+ <Mage_Catalog_Model_Product_Type_Price/>
290
+ <Mage_Catalog_Model_Product_Type_Simple/>
291
+ <Mage_Catalog_Model_Product_Url/>
292
+ <Mage_Catalog_Model_Product_Visibility/>
293
+ <Mage_Catalog_Model_Resource_Eav_Attribute/>
294
+ <Mage_Catalog_Model_Resource_Abstract/>
295
+ <Mage_Catalog_Model_Resource_Collection_Abstract/>
296
+ <Mage_Catalog_Model_Resource_Config/>
297
+ <Mage_Catalog_Model_Resource_Product/>
298
+ <Mage_Catalog_Model_Resource_Product_Attribute_Backend_Media/>
299
+ <Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice/>
300
+ <Mage_Catalog_Model_Resource_Product_Collection/>
301
+ <Mage_Catalog_Model_Resource_Product_Link_Product_Collection/>
302
+ <Mage_Catalog_Model_Resource_Product_Option/>
303
+ <Mage_Catalog_Model_Resource_Product_Option_Collection/>
304
+ <Mage_Checkout_Block_Cart/>
305
+ <Mage_Checkout_Block_Cart_Coupon/>
306
+ <Mage_Checkout_Block_Cart_Crosssell/>
307
+ <Mage_Checkout_Block_Cart_Item_Renderer/>
308
+ <Mage_Checkout_Block_Cart_Shipping/>
309
+ <Mage_Checkout_Block_Cart_Totals/>
310
+ <Mage_Checkout_Block_Multishipping_Link/>
311
+ <Mage_Checkout_Block_Onepage_Link/>
312
+ <Mage_Checkout_Block_Total_Default/>
313
+ <Mage_Checkout_Block_Total_Tax/>
314
+ <Mage_Checkout_Model_Observer/>
315
+ <Mage_Core_Block_Html_Select/>
316
+ <Mage_Core_Model_Date/>
317
+ <Mage_Core_Model_Encryption/>
318
+ <Mage_Customer_Model_Address_Abstract/>
319
+ <Mage_Customer_Model_Entity_Group/>
320
+ <Mage_Directory_Block_Data/>
321
+ <Mage_Directory_Helper_Data/>
322
+ <Mage_Directory_Model_Currency/>
323
+ <Mage_Directory_Model_Resource_Currency/>
324
+ <Mage_Directory_Model_Resource_Region/>
325
+ <Mage_Directory_Model_Region/>
326
+ <Mage_Eav_Model_Config/>
327
+ <Mage_Eav_Model_Entity/>
328
+ <Mage_Eav_Model_Entity_Attribute/>
329
+ <Mage_Eav_Model_Entity_Attribute_Backend_Abstract/>
330
+ <Mage_Eav_Model_Entity_Attribute_Backend_Array/>
331
+ <Mage_Eav_Model_Entity_Attribute_Backend_Interface/>
332
+ <Mage_Eav_Model_Entity_Attribute_Interface/>
333
+ <Mage_Eav_Model_Entity_Collection_Abstract/>
334
+ <Mage_Eav_Model_Entity_Interface/>
335
+ <Mage_Eav_Model_Entity_Type/>
336
+ <Mage_Eav_Model_Resource_Entity_Attribute/>
337
+ <Mage_Eav_Model_Resource_Entity_Type/>
338
+ <Mage_GiftMessage_Model_Entity_Attribute_Backend_Boolean_Config/>
339
+ <Mage_GiftMessage_Model_Observer/>
340
+ <Mage_GoogleCheckout_Block_Link/>
341
+ <Mage_GoogleCheckout_Helper_Data/>
342
+ <Mage_GoogleOptimizer_Block_Code_Conversion/>
343
+ <Mage_Reports_Model_Event_Observer/>
344
+ <Mage_Rule_Helper_Data/>
345
+ <Mage_Rule_Model_Condition_Abstract/>
346
+ <Mage_Rule_Model_Condition_Combine/>
347
+ <Mage_Rule_Model_Condition_Interface/>
348
+ <Mage_Rule_Model_Rule/>
349
+ <Mage_SalesRule_Helper_Data/>
350
+ <Mage_SalesRule_Model_Resource_Rule/>
351
+ <Mage_SalesRule_Model_Resource_Rule_Collection/>
352
+ <Mage_SalesRule_Model_Observer/>
353
+ <Mage_SalesRule_Model_Rule/>
354
+ <Mage_SalesRule_Model_Rule_Condition_Combine/>
355
+ <Mage_SalesRule_Model_Rule_Condition_Product/>
356
+ <Mage_SalesRule_Model_Rule_Condition_Product_Combine/>
357
+ <Mage_SalesRule_Model_Rule_Customer/>
358
+ <Mage_SalesRule_Model_Validator/>
359
+ <Mage_Sales_Helper_Data/>
360
+ <Mage_Sales_Model_Resource_Abstract/>
361
+ <Mage_Sales_Model_Resource_Quote/>
362
+ <Mage_Sales_Model_Resource_Quote_Address/>
363
+ <Mage_Sales_Model_Resource_Quote_Address_Collection/>
364
+ <Mage_Sales_Model_Resource_Quote_Address_Item/>
365
+ <Mage_Sales_Model_Resource_Quote_Address_Item_Collection/>
366
+ <Mage_Sales_Model_Resource_Quote_Address_Rate/>
367
+ <Mage_Sales_Model_Resource_Quote_Address_Rate_Collection/>
368
+ <Mage_Sales_Model_Resource_Quote_Item/>
369
+ <Mage_Sales_Model_Resource_Quote_Item_Collection/>
370
+ <Mage_Sales_Model_Resource_Quote_Item_Option/>
371
+ <Mage_Sales_Model_Resource_Quote_Item_Option_Collection/>
372
+ <Mage_Sales_Model_Quote/>
373
+ <Mage_Sales_Model_Quote_Address/>
374
+ <Mage_Sales_Model_Quote_Address_Item/>
375
+ <Mage_Sales_Model_Quote_Address_Rate/>
376
+ <Mage_Sales_Model_Quote_Address_Total/>
377
+ <Mage_Sales_Model_Quote_Address_Total_Abstract/>
378
+ <Mage_Sales_Model_Quote_Address_Total_Discount/>
379
+ <Mage_Sales_Model_Quote_Address_Total_Grand/>
380
+ <Mage_Sales_Model_Quote_Address_Total_Shipping/>
381
+ <Mage_Sales_Model_Quote_Address_Total_Subtotal/>
382
+ <Mage_Sales_Model_Quote_Address_Total_Tax/>
383
+ <Mage_Sales_Model_Quote_Config/>
384
+ <Mage_Sales_Model_Quote_Item/>
385
+ <Mage_Sales_Model_Quote_Item_Abstract/>
386
+ <Mage_Sales_Model_Quote_Item_Option/>
387
+ <Mage_Shipping_Model_Rate_Abstract/>
388
+ <Mage_Tax_Helper_Data/>
389
+ <Mage_Tax_Model_Calculation/>
390
+ <Mage_Tax_Model_Config/>
391
+ <Mage_Tax_Model_Resource_Calculation/>
392
+ <Mage_Tax_Model_Observer/>
393
+ <Varien_Crypt/>
394
+ <Varien_Crypt_Abstract/>
395
+ <Varien_Crypt_Mcrypt/>
396
+ <Zend_Currency/>
397
+ <Zend_Date/>
398
+ <Zend_Date_DateObject/>
399
+ <Zend_Locale/>
400
+ <Zend_Locale_Data/>
401
+ <Zend_Locale_Format/>
402
+ <Zend_Locale_Math/>
403
+ </checkout>
404
+ </includes>
405
+ </config>
app/code/core/Mage/Compiler/etc/config.xml ADDED
@@ -0,0 +1,87 @@
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Mage
23
+ * @package Mage_Compiler
24
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <config>
29
+ <modules>
30
+ <Mage_Compiler>
31
+ <version>1.6.0.0</version>
32
+ </Mage_Compiler>
33
+ </modules>
34
+ <global>
35
+ <models>
36
+ <compiler>
37
+ <class>Mage_Compiler_Model</class>
38
+ <resourceModel>compiler_resource</resourceModel>
39
+ </compiler>
40
+ <compiler_resource>
41
+ <class>Mage_Compiler_Model_Resource</class>
42
+ <deprecatedNode>compiler_mysql4</deprecatedNode>
43
+ <entities>
44
+ <configuration>
45
+ <table>compiler_configuration</table>
46
+ </configuration>
47
+ </entities>
48
+ </compiler_resource>
49
+ </models>
50
+ <resources>
51
+ <compiler_setup>
52
+ <setup>
53
+ <module>Mage_Compiler</module>
54
+ </setup>
55
+ </compiler_setup>
56
+ </resources>
57
+ </global>
58
+ <admin>
59
+ <routers>
60
+ <adminhtml>
61
+ <args>
62
+ <modules>
63
+ <Mage_Compiler before="Mage_Adminhtml">Mage_Compiler_Adminhtml</Mage_Compiler>
64
+ </modules>
65
+ </args>
66
+ </adminhtml>
67
+ </routers>
68
+ </admin>
69
+ <adminhtml>
70
+ <translate>
71
+ <modules>
72
+ <Mage_Compiler>
73
+ <files>
74
+ <default>Mage_Compiler.csv</default>
75
+ </files>
76
+ </Mage_Compiler>
77
+ </modules>
78
+ </translate>
79
+ <layout>
80
+ <updates>
81
+ <compiler>
82
+ <file>compiler.xml</file>
83
+ </compiler>
84
+ </updates>
85
+ </layout>
86
+ </adminhtml>
87
+ </config>
app/design/adminhtml/default/default/layout/compiler.xml ADDED
@@ -0,0 +1,35 @@
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category design
23
+ * @package default_default
24
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+
29
+ <layout>
30
+ <adminhtml_compiler_process_index>
31
+ <reference name="content">
32
+ <block type="compiler/process" name="compiler_process" template="compiler/process.phtml"></block>
33
+ </reference>
34
+ </adminhtml_compiler_process_index>
35
+ </layout>
app/design/adminhtml/default/default/template/compiler/process.phtml ADDED
@@ -0,0 +1,94 @@
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
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@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <div class="content-header">
28
+ <table cellspacing="0">
29
+ <tr>
30
+ <td style="width:50%;"><h3 class="icon-head head-compilation"><?php echo $this->getHeader() ?></h3></td>
31
+ <td class="form-buttons">
32
+ <?php if ($this->canRunCompilation()): ?>
33
+ <?php echo $this->getChangeStatusButtonHtml() ?>
34
+ <?php echo $this->getRunButtonHtml() ?>
35
+ <?php endif;?>
36
+ </td>
37
+ </tr>
38
+ </table>
39
+ </div>
40
+ <div class="entry-edit">
41
+ <form name="compilation_form" id="compilation_form" method="post" action="<?php echo $this->getRunFormAction(); ?>">
42
+ <?php echo $this->getBlockHtml('formkey')?>
43
+ <?php if (!$this->canRunCompilation()): ?>
44
+ <div id="messages"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
45
+ <?php endif;?>
46
+
47
+ <div class="entry-edit-head">
48
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('compiler')->__('Compilation State') ?></h4>
49
+ </div>
50
+ <fieldset>
51
+ <legend><?php echo Mage::helper('compiler')->__('Compilation State') ?></legend>
52
+ <table cellspacing="0" class="form-list" style="width:100%">
53
+ <tr>
54
+ <td class="label"><label ><?php echo Mage::helper('compiler')->__('Compiler Status')?></label></td>
55
+ <td class="value">
56
+ <strong><?php echo $this->getCompilerStatus()?></strong>
57
+ </td>
58
+ </tr>
59
+ <tr>
60
+ <td class="label"><label ><?php echo Mage::helper('compiler')->__('Compilation State')?></label></td>
61
+ <td class="value">
62
+ <strong><?php echo $this->getCompilerState()?></strong>
63
+ </td>
64
+ </tr>
65
+ <tr>
66
+ <td class="label"><label ><?php echo Mage::helper('compiler')->__('Collected Files Count')?></label></td>
67
+ <td class="value">
68
+ <strong><?php echo $this->getCollectedFilesCount() ?></strong>
69
+ </td>
70
+ </tr>
71
+ <tr>
72
+ <td class="label"><label ><?php echo Mage::helper('compiler')->__('Compiled Scopes Count')?></label></td>
73
+ <td class="value">
74
+ <strong><?php echo $this->getCompiledFilesCount() ?></strong>
75
+ </td>
76
+ </tr>
77
+ <tr>
78
+ <td class="label"><label ><?php echo Mage::helper('compiler')->__('Scopes Compilation Settings')?></label></td>
79
+ <td class="value">
80
+ <?php foreach($this->getCompilationList() as $_frontName => $_classNames) : ?>
81
+ <p>
82
+ <label><strong><?php echo $_frontName ?></strong></label><br />
83
+ <textarea style="width:70%" readonly="readonly" cols="5" rows="3"><?php echo $this->arrToSting($_classNames)?></textarea>
84
+ </p>
85
+ <?php endforeach; ?>
86
+ </td>
87
+ </tr>
88
+ </table>
89
+ </fieldset>
90
+ </form>
91
+ </div>
92
+ <script type="text/javascript">
93
+ compilationForm = new varienForm('compilation_form');
94
+ </script>
app/etc/modules/Mage_Compiler.xml ADDED
@@ -0,0 +1,38 @@
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category Mage
23
+ * @package Mage_Compiler
24
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <config>
29
+ <modules>
30
+ <Mage_Compiler>
31
+ <active>true</active>
32
+ <codePool>core</codePool>
33
+ <depends>
34
+ <Mage_Core />
35
+ </depends>
36
+ </Mage_Compiler>
37
+ </modules>
38
+ </config>
app/locale/en_US/Mage_Compiler.csv ADDED
@@ -0,0 +1,21 @@
1
+ "Collected Files Count","Collected Files Count"
2
+ "Compilation","Compilation"
3
+ "Compilation State","Compilation State"
4
+ "Compilation error","Compilation error"
5
+ "Compiled","Compiled"
6
+ "Compiled Scopes Count","Compiled Scopes Count"
7
+ "Compiler Status","Compiler Status"
8
+ "Compiler include path is disabled.","Compiler include path is disabled."
9
+ "Compiler include path is enabled.","Compiler include path is enabled."
10
+ "Directory ""%s"" must be writeable","Directory ""%s"" must be writeable"
11
+ "Disable","Disable"
12
+ "Disabled","Disabled"
13
+ "Enable","Enable"
14
+ "Enabled","Enabled"
15
+ "File ""%s"" must be writeable","File ""%s"" must be writeable"
16
+ "Not Compiled","Not Compiled"
17
+ "Run Compilation Process","Run Compilation Process"
18
+ "Scopes Compilation Settings","Scopes Compilation Settings"
19
+ "System","System"
20
+ "The compilation has completed.","The compilation has completed."
21
+ "Tools","Tools"
includes/.htaccess ADDED
@@ -0,0 +1,2 @@
1
+ Order deny,allow
2
+ Deny from all
includes/config.php ADDED
@@ -0,0 +1,29 @@
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
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@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage
23
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ #define('COMPILER_INCLUDE_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'src');
29
+ #define('COMPILER_COLLECT_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'stat');
package.xml ADDED
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Mage_Compiler</name>
4
+ <version>1.6.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This module compiles all files of a Magento installation and creates a single include path to increase performance</summary>
10
+ <description>This module compiles all files of a Magento installation and creates a single include path to increase performance</description>
11
+ <notes>1.6.0.0</notes>
12
+ <authors><author><name>Magento Core Team</name><user>core</user><email>core@magentocommerce.com</email></author></authors>
13
+ <date>2011-08-18</date>
14
+ <time>08:29:39</time>
15
+ <contents><target name="magecore"><dir name="Mage"><dir name="Compiler"><dir name="Block"><file name="Process.php" hash="f43427a957edc5e10aff6b7a2cd527c4"/></dir><dir name="Helper"><file name="Data.php" hash="0e5ed3961900e75c6abf5ea10bc6ba75"/></dir><dir name="Model"><file name="Process.php" hash="7717b2ba1552b1a42207997bb3ab40f7"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Compiler"><file name="ProcessController.php" hash="7ab60831fb7d73ce798c8334d2f8a4d7"/></dir></dir><file name="ProcessController.php" hash="562d0879a4f351d8af62a8ad7ade69ed"/></dir><dir name="etc"><file name="adminhtml.xml" hash="9d83dbc1b48a4bded5789e3ae3ece34b"/><file name="compilation.xml" hash="734e7d287c52b49d9d6735c6c5f6fdd8"/><file name="config.xml" hash="e164f5f94e30c784b1e176b5cfc78d0d"/></dir></dir></dir></target><target name="mage"><dir name="includes"><file name="config.php" hash="8400dea44d09cc57209d8a64cdd207d7"/><file name=".htaccess" hash="72617d60821288133a367f70bf39ad93"/><file name=".htaccess" hash="72617d60821288133a367f70bf39ad93"/></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_Compiler.xml" hash="eb21902967e71f8c20ad0dc640624c6c"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="compiler.xml" hash="8fa81d7cbc1328b9b2d39031a3ef3616"/></dir><dir name="template"><dir name="compiler"><file name="process.phtml" hash="baf1f496c7bc367c27294896d6c1bfa1"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Mage_Compiler.csv" hash="caa1d67e6c508421a8c8c234ae204c5d"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.6.1.0</max></package><package><name>Mage_Core_Adminhtml</name><channel>community</channel><min>1.6.0.0</min><max>1.6.1.0</max></package></required></dependencies>
18
+ </package>