File tree 5 files changed +41
-12
lines changed
lib/internal/Magento/Framework
5 files changed +41
-12
lines changed Original file line number Diff line number Diff line change 31
31
// Sets default autoload mappings, may be overridden in Bootstrap::create
32
32
\Magento \Framework \App \Bootstrap::populateAutoloader (BP , []);
33
33
34
- require_once BP . '/app/functions.php ' ;
35
-
36
34
/* Custom umask value may be provided in optional mage_umask file in root */
37
35
$ umaskFile = BP . '/magento_umask ' ;
38
36
$ mask = file_exists ($ umaskFile ) ? octdec (file_get_contents ($ umaskFile )) : 002 ;
Original file line number Diff line number Diff line change 6
6
7
7
/**
8
8
* Create value-object \Magento\Framework\Phrase
9
- *
9
+ * @deprecated The global function __() is now loaded via Magento Framework, the below require is only
10
+ * for backwards compatibility reasons and this file will be removed in a future version
11
+ * @see Magento\Framework\Phrase\__.php
12
+ * @SuppressWarnings(PHPMD.ShortMethodName)
10
13
* @return \Magento\Framework\Phrase
11
14
*/
12
- function __ ()
13
- {
14
- $ argc = func_get_args ();
15
+ if (!function_exists ('__ ' )) {
16
+ function __ ()
17
+ {
18
+ $ argc = func_get_args ();
15
19
16
- $ text = array_shift ($ argc );
17
- if (!empty ($ argc ) && is_array ($ argc [0 ])) {
18
- $ argc = $ argc [0 ];
19
- }
20
+ $ text = array_shift ($ argc );
21
+ if (!empty ($ argc ) && is_array ($ argc [0 ])) {
22
+ $ argc = $ argc [0 ];
23
+ }
20
24
21
- return new \Magento \Framework \Phrase ($ text , $ argc );
25
+ return new \Magento \Framework \Phrase ($ text , $ argc );
26
+ }
22
27
}
Original file line number Diff line number Diff line change 11
11
}
12
12
13
13
require_once __DIR__ . '/autoload.php ' ;
14
- require BP . '/app/functions.php ' ;
15
14
16
15
setCustomErrorHandler ();
17
16
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ declare (strict_types=1 );
7
+
8
+ /**
9
+ * Create value-object \Magento\Framework\Phrase
10
+ * @SuppressWarnings(PHPMD.ShortMethodName)
11
+ * @return \Magento\Framework\Phrase
12
+ */
13
+ function __ ()
14
+ {
15
+ $ argc = func_get_args ();
16
+
17
+ $ text = array_shift ($ argc );
18
+ if (!empty ($ argc ) && is_array ($ argc [0 ])) {
19
+ $ argc = $ argc [0 ];
20
+ }
21
+
22
+ return new \Magento \Framework \Phrase ($ text , $ argc );
23
+ }
Original file line number Diff line number Diff line change 7
7
use \Magento \Framework \Component \ComponentRegistrar ;
8
8
9
9
ComponentRegistrar::register (ComponentRegistrar::LIBRARY , 'magento/framework ' , __DIR__ );
10
+
11
+ if (!function_exists ('__ ' )) {
12
+ require 'Phrase/__.php ' ;
13
+ }
You can’t perform that action at this time.
0 commit comments