svn_status

(PECL svn >= 0.1.0)

svn_statusReturns the status of working copy files and directories

Beschreibung

svn_status(string $path, int $flags = 0): array

Returns the status of working copy files and directories, giving modifications, additions, deletions and other changes to items in the working copy.

Parameter-Liste

path

Local path to file or directory to retrieve status of.

Hinweis: Relative Pfade werden so aufgelöst, als ob das aktuelle Verzeichnis das wäre, in dem sich das PHP-Binary befindet. Um stattdessen das aktuelle Verzeichnis des aufrufenden Skripts zu nutzen, müssen sie die realpath()-Funktion oder dirname(__FILE__) zu Hilfe ziehen.

flags

Any combination of Svn::NON_RECURSIVE, Svn::ALL (regardless of modification status), Svn::SHOW_UPDATES (entries will be added for items that are out-of-date), Svn::NO_IGNORE (disregard svn:ignore properties when scanning for new files) and Svn::IGNORE_EXTERNALS.

Rückgabewerte

Returns a numerically indexed array of associative arrays detailing the status of items in the repository:

Array (
    [0] => Array (
        // information on item
    )
    [1] => ...
)

The information on the item is an associative array that can contain the following keys:

path
String path to file/directory of this entry on local filesystem.
text_status
Status of item's text. Siehe auch Status-Konstanten für mögliche Werte.
repos_text_status
Status of item's text in repository. Only accurate if update was set to true. Siehe auch Status-Konstanten für mögliche Werte.
prop_status
Status of item's properties. Siehe auch Status-Konstanten für mögliche Werte.
repos_prop_status
Status of item's property in repository. Only accurate if update was set to true. Siehe auch Status-Konstanten für mögliche Werte.
locked
Whether or not the item is locked. (Only set if true.)
copied
Whether or not the item was copied (scheduled for addition with history). (Only set if true.)
switched
Whether or not the item was switched using the switch command. (Only set if true)

These keys are only set if the item is versioned:

name
Base name of item in repository.
url
URL of item in repository.
repos
Base URL of repository.
revision
Integer revision of item in working copy.
kind
Type of item, i.e. file or directory. Siehe auch Type-Konstanten für mögliche Werte.
schedule
Scheduled action for item, i.e. addition or deletion. Constants for these magic numbers are not available, they can be emulated by using:
<?php
if (!defined('svn_wc_schedule_normal')) {
    
define('svn_wc_schedule_normal',  0); // nothing special
    
define('svn_wc_schedule_add',     1); // item will be added
    
define('svn_wc_schedule_delete',  2); // item will be deleted
    
define('svn_wc_schedule_replace'3); // item will be added and deleted
}
?>
deleted
Whether or not the item was deleted, but parent revision lags behind. (Only set if true.)
absent
Whether or not the item is absent, that is, Subversion knows that there should be something there but there isn't. (Only set if true.)
incomplete
Whether or not the entries file for a directory is incomplete. (Only set if true.)
cmt_date
Integer Unix timestamp of last commit date. (Unaffected by update.)
cmt_rev
Integer revision of last commit. (Unaffected by update.)
cmt_author
String author of last commit. (Unaffected by update.)
prop_time
Integer Unix timestamp of last up-to-date time for properties
text_time
Integer Unix timestamp of last up-to-date time for text

Beispiele

Beispiel #1 Basic example

This example demonstrates a basic, theoretical usage of this function.

<?php
print_r
(svn_status(realpath('wc')));
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

Array (
    [0] => Array (
        [path] => /home/bob/wc/sandwich.txt
        [text_status] => 8 // item was modified
        [repos_text_status] => 1 // no information available, use update
        [prop_status] => 3 // no changes
        [repos_prop_status] => 1 // no information available, use update
        [name] => sandwich.txt
        [url] => http://www.example.com/svnroot/deli/trunk/sandwich.txt
        [repos] => http://www.example.com/svnroot/
        [revision] => 123
        [kind] => 1 // file
        [schedule] => 0 // no special actions scheduled
        [cmt_date] => 1165543135
        [cmt_rev] => 120
        [cmt_author] => Alice
        [prop_time] => 1180201728
        [text_time] => 1180201729
    )
)

Anmerkungen

Warnung

Diese Funktion ist EXPERIMENTELL. Das Verhalten, der Funktionsname und die die zugehörige Dokumentation, können sich in zukünftigen PHP-Versionen ohne Ankündigung ändern. Seien Sie gewarnt und verwenden Sie diese Funktion auf eigenes Risiko.

Siehe auch

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Grundlagen von Views in MySQL

Views in einer MySQL-Datenbank bieten die Möglichkeit, eine virtuelle Tabelle basierend auf dem Ergebnis einer SQL-Abfrage zu erstellen. ...

admin

Autor : admin
Kategorie: mySQL-Tutorials

Definition von Stored Procedures - eine Einführung

Stored Procedures sind vordefinierte SQL-Codeblöcke, die in einer Datenbank gespeichert sind und bei Bedarf aufgerufen werden können. ...

Bernie

Autor : ebiz-consult GmbH & Co. KG
Kategorie: mySQL-Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Berechnungen durchführen

Hallo liebe Forenmitglieder, meine erste frage ist zum Aufbau meiner kleinen Berechnungswebseite, nichts kommerzielles, soll nur eine Anwendung f ...

Geschrieben von matze511 am 21.04.2024 21:42:37
Forum: PHP Developer Forum
Professioneller Webentwickler & Webdesigner

Of course, here is the translation: Hello, Thank you for your interest in the long-term project. Your extensive skills and experience in web dev ...

Geschrieben von Athelstan am 15.04.2024 09:25:39
Forum: Jobgesuche
Wir stellen unsere SEO-Agentur vor

Hallo In der heutigen digitalen Welt war es für Unternehmen noch nie so einfach, ihre Reichweite weltweit zu vergrößern. Wenn Sie außerhalb I ...

Geschrieben von thomasmuller am 14.04.2024 07:18:33
Forum: User stellen sich vor
Spielplan für 4 Gruppen zu je 6 Teams auf 2 Feldern

Hallöchen zusammen, ich versuche derzeit unseren Excel-Spielplan in PHP zu überführen. Eigentlich bin ich auch shon fertig - wenn da nicht dies ...

Geschrieben von derH0st am 11.04.2024 15:58:37
Forum: PHP Developer Forum