質問するログイン新規登録

質問編集履歴

2

d3r

2018/06/24 17:28

投稿

earnest_gay
earnest_gay

スコア615

title CHANGED
File without changes
body CHANGED
@@ -98,6 +98,7 @@
98
98
 
99
99
 
100
100
  ちょっとだけ近づいてきたけどこれじゃ無限ループになってしまう。。。
101
+ プロパティーにflag的なものは持たせたくない。
101
102
  ```
102
103
  public static function changingTheOrderOfCoreFiles($fullPathFiles)
103
104
  {

1

c3r

2018/06/24 17:28

投稿

earnest_gay
earnest_gay

スコア615

title CHANGED
File without changes
body CHANGED
@@ -94,4 +94,36 @@
94
94
  }
95
95
  return $getFiles;
96
96
  }
97
+ ```
98
+
99
+
100
+ ちょっとだけ近づいてきたけどこれじゃ無限ループになってしまう。。。
101
+ ```
102
+ public static function changingTheOrderOfCoreFiles($fullPathFiles)
103
+ {
104
+ $getFiles = array();
105
+ foreach ($fullPathFiles as $fullPathFile) {
106
+
107
+ $fileName = mb_strtolower(self::getFileName($fullPathFile));
108
+ // ファイル名に'Front or Admin' が含まれておらず、 'Base'は含まれているか?
109
+ if (
110
+ (strpos($fileName, mb_strtolower(self::FRONT_IDENTIFIER)) === false ||
111
+ strpos($fileName, mb_strtolower(self::ADMIN_IDENTIFIER)) === false
112
+ )
113
+ && strpos($fileName, mb_strtolower(self::BASE_IDENTIFIER)) !== false
114
+ ) {
115
+ $getFiles[] = $fullPathFile;
116
+ }
117
+ // ファイル名に'Front or Admin' が含まれいて、 'Base'も含まれているか?
118
+ if (
119
+ (strpos($fileName, mb_strtolower(self::FRONT_IDENTIFIER)) !== false ||
120
+ strpos($fileName, mb_strtolower(self::ADMIN_IDENTIFIER)) !== false
121
+ )
122
+ && strpos($fileName, mb_strtolower(self::BASE_IDENTIFIER)) !== false
123
+ ) {
124
+ $getFiles = array_merge($getFiles, self::changingTheOrderOfCoreFiles(array($fullPathFile)));
125
+ }
126
+ }
127
+ return $getFiles;
128
+ }
97
129
  ```