-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Namespace-Angleichng an den FOR-Standard * Namespace-Anpassung auch für den CLI-Command * Der Format-Parameter bei den Formattern ist eher verwirrend. Nur weil in den EXIF-Daten z.B. als Auslösezeit 0.025 (wäre Format RAW). Das will man das nicht so ausgeben. Als Angabe erwartet man 1/40 (Format READABLE). Wozu auch den Parameter mitschleifen, wenn er meistens gar nicht genutzt wird? (wie z.B. bei den GEO-Daten) Wird also nicht gebraucht. * Deprecation Warnung optimieren. a) War bisher viel zu unübersichtlich. b) Wurde auf eine Verwendung innerhalb des Addons verwiesen. Der Ort sollte die erste Stelle außerhalb sein. Also da wo der Benutzer den Code schreibt * Deprecations nicht als Attribut einsetzen * null-Parameter, gefunden via phpunit * Autoload callback ist eine void-Funktion. * FormatInterface ist eigentlich eine Basis-Klasse. Also wäre FormatBase der bessere Name. * Da FormatBase noch nicht verwendet werden kann, kann dort auch die neue API komplett umgesetzt sein. Das alte FormartInterface muss es erstmal weiter bis v4 unterstützen * Echtes FormtterInterface als alternative zur abstrakten Klasse. Vorteil: Das Daten-Array kann vom Entwickler selbst bestimmt werden. * Bugfix: Fehlerhafte Anzeigen, bei Belichtungszeiten über 1 sek. Fehlerhafte Beispiele: "1/1 s" statt "1 s" "13/1 s" statt "13 s" "3/5 s" statt "0,6 s" "1/2 s" statt "0,5 s" * Formatter für Geodaten in Grad-Schreibweise * Version aus Datei-Kommentaren entfernen, das hat mit der Realität kaum was zu tun * phpUnit-Dateien ausschließen * Fehlerbereinigung mit phpUnit * phpStan
- Loading branch information
Showing
34 changed files
with
793 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.phpunit.cache | ||
_docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
<?php | ||
|
||
use FriendsOfRedaxo\addon\MediapoolExif\MediapoolExif; | ||
use FriendsOfRedaxo\MediapoolExif; | ||
|
||
spl_autoload_register(['FriendsOfRedaxo\\MediapoolExif\\Autoload', 'autoload'], true, true); // remove in v4 | ||
|
||
class_alias(MediapoolExif\Exception\InvalidClassException::class, 'FriendsOfRedaxo\\addon\\MediapoolExif\\Exception\\InvalidClassException');// remove in v4 | ||
class_alias(MediapoolExif\Exception\InvalidFormatExcption::class, 'FriendsOfRedaxo\\addon\\MediapoolExif\\Exception\\InvalidFormatExcption');// remove in v4 | ||
class_alias(MediapoolExif\Exception\IptcException::class, 'FriendsOfRedaxo\\addon\\MediapoolExif\\Exception\\IptcException');// remove in v4 | ||
class_alias(MediapoolExif\Exception\NotFoundException::class, 'FriendsOfRedaxo\\addon\\MediapoolExif\\Exception\\NotFoundException');// remove in v4 | ||
|
||
$dir = realpath(__DIR__); | ||
if ($dir !== false) { | ||
rex_fragment::addDirectory($dir); | ||
} | ||
|
||
|
||
$class = MediapoolExif::class; | ||
$class = MediapoolExif\MediapoolExif::class; | ||
rex_extension::register('MEDIA_ADDED', [$class, 'processUploadedMedia'], rex_extension::LATE); | ||
rex_extension::register('MEDIA_UPDATED', [$class, 'processUploadedMedia'], rex_extension::LATE); | ||
rex_extension::register('MEDIA_DETAIL_SIDEBAR', [$class, 'mediapoolDetailOutput']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
|
||
/** | ||
* Datei für ... | ||
* | ||
* @author akrys | ||
*/ | ||
namespace FriendsOfRedaxo\MediapoolExif; | ||
|
||
/** | ||
* Description of Autoload | ||
* | ||
* @author akrys | ||
*/ | ||
class Autoload | ||
{ | ||
|
||
/** | ||
* (Absolutes) Basis Verzeichnis holen | ||
* @return string | ||
* @deprecated wird nicht mehr benötigt, sobald alte Klassen mit 'addon' im Namespace nicht mehr unterstützt werden | ||
* @codeCoverageIgnore | ||
*/ | ||
public static function getBaseDir() // remove in v4 | ||
{ | ||
return (string) realpath(__DIR__); | ||
} | ||
|
||
/** | ||
* Autoload Funktion | ||
* @param string $name | ||
* @return void | ||
* | ||
* @deprecated wird nicht mehr benötigt, sobald alte Klassen mit 'addon' im Namespace nicht mehr unterstützt werden | ||
* @codeCoverageIgnore | ||
*/ | ||
public static function autoload($name): void // remove in v4 | ||
{ | ||
if (stristr($name, 'FriendsOfRedaxo\\addon\\MediapoolExif')) { | ||
$oldName = $name; | ||
$newName = str_replace('FriendsOfRedaxo\\addon\\MediapoolExif', 'FriendsOfRedaxo\\MediapoolExif', $name); | ||
|
||
$backtrace = debug_backtrace(); | ||
$backtraceText = ''; | ||
$i = 0; | ||
foreach ($backtrace as $key => $item) { | ||
if (isset($backtrace[$key]['file']) && isset($backtrace[$key]['line'])) { | ||
if (stristr($backtrace[$key]['file'], '/mediapool_exif/')) { | ||
continue; | ||
} | ||
|
||
$backtraceText = ' in '.$backtrace[$key]['file'].': '.$backtrace[$key]['line']; | ||
break; | ||
} | ||
$i++; | ||
} | ||
|
||
$msg = "Deprecated class name found: ".$oldName.$backtraceText.PHP_EOL.'New class: '.$newName; | ||
|
||
class_alias($newName, $oldName); | ||
|
||
user_error($msg, E_USER_DEPRECATED); | ||
$name = $newName; | ||
} | ||
|
||
|
||
if (!stristr($name, __NAMESPACE__)) { | ||
return; | ||
} | ||
|
||
if (class_exists($name) || interface_exists($name)) { | ||
return; | ||
} | ||
|
||
//namespace parts not in directory structure. | ||
$name = str_replace(__NAMESPACE__, '', $name); | ||
|
||
$filename = self::getBaseDir().'/'.str_replace('\\', '/', $name).'.php'; | ||
if (file_exists($filename)) { | ||
require $filename; | ||
return; | ||
} | ||
// throw new \Exception($filename.' not found'); | ||
return; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.