Skip to content

Commit 5696229

Browse files
committed
Progress towards v3 (~3.3).
1 parent cc62a90 commit 5696229

16 files changed

+2060
-108
lines changed

readme.ar.md

Lines changed: 133 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,16 @@ https://github.com/phpMussel/Examples
112112
<div dir="rtl">ستضيف المقتطفات أدناه حسابًا جديدًا للواجهة الأمامية باسم المستخدم "admin" وكلمة المرور "password".<br /><br /></div>
113113

114114
<div dir="rtl">لملفات INI:<br /><br /></div>
115-
```
115+
116+
```INI
116117
[user.admin]
117118
password='$2y$10$FPF5Im9MELEvF5AYuuRMSO.QKoYVpsiu1YU9aDClgrU57XtLof/dK'
118119
permissions='1'
119120
```
120121

121122
<div dir="rtl">لملفات YML:<br /><br /></div>
122-
```
123+
124+
```YAML
123125
user.admin:
124126
password: "$2y$10$FPF5Im9MELEvF5AYuuRMSO.QKoYVpsiu1YU9aDClgrU57XtLof/dK"
125127
permissions: 1
@@ -171,7 +173,135 @@ public function __construct(
171173
public function __construct(\phpMussel\Core\Loader &$Loader)
172174
```
173175

174-
#### <div dir="rtl">٣.٤ API الماسح</div>
176+
#### <div dir="rtl">٣.٢ المسح التلقائي لتحميل الملف</div>
177+
178+
<div dir="rtl">لإنشاء معالج التحميل:<br /><br /></div>
179+
180+
```PHP
181+
$Web = new \phpMussel\Web\Web($Loader, $Scanner);
182+
```
183+
184+
<div dir="rtl">لفحص تحميلات الملفات:<br /><br /></div>
185+
186+
```PHP
187+
$Web->scan();
188+
```
189+
190+
<div dir="rtl">بشكل اختياري ، يمكن أن يحاول phpMussel إصلاح أسماء التحميلات في حالة وجود خطأ ما ، إذا كنت ترغب في:<br /><br /></div>
191+
192+
```PHP
193+
$Web->demojibakefier();
194+
```
195+
196+
<div dir="rtl">كمثال كامل:<br /><br /></div>
197+
198+
```PHP
199+
<?php
200+
// Path to vendor directory.
201+
$Vendor = __DIR__ . DIRECTORY_SEPARATOR . 'vendor';
202+
203+
// Composer's autoloader.
204+
require $Vendor . DIRECTORY_SEPARATOR . 'autoload.php';
205+
206+
$Loader = new \phpMussel\Core\Loader();
207+
$Scanner = new \phpMussel\Core\Scanner($Loader);
208+
$Web = new \phpMussel\Web\Web($Loader, $Scanner);
209+
$Loader->Events->addHandler('sendMail', new \phpMussel\PHPMailer\Linker($Loader));
210+
211+
// Scans file uploads (execution terminates here if the scan finds anything).
212+
$Web->scan();
213+
214+
// Fixes possible corrupted file upload names (Warning: modifies the content of $_FILES).
215+
$Web->demojibakefier();
216+
217+
// Cleanup.
218+
unset($Web, $Scanner, $Loader);
219+
220+
?><html>
221+
<form enctype="multipart/form-data" name="upload" action="" method="post">
222+
<div class="spanner">
223+
<input type="file" name="upload_test[]" value="" />
224+
<input type="submit" value="OK" />
225+
</div>
226+
</form>
227+
</html>
228+
```
229+
230+
<div dir="rtl">عند محاولة تحميل الملف <code dir="ltr">ascii_standard_testfile.txt</code> (يتم توفير عينة حميدة لغرض وحيد هو اختبار phpMussel):<br /><br /></div>
231+
232+
![لقطة شاشة](https://raw.githubusercontent.com/phpMussel/extras/master/screenshots/web-v3.0.0-alpha2.png)
233+
234+
#### <div dir="rtl">٣.٣ وضع CLI</div>
235+
236+
<div dir="rtl">لإنشاء معالج CLI:<br /><br /></div>
237+
238+
```PHP
239+
$CLI = new \phpMussel\CLI\CLI($Loader, $Scanner);
240+
```
241+
242+
<div dir="rtl">كمثال كامل:<br /><br /></div>
243+
244+
```PHP
245+
<?php
246+
// Path to vendor directory.
247+
$Vendor = __DIR__ . DIRECTORY_SEPARATOR . 'vendor';
248+
249+
// Composer's autoloader.
250+
require $Vendor . DIRECTORY_SEPARATOR . 'autoload.php';
251+
252+
$Loader = new \phpMussel\Core\Loader();
253+
$Scanner = new \phpMussel\Core\Scanner($Loader);
254+
$CLI = new \phpMussel\CLI\CLI($Loader, $Scanner);
255+
256+
unset($CLI, $Scanner, $Loader);
257+
```
258+
259+
<div dir="rtl">لقطة شاشة:<br /><br /></div>
260+
261+
![لقطة شاشة:](https://raw.githubusercontent.com/phpMussel/extras/master/screenshots/cli-v3.0.0-alpha2.png)
262+
263+
#### <div dir="rtl">٣.٤ الواجهة الأمامية</div>
264+
265+
<div dir="rtl">لإنشاء الواجهة الأمامية:<br /><br /></div>
266+
267+
```PHP
268+
$FrontEnd = new \phpMussel\FrontEnd\FrontEnd($Loader, $Scanner);
269+
```
270+
271+
<div dir="rtl">كمثال كامل:<br /><br /></div>
272+
273+
```PHP
274+
<?php
275+
// Path to vendor directory.
276+
$Vendor = __DIR__ . DIRECTORY_SEPARATOR . 'vendor';
277+
278+
// Composer's autoloader.
279+
require $Vendor . DIRECTORY_SEPARATOR . 'autoload.php';
280+
281+
$Loader = new \phpMussel\Core\Loader();
282+
$Scanner = new \phpMussel\Core\Scanner($Loader);
283+
$FrontEnd = new \phpMussel\FrontEnd\FrontEnd($Loader, $Scanner);
284+
$Web = new \phpMussel\Web\Web($Loader, $Scanner);
285+
$Loader->Events->addHandler('sendMail', new \phpMussel\PHPMailer\Linker($Loader));
286+
287+
// Scans file uploads (execution terminates here if the scan finds anything).
288+
$Web->scan();
289+
290+
// Fixes possible corrupted file upload names (Warning: modifies the content of $_FILES).
291+
$Web->demojibakefier();
292+
293+
// Load the front-end.
294+
$FrontEnd->view();
295+
296+
// Cleanup.
297+
unset($Web, $FrontEnd, $Scanner, $Loader);
298+
```
299+
300+
<div dir="rtl">لقطة شاشة:<br /><br /></div>
301+
302+
![لقطة شاشة](https://raw.githubusercontent.com/phpMussel/extras/master/screenshots/frontend-v3.0.0-alpha2.png)
303+
304+
#### <div dir="rtl">٣.٧ API الماسح</div>
175305

176306
النتائج | وصف
177307
--:|--:

readme.de.md

Lines changed: 134 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,16 @@ Wenn Sie das phpMussel-Frontend verwenden möchten, können Sie alles auf das Fr
108108
In den folgenden Auszügen wird ein neues Konto im Front-End mit dem Benutzernamen "admin" und dem Kennwort "password" hinzugefügt.
109109

110110
Für INI-Dateien:
111-
```
111+
112+
```INI
112113
[user.admin]
113114
password='$2y$10$FPF5Im9MELEvF5AYuuRMSO.QKoYVpsiu1YU9aDClgrU57XtLof/dK'
114115
permissions='1'
115116
```
116117

117118
Für YML-Dateien:
118-
```
119+
120+
```YAML
119121
user.admin:
120122
password: "$2y$10$FPF5Im9MELEvF5AYuuRMSO.QKoYVpsiu1YU9aDClgrU57XtLof/dK"
121123
permissions: 1
@@ -167,7 +169,135 @@ Der Konstruktor für den Scanner akzeptiert nur einen Parameter und ist obligato
167169
public function __construct(\phpMussel\Core\Loader &$Loader)
168170
```
169171

170-
#### 3.4 SCANNER-API
172+
#### 3.2 AUTOMATISCHES SCANNEN DES DATEI-UPLOADS
173+
174+
Instanziieren des Upload-Handlers:
175+
176+
```PHP
177+
$Web = new \phpMussel\Web\Web($Loader, $Scanner);
178+
```
179+
180+
Scannen von Datei-Uploads:
181+
182+
```PHP
183+
$Web->scan();
184+
```
185+
186+
Optional kann phpMussel versuchen, die Namen von Uploads zu reparieren, falls etwas nicht stimmt, wenn Sie möchten:
187+
188+
```PHP
189+
$Web->demojibakefier();
190+
```
191+
192+
Als vollständiges Beispiel:
193+
194+
```PHP
195+
<?php
196+
// Path to vendor directory.
197+
$Vendor = __DIR__ . DIRECTORY_SEPARATOR . 'vendor';
198+
199+
// Composer's autoloader.
200+
require $Vendor . DIRECTORY_SEPARATOR . 'autoload.php';
201+
202+
$Loader = new \phpMussel\Core\Loader();
203+
$Scanner = new \phpMussel\Core\Scanner($Loader);
204+
$Web = new \phpMussel\Web\Web($Loader, $Scanner);
205+
$Loader->Events->addHandler('sendMail', new \phpMussel\PHPMailer\Linker($Loader));
206+
207+
// Scans file uploads (execution terminates here if the scan finds anything).
208+
$Web->scan();
209+
210+
// Fixes possible corrupted file upload names (Warning: modifies the content of $_FILES).
211+
$Web->demojibakefier();
212+
213+
// Cleanup.
214+
unset($Web, $Scanner, $Loader);
215+
216+
?><html>
217+
<form enctype="multipart/form-data" name="upload" action="" method="post">
218+
<div class="spanner">
219+
<input type="file" name="upload_test[]" value="" />
220+
<input type="submit" value="OK" />
221+
</div>
222+
</form>
223+
</html>
224+
```
225+
226+
*Beim Uploaden von `ascii_standard_testfile.txt`, einem harmlosen Beispiel das ausschließlich zum Testen von phpMussel bereitgestellt wird:
227+
228+
![Screenshot](https://raw.githubusercontent.com/phpMussel/extras/master/screenshots/web-v3.0.0-alpha2.png)
229+
230+
#### 3.3 CLI-MODUS
231+
232+
Instanziieren des CLI-Handlers:
233+
234+
```PHP
235+
$CLI = new \phpMussel\CLI\CLI($Loader, $Scanner);
236+
```
237+
238+
Als vollständiges Beispiel:
239+
240+
```PHP
241+
<?php
242+
// Path to vendor directory.
243+
$Vendor = __DIR__ . DIRECTORY_SEPARATOR . 'vendor';
244+
245+
// Composer's autoloader.
246+
require $Vendor . DIRECTORY_SEPARATOR . 'autoload.php';
247+
248+
$Loader = new \phpMussel\Core\Loader();
249+
$Scanner = new \phpMussel\Core\Scanner($Loader);
250+
$CLI = new \phpMussel\CLI\CLI($Loader, $Scanner);
251+
252+
unset($CLI, $Scanner, $Loader);
253+
```
254+
255+
*Screenshot:*
256+
257+
![Screenshot](https://raw.githubusercontent.com/phpMussel/extras/master/screenshots/cli-v3.0.0-alpha2.png)
258+
259+
#### 3.4 FRONTEND
260+
261+
Instanziieren des Frontends:
262+
263+
```PHP
264+
$FrontEnd = new \phpMussel\FrontEnd\FrontEnd($Loader, $Scanner);
265+
```
266+
267+
Als vollständiges Beispiel:
268+
269+
```PHP
270+
<?php
271+
// Path to vendor directory.
272+
$Vendor = __DIR__ . DIRECTORY_SEPARATOR . 'vendor';
273+
274+
// Composer's autoloader.
275+
require $Vendor . DIRECTORY_SEPARATOR . 'autoload.php';
276+
277+
$Loader = new \phpMussel\Core\Loader();
278+
$Scanner = new \phpMussel\Core\Scanner($Loader);
279+
$FrontEnd = new \phpMussel\FrontEnd\FrontEnd($Loader, $Scanner);
280+
$Web = new \phpMussel\Web\Web($Loader, $Scanner);
281+
$Loader->Events->addHandler('sendMail', new \phpMussel\PHPMailer\Linker($Loader));
282+
283+
// Scans file uploads (execution terminates here if the scan finds anything).
284+
$Web->scan();
285+
286+
// Fixes possible corrupted file upload names (Warning: modifies the content of $_FILES).
287+
$Web->demojibakefier();
288+
289+
// Load the front-end.
290+
$FrontEnd->view();
291+
292+
// Cleanup.
293+
unset($Web, $FrontEnd, $Scanner, $Loader);
294+
```
295+
296+
*Screenshot:*
297+
298+
![Screenshot](https://raw.githubusercontent.com/phpMussel/extras/master/screenshots/frontend-v3.0.0-alpha2.png)
299+
300+
#### 3.5 SCANNER-API
171301

172302
Ergebnisse | Beschreibung
173303
--:|:--
@@ -182,7 +312,7 @@ Ergebnisse | Beschreibung
182312

183313
*Siehe auch: [Wie man spezifische Details über Dateien zugreifen, wenn sie gescannt werden?](#SCAN_DEBUGGING)*
184314

185-
#### 3.5 ZWEI-FAKTOR-AUTHENTIFIZIERUNG
315+
#### 3.6 ZWEI-FAKTOR-AUTHENTIFIZIERUNG
186316

187317
Es ist möglich, das Frontend sicherer zu machen, indem Sie die Zwei-Faktor-Authentifizierung ("2FA") aktivieren. Wenn Sie sich bei einem 2FA-aktivierten Konto eingeloggt, wird eine E-Mail an die mit diesem Konto verknüpfte E-Mail-Adresse gesendet. Diese E-Mail enthält einen "2FA-Code", den der Nutzer zusätzlich zum Benutzernamen und Passwort eingeben muss, um sich mit diesem Konto einloggen zu können. Das bedeutet, dass das Erlangen eines Kontopassworts nicht ausreicht, damit sich ein Hacker oder potentieller Angreifer in diesem Konto einloggen kann, da sie auch bereits Zugriff auf die mit diesem Konto verknüpfte E-Mail-Adresse haben müssen, um den mit der Sitzung verbundenen 2FA-Code empfangen und verwenden zu können, dadurch wird das Frontend sicherer.
188318

readme.en.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,16 @@ If you want to use the phpMussel front-end, you can configure everything from th
108108
The below excerpts will add a new account to the front-end with the username "admin", and the password "password".
109109

110110
For INI files:
111-
```
111+
112+
```INI
112113
[user.admin]
113114
password='$2y$10$FPF5Im9MELEvF5AYuuRMSO.QKoYVpsiu1YU9aDClgrU57XtLof/dK'
114115
permissions='1'
115116
```
116117

117118
For YML files:
118-
```
119+
120+
```YAML
119121
user.admin:
120122
password: "$2y$10$FPF5Im9MELEvF5AYuuRMSO.QKoYVpsiu1YU9aDClgrU57XtLof/dK"
121123
permissions: 1
@@ -254,7 +256,7 @@ unset($CLI, $Scanner, $Loader);
254256

255257
![Screenshot](https://raw.githubusercontent.com/phpMussel/extras/master/screenshots/cli-v3.0.0-alpha2.png)
256258

257-
#### 3.3 FRONT-END
259+
#### 3.4 FRONT-END
258260

259261
To instantiate the front-end:
260262

@@ -295,7 +297,7 @@ unset($Web, $FrontEnd, $Scanner, $Loader);
295297

296298
![Screenshot](https://raw.githubusercontent.com/phpMussel/extras/master/screenshots/frontend-v3.0.0-alpha2.png)
297299

298-
#### 3.4 SCANNER API
300+
#### 3.5 SCANNER API
299301

300302
You can also implement the phpMussel scanner API within other programs and scripts, if you'd like.
301303

@@ -447,7 +449,7 @@ Fri, 17 Jul 2020 18:50:50 +0800 Finished.
447449

448450
*See also: [How to access specific details about files when they are scanned?](#SCAN_DEBUGGING)*
449451

450-
#### 3.5 TWO-FACTOR AUTHENTICATION
452+
#### 3.6 TWO-FACTOR AUTHENTICATION
451453

452454
It's possible to make the front-end more secure by enabling two-factor authentication ("2FA"). When logging into a 2FA-enabled account, an email is sent to the email address associated with that account. This email contains a "2FA code", which the user must then enter, in addition to the username and password, in order to be able to log in using that account. This means that obtaining an account password would not be enough for any hacker or potential attacker to be able to log into that account, as they would also need to already have access to the email address associated with that account in order to be able to receive and utilise the 2FA code associated with the session, thus making the front-end more secure.
453455

@@ -460,7 +462,7 @@ Next, you'll need to associate an email address with an account, so that phpMuss
460462

461463
### 4. <a name="SECTION4"></a>EXTENDING PHPMUSSEL
462464

463-
phpMussel is designed with extensibility in mind. Pull requests to any of the repositories at the phpMussel organisation, and [contributing](https://github.com/phpMussel/.github/blob/master/CONTRIBUTING.md) in general, are always welcome. However, if you need to modify or extend phpMussel in ways which aren't suitable for contributing back those particular repositories, that is definitely possible to do (e.g., for modifications or extensions which are specific to your particular implementation, which can't be publicised due to confidentiality or privacy needs at your organisational, or which might be prefereably publicised at their own repository, such as for plugins and new Composer packages which require phpMussel).
465+
phpMussel is designed with extensibility in mind. Pull requests to any of the repositories at the phpMussel organisation, and [contributions](https://github.com/phpMussel/.github/blob/master/CONTRIBUTING.md) in general, are always welcome. However, if you need to modify or extend phpMussel in ways which aren't suitable for contributing back those particular repositories, that is definitely possible to do (e.g., for modifications or extensions which are specific to your particular implementation, which can't be publicised due to confidentiality or privacy needs at your organisation, or which might be preferably publicised at their own repository, such as for plugins and new Composer packages which require phpMussel).
464466

465467
Since v3, all phpMussel functionality exists as classes, which means that in some cases, the [object inheritance](https://www.php.net/manual/en/language.oop5.inheritance.php) mechanisms provided by PHP could be an easy and appropriate way to extend phpMussel.
466468

0 commit comments

Comments
 (0)