diff options
Diffstat (limited to 'apps')
183 files changed, 8916 insertions, 564 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 5bf4f5c0981..95c0723f254 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -334,8 +334,13 @@ $(document).ready(function() { var result=$.parseJSON(response); delete data.jqXHR; - - if (typeof result[0] === 'undefined') { + + if (result.status === 'error' && result.data && result.data.message){ + data.textStatus = 'servererror'; + data.errorThrown = result.data.message; + var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); + fu._trigger('fail', e, data); + } else if (typeof result[0] === 'undefined') { data.textStatus = 'servererror'; data.errorThrown = t('files', 'Could not get result from server.'); var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); diff --git a/apps/files/l10n/ca.php b/apps/files/l10n/ca.php index 9625d162dcf..8173dac1bec 100644 --- a/apps/files/l10n/ca.php +++ b/apps/files/l10n/ca.php @@ -3,6 +3,14 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "No s'ha pogut moure %s - Ja hi ha un fitxer amb aquest nom", "Could not move %s" => " No s'ha pogut moure %s", "File name cannot be empty." => "El nom del fitxer no pot ser buit.", +"File name must not contain \"/\". Please choose a different name." => "El nom de fitxer no pot contenir \"/\". Indiqueu un nom diferent.", +"The name %s is already used in the folder %s. Please choose a different name." => "El nom %s ja s'usa en la carpeta %s. Indiqueu un nom diferent.", +"Not a valid source" => "No és un origen vàlid", +"Error while downloading %s to %s" => "S'ha produït un error en baixar %s a %s", +"Error when creating the file" => "S'ha produït un error en crear el fitxer", +"Folder name cannot be empty." => "El nom de la carpeta no pot ser buit.", +"Folder name must not contain \"/\". Please choose a different name." => "El nom de la carpeta no pot contenir \"/\". Indiqueu un nom diferent.", +"Error when creating the folder" => "S'ha produït un error en crear la carpeta", "Unable to set upload directory." => "No es pot establir la carpeta de pujada.", "Invalid Token" => "Testimoni no vàlid", "No file was uploaded. Unknown error" => "No s'ha carregat cap fitxer. Error desconegut", @@ -23,11 +31,16 @@ $TRANSLATIONS = array( "Upload cancelled." => "La pujada s'ha cancel·lat.", "Could not get result from server." => "No hi ha resposta del servidor.", "File upload is in progress. Leaving the page now will cancel the upload." => "Hi ha una pujada en curs. Si abandoneu la pàgina la pujada es cancel·larà.", +"URL cannot be empty" => "L'URL no pot ser buit", +"In the home folder 'Shared' is a reserved filename" => "A la carpeta inici 'Compartit' és un nom de fitxer reservat", "{new_name} already exists" => "{new_name} ja existeix", +"Could not create file" => "No s'ha pogut crear el fitxer", +"Could not create folder" => "No s'ha pogut crear la carpeta", "Share" => "Comparteix", "Delete permanently" => "Esborra permanentment", "Rename" => "Reanomena", "Pending" => "Pendent", +"Could not rename file" => "No es pot canviar el nom de fitxer", "replaced {new_name} with {old_name}" => "s'ha substituït {old_name} per {new_name}", "undo" => "desfés", "_%n folder_::_%n folders_" => array("%n carpeta","%n carpetes"), @@ -38,6 +51,8 @@ $TRANSLATIONS = array( "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "El nóm no és vàlid, '\\', '/', '<', '>', ':', '\"', '|', '?' i '*' no estan permesos.", "Your storage is full, files can not be updated or synced anymore!" => "El vostre espai d'emmagatzemament és ple, els fitxers ja no es poden actualitzar o sincronitzar!", "Your storage is almost full ({usedSpacePercent}%)" => "El vostre espai d'emmagatzemament és gairebé ple ({usedSpacePercent}%)", +"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "L'aplicació d'encriptació està activada però les claus no estan inicialitzades, sortiu i acrediteu-vos de nou.", +"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "La clau privada de l'aplicació d'encriptació no és vàlida! Actualitzeu la contrasenya de la clau privada a l'arranjament personal per recuperar els fitxers encriptats.", "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "L'encriptació s'ha desactivat però els vostres fitxers segueixen encriptats. Aneu a la vostra configuració personal per desencriptar els vostres fitxers.", "Your download is being prepared. This might take some time if the files are big." => "S'està preparant la baixada. Pot trigar una estona si els fitxers són grans.", "Error moving file" => "Error en moure el fitxer", @@ -62,6 +77,7 @@ $TRANSLATIONS = array( "From link" => "Des d'enllaç", "Deleted files" => "Fitxers esborrats", "Cancel upload" => "Cancel·la la pujada", +"You don’t have permission to upload or create files here" => "No teniu permisos per a pujar o crear els fitxers aquí", "Nothing in here. Upload something!" => "Res per aquí. Pugeu alguna cosa!", "Download" => "Baixa", "Unshare" => "Deixa de compartir", diff --git a/apps/files/l10n/de.php b/apps/files/l10n/de.php index 9aad5d73cbb..652a91310cb 100644 --- a/apps/files/l10n/de.php +++ b/apps/files/l10n/de.php @@ -4,10 +4,11 @@ $TRANSLATIONS = array( "Could not move %s" => "Konnte %s nicht verschieben", "File name cannot be empty." => "Der Dateiname darf nicht leer sein.", "File name must not contain \"/\". Please choose a different name." => "Der Dateiname darf kein \"/\" enthalten. Bitte wähle einen anderen Namen.", -"The name %s is already used in the folder %s. Please choose a different name." => "Der Name %s wird bereits im Ordner %s benutzt. Bitte wählen Sie einen anderen Namen.", +"The name %s is already used in the folder %s. Please choose a different name." => "Der Name %s wird bereits im Ordner %s benutzt. Bitte wähle einen anderen Namen.", "Not a valid source" => "Keine gültige Quelle", "Error while downloading %s to %s" => "Fehler beim Herunterladen von %s nach %s", "Error when creating the file" => "Fehler beim Erstellen der Datei", +"Folder name cannot be empty." => "Der Ordner-Name darf nicht leer sein.", "Folder name must not contain \"/\". Please choose a different name." => "Der Ordner-Name darf kein \"/\" enthalten. Bitte wähle einen anderen Namen.", "Error when creating the folder" => "Fehler beim Erstellen des Ordners", "Unable to set upload directory." => "Das Upload-Verzeichnis konnte nicht gesetzt werden.", @@ -25,7 +26,7 @@ $TRANSLATIONS = array( "Upload failed. Could not find uploaded file" => "Hochladen fehlgeschlagen. Hochgeladene Datei konnte nicht gefunden werden.", "Invalid directory." => "Ungültiges Verzeichnis.", "Files" => "Dateien", -"Unable to upload {filename} as it is a directory or has 0 bytes" => "Datei {filename} kann nicht hochgeladen werden, da sie entweder ein Verzeichnis oder 0 Bytes groß ist", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "Die Datei {filename} kann nicht hochgeladen werden, da sie entweder ein Verzeichnis oder 0 Bytes groß ist", "Not enough space available" => "Nicht genug Speicherplatz verfügbar", "Upload cancelled." => "Upload abgebrochen.", "Could not get result from server." => "Ergebnis konnte nicht vom Server abgerufen werden.", @@ -50,9 +51,9 @@ $TRANSLATIONS = array( "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ungültiger Name, '\\', '/', '<', '>', ':', '\"', '|', '?' und '*' sind nicht zulässig.", "Your storage is full, files can not be updated or synced anymore!" => "Dein Speicher ist voll, daher können keine Dateien mehr aktualisiert oder synchronisiert werden!", "Your storage is almost full ({usedSpacePercent}%)" => "Dein Speicher ist fast voll ({usedSpacePercent}%)", -"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Verschlüsselung-App ist aktiviert aber Deine Schlüssel sind nicht initialisiert. Bitte melden sich nochmals ab und wieder an.", -"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Ungültiger privater Schlüssel für die Verschlüsselung-App. Bitte aktualisiere dein privates Schlüssel-Passwort um den Zugriff auf Deine verschlüsselten Dateien wiederherzustellen.", -"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Die Verschlüsselung wurde deaktiviert, jedoch sind deine Dateien nach wie vor verschlüsselt. Bitte gehe zu deinen persönlichen Einstellungen, um deine Dateien zu entschlüsseln.", +"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Die Verschlüsselung-App ist aktiviert, aber Deine Schlüssel sind nicht initialisiert. Bitte melden Dich nochmals ab und wieder an.", +"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Ungültiger privater Schlüssel für die Verschlüsselung-App. Bitte aktualisiere Dein privates Schlüssel-Passwort, um den Zugriff auf Deine verschlüsselten Dateien wiederherzustellen.", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Die Verschlüsselung wurde deaktiviert, jedoch sind Deine Dateien nach wie vor verschlüsselt. Bitte gehe zu Deinen persönlichen Einstellungen, um Deine Dateien zu entschlüsseln.", "Your download is being prepared. This might take some time if the files are big." => "Dein Download wird vorbereitet. Dies kann bei größeren Dateien etwas dauern.", "Error moving file" => "Fehler beim Verschieben der Datei", "Error" => "Fehler", @@ -76,7 +77,7 @@ $TRANSLATIONS = array( "From link" => "Von einem Link", "Deleted files" => "Gelöschte Dateien", "Cancel upload" => "Upload abbrechen", -"You don’t have permission to upload or create files here" => "Du besitzt hier keine Berechtigung Dateien hochzuladen oder zu erstellen", +"You don’t have permission to upload or create files here" => "Du besitzt hier keine Berechtigung, um Dateien hochzuladen oder zu erstellen", "Nothing in here. Upload something!" => "Alles leer. Lade etwas hoch!", "Download" => "Herunterladen", "Unshare" => "Freigabe aufheben", diff --git a/apps/files/l10n/de_DE.php b/apps/files/l10n/de_DE.php index 5abf25629f5..68446101910 100644 --- a/apps/files/l10n/de_DE.php +++ b/apps/files/l10n/de_DE.php @@ -8,6 +8,7 @@ $TRANSLATIONS = array( "Not a valid source" => "Keine gültige Quelle", "Error while downloading %s to %s" => "Fehler beim Herunterladen von %s nach %s", "Error when creating the file" => "Fehler beim Erstellen der Datei", +"Folder name cannot be empty." => "Der Ordner-Name darf nicht leer sein.", "Folder name must not contain \"/\". Please choose a different name." => "Der Ordner-Name darf kein \"/\" enthalten. Bitte wählen Sie einen anderen Namen.", "Error when creating the folder" => "Fehler beim Erstellen des Ordners", "Unable to set upload directory." => "Das Upload-Verzeichnis konnte nicht gesetzt werden.", diff --git a/apps/files/l10n/en_GB.php b/apps/files/l10n/en_GB.php index f9a8787b4ee..ce783244b6d 100644 --- a/apps/files/l10n/en_GB.php +++ b/apps/files/l10n/en_GB.php @@ -3,6 +3,14 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "Could not move %s - File with this name already exists", "Could not move %s" => "Could not move %s", "File name cannot be empty." => "File name cannot be empty.", +"File name must not contain \"/\". Please choose a different name." => "File name must not contain \"/\". Please choose a different name.", +"The name %s is already used in the folder %s. Please choose a different name." => "The name %s is already used in the folder %s. Please choose a different name.", +"Not a valid source" => "Not a valid source", +"Error while downloading %s to %s" => "Error whilst downloading %s to %s", +"Error when creating the file" => "Error when creating the file", +"Folder name cannot be empty." => "Folder name cannot be empty.", +"Folder name must not contain \"/\". Please choose a different name." => "Folder name must not contain \"/\". Please choose a different name.", +"Error when creating the folder" => "Error when creating the folder", "Unable to set upload directory." => "Unable to set upload directory.", "Invalid Token" => "Invalid Token", "No file was uploaded. Unknown error" => "No file was uploaded. Unknown error", @@ -23,11 +31,16 @@ $TRANSLATIONS = array( "Upload cancelled." => "Upload cancelled.", "Could not get result from server." => "Could not get result from server.", "File upload is in progress. Leaving the page now will cancel the upload." => "File upload is in progress. Leaving the page now will cancel the upload.", +"URL cannot be empty" => "URL cannot be empty", +"In the home folder 'Shared' is a reserved filename" => "In the home folder 'Shared' is a reserved file name", "{new_name} already exists" => "{new_name} already exists", +"Could not create file" => "Could not create file", +"Could not create folder" => "Could not create folder", "Share" => "Share", "Delete permanently" => "Delete permanently", "Rename" => "Rename", "Pending" => "Pending", +"Could not rename file" => "Could not rename file", "replaced {new_name} with {old_name}" => "replaced {new_name} with {old_name}", "undo" => "undo", "_%n folder_::_%n folders_" => array("%n folder","%n folders"), @@ -64,6 +77,7 @@ $TRANSLATIONS = array( "From link" => "From link", "Deleted files" => "Deleted files", "Cancel upload" => "Cancel upload", +"You don’t have permission to upload or create files here" => "You don’t have permission to upload or create files here", "Nothing in here. Upload something!" => "Nothing in here. Upload something!", "Download" => "Download", "Unshare" => "Unshare", diff --git a/apps/files/l10n/es.php b/apps/files/l10n/es.php index d00565cce26..164904beba9 100644 --- a/apps/files/l10n/es.php +++ b/apps/files/l10n/es.php @@ -3,6 +3,14 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "No se pudo mover %s - Ya existe un archivo con ese nombre.", "Could not move %s" => "No se pudo mover %s", "File name cannot be empty." => "El nombre de archivo no puede estar vacío.", +"File name must not contain \"/\". Please choose a different name." => "El nombre del archivo, NO puede contener el simbolo\"/\", por favor elija un nombre diferente.", +"The name %s is already used in the folder %s. Please choose a different name." => "El nombre %s ya está en uso por la carpeta %s. Por favor elija uno diferente.", +"Not a valid source" => "No es un origen válido", +"Error while downloading %s to %s" => "Error mientras se descargaba %s a %s", +"Error when creating the file" => "Error al crear el archivo", +"Folder name cannot be empty." => "El nombre de la carpeta no puede estar vacío.", +"Folder name must not contain \"/\". Please choose a different name." => "El nombre de la carpeta, NO puede contener el simbolo\"/\", por favor elija un nombre diferente.", +"Error when creating the folder" => "Error al crear la carpeta.", "Unable to set upload directory." => "Incapaz de crear directorio de subida.", "Invalid Token" => "Token Inválido", "No file was uploaded. Unknown error" => "No se subió ningún archivo. Error desconocido", @@ -23,11 +31,16 @@ $TRANSLATIONS = array( "Upload cancelled." => "Subida cancelada.", "Could not get result from server." => "No se pudo obtener respuesta del servidor.", "File upload is in progress. Leaving the page now will cancel the upload." => "La subida del archivo está en proceso. Si sale de la página ahora, la subida será cancelada.", +"URL cannot be empty" => "URL no puede estar vacio", +"In the home folder 'Shared' is a reserved filename" => "En la carpeta home, no se puede usar 'Shared'", "{new_name} already exists" => "{new_name} ya existe", +"Could not create file" => "No se pudo crear el archivo", +"Could not create folder" => "No se pudo crear la carpeta", "Share" => "Compartir", "Delete permanently" => "Eliminar permanentemente", "Rename" => "Renombrar", "Pending" => "Pendiente", +"Could not rename file" => "No se pudo renombrar el archivo", "replaced {new_name} with {old_name}" => "reemplazado {new_name} con {old_name}", "undo" => "deshacer", "_%n folder_::_%n folders_" => array("%n carpeta","%n carpetas"), @@ -64,6 +77,7 @@ $TRANSLATIONS = array( "From link" => "Desde enlace", "Deleted files" => "Archivos eliminados", "Cancel upload" => "Cancelar subida", +"You don’t have permission to upload or create files here" => "No tienes permisos para subir o crear archivos aquí.", "Nothing in here. Upload something!" => "No hay nada aquí. ¡Suba algo!", "Download" => "Descargar", "Unshare" => "Dejar de compartir", diff --git a/apps/files/l10n/et_EE.php b/apps/files/l10n/et_EE.php index 3b67ffac76f..5d3cb802f5e 100644 --- a/apps/files/l10n/et_EE.php +++ b/apps/files/l10n/et_EE.php @@ -3,6 +3,14 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "Ei saa liigutada faili %s - samanimeline fail on juba olemas", "Could not move %s" => "%s liigutamine ebaõnnestus", "File name cannot be empty." => "Faili nimi ei saa olla tühi.", +"File name must not contain \"/\". Please choose a different name." => "Faili nimi ei tohi sisaldada \"/\". Palun vali mõni teine nimi.", +"The name %s is already used in the folder %s. Please choose a different name." => "Nimi %s on juba kasutusel kataloogis %s. Palun vali mõni teine nimi.", +"Not a valid source" => "Pole korrektne lähteallikas", +"Error while downloading %s to %s" => "Viga %s allalaadimisel %s", +"Error when creating the file" => "Viga faili loomisel", +"Folder name cannot be empty." => "Kataloogi nimi ei saa olla tühi.", +"Folder name must not contain \"/\". Please choose a different name." => "Kataloogi nimi ei tohi sisaldada \"/\". Palun vali mõni teine nimi.", +"Error when creating the folder" => "Viga kataloogi loomisel", "Unable to set upload directory." => "Üleslaadimiste kausta määramine ebaõnnestus.", "Invalid Token" => "Vigane kontrollkood", "No file was uploaded. Unknown error" => "Ühtegi faili ei laetud üles. Tundmatu viga", @@ -23,11 +31,16 @@ $TRANSLATIONS = array( "Upload cancelled." => "Üleslaadimine tühistati.", "Could not get result from server." => "Serverist ei saadud tulemusi", "File upload is in progress. Leaving the page now will cancel the upload." => "Faili üleslaadimine on töös. Lehelt lahkumine katkestab selle üleslaadimise.", +"URL cannot be empty" => "URL ei saa olla tühi", +"In the home folder 'Shared' is a reserved filename" => "Kodukataloogis 'Shared' on reserveeritud failinimi", "{new_name} already exists" => "{new_name} on juba olemas", +"Could not create file" => "Ei suuda luua faili", +"Could not create folder" => "Ei suuda luua kataloogi", "Share" => "Jaga", "Delete permanently" => "Kustuta jäädavalt", "Rename" => "Nimeta ümber", "Pending" => "Ootel", +"Could not rename file" => "Ei suuda faili ümber nimetada", "replaced {new_name} with {old_name}" => "asendas nime {old_name} nimega {new_name}", "undo" => "tagasi", "_%n folder_::_%n folders_" => array("%n kataloog","%n kataloogi"), @@ -64,6 +77,7 @@ $TRANSLATIONS = array( "From link" => "Allikast", "Deleted files" => "Kustutatud failid", "Cancel upload" => "Tühista üleslaadimine", +"You don’t have permission to upload or create files here" => "Sul puuduvad õigused siia failide üleslaadimiseks või tekitamiseks", "Nothing in here. Upload something!" => "Siin pole midagi. Lae midagi üles!", "Download" => "Lae alla", "Unshare" => "Lõpeta jagamine", diff --git a/apps/files/l10n/fi_FI.php b/apps/files/l10n/fi_FI.php index 3092c738c3b..3a9d4132fa2 100644 --- a/apps/files/l10n/fi_FI.php +++ b/apps/files/l10n/fi_FI.php @@ -3,6 +3,12 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "Kohteen %s siirto ei onnistunut - Tiedosto samalla nimellä on jo olemassa", "Could not move %s" => "Kohteen %s siirto ei onnistunut", "File name cannot be empty." => "Tiedoston nimi ei voi olla tyhjä.", +"File name must not contain \"/\". Please choose a different name." => "Tiedoston nimessä ei saa olla merkkiä \"/\". Valitse toinen nimi.", +"Not a valid source" => "Virheellinen lähde", +"Error when creating the file" => "Virhe tiedostoa luotaessa", +"Folder name cannot be empty." => "Kansion nimi ei voi olla tyhjä.", +"Folder name must not contain \"/\". Please choose a different name." => "Kansion nimessä ei saa olla merkkiä \"/\". Valitse toinen nimi.", +"Error when creating the folder" => "Virhe kansiota luotaessa", "No file was uploaded. Unknown error" => "Tiedostoa ei lähetetty. Tuntematon virhe", "There is no error, the file uploaded with success" => "Ei virheitä, tiedosto lähetettiin onnistuneesti", "The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Lähetetyn tiedoston koko ylittää php.ini-tiedoston upload_max_filesize-säännön:", @@ -20,10 +26,13 @@ $TRANSLATIONS = array( "Could not get result from server." => "Tuloksien saaminen palvelimelta ei onnistunut.", "File upload is in progress. Leaving the page now will cancel the upload." => "Tiedoston lähetys on meneillään. Sivulta poistuminen nyt peruu tiedoston lähetyksen.", "{new_name} already exists" => "{new_name} on jo olemassa", +"Could not create file" => "Tiedoston luominen epäonnistui", +"Could not create folder" => "Kansion luominen epäonnistui", "Share" => "Jaa", "Delete permanently" => "Poista pysyvästi", "Rename" => "Nimeä uudelleen", "Pending" => "Odottaa", +"Could not rename file" => "Tiedoston nimeäminen uudelleen epäonnistui", "undo" => "kumoa", "_%n folder_::_%n folders_" => array("%n kansio","%n kansiota"), "_%n file_::_%n files_" => array("%n tiedosto","%n tiedostoa"), @@ -54,6 +63,7 @@ $TRANSLATIONS = array( "From link" => "Linkistä", "Deleted files" => "Poistetut tiedostot", "Cancel upload" => "Peru lähetys", +"You don’t have permission to upload or create files here" => "Käyttöoikeutesi eivät riitä tiedostojen lähettämiseen tai kansioiden luomiseen tähän sijaintiin", "Nothing in here. Upload something!" => "Täällä ei ole mitään. Lähetä tänne jotakin!", "Download" => "Lataa", "Unshare" => "Peru jakaminen", diff --git a/apps/files/l10n/fr.php b/apps/files/l10n/fr.php index a9ad3d1c0c8..2761a95950c 100644 --- a/apps/files/l10n/fr.php +++ b/apps/files/l10n/fr.php @@ -3,6 +3,14 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "Impossible de déplacer %s - Un fichier possédant ce nom existe déjà", "Could not move %s" => "Impossible de déplacer %s", "File name cannot be empty." => "Le nom de fichier ne peut être vide.", +"File name must not contain \"/\". Please choose a different name." => "Le nom de fichier ne doit pas contenir \"/\". Merci de choisir un nom différent.", +"The name %s is already used in the folder %s. Please choose a different name." => "Le nom %s est déjà utilisé dans le dossier %s. Merci de choisir un nom différent.", +"Not a valid source" => "La source n'est pas valide", +"Error while downloading %s to %s" => "Erreur pendant le téléchargement de %s à %s", +"Error when creating the file" => "Erreur pendant la création du fichier", +"Folder name cannot be empty." => "Le nom de dossier ne peux pas être vide.", +"Folder name must not contain \"/\". Please choose a different name." => "Le nom de dossier ne doit pas contenir \"/\". Merci de choisir un nom différent.", +"Error when creating the folder" => "Erreur pendant la création du dossier", "Unable to set upload directory." => "Impossible de définir le dossier pour l'upload, charger.", "Invalid Token" => "Jeton non valide", "No file was uploaded. Unknown error" => "Aucun fichier n'a été envoyé. Erreur inconnue", @@ -23,11 +31,16 @@ $TRANSLATIONS = array( "Upload cancelled." => "Envoi annulé.", "Could not get result from server." => "Ne peut recevoir les résultats du serveur.", "File upload is in progress. Leaving the page now will cancel the upload." => "L'envoi du fichier est en cours. Quitter cette page maintenant annulera l'envoi du fichier.", +"URL cannot be empty" => "L'URL ne peut pas être vide", +"In the home folder 'Shared' is a reserved filename" => "Dans le dossier home, 'Partagé' est un nom de fichier réservé", "{new_name} already exists" => "{new_name} existe déjà", +"Could not create file" => "Impossible de créer le fichier", +"Could not create folder" => "Impossible de créer le dossier", "Share" => "Partager", "Delete permanently" => "Supprimer de façon définitive", "Rename" => "Renommer", "Pending" => "En attente", +"Could not rename file" => "Impossible de renommer le fichier", "replaced {new_name} with {old_name}" => "{new_name} a été remplacé par {old_name}", "undo" => "annuler", "_%n folder_::_%n folders_" => array("%n dossier","%n dossiers"), @@ -64,6 +77,7 @@ $TRANSLATIONS = array( "From link" => "Depuis le lien", "Deleted files" => "Fichiers supprimés", "Cancel upload" => "Annuler l'envoi", +"You don’t have permission to upload or create files here" => "Vous n'avez pas la permission de téléverser ou de créer des fichiers ici", "Nothing in here. Upload something!" => "Il n'y a rien ici ! Envoyez donc quelque chose :)", "Download" => "Télécharger", "Unshare" => "Ne plus partager", diff --git a/apps/files/l10n/gl.php b/apps/files/l10n/gl.php index 0848a577e27..1a2dc5a1b8a 100644 --- a/apps/files/l10n/gl.php +++ b/apps/files/l10n/gl.php @@ -8,6 +8,7 @@ $TRANSLATIONS = array( "Not a valid source" => "Esta orixe non é correcta", "Error while downloading %s to %s" => "Produciuse un erro ao descargar %s en %s", "Error when creating the file" => "Produciuse un erro ao crear o ficheiro", +"Folder name cannot be empty." => "O nome de cartafol non pode estar baleiro.", "Folder name must not contain \"/\". Please choose a different name." => "O nome do cartafol non pode conter «/». Escolla outro nome.", "Error when creating the folder" => "Produciuse un erro ao crear o cartafol", "Unable to set upload directory." => "Non é posíbel configurar o directorio de envíos.", diff --git a/apps/files/l10n/it.php b/apps/files/l10n/it.php index 820facda52c..71e41b62d4b 100644 --- a/apps/files/l10n/it.php +++ b/apps/files/l10n/it.php @@ -3,6 +3,14 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "Impossibile spostare %s - un file con questo nome esiste già", "Could not move %s" => "Impossibile spostare %s", "File name cannot be empty." => "Il nome del file non può essere vuoto.", +"File name must not contain \"/\". Please choose a different name." => "Il nome del file non può contenere il carattere \"/\". Per favore scegli un nome diverso.", +"The name %s is already used in the folder %s. Please choose a different name." => "Il nome %s è attualmente in uso nella cartella %s. Per favore scegli un nome diverso.", +"Not a valid source" => "Non è una sorgente valida", +"Error while downloading %s to %s" => "Errore durante lo scaricamento di %s su %s", +"Error when creating the file" => "Errore durante la creazione del file", +"Folder name cannot be empty." => "Il nome della cartella non può essere vuoto.", +"Folder name must not contain \"/\". Please choose a different name." => "Il nome della cartella non può contenere il carattere \"/\". Per favore scegli un nome diverso.", +"Error when creating the folder" => "Errore durante la creazione della cartella", "Unable to set upload directory." => "Impossibile impostare una cartella di caricamento.", "Invalid Token" => "Token non valido", "No file was uploaded. Unknown error" => "Nessun file è stato inviato. Errore sconosciuto", @@ -23,11 +31,16 @@ $TRANSLATIONS = array( "Upload cancelled." => "Invio annullato", "Could not get result from server." => "Impossibile ottenere il risultato dal server.", "File upload is in progress. Leaving the page now will cancel the upload." => "Caricamento del file in corso. La chiusura della pagina annullerà il caricamento.", +"URL cannot be empty" => "L'URL non può essere vuoto.", +"In the home folder 'Shared' is a reserved filename" => "Nella cartella home 'Shared' è un nome riservato", "{new_name} already exists" => "{new_name} esiste già", +"Could not create file" => "Impossibile creare il file", +"Could not create folder" => "Impossibile creare la cartella", "Share" => "Condividi", "Delete permanently" => "Elimina definitivamente", "Rename" => "Rinomina", "Pending" => "In corso", +"Could not rename file" => "Impossibile rinominare il file", "replaced {new_name} with {old_name}" => "sostituito {new_name} con {old_name}", "undo" => "annulla", "_%n folder_::_%n folders_" => array("%n cartella","%n cartelle"), @@ -64,6 +77,7 @@ $TRANSLATIONS = array( "From link" => "Da collegamento", "Deleted files" => "File eliminati", "Cancel upload" => "Annulla invio", +"You don’t have permission to upload or create files here" => "Qui non hai i permessi di caricare o creare file", "Nothing in here. Upload something!" => "Non c'è niente qui. Carica qualcosa!", "Download" => "Scarica", "Unshare" => "Rimuovi condivisione", diff --git a/apps/files/l10n/ja_JP.php b/apps/files/l10n/ja_JP.php index e95a3fa5172..2167eb40a36 100644 --- a/apps/files/l10n/ja_JP.php +++ b/apps/files/l10n/ja_JP.php @@ -3,6 +3,14 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "%s を移動できませんでした ― この名前のファイルはすでに存在します", "Could not move %s" => "%s を移動できませんでした", "File name cannot be empty." => "ファイル名を空にすることはできません。", +"File name must not contain \"/\". Please choose a different name." => "ファイル名には \"/\" を含めることはできません。別の名前を選択してください。", +"The name %s is already used in the folder %s. Please choose a different name." => "%s はフォルダ %s ないですでに使われています。別の名前を選択してください。", +"Not a valid source" => "有効なソースではありません", +"Error while downloading %s to %s" => "%s から %s へのダウンロードエラー", +"Error when creating the file" => "ファイルの生成エラー", +"Folder name cannot be empty." => "フォルダ名は空にできません", +"Folder name must not contain \"/\". Please choose a different name." => "フォルダ名には \"/\" を含めることはできません。別の名前を選択してください。", +"Error when creating the folder" => "フォルダの生成エラー", "Unable to set upload directory." => "アップロードディレクトリを設定出来ません。", "Invalid Token" => "無効なトークン", "No file was uploaded. Unknown error" => "ファイルは何もアップロードされていません。不明なエラー", @@ -23,11 +31,16 @@ $TRANSLATIONS = array( "Upload cancelled." => "アップロードはキャンセルされました。", "Could not get result from server." => "サーバから結果を取得できませんでした。", "File upload is in progress. Leaving the page now will cancel the upload." => "ファイル転送を実行中です。今このページから移動するとアップロードが中止されます。", +"URL cannot be empty" => "URL は空にできません", +"In the home folder 'Shared' is a reserved filename" => "ホームフォルダでは、'Shared' はシステムが使用する予約済みのファイル名です", "{new_name} already exists" => "{new_name} はすでに存在しています", +"Could not create file" => "ファイルを作成できませんでした", +"Could not create folder" => "フォルダを作成できませんでした", "Share" => "共有", "Delete permanently" => "完全に削除する", "Rename" => "名前の変更", "Pending" => "中断", +"Could not rename file" => "ファイルの名前変更ができませんでした", "replaced {new_name} with {old_name}" => "{old_name} を {new_name} に置換", "undo" => "元に戻す", "_%n folder_::_%n folders_" => array("%n 個のフォルダ"), @@ -64,6 +77,7 @@ $TRANSLATIONS = array( "From link" => "リンク", "Deleted files" => "削除ファイル", "Cancel upload" => "アップロードをキャンセル", +"You don’t have permission to upload or create files here" => "ここにファイルをアップロードもしくは作成する権限がありません", "Nothing in here. Upload something!" => "ここには何もありません。何かアップロードしてください。", "Download" => "ダウンロード", "Unshare" => "共有解除", diff --git a/apps/files/l10n/lt_LT.php b/apps/files/l10n/lt_LT.php index 2270e21a96a..a96252066c3 100644 --- a/apps/files/l10n/lt_LT.php +++ b/apps/files/l10n/lt_LT.php @@ -3,6 +3,12 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "Nepavyko perkelti %s - failas su tokiu pavadinimu jau egzistuoja", "Could not move %s" => "Nepavyko perkelti %s", "File name cannot be empty." => "Failo pavadinimas negali būti tuščias.", +"File name must not contain \"/\". Please choose a different name." => "Failo pavadinime negali būti simbolio \"/\". Prašome pasirinkti kitokį pavadinimą.", +"Error while downloading %s to %s" => "Klaida siunčiant %s į %s", +"Error when creating the file" => "Klaida kuriant failą", +"Folder name cannot be empty." => "Aplanko pavadinimas negali būti tuščias.", +"Folder name must not contain \"/\". Please choose a different name." => "Aplanko pavadinime negali būti simbolio \"/\". Prašome pasirinkti kitokį pavadinimą.", +"Error when creating the folder" => "Klaida kuriant aplanką", "Unable to set upload directory." => "Nepavyksta nustatyti įkėlimų katalogo.", "Invalid Token" => "Netinkamas ženklas", "No file was uploaded. Unknown error" => "Failai nebuvo įkelti dėl nežinomos priežasties", @@ -23,11 +29,15 @@ $TRANSLATIONS = array( "Upload cancelled." => "Įkėlimas atšauktas.", "Could not get result from server." => "Nepavyko gauti rezultato iš serverio.", "File upload is in progress. Leaving the page now will cancel the upload." => "Failo įkėlimas pradėtas. Jei paliksite šį puslapį, įkėlimas nutrūks.", +"URL cannot be empty" => "URL negali būti tuščias.", "{new_name} already exists" => "{new_name} jau egzistuoja", +"Could not create file" => "Neįmanoma sukurti failo", +"Could not create folder" => "Neįmanoma sukurti aplanko", "Share" => "Dalintis", "Delete permanently" => "Ištrinti negrįžtamai", "Rename" => "Pervadinti", "Pending" => "Laukiantis", +"Could not rename file" => "Neįmanoma pervadinti failo", "replaced {new_name} with {old_name}" => "pakeiskite {new_name} į {old_name}", "undo" => "anuliuoti", "_%n folder_::_%n folders_" => array("%n aplankas","%n aplankai","%n aplankų"), @@ -64,6 +74,7 @@ $TRANSLATIONS = array( "From link" => "Iš nuorodos", "Deleted files" => "Ištrinti failai", "Cancel upload" => "Atšaukti siuntimą", +"You don’t have permission to upload or create files here" => "Jūs neturite leidimo čia įkelti arba kurti failus", "Nothing in here. Upload something!" => "Čia tuščia. Įkelkite ką nors!", "Download" => "Atsisiųsti", "Unshare" => "Nebesidalinti", diff --git a/apps/files/l10n/mk.php b/apps/files/l10n/mk.php index 7c7ac34a347..695fa749297 100644 --- a/apps/files/l10n/mk.php +++ b/apps/files/l10n/mk.php @@ -1,5 +1,16 @@ <?php $TRANSLATIONS = array( +"Could not move %s - File with this name already exists" => "Не можам да го преместам %s - Датотека со такво име веќе постои", +"Could not move %s" => "Не можам да ги префрлам %s", +"File name cannot be empty." => "Името на датотеката не може да биде празно.", +"Not a valid source" => "Не е валиден извор", +"Error while downloading %s to %s" => "Грешка додека преземам %s to %s", +"Error when creating the file" => "Грешка при креирање на датотека", +"Folder name cannot be empty." => "Името на папката не може да биде празно.", +"Folder name must not contain \"/\". Please choose a different name." => "Името на папката не смее да содржи \"/\". Одберете друго име.", +"Error when creating the folder" => "Грешка при креирање на папка", +"Unable to set upload directory." => "Не може да се постави папката за префрлање на податоци.", +"Invalid Token" => "Грешен токен", "No file was uploaded. Unknown error" => "Ниту еден фајл не се вчита. Непозната грешка", "There is no error, the file uploaded with success" => "Датотеката беше успешно подигната.", "The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Подигнатата датотека ја надминува upload_max_filesize директивата во php.ini:", @@ -8,23 +19,42 @@ $TRANSLATIONS = array( "No file was uploaded" => "Не беше подигната датотека.", "Missing a temporary folder" => "Недостасува привремена папка", "Failed to write to disk" => "Неуспеав да запишам на диск", +"Not enough storage available" => "Нема доволно слободен сториџ", +"Upload failed. Could not find uploaded file" => "Префрлањето е неуспешно. Не можам да го најдам префрлената датотека.", +"Invalid directory." => "Погрешна папка.", "Files" => "Датотеки", +"Not enough space available" => "Немате доволно дисков простор", "Upload cancelled." => "Преземањето е прекинато.", +"Could not get result from server." => "Не можам да добијам резултат од серверот.", "File upload is in progress. Leaving the page now will cancel the upload." => "Подигање на датотека е во тек. Напуштење на страницата ќе го прекине.", +"URL cannot be empty" => "URL-то не може да биде празно", +"In the home folder 'Shared' is a reserved filename" => "Во домашната папка, 'Shared' е резервирано има на датотека/папка", "{new_name} already exists" => "{new_name} веќе постои", +"Could not create file" => "Не множам да креирам датотека", +"Could not create folder" => "Не можам да креирам папка", "Share" => "Сподели", +"Delete permanently" => "Трајно избришани", "Rename" => "Преименувај", "Pending" => "Чека", +"Could not rename file" => "Не можам да ја преименувам датотеката", "replaced {new_name} with {old_name}" => "заменета {new_name} со {old_name}", "undo" => "врати", "_%n folder_::_%n folders_" => array("",""), "_%n file_::_%n files_" => array("",""), +"{dirs} and {files}" => "{dirs} и {files}", "_Uploading %n file_::_Uploading %n files_" => array("",""), +"'.' is an invalid file name." => "'.' е грешно име за датотека.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Неправилно име. , '\\', '/', '<', '>', ':', '\"', '|', '?' и '*' не се дозволени.", +"Your storage is full, files can not be updated or synced anymore!" => "Вашиот сториџ е полн, датотеките веќе не можат да се освежуваат или синхронизираат!", +"Your storage is almost full ({usedSpacePercent}%)" => "Вашиот сториџ е скоро полн ({usedSpacePercent}%)", +"Your download is being prepared. This might take some time if the files are big." => "Вашето преземање се подготвува. Ова може да потрае до колку датотеките се големи.", +"Error moving file" => "Грешка при префрлање на датотека", "Error" => "Грешка", "Name" => "Име", "Size" => "Големина", "Modified" => "Променето", +"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Грешно име на папката. Користењето на 'Shared' е резервирано од самиот ownCloud", +"%s could not be renamed" => "%s не може да биде преименуван", "Upload" => "Подигни", "File handling" => "Ракување со датотеки", "Maximum upload size" => "Максимална големина за подигање", @@ -38,6 +68,7 @@ $TRANSLATIONS = array( "Text file" => "Текстуална датотека", "Folder" => "Папка", "From link" => "Од врска", +"Deleted files" => "Избришани датотеки", "Cancel upload" => "Откажи прикачување", "Nothing in here. Upload something!" => "Тука нема ништо. Снимете нешто!", "Download" => "Преземи", @@ -46,6 +77,7 @@ $TRANSLATIONS = array( "Upload too large" => "Фајлот кој се вчитува е преголем", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Датотеките кои се обидувате да ги подигнете ја надминуваат максималната големина за подигнување датотеки на овој сервер.", "Files are being scanned, please wait." => "Се скенираат датотеки, ве молам почекајте.", -"Current scanning" => "Моментално скенирам" +"Current scanning" => "Моментално скенирам", +"Upgrading filesystem cache..." => "Го надградувам кешот на фјал системот..." ); $PLURAL_FORMS = "nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;"; diff --git a/apps/files/l10n/ms_MY.php b/apps/files/l10n/ms_MY.php index 82d0fda89d9..0a7a50abb1a 100644 --- a/apps/files/l10n/ms_MY.php +++ b/apps/files/l10n/ms_MY.php @@ -10,6 +10,7 @@ $TRANSLATIONS = array( "Files" => "Fail-fail", "Upload cancelled." => "Muatnaik dibatalkan.", "Share" => "Kongsi", +"Rename" => "Namakan", "Pending" => "Dalam proses", "_%n folder_::_%n folders_" => array(""), "_%n file_::_%n files_" => array(""), diff --git a/apps/files/l10n/pl.php b/apps/files/l10n/pl.php index b5dc3aa2b62..7eb84013028 100644 --- a/apps/files/l10n/pl.php +++ b/apps/files/l10n/pl.php @@ -3,6 +3,7 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "Nie można było przenieść %s - Plik o takiej nazwie już istnieje", "Could not move %s" => "Nie można było przenieść %s", "File name cannot be empty." => "Nazwa pliku nie może być pusta.", +"Folder name cannot be empty." => "Nazwa folderu nie może być pusta.", "Unable to set upload directory." => "Nie można ustawić katalog wczytywania.", "Invalid Token" => "Nieprawidłowy Token", "No file was uploaded. Unknown error" => "Żaden plik nie został załadowany. Nieznany błąd", diff --git a/apps/files/l10n/pt_BR.php b/apps/files/l10n/pt_BR.php index a141d33a33c..79470200567 100644 --- a/apps/files/l10n/pt_BR.php +++ b/apps/files/l10n/pt_BR.php @@ -3,6 +3,14 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "Impossível mover %s - Um arquivo com este nome já existe", "Could not move %s" => "Impossível mover %s", "File name cannot be empty." => "O nome do arquivo não pode estar vazio.", +"File name must not contain \"/\". Please choose a different name." => "O nome do arquivo não deve conter \"/\". Por favor, escolha um nome diferente.", +"The name %s is already used in the folder %s. Please choose a different name." => "O nome %s já é usado na pasta %s. Por favor, escolha um nome diferente.", +"Not a valid source" => "Não é uma fonte válida", +"Error while downloading %s to %s" => "Erro ao baixar %s para %s", +"Error when creating the file" => "Erro ao criar o arquivo", +"Folder name cannot be empty." => "O nome da pasta não pode estar vazio.", +"Folder name must not contain \"/\". Please choose a different name." => "O nome da pasta não pode conter \"/\". Por favor, escolha um nome diferente.", +"Error when creating the folder" => "Erro ao criar a pasta", "Unable to set upload directory." => "Impossível configurar o diretório de upload", "Invalid Token" => "Token inválido", "No file was uploaded. Unknown error" => "Nenhum arquivo foi enviado. Erro desconhecido", @@ -23,11 +31,16 @@ $TRANSLATIONS = array( "Upload cancelled." => "Envio cancelado.", "Could not get result from server." => "Não foi possível obter o resultado do servidor.", "File upload is in progress. Leaving the page now will cancel the upload." => "Upload em andamento. Sair da página agora resultará no cancelamento do envio.", +"URL cannot be empty" => "URL não pode estar vazia", +"In the home folder 'Shared' is a reserved filename" => "Na pasta home 'Shared- Compartilhada' é um nome reservado", "{new_name} already exists" => "{new_name} já existe", +"Could not create file" => "Não foi possível criar o arquivo", +"Could not create folder" => "Não foi possível criar a pasta", "Share" => "Compartilhar", "Delete permanently" => "Excluir permanentemente", "Rename" => "Renomear", "Pending" => "Pendente", +"Could not rename file" => "Não foi possível renomear o arquivo", "replaced {new_name} with {old_name}" => "Substituído {old_name} por {new_name} ", "undo" => "desfazer", "_%n folder_::_%n folders_" => array("%n pasta","%n pastas"), @@ -64,6 +77,7 @@ $TRANSLATIONS = array( "From link" => "Do link", "Deleted files" => "Arquivos apagados", "Cancel upload" => "Cancelar upload", +"You don’t have permission to upload or create files here" => "Você não tem permissão para carregar ou criar arquivos aqui", "Nothing in here. Upload something!" => "Nada aqui.Carrege alguma coisa!", "Download" => "Baixar", "Unshare" => "Descompartilhar", diff --git a/apps/files/l10n/sv.php b/apps/files/l10n/sv.php index c570bc32e50..6360ff3cd57 100644 --- a/apps/files/l10n/sv.php +++ b/apps/files/l10n/sv.php @@ -3,6 +3,13 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "Kunde inte flytta %s - Det finns redan en fil med detta namn", "Could not move %s" => "Kan inte flytta %s", "File name cannot be empty." => "Filnamn kan inte vara tomt.", +"File name must not contain \"/\". Please choose a different name." => "Filnamnet får ej innehålla \"/\". Välj ett annat namn.", +"The name %s is already used in the folder %s. Please choose a different name." => "Namnet %s används redan i katalogen %s. Välj ett annat namn.", +"Error while downloading %s to %s" => "Fel under nerladdning från %s till %s", +"Error when creating the file" => "Fel under skapande utav filen", +"Folder name cannot be empty." => "Katalognamn kan ej vara tomt.", +"Folder name must not contain \"/\". Please choose a different name." => "Katalog namnet får ej innehålla \"/\". Välj ett annat namn.", +"Error when creating the folder" => "Fel under skapande utav en katalog", "Unable to set upload directory." => "Kan inte sätta mapp för uppladdning.", "Invalid Token" => "Ogiltig token", "No file was uploaded. Unknown error" => "Ingen fil uppladdad. Okänt fel", @@ -23,11 +30,16 @@ $TRANSLATIONS = array( "Upload cancelled." => "Uppladdning avbruten.", "Could not get result from server." => "Gick inte att hämta resultat från server.", "File upload is in progress. Leaving the page now will cancel the upload." => "Filuppladdning pågår. Lämnar du sidan så avbryts uppladdningen.", +"URL cannot be empty" => "URL kan ej vara tomt", +"In the home folder 'Shared' is a reserved filename" => "I hemma katalogen 'Delat' är ett reserverat filnamn", "{new_name} already exists" => "{new_name} finns redan", +"Could not create file" => "Kunde ej skapa fil", +"Could not create folder" => "Kunde ej skapa katalog", "Share" => "Dela", "Delete permanently" => "Radera permanent", "Rename" => "Byt namn", "Pending" => "Väntar", +"Could not rename file" => "Kan ej byta filnamn", "replaced {new_name} with {old_name}" => "ersatt {new_name} med {old_name}", "undo" => "ångra", "_%n folder_::_%n folders_" => array("%n mapp","%n mappar"), @@ -64,6 +76,7 @@ $TRANSLATIONS = array( "From link" => "Från länk", "Deleted files" => "Raderade filer", "Cancel upload" => "Avbryt uppladdning", +"You don’t have permission to upload or create files here" => "Du har ej tillåtelse att ladda upp eller skapa filer här", "Nothing in here. Upload something!" => "Ingenting här. Ladda upp något!", "Download" => "Ladda ner", "Unshare" => "Sluta dela", diff --git a/apps/files/l10n/tr.php b/apps/files/l10n/tr.php index b7b83f869e1..4bbb62c7162 100644 --- a/apps/files/l10n/tr.php +++ b/apps/files/l10n/tr.php @@ -8,6 +8,7 @@ $TRANSLATIONS = array( "Not a valid source" => "Geçerli bir kaynak değil", "Error while downloading %s to %s" => "%s, %s içine indirilirken hata", "Error when creating the file" => "Dosya oluşturulurken hata", +"Folder name cannot be empty." => "Klasör adı boş olamaz.", "Folder name must not contain \"/\". Please choose a different name." => "Klasör adı \"/\" içermemelidir. Lütfen farklı bir isim seçin.", "Error when creating the folder" => "Klasör oluşturulurken hata", "Unable to set upload directory." => "Yükleme dizini tanımlanamadı.", diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php index 6e2d360917b..35574b8e5b9 100644 --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@ -35,6 +35,12 @@ class Hooks { * @note This method should never be called for users using client side encryption
*/
public static function login($params) {
+
+ if (\OCP\App::isEnabled('files_encryption') === false) {
+ return true;
+ }
+
+
$l = new \OC_L10N('files_encryption');
$view = new \OC_FilesystemView('/');
@@ -117,11 +123,12 @@ class Hooks { * @note This method should never be called for users using client side encryption
*/
public static function postCreateUser($params) {
- $view = new \OC_FilesystemView('/');
-
- $util = new Util($view, $params['uid']);
- Helper::setupUser($util, $params['password']);
+ if (\OCP\App::isEnabled('files_encryption')) {
+ $view = new \OC_FilesystemView('/');
+ $util = new Util($view, $params['uid']);
+ Helper::setupUser($util, $params['password']);
+ }
}
/**
@@ -129,26 +136,31 @@ class Hooks { * @note This method should never be called for users using client side encryption
*/
public static function postDeleteUser($params) {
- $view = new \OC_FilesystemView('/');
- // cleanup public key
- $publicKey = '/public-keys/' . $params['uid'] . '.public.key';
+ if (\OCP\App::isEnabled('files_encryption')) {
+ $view = new \OC_FilesystemView('/');
- // Disable encryption proxy to prevent recursive calls
- $proxyStatus = \OC_FileProxy::$enabled;
- \OC_FileProxy::$enabled = false;
+ // cleanup public key
+ $publicKey = '/public-keys/' . $params['uid'] . '.public.key';
- $view->unlink($publicKey);
+ // Disable encryption proxy to prevent recursive calls
+ $proxyStatus = \OC_FileProxy::$enabled;
+ \OC_FileProxy::$enabled = false;
- \OC_FileProxy::$enabled = $proxyStatus;
+ $view->unlink($publicKey);
+
+ \OC_FileProxy::$enabled = $proxyStatus;
+ }
}
/**
* @brief If the password can't be changed within ownCloud, than update the key password in advance.
*/
public static function preSetPassphrase($params) {
- if ( ! \OC_User::canUserChangePassword($params['uid']) ) {
- self::setPassphrase($params);
+ if (\OCP\App::isEnabled('files_encryption')) {
+ if ( ! \OC_User::canUserChangePassword($params['uid']) ) {
+ self::setPassphrase($params);
+ }
}
}
@@ -157,6 +169,11 @@ class Hooks { * @param array $params keys: uid, password
*/
public static function setPassphrase($params) {
+
+ if (\OCP\App::isEnabled('files_encryption') === false) {
+ return true;
+ }
+
// Only attempt to change passphrase if server-side encryption
// is in use (client-side encryption does not have access to
// the necessary keys)
@@ -227,6 +244,10 @@ class Hooks { */
public static function preShared($params) {
+ if (\OCP\App::isEnabled('files_encryption') === false) {
+ return true;
+ }
+
$l = new \OC_L10N('files_encryption');
$users = array();
$view = new \OC\Files\View('/public-keys/');
@@ -278,6 +299,10 @@ class Hooks { // [run] => whether emitting script should continue to run
// TODO: Should other kinds of item be encrypted too?
+ if (\OCP\App::isEnabled('files_encryption') === false) {
+ return true;
+ }
+
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') {
$view = new \OC_FilesystemView('/');
@@ -372,6 +397,10 @@ class Hooks { // [shareWith] => test1
// [itemParent] =>
+ if (\OCP\App::isEnabled('files_encryption') === false) {
+ return true;
+ }
+
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') {
$view = new \OC_FilesystemView('/');
@@ -453,6 +482,11 @@ class Hooks { * of the stored versions along the actual file
*/
public static function postRename($params) {
+
+ if (\OCP\App::isEnabled('files_encryption') === false) {
+ return true;
+ }
+
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
diff --git a/apps/files_encryption/l10n/ca.php b/apps/files_encryption/l10n/ca.php index d55c5f6d302..61f45daee43 100644 --- a/apps/files_encryption/l10n/ca.php +++ b/apps/files_encryption/l10n/ca.php @@ -8,20 +8,26 @@ $TRANSLATIONS = array( "Could not change the password. Maybe the old password was not correct." => "No s'ha pogut canviar la contrasenya. Potser la contrasenya anterior no era correcta.", "Private key password successfully updated." => "La contrasenya de la clau privada s'ha actualitzat.", "Could not update the private key password. Maybe the old password was not correct." => "No s'ha pogut actualitzar la contrasenya de la clau privada. Potser la contrasenya anterior no era correcta.", +"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "L'aplicació d'encriptació no està inicialitzada! Potser l'aplicació d'encriptació ha estat reiniciada durant la sessió. Intenteu sortir i acreditar-vos de nou per reinicialitzar l'aplicació d'encriptació.", "Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "La clau privada no és vàlida! Probablement la contrasenya va ser canviada des de fora del sistema ownCloud (per exemple, en el directori de l'empresa). Vostè pot actualitzar la contrasenya de clau privada en la seva configuració personal per poder recuperar l'accés en els arxius xifrats.", +"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "No es pot desencriptar aquest fitxer, probablement és un fitxer compartit. Demaneu al propietari del fitxer que el comparteixi de nou amb vós.", +"Unknown error please check your system settings or contact your administrator" => "Error desconegut. Comproveu l'arranjament del sistema o contacteu amb l'administrador", "Missing requirements." => "Manca de requisits.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Assegureu-vos que teniu instal·lat PHP 5.3.3 o una versió superior i que està activat Open SSL i habilitada i configurada correctament l'extensió de PHP. De moment, l'aplicació d'encriptació s'ha desactivat.", "Following users are not set up for encryption:" => "Els usuaris següents no estan configurats per a l'encriptació:", "Saving..." => "Desant...", +"Go directly to your " => "Vés directament a", "personal settings" => "arranjament personal", "Encryption" => "Xifrat", "Enable recovery key (allow to recover users files in case of password loss):" => "Activa la clau de recuperació (permet recuperar fitxers d'usuaris en cas de pèrdua de contrasenya):", "Recovery key password" => "Clau de recuperació de la contrasenya", +"Repeat Recovery key password" => "Repetiu la clau de recuperació de contrasenya", "Enabled" => "Activat", "Disabled" => "Desactivat", "Change recovery key password:" => "Canvia la clau de recuperació de contrasenya:", "Old Recovery key password" => "Antiga clau de recuperació de contrasenya", "New Recovery key password" => "Nova clau de recuperació de contrasenya", +"Repeat New Recovery key password" => "Repetiu la nova clau de recuperació de contrasenya", "Change Password" => "Canvia la contrasenya", "Your private key password no longer match your log-in password:" => "La clau privada ja no es correspon amb la contrasenya d'accés:", "Set your old private key password to your current log-in password." => "Establiu la vostra contrasenya clau en funció de la contrasenya actual d'accés.", diff --git a/apps/files_encryption/l10n/mk.php b/apps/files_encryption/l10n/mk.php index fd8dd4e51c1..098f4d635ba 100644 --- a/apps/files_encryption/l10n/mk.php +++ b/apps/files_encryption/l10n/mk.php @@ -1,6 +1,20 @@ <?php $TRANSLATIONS = array( +"Password successfully changed." => "Лозинката е успешно променета.", +"Could not change the password. Maybe the old password was not correct." => "Лозинката не можеше да се промени. Можеби старата лозинка не беше исправна.", +"Missing requirements." => "Барања кои недостасуваат.", "Saving..." => "Снимам...", -"Encryption" => "Енкрипција" +"Go directly to your " => "Одете директно на вашиот", +"personal settings" => "лични подесувања", +"Encryption" => "Енкрипција", +"Repeat Recovery key password" => "Повтори ја лозинката за клучот на обновување", +"Enabled" => "Овозможен", +"Disabled" => "Оневозможен", +"Old Recovery key password" => "Старата лозинка за клучот на обновување ", +"Repeat New Recovery key password" => "Повтори ја лозинката за клучот на обновувањето", +"Change Password" => "Смени лозинка", +"Old log-in password" => "Старата лозинка за најавување", +"Current log-in password" => "Тековната лозинка за најавување", +"Enable password recovery:" => "Овозможи го обновувањето на лозинката:" ); $PLURAL_FORMS = "nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;"; diff --git a/apps/files_external/3rdparty/php-opencloud/LICENSE b/apps/files_external/3rdparty/php-opencloud/LICENSE new file mode 100644 index 00000000000..f7c56967e6c --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/LICENSE @@ -0,0 +1,16 @@ + Copyright 2012-2013 Rackspace US, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + All contributions to this repository are covered under the same license, + terms, and conditions.
\ No newline at end of file diff --git a/apps/files_external/3rdparty/php-opencloud/lib/Autoload.php b/apps/files_external/3rdparty/php-opencloud/lib/Autoload.php new file mode 100644 index 00000000000..32e9dc24b7e --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/Autoload.php @@ -0,0 +1,296 @@ +<?php + +// Copyright (c) 2004-2013 Fabien Potencier + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is furnished +// to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +class ClassLoader +{ + private $namespaces = array(); + private $prefixes = array(); + private $namespaceFallbacks = array(); + private $prefixFallbacks = array(); + private $useIncludePath = false; + + /** + * Turns on searching the include for class files. Allows easy loading + * of installed PEAR packages + * + * @param Boolean $useIncludePath + */ + public function useIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return Boolean + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Gets the configured namespaces. + * + * @return array A hash with namespaces as keys and directories as values + */ + public function getNamespaces() + { + return $this->namespaces; + } + + /** + * Gets the configured class prefixes. + * + * @return array A hash with class prefixes as keys and directories as values + */ + public function getPrefixes() + { + return $this->prefixes; + } + + /** + * Gets the directory(ies) to use as a fallback for namespaces. + * + * @return array An array of directories + */ + public function getNamespaceFallbacks() + { + return $this->namespaceFallbacks; + } + + /** + * Gets the directory(ies) to use as a fallback for class prefixes. + * + * @return array An array of directories + */ + public function getPrefixFallbacks() + { + return $this->prefixFallbacks; + } + + /** + * Registers the directory to use as a fallback for namespaces. + * + * @param array $dirs An array of directories + * + * @api + */ + public function registerNamespaceFallbacks(array $dirs) + { + $this->namespaceFallbacks = $dirs; + } + + /** + * Registers a directory to use as a fallback for namespaces. + * + * @param string $dir A directory + */ + public function registerNamespaceFallback($dir) + { + $this->namespaceFallbacks[] = $dir; + } + + /** + * Registers directories to use as a fallback for class prefixes. + * + * @param array $dirs An array of directories + * + * @api + */ + public function registerPrefixFallbacks(array $dirs) + { + $this->prefixFallbacks = $dirs; + } + + /** + * Registers a directory to use as a fallback for class prefixes. + * + * @param string $dir A directory + */ + public function registerPrefixFallback($dir) + { + $this->prefixFallbacks[] = $dir; + } + + /** + * Registers an array of namespaces + * + * @param array $namespaces An array of namespaces (namespaces as keys and locations as values) + * + * @api + */ + public function registerNamespaces(array $namespaces) + { + foreach ($namespaces as $namespace => $locations) { + $this->namespaces[$namespace] = (array) $locations; + } + } + + /** + * Registers a namespace. + * + * @param string $namespace The namespace + * @param array|string $paths The location(s) of the namespace + * + * @api + */ + public function registerNamespace($namespace, $paths) + { + $this->namespaces[$namespace] = (array) $paths; + } + + /** + * Registers an array of classes using the PEAR naming convention. + * + * @param array $classes An array of classes (prefixes as keys and locations as values) + * + * @api + */ + public function registerPrefixes(array $classes) + { + foreach ($classes as $prefix => $locations) { + $this->prefixes[$prefix] = (array) $locations; + } + } + + /** + * Registers a set of classes using the PEAR naming convention. + * + * @param string $prefix The classes prefix + * @param array|string $paths The location(s) of the classes + * + * @api + */ + public function registerPrefix($prefix, $paths) + { + $this->prefixes[$prefix] = (array) $paths; + } + + /** + * Registers this instance as an autoloader. + * + * @param Boolean $prepend Whether to prepend the autoloader or not + * + * @api + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + } + + /** + * Fix for certain versions of PHP that have trouble with + * namespaces with leading separators. + * + * @access private + * @param mixed $className + * @return void + */ + private function makeBackwardsCompatible($className) + { + return (phpversion() < '5.3.3') ? ltrim($className, '\\') : $className; + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * + * @return Boolean|null True, if loaded + */ + public function loadClass($class) + { + $class = $this->makeBackwardsCompatible($class); + + if ($file = $this->findFile($class)) { + require $file; + + return true; + } + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|null The path, if found + */ + public function findFile($class) + { + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $namespace = substr($class, 0, $pos); + $className = substr($class, $pos + 1); + $normalizedClass = str_replace('\\', DIRECTORY_SEPARATOR, $namespace).DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $className).'.php'; + foreach ($this->namespaces as $ns => $dirs) { + if (0 !== strpos($namespace, $ns)) { + continue; + } + + foreach ($dirs as $dir) { + $file = $dir.DIRECTORY_SEPARATOR.$normalizedClass; + if (is_file($file)) { + return $file; + } + } + } + + foreach ($this->namespaceFallbacks as $dir) { + $file = $dir.DIRECTORY_SEPARATOR.$normalizedClass; + if (is_file($file)) { + return $file; + } + } + + } else { + // PEAR-like class name + $normalizedClass = str_replace('_', DIRECTORY_SEPARATOR, $class).'.php'; + foreach ($this->prefixes as $prefix => $dirs) { + if (0 !== strpos($class, $prefix)) { + continue; + } + + foreach ($dirs as $dir) { + $file = $dir.DIRECTORY_SEPARATOR.$normalizedClass; + if (is_file($file)) { + return $file; + } + } + } + + foreach ($this->prefixFallbacks as $dir) { + $file = $dir.DIRECTORY_SEPARATOR.$normalizedClass; + if (is_file($file)) { + return $file; + } + } + } + + if ($this->useIncludePath && $file = stream_resolve_include_path($normalizedClass)) { + return $file; + } + } +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Base.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Base.php new file mode 100644 index 00000000000..f80c9320e2a --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Base.php @@ -0,0 +1,301 @@ +<?php +/** + * @copyright 2012-2013 Rackspace Hosting, Inc. + * See COPYING for licensing information + * @package phpOpenCloud + * @version 1.0 + * @author Glen Campbell <glen.campbell@rackspace.com> + * @author Jamie Hannaford <jamie.hannaford@rackspace.com> + */ + +namespace OpenCloud\Common; + +use OpenCloud\Common\Lang; +use OpenCloud\Common\Exceptions\AttributeError; +use OpenCloud\Common\Exceptions\JsonError; +use OpenCloud\Common\Exceptions\UrlError; + +/** + * The root class for all other objects used or defined by this SDK. + * + * It contains common code for error handling as well as service functions that + * are useful. Because it is an abstract class, it cannot be called directly, + * and it has no publicly-visible properties. + */ +abstract class Base +{ + + private $http_headers = array(); + private $_errors = array(); + + /** + * Debug status. + * + * @var LoggerInterface + * @access private + */ + private $logger; + + /** + * Sets the Logger object. + * + * @param \OpenCloud\Common\Log\LoggerInterface $logger + */ + public function setLogger(Log\LoggerInterface $logger) + { + $this->logger = $logger; + } + + /** + * Returns the Logger object. + * + * @return \OpenCloud\Common\Log\AbstractLogger + */ + public function getLogger() + { + if (null === $this->logger) { + $this->setLogger(new Log\Logger); + } + return $this->logger; + } + + /** + * Returns the URL of the service/object + * + * The assumption is that nearly all objects will have a URL; at this + * base level, it simply throws an exception to enforce the idea that + * subclasses need to define this method. + * + * @throws UrlError + */ + public function url($subresource = '') + { + throw new UrlError(Lang::translate( + 'URL method must be overridden in class definition' + )); + } + +/** + * Populates the current object based on an unknown data type. + * + * @param array|object|string|integer $info + * @throws Exceptions\InvalidArgumentError + */ + public function populate($info, $setObjects = true) + { + if (is_string($info) || is_integer($info)) { + + // If the data type represents an ID, the primary key is set + // and we retrieve the full resource from the API + $this->{$this->primaryKeyField()} = (string) $info; + $this->refresh($info); + + } elseif (is_object($info) || is_array($info)) { + + foreach($info as $key => $value) { + + if ($key == 'metadata' || $key == 'meta') { + + if (empty($this->metadata) || !$this->metadata instanceof Metadata) { + $this->metadata = new Metadata; + } + + // Metadata + $this->$key->setArray($value); + + } elseif (!empty($this->associatedResources[$key]) && $setObjects === true) { + + // Associated resource + try { + $resource = $this->service()->resource($this->associatedResources[$key], $value); + $resource->setParent($this); + $this->$key = $resource; + } catch (Exception\ServiceException $e) {} + + } elseif (!empty($this->associatedCollections[$key]) && $setObjects === true) { + + // Associated collection + try { + $this->$key = $this->service()->resourceList($this->associatedCollections[$key], null, $this); + } catch (Exception\ServiceException $e) {} + + } else { + + // Normal key/value pair + $this->$key = $value; + } + } + } elseif (null !== $info) { + throw new Exceptions\InvalidArgumentError(sprintf( + Lang::translate('Argument for [%s] must be string or object'), + get_class() + )); + } + } + + /** + * Sets extended attributes on an object and validates them + * + * This function is provided to ensure that attributes cannot + * arbitrarily added to an object. If this function is called, it + * means that the attribute is not defined on the object, and thus + * an exception is thrown. + * + * @codeCoverageIgnore + * + * @param string $property the name of the attribute + * @param mixed $value the value of the attribute + * @return void + */ + public function __set($property, $value) + { + $this->setProperty($property, $value); + } + + /** + * Sets an extended (unrecognized) property on the current object + * + * If RAXSDK_STRICT_PROPERTY_CHECKS is TRUE, then the prefix of the + * property name must appear in the $prefixes array, or else an + * exception is thrown. + * + * @param string $property the property name + * @param mixed $value the value of the property + * @param array $prefixes optional list of supported prefixes + * @throws \OpenCloud\AttributeError if strict checks are on and + * the property prefix is not in the list of prefixes. + */ + public function setProperty($property, $value, array $prefixes = array()) + { + // if strict checks are off, go ahead and set it + if (!RAXSDK_STRICT_PROPERTY_CHECKS + || $this->checkAttributePrefix($property, $prefixes) + ) { + $this->$property = $value; + } else { + // if that fails, then throw the exception + throw new AttributeError(sprintf( + Lang::translate('Unrecognized attribute [%s] for [%s]'), + $property, + get_class($this) + )); + } + } + + /** + * Converts an array of key/value pairs into a single query string + * + * For example, array('A'=>1,'B'=>2) would become 'A=1&B=2'. + * + * @param array $arr array of key/value pairs + * @return string + */ + public function makeQueryString($array) + { + $queryString = ''; + + foreach($array as $key => $value) { + if ($queryString) { + $queryString .= '&'; + } + $queryString .= urlencode($key) . '=' . urlencode($this->to_string($value)); + } + + return $queryString; + } + + /** + * Checks the most recent JSON operation for errors + * + * This function should be called after any `json_*()` function call. + * This ensures that nasty JSON errors are detected and the proper + * exception thrown. + * + * Example: + * `$obj = json_decode($string);` + * `if (check_json_error()) do something ...` + * + * @return boolean TRUE if an error occurred, FALSE if none + * @throws JsonError + * + * @codeCoverageIgnore + */ + public function checkJsonError() + { + switch (json_last_error()) { + case JSON_ERROR_NONE: + return; + case JSON_ERROR_DEPTH: + $jsonError = 'JSON error: The maximum stack depth has been exceeded'; + break; + case JSON_ERROR_STATE_MISMATCH: + $jsonError = 'JSON error: Invalid or malformed JSON'; + break; + case JSON_ERROR_CTRL_CHAR: + $jsonError = 'JSON error: Control character error, possibly incorrectly encoded'; + break; + case JSON_ERROR_SYNTAX: + $jsonError = 'JSON error: Syntax error'; + break; + case JSON_ERROR_UTF8: + $jsonError = 'JSON error: Malformed UTF-8 characters, possibly incorrectly encoded'; + break; + default: + $jsonError = 'Unexpected JSON error'; + break; + } + + if (isset($jsonError)) { + throw new JsonError(Lang::translate($jsonError)); + } + } + + /** + * Returns a class that implements the HttpRequest interface. + * + * This can be stubbed out for unit testing and avoid making live calls. + */ + public function getHttpRequestObject($url, $method = 'GET', array $options = array()) + { + return new Request\Curl($url, $method, $options); + } + + /** + * Checks the attribute $property and only permits it if the prefix is + * in the specified $prefixes array + * + * This is to support extension namespaces in some services. + * + * @param string $property the name of the attribute + * @param array $prefixes a list of prefixes + * @return boolean TRUE if valid; FALSE if not + */ + private function checkAttributePrefix($property, array $prefixes = array()) + { + $prefix = strstr($property, ':', true); + + if (in_array($prefix, $prefixes)) { + return true; + } else { + return false; + } + } + + /** + * Converts a value to an HTTP-displayable string form + * + * @param mixed $x a value to convert + * @return string + */ + private function to_string($x) + { + if (is_bool($x) && $x) { + return 'True'; + } elseif (is_bool($x)) { + return 'False'; + } else { + return (string) $x; + } + } + +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Collection.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Collection.php new file mode 100644 index 00000000000..e1bf80376e0 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Collection.php @@ -0,0 +1,320 @@ +<?php + +namespace OpenCloud\Common; + +/** + * Provides an abstraction for working with ordered sets of objects + * + * Collection objects are used whenever there are multiples; for example, + * multiple objects in a container, or multiple servers in a service. + * + * @since 1.0 + * @author Glen Campbell <glen.campbell@rackspace.com> + * @author Jamie Hannaford <jamie.hannaford@rackspace.com> + */ +class Collection extends Base +{ + + private $service; + private $itemclass; + private $itemlist = array(); + private $pointer = 0; + private $sortkey; + private $next_page_class; + private $next_page_callback; + private $next_page_url; + + /** + * A Collection is an array of objects + * + * Some assumptions: + * * The `Collection` class assumes that there exists on its service + * a factory method with the same name of the class. For example, if + * you create a Collection of class `Foobar`, it will attempt to call + * the method `parent::Foobar()` to create instances of that class. + * * It assumes that the factory method can take an array of values, and + * it passes that to the method. + * + * @param Service $service - the service associated with the collection + * @param string $itemclass - the Class of each item in the collection + * (assumed to be the name of the factory method) + * @param array $arr - the input array + */ + public function __construct($service, $itemclass, $array) + { + $this->service = $service; + + $this->getLogger()->info( + 'Collection:service={class}, class={itemClass}, array={array}', + array( + 'class' => get_class($service), + 'itemClass' => $itemclass, + 'array' => print_r($array, true) + ) + ); + + $this->next_page_class = $itemclass; + + if (false !== ($classNamePos = strrpos($itemclass, '\\'))) { + $this->itemclass = substr($itemclass, $classNamePos + 1); + } else { + $this->itemclass = $itemclass; + } + + if (!is_array($array)) { + throw new Exceptions\CollectionError( + Lang::translate('Cannot create a Collection without an array') + ); + } + + // save the array of items + $this->setItemList($array); + } + + /** + * Set the entire data array. + * + * @param array $array + */ + public function setItemList(array $array) + { + $this->itemlist = $array; + } + + /** + * Retrieve the entire data array. + * + * @return array + */ + public function getItemList() + { + return $this->itemlist; + } + + /** + * Returns the number of items in the collection + * + * For most services, this is the total number of items. If the Collection + * is paginated, however, this only returns the count of items in the + * current page of data. + * + * @return int + */ + public function count() + { + return count($this->itemlist); + } + + /** + * Pseudonym for count() + * + * @codeCoverageIgnore + */ + public function size() + { + return $this->count(); + } + + /** + * Retrieves the service associated with the Collection + * + * @return Service + */ + public function service() + { + return $this->service; + } + + /** + * Resets the pointer to the beginning, but does NOT return the first item + * + * @api + * @return void + */ + public function reset() + { + $this->pointer = 0; + } + + /** + * Resets the collection pointer back to the first item in the page + * and returns it + * + * This is useful if you're only interested in the first item in the page. + * + * @api + * @return Base the first item in the set + */ + public function first() + { + $this->reset(); + return $this->next(); + } + + /** + * Returns the next item in the page + * + * @api + * @return Base the next item or FALSE if at the end of the page + */ + public function next() + { + if ($this->pointer >= $this->count()) { + return false; + } + + $service = $this->service(); + + if (method_exists($service, $this->itemclass)) { + return $service->{$this->itemclass}($this->itemlist[$this->pointer++]); + } elseif (method_exists($service, 'resource')) { + return $service->resource($this->itemclass, $this->itemlist[$this->pointer++]); + } + // @codeCoverageIgnoreStart + return false; + // @codeCoverageIgnoreEnd + } + + /** + * sorts the collection on a specified key + * + * Note: only top-level keys can be used as the sort key. Note that this + * only sorts the data in the current page of the Collection (for + * multi-page data). + * + * @api + * @param string $keyname the name of the field to use as the sort key + * @return void + */ + public function sort($keyname = 'id') + { + $this->sortkey = $keyname; + usort($this->itemlist, array($this, 'sortCompare')); + } + + /** + * selects only specified items from the Collection + * + * This provides a simple form of filtering on Collections. For each item + * in the collection, it calls the callback function, passing it the item. + * If the callback returns `TRUE`, then the item is retained; if it returns + * `FALSE`, then the item is deleted from the collection. + * + * Note that this should not supersede server-side filtering; the + * `Collection::Select()` method requires that *all* of the data for the + * Collection be retrieved from the server before the filtering is + * performed; this can be very inefficient, especially for large data + * sets. This method is mostly useful on smaller-sized sets. + * + * Example: + * <code> + * $services = $connection->ServiceList(); + * $services->Select(function($item){ return $item->region=='ORD';}); + * // now the $services Collection only has items from the ORD region + * </code> + * + * `Select()` is *destructive*; that is, it actually removes entries from + * the collection. For example, if you use `Select()` to find items with + * the ID > 10, then use it again to find items that are <= 10, it will + * return an empty list. + * + * @api + * @param callable $testfunc a callback function that is passed each item + * in turn. Note that `Select()` performs an explicit test for + * `FALSE`, so functions like `strpos()` need to be cast into a + * boolean value (and not just return the integer). + * @returns void + * @throws DomainError if callback doesn't return a boolean value + */ + public function select($testfunc) + { + foreach ($this->getItemList() as $index => $item) { + $test = call_user_func($testfunc, $item); + if (!is_bool($test)) { + throw new Exceptions\DomainError( + Lang::translate('Callback function for Collection::Select() did not return boolean') + ); + } + if ($test === false) { + unset($this->itemlist[$index]); + } + } + } + + /** + * returns the Collection object for the next page of results, or + * FALSE if there are no more pages + * + * Generally, the structure for a multi-page collection will look like + * this: + * + * $coll = $obj->Collection(); + * do { + * while($item = $coll->Next()) { + * // do something with the item + * } + * } while ($coll = $coll->NextPage()); + * + * @api + * @return Collection if there are more pages of results, otherwise FALSE + */ + public function nextPage() + { + if (isset($this->next_page_url)) { + return call_user_func( + $this->next_page_callback, + $this->next_page_class, + $this->next_page_url + ); + } + // @codeCoverageIgnoreStart + return false; + // @codeCoverageIgnoreEnd + } + + /** + * for paginated collection, sets the callback function and URL for + * the next page + * + * The callback function should have the signature: + * + * function Whatever($class, $url, $parent) + * + * and the `$url` should be the URL of the next page of results + * + * @param callable $callback the name of the function (or array of + * object, function name) + * @param string $url the URL of the next page of results + * @return void + */ + public function setNextPageCallback($callback, $url) + { + $this->next_page_callback = $callback; + $this->next_page_url = $url; + } + + /** + * Compares two values of sort keys + */ + private function sortCompare($a, $b) + { + $key = $this->sortkey; + + // handle strings with strcmp() + if (is_string($a->$key)) { + return strcmp($a->$key, $b->$key); + } + + // handle others with logical comparisons + if ($a->$key == $b->$key) { + return 0; + } + + if ($a->$key < $b->$key) { + return -1; + } else { + return 1; + } + } + +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncError.php new file mode 100644 index 00000000000..cbbacff38bd --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class AsyncError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncHttpError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncHttpError.php new file mode 100644 index 00000000000..dc7b2d7e3a7 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncHttpError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class AsyncHttpError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncTimeoutError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncTimeoutError.php new file mode 100644 index 00000000000..bba5f09f64f --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncTimeoutError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class AsyncTimeoutError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AttributeError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AttributeError.php new file mode 100644 index 00000000000..7d09ceb0147 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AttributeError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class AttributeError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AuthenticationError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AuthenticationError.php new file mode 100644 index 00000000000..091e4602ec0 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AuthenticationError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class AuthenticationError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/BaseException.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/BaseException.php new file mode 100644 index 00000000000..0bc967adf67 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/BaseException.php @@ -0,0 +1,7 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class BaseException extends \Exception +{ +}
\ No newline at end of file diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnError.php new file mode 100644 index 00000000000..0f972e9c5c7 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class CdnError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnHttpError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnHttpError.php new file mode 100644 index 00000000000..f1e2722f158 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnHttpError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class CdnHttpError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnNotAvailableError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnNotAvailableError.php new file mode 100644 index 00000000000..853b17c7127 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnNotAvailableError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class CdnNotAvailableError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnTtlError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnTtlError.php new file mode 100644 index 00000000000..b4364f93467 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnTtlError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class CdnTtlError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CollectionError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CollectionError.php new file mode 100644 index 00000000000..9d5030403f6 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CollectionError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class CollectionError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerCreateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerCreateError.php new file mode 100644 index 00000000000..afc8119bd5a --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerCreateError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class ContainerCreateError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerDeleteError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerDeleteError.php new file mode 100644 index 00000000000..c212bfbaffd --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerDeleteError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class ContainerDeleteError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerError.php new file mode 100644 index 00000000000..c9716fef075 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class ContainerError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNameError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNameError.php new file mode 100644 index 00000000000..e0b9592835e --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNameError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class ContainerNameError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNotEmptyError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNotEmptyError.php new file mode 100644 index 00000000000..e987449d444 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNotEmptyError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class ContainerNotEmptyError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNotFoundError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNotFoundError.php new file mode 100644 index 00000000000..2e700dbe039 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNotFoundError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class ContainerNotFoundError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CreateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CreateError.php new file mode 100644 index 00000000000..bb2030373fb --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CreateError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class CreateError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CreateUpdateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CreateUpdateError.php new file mode 100644 index 00000000000..8aa651a76d9 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CreateUpdateError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class CreateUpdateError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CredentialError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CredentialError.php new file mode 100644 index 00000000000..2769edaf378 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CredentialError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class CredentialError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseCreateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseCreateError.php new file mode 100644 index 00000000000..eb19198c2fe --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseCreateError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class DatabaseCreateError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseDeleteError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseDeleteError.php new file mode 100644 index 00000000000..41f397529fe --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseDeleteError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class DatabaseDeleteError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseListError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseListError.php new file mode 100644 index 00000000000..04a7fb9e835 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseListError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class DatabaseListError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseNameError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseNameError.php new file mode 100644 index 00000000000..17a987a03b0 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseNameError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class DatabaseNameError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseUpdateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseUpdateError.php new file mode 100644 index 00000000000..c891c173787 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseUpdateError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class DatabaseUpdateError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DeleteError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DeleteError.php new file mode 100644 index 00000000000..27c4b2a4894 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DeleteError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class DeleteError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DocumentError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DocumentError.php new file mode 100644 index 00000000000..d501e3594b6 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DocumentError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class DocumentError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DomainError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DomainError.php new file mode 100644 index 00000000000..b4eac2ae1d3 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DomainError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class DomainError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/EmptyResponseError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/EmptyResponseError.php new file mode 100644 index 00000000000..c7863c09b01 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/EmptyResponseError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class EmptyResponseError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/EndpointError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/EndpointError.php new file mode 100644 index 00000000000..a686a6456e9 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/EndpointError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class EndpointError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/FlavorError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/FlavorError.php new file mode 100644 index 00000000000..469dc27e76c --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/FlavorError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class FlavorError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpError.php new file mode 100644 index 00000000000..1b54b8a8253 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class HttpError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpForbiddenError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpForbiddenError.php new file mode 100644 index 00000000000..a5c64780516 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpForbiddenError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class HttpForbiddenError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpOverLimitError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpOverLimitError.php new file mode 100644 index 00000000000..243e8df64fd --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpOverLimitError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class HttpOverLimitError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpRetryError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpRetryError.php new file mode 100644 index 00000000000..78345840bba --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpRetryError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class HttpRetryError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpTimeoutError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpTimeoutError.php new file mode 100644 index 00000000000..81bc9dda608 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpTimeoutError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class HttpTimeoutError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpUnauthorizedError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpUnauthorizedError.php new file mode 100644 index 00000000000..9b1edb20333 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpUnauthorizedError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class HttpUnauthorizedError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpUrlError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpUrlError.php new file mode 100644 index 00000000000..fa2af82c564 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpUrlError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class HttpUrlError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/IOError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/IOError.php new file mode 100644 index 00000000000..df816336c6c --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/IOError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class IOError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/IdRequiredError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/IdRequiredError.php new file mode 100644 index 00000000000..398b9f3fd85 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/IdRequiredError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class IdRequiredError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ImageError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ImageError.php new file mode 100644 index 00000000000..3b846a7551f --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ImageError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class ImageError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceCreateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceCreateError.php new file mode 100644 index 00000000000..65caa154497 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceCreateError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class InstanceCreateError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceDeleteError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceDeleteError.php new file mode 100644 index 00000000000..e4c6fdb7f57 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceDeleteError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class InstanceDeleteError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceError.php new file mode 100644 index 00000000000..48152824862 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class InstanceError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceFlavorError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceFlavorError.php new file mode 100644 index 00000000000..e8a074eb9bf --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceFlavorError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class InstanceFlavorError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceNotFound.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceNotFound.php new file mode 100644 index 00000000000..4bc94797b3f --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceNotFound.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class InstanceNotFound extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceUpdateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceUpdateError.php new file mode 100644 index 00000000000..b15f3426013 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceUpdateError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class InstanceUpdateError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidArgumentError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidArgumentError.php new file mode 100644 index 00000000000..a655f11a731 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidArgumentError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class InvalidArgumentError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidIdTypeError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidIdTypeError.php new file mode 100644 index 00000000000..f329c748957 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidIdTypeError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class InvalidIdTypeError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidIpTypeError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidIpTypeError.php new file mode 100644 index 00000000000..370d8f650de --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidIpTypeError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class InvalidIpTypeError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidParameterError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidParameterError.php new file mode 100644 index 00000000000..f13986ffc94 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidParameterError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class InvalidParameterError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidRequestError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidRequestError.php new file mode 100644 index 00000000000..0266d8f22bd --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidRequestError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class InvalidRequestError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/JsonError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/JsonError.php new file mode 100644 index 00000000000..96f9102ed37 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/JsonError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class JsonError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/LoggingException.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/LoggingException.php new file mode 100644 index 00000000000..a5bdad705f4 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/LoggingException.php @@ -0,0 +1,16 @@ +<?php +/** + * @copyright Copyright 2012-2013 Rackspace US, Inc. + See COPYING for licensing information. + * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0 + * @version 1.5.9 + * @author Jamie Hannaford <jamie.hannaford@rackspace.com> + */ + +namespace OpenCloud\Common\Exceptions; + +use Exception; + +class LoggingException extends Exception +{ +}
\ No newline at end of file diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataCreateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataCreateError.php new file mode 100644 index 00000000000..a119397392f --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataCreateError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class MetadataCreateError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataDeleteError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataDeleteError.php new file mode 100644 index 00000000000..4acd879afe9 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataDeleteError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class MetadataDeleteError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataError.php new file mode 100644 index 00000000000..65f94975a44 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class MetadataError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataJsonError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataJsonError.php new file mode 100644 index 00000000000..a7a74ca9e13 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataJsonError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class MetadataJsonError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataKeyError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataKeyError.php new file mode 100644 index 00000000000..606f6d95874 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataKeyError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class MetadataKeyError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataPrefixError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataPrefixError.php new file mode 100644 index 00000000000..271e69010a7 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataPrefixError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class MetadataPrefixError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataUpdateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataUpdateError.php new file mode 100644 index 00000000000..49db43d6f70 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataUpdateError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class MetadataUpdateError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MisMatchedChecksumError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MisMatchedChecksumError.php new file mode 100644 index 00000000000..75b4f926995 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MisMatchedChecksumError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class MisMatchedChecksumError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MissingValueError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MissingValueError.php new file mode 100644 index 00000000000..0dd5b8ee737 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MissingValueError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class MissingValueError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NameError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NameError.php new file mode 100644 index 00000000000..6918120a56c --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NameError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class NameError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkCreateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkCreateError.php new file mode 100644 index 00000000000..a0c7640ffe8 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkCreateError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class NetworkCreateError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkDeleteError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkDeleteError.php new file mode 100644 index 00000000000..0e2922babe2 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkDeleteError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class NetworkDeleteError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkError.php new file mode 100644 index 00000000000..4b30806c1bc --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class NetworkError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkUpdateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkUpdateError.php new file mode 100644 index 00000000000..f55f09d8ec2 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkUpdateError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class NetworkUpdateError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkUrlError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkUrlError.php new file mode 100644 index 00000000000..666ec50482b --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkUrlError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class NetworkUrlError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NoContentTypeError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NoContentTypeError.php new file mode 100644 index 00000000000..59a33088163 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NoContentTypeError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class NoContentTypeError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NoNameError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NoNameError.php new file mode 100644 index 00000000000..2d56f5fcd0d --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NoNameError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class NoNameError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjFetchError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjFetchError.php new file mode 100644 index 00000000000..9d7391823e8 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjFetchError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class ObjFetchError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjectCopyError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjectCopyError.php new file mode 100644 index 00000000000..ef7b3b39220 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjectCopyError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class ObjectCopyError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjectError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjectError.php new file mode 100644 index 00000000000..ea667ad25f6 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjectError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class ObjectError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/RebuildError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/RebuildError.php new file mode 100644 index 00000000000..9ee6ab37fd9 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/RebuildError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class RebuildError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/RecordTypeError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/RecordTypeError.php new file mode 100644 index 00000000000..718ce98574c --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/RecordTypeError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class RecordTypeError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerActionError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerActionError.php new file mode 100644 index 00000000000..d4ad6453281 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerActionError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class ServerActionError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerCreateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerCreateError.php new file mode 100644 index 00000000000..69904111c61 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerCreateError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class ServerCreateError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerDeleteError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerDeleteError.php new file mode 100644 index 00000000000..94a1adc4f0b --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerDeleteError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class ServerDeleteError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerImageScheduleError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerImageScheduleError.php new file mode 100644 index 00000000000..19fbcbd279c --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerImageScheduleError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class ServerImageScheduleError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerIpsError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerIpsError.php new file mode 100644 index 00000000000..3e737c28614 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerIpsError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class ServerIpsError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerJsonError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerJsonError.php new file mode 100644 index 00000000000..c10e67d645d --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerJsonError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class ServerJsonError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerUpdateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerUpdateError.php new file mode 100644 index 00000000000..d9d7b370808 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerUpdateError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class ServerUpdateError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerUrlError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerUrlError.php new file mode 100644 index 00000000000..ba0308d04e7 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerUrlError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class ServerUrlError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServiceValueError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServiceValueError.php new file mode 100644 index 00000000000..7ce52c846a4 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServiceValueError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class ServiceValueError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/SnapshotError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/SnapshotError.php new file mode 100644 index 00000000000..14d7614a9ee --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/SnapshotError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class SnapshotError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/TempUrlMethodError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/TempUrlMethodError.php new file mode 100644 index 00000000000..61f4647d1b3 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/TempUrlMethodError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class TempUrlMethodError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnknownError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnknownError.php new file mode 100644 index 00000000000..2b0772530fc --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnknownError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class UnknownError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnknownParameterError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnknownParameterError.php new file mode 100644 index 00000000000..704ee28c052 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnknownParameterError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class UnknownParameterError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnrecognizedServiceError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnrecognizedServiceError.php new file mode 100644 index 00000000000..396d451e131 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnrecognizedServiceError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class UnrecognizedServiceError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedExtensionError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedExtensionError.php new file mode 100644 index 00000000000..5ff5ae89c73 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedExtensionError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class UnsupportedExtensionError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedFeatureExtension.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedFeatureExtension.php new file mode 100644 index 00000000000..6d9143a1d91 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedFeatureExtension.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class UnsupportedFeatureExtension extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedVersionError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedVersionError.php new file mode 100644 index 00000000000..060733ad5b5 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedVersionError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class UnsupportedVersionError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UpdateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UpdateError.php new file mode 100644 index 00000000000..23f0dbb6aa7 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UpdateError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class UpdateError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UrlError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UrlError.php new file mode 100644 index 00000000000..6c4d9ab69aa --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UrlError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class UrlError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserCreateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserCreateError.php new file mode 100644 index 00000000000..f87ee0d2fc9 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserCreateError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class UserCreateError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserDeleteError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserDeleteError.php new file mode 100644 index 00000000000..3196289aafc --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserDeleteError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class UserDeleteError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserListError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserListError.php new file mode 100644 index 00000000000..7d287ae0ecf --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserListError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class UserListError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserNameError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserNameError.php new file mode 100644 index 00000000000..51902f8e93c --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserNameError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class UserNameError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserUpdateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserUpdateError.php new file mode 100644 index 00000000000..403b53420d0 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserUpdateError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class UserUpdateError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/VolumeError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/VolumeError.php new file mode 100644 index 00000000000..c19c4c2009d --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/VolumeError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class VolumeError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/VolumeTypeError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/VolumeTypeError.php new file mode 100644 index 00000000000..a9cc1e3f64b --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/VolumeTypeError.php @@ -0,0 +1,5 @@ +<?php + +namespace OpenCloud\Common\Exceptions; + +class VolumeTypeError extends \Exception {} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/Role.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/Role.php new file mode 100644 index 00000000000..b2c480d71b5 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/Role.php @@ -0,0 +1,21 @@ +<?php + +/** + * PHP OpenCloud library. + * + * @author Jamie Hannaford <jamie@limetree.org> + * @version 2.0.0 + * @copyright Copyright 2012-2013 Rackspace US, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0 + */ + +/** + * Description of Role + * + * @link + * + * @codeCoverageIgnore + */ +class Role +{ +}
\ No newline at end of file diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/Tenant.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/Tenant.php new file mode 100644 index 00000000000..62783613c2f --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/Tenant.php @@ -0,0 +1,22 @@ +<?php + +/** + * PHP OpenCloud library. + * + * @author Jamie Hannaford <jamie@limetree.org> + * @version 2.0.0 + * @copyright Copyright 2012-2013 Rackspace US, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0 + */ + +/** + * Description of Tenant + * + * @link + * + * @codeCoverageIgnore + */ +class Tenant +{ + +}
\ No newline at end of file diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/User.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/User.php new file mode 100644 index 00000000000..9e3862d1750 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/User.php @@ -0,0 +1,73 @@ +<?php +/** + * @copyright 2012-2013 Rackspace Hosting, Inc. + * See COPYING for licensing information + * @package phpOpenCloud + * @version 1.5.9 + * @author Glen Campbell <glen.campbell@rackspace.com> + * @author Jamie Hannaford <jamie.hannaford@rackspace.co.uk> + */ + +/** + * Represents a sub-user in Keystone. + * + * @link http://docs.rackspace.com/auth/api/v2.0/auth-client-devguide/content/User_Calls.html + * + * @codeCoverageIgnore + */ +class User extends PersistentObject +{ + + public static function factory($info) + { + $user = new self; + } + + /** + * Return detailed information about a specific user, by either user name or user ID. + * @param int|string $info + */ + public function get($info) + { + if (is_integer($info)) { + + } elseif (is_string($info)) { + + } else { + throw new Exception\IdentityException(sprintf( + 'A string-based username or an integer-based user ID is valid' + )); + } + } + + public function create() + { + + } + + public function update() + { + + } + + public function delete() + { + + } + + public function listAllCredentials() + { + + } + + public function getCredentials() + { + + } + + public function resetApiKey() + { + + } + +}
\ No newline at end of file diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Lang.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Lang.php new file mode 100644 index 00000000000..7bb12859734 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Lang.php @@ -0,0 +1,21 @@ +<?php + +namespace OpenCloud\Common; + +class Lang +{ + + public static function translate($word = null) + { + return $word; + } + + public static function noslash($str) + { + while ($str && (substr($str, -1) == '/')) { + $str = substr($str, 0, strlen($str) - 1); + } + return $str; + } + +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/AbstractLogger.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/AbstractLogger.php new file mode 100644 index 00000000000..c7aea7f8767 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/AbstractLogger.php @@ -0,0 +1,140 @@ +<?php + +// Copyright (c) 2012 PHP Framework Interoperability Group +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +namespace OpenCloud\Common\Log; + +/** + * This is a simple Logger implementation that other Loggers can inherit from. + * + * It simply delegates all log-level-specific methods to the `log` method to + * reduce boilerplate code that a simple Logger that does the same thing with + * messages regardless of the error level has to implement. + */ +abstract class AbstractLogger implements LoggerInterface +{ + /** + * System is unusable. + * + * @param string $message + * @param array $context + * @return null + */ + public function emergency($message, array $context = array()) + { + $this->log(LogLevel::EMERGENCY, $message, $context); + } + + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string $message + * @param array $context + * @return null + */ + public function alert($message, array $context = array()) + { + $this->log(LogLevel::ALERT, $message, $context); + } + + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string $message + * @param array $context + * @return null + */ + public function critical($message, array $context = array()) + { + $this->log(LogLevel::CRITICAL, $message, $context); + } + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string $message + * @param array $context + * @return null + */ + public function error($message, array $context = array()) + { + $this->log(LogLevel::ERROR, $message, $context); + } + + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + * + * @param string $message + * @param array $context + * @return null + */ + public function warning($message, array $context = array()) + { + $this->log(LogLevel::WARNING, $message, $context); + } + + /** + * Normal but significant events. + * + * @param string $message + * @param array $context + * @return null + */ + public function notice($message, array $context = array()) + { + $this->log(LogLevel::NOTICE, $message, $context); + } + + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string $message + * @param array $context + * @return null + */ + public function info($message, array $context = array()) + { + $this->log(LogLevel::INFO, $message, $context); + } + + /** + * Detailed debug information. + * + * @param string $message + * @param array $context + * @return null + */ + public function debug($message, array $context = array()) + { + $this->log(LogLevel::DEBUG, $message, $context); + } +}
\ No newline at end of file diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/LogLevel.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/LogLevel.php new file mode 100644 index 00000000000..64b0169b507 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/LogLevel.php @@ -0,0 +1,38 @@ +<?php + +// Copyright (c) 2012 PHP Framework Interoperability Group +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +namespace OpenCloud\Common\Log; + +/** + * Describes log levels + */ +class LogLevel +{ + const EMERGENCY = 'emergency'; + const ALERT = 'alert'; + const CRITICAL = 'critical'; + const ERROR = 'error'; + const WARNING = 'warning'; + const NOTICE = 'notice'; + const INFO = 'info'; + const DEBUG = 'debug'; +}
\ No newline at end of file diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/Logger.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/Logger.php new file mode 100644 index 00000000000..e11d3fbb7ca --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/Logger.php @@ -0,0 +1,220 @@ +<?php +/** + * @copyright Copyright 2012-2013 Rackspace US, Inc. + See COPYING for licensing information. + * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0 + * @version 1.5.9 + * @author Jamie Hannaford <jamie.hannaford@rackspace.com> + */ + +namespace OpenCloud\Common\Log; + +use OpenCloud\Common\Exceptions\LoggingException; + +/** + * Basic logger for OpenCloud which extends FIG's PSR-3 standard logger. + * + * @link https://github.com/php-fig/log + */ +class Logger extends AbstractLogger +{ + /** + * Is this debug class enabled or not? + * + * @var bool + */ + private $enabled = false; + + /** + * These are the levels which will always be outputted - regardless of + * user-imposed settings. + * + * @var array + */ + private $urgentLevels = array( + LogLevel::EMERGENCY, + LogLevel::ALERT, + LogLevel::CRITICAL + ); + + /** + * Logging options. + * + * @var array + */ + private $options = array( + 'outputToFile' => false, + 'logFile' => null, + 'dateFormat' => 'd/m/y H:I', + 'delimeter' => ' - ' + ); + + /** + * Determines whether a log level needs to be outputted. + * + * @param string $logLevel + * @return bool + */ + private function outputIsUrgent($logLevel) + { + return in_array($logLevel, $this->urgentLevels); + } + + /** + * Interpolates context values into the message placeholders. + * + * @param string $message + * @param array $context + * @return type + */ + private function interpolate($message, array $context = array()) + { + // build a replacement array with braces around the context keys + $replace = array(); + foreach ($context as $key => $val) { + $replace['{' . $key . '}'] = $val; + } + + // interpolate replacement values into the message and return + return strtr($message, $replace); + } + + /** + * Enable or disable the debug class. + * + * @param bool $enabled + * @return self + */ + public function setEnabled($enabled) + { + $this->enabled = $enabled; + return $this; + } + + /** + * Is the debug class enabled? + * + * @return bool + */ + public function getEnabled() + { + return $this->enabled; + } + + /** + * Set an array of options. + * + * @param array $options + */ + public function setOptions(array $options = array()) + { + foreach ($options as $key => $value) { + $this->setOption($key, $value); + } + } + + /** + * Get all options. + * + * @return array + */ + public function getOptions() + { + return $this->options; + } + + /** + * Set an individual option. + * + * @param string $key + * @param string $value + */ + public function setOption($key, $value) + { + if ($this->optionExists($key)) { + $this->options[$key] = $value; + } + } + + /** + * Get an individual option. + * + * @param string $key + * @return string|null + */ + public function getOption($key) + { + if ($this->optionExists($key)) { + return $this->options[$key]; + } + } + + /** + * Check whether an individual option exists. + * + * @param string $key + * @return bool + */ + private function optionExists($key) + { + return array_key_exists($key, $this->getOptions()); + } + + /** + * Outputs a log message if necessary. + * + * @param string $logLevel + * @param string $message + * @param string $context + */ + public function log($level, $message, array $context = array()) + { + if ($this->outputIsUrgent($level) + || $this->getEnabled() === true + || RAXSDK_DEBUG === true + ) { + $this->dispatch($message, $context); + } + } + + /** + * Used to format the line outputted in the log file. + * + * @param string $string + * @return string + */ + private function formatFileLine($string) + { + $format = $this->getOption('dateFormat') . $this->getOption('delimeter'); + return date($format) . $string; + } + + /** + * Dispatch a log output message. + * + * @param string $message + * @param array $context + * @throws LoggingException + */ + private function dispatch($message, $context) + { + $output = $this->interpolate($message, $context) . PHP_EOL; + + if ($this->getOption('outputToFile') === true) { + $file = $this->getOption('logFile'); + + if (!is_writable($file)) { + throw new LoggingException( + 'The log file either does not exist or is not writeable' + ); + } + + // Output to file + file_put_contents($file, $this->formatFileLine($output)); + } else { + + echo $output; + } + } + +}
\ No newline at end of file diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/LoggerInterface.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/LoggerInterface.php new file mode 100644 index 00000000000..daef1b04dad --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/LoggerInterface.php @@ -0,0 +1,134 @@ +<?php + +// Copyright (c) 2012 PHP Framework Interoperability Group +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +namespace OpenCloud\Common\Log; + +/** + * Describes a logger instance + * + * The message MUST be a string or object implementing __toString(). + * + * The message MAY contain placeholders in the form: {foo} where foo + * will be replaced by the context data in key "foo". + * + * The context array can contain arbitrary data, the only assumption that + * can be made by implementors is that if an Exception instance is given + * to produce a stack trace, it MUST be in a key named "exception". + * + * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md + * for the full interface specification. + */ +interface LoggerInterface +{ + /** + * System is unusable. + * + * @param string $message + * @param array $context + * @return null + */ + public function emergency($message, array $context = array()); + + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string $message + * @param array $context + * @return null + */ + public function alert($message, array $context = array()); + + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string $message + * @param array $context + * @return null + */ + public function critical($message, array $context = array()); + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string $message + * @param array $context + * @return null + */ + public function error($message, array $context = array()); + + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + * + * @param string $message + * @param array $context + * @return null + */ + public function warning($message, array $context = array()); + + /** + * Normal but significant events. + * + * @param string $message + * @param array $context + * @return null + */ + public function notice($message, array $context = array()); + + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string $message + * @param array $context + * @return null + */ + public function info($message, array $context = array()); + + /** + * Detailed debug information. + * + * @param string $message + * @param array $context + * @return null + */ + public function debug($message, array $context = array()); + + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string $message + * @param array $context + * @return null + */ + public function log($level, $message, array $context = array()); +}
\ No newline at end of file diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Metadata.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Metadata.php new file mode 100644 index 00000000000..be6903e897e --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Metadata.php @@ -0,0 +1,92 @@ +<?php +/** + * A metadata object, used by other components in Compute and Object Storage + * + * @copyright 2012-2013 Rackspace Hosting, Inc. + * See COPYING for licensing information + * + * @package phpOpenCloud + * @version 1.0 + * @author Glen Campbell <glen.campbell@rackspace.com> + */ + +namespace OpenCloud\Common; + +/** + * The Metadata class represents either Server or Image metadata + * + * @api + * @author Glen Campbell <glen.campbell@rackspace.com> + */ +class Metadata extends Base +{ + + // array holding the names of keys that were set + private $_keylist = array(); + + /** + * This setter overrides the base one, since the metadata key can be + * anything + * + * @param string $key + * @param string $value + * @return void + */ + public function __set($key, $value) + { + // set the value and track the keys + if (!in_array($key, $this->_keylist)) { + $this->_keylist[] = $key; + } + + $this->$key = $value; + } + + /** + * Returns the list of keys defined + * + * @return array + */ + public function Keylist() + { + return $this->_keylist; + } + + /** + * Sets metadata values from an array, with optional prefix + * + * If $prefix is provided, then only array keys that match the prefix + * are set as metadata values, and $prefix is stripped from the key name. + * + * @param array $values an array of key/value pairs to set + * @param string $prefix if provided, a prefix that is used to identify + * metadata values. For example, you can set values from headers + * for a Container by using $prefix='X-Container-Meta-'. + * @return void + */ + public function setArray($values, $prefix = null) + { + if (empty($values)) { + return false; + } + + foreach ($values as $key => $value) { + if ($prefix) { + if (strpos($key, $prefix) === 0) { + $name = substr($key, strlen($prefix)); + $this->getLogger()->info( + Lang::translate('Setting [{name}] to [{value}]'), + array( + 'name' => $name, + 'value' => $value + ) + ); + $this->$name = $value; + } + } else { + $this->$key = $value; + } + } + } + +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Nova.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Nova.php new file mode 100644 index 00000000000..fe4dcccc73f --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Nova.php @@ -0,0 +1,140 @@ +<?php + +/** + * An abstract class that defines shared components for products that use + * OpenStack Nova + * + * @copyright 2012-2013 Rackspace Hosting, Inc. + * See COPYING for licensing information + * + * @package phpOpenCloud + * @version 1.0 + * @author Glen Campbell <glen.campbell@rackspace.com> + */ + +namespace OpenCloud\Common; + +use OpenCloud\OpenStack; +use OpenCloud\Common\Lang; +use OpenCloud\Compute\Flavor; + +/** + * Nova is an abstraction layer for the OpenStack compute service. + * + * Nova is used as a basis for several products, including Compute services + * as well as Rackspace's Cloud Databases. This class is, in essence, a vehicle + * for sharing common code between those other classes. + */ +abstract class Nova extends Service +{ + + private $_url; + + /** + * Called when creating a new Compute service object + * + * _NOTE_ that the order of parameters for this is *different* from the + * parent Service class. This is because the earlier parameters are the + * ones that most typically change, whereas the later ones are not + * modified as often. + * + * @param \OpenCloud\Identity $conn - a connection object + * @param string $serviceRegion - identifies the region of this Compute + * service + * @param string $urltype - identifies the URL type ("publicURL", + * "privateURL") + * @param string $serviceName - identifies the name of the service in the + * catalog + */ + public function __construct( + OpenStack $conn, + $serviceType, + $serviceName, + $serviceRegion, + $urltype + ) { + parent::__construct( + $conn, + $serviceType, + $serviceName, + $serviceRegion, + $urltype + ); + + $this->_url = Lang::noslash(parent::Url()); + + $this->getLogger()->info(Lang::translate('Initializing Nova...')); + } + + /** + * Returns a flavor from the service + * + * This is a factory method and should generally be called instead of + * creating a Flavor object directly. + * + * @api + * @param string $id - if supplied, the Flavor identified by this is + * retrieved + * @return Compute\Flavor object + */ + public function Flavor($id = null) + { + return new Flavor($this, $id); + } + + /** + * Returns a list of Flavor objects + * + * This is a factory method and should generally be called instead of + * creating a FlavorList object directly. + * + * @api + * @param boolean $details - if TRUE (the default), returns full details. + * Set to FALSE to retrieve minimal details and possibly improve + * performance. + * @param array $filter - optional key/value pairs for creating query + * strings + * @return Collection (or FALSE on an error) + */ + public function FlavorList($details = true, array $filter = array()) + { + if ($details) { + $url = $this->Url(Flavor::ResourceName().'/detail', $filter); + } else { + $url = $this->Url(Flavor::ResourceName(), $filter); + } + return $this->Collection('\OpenCloud\Compute\Flavor', $url); + } + + /** + * Gets a request from an HTTP source and ensures that the + * content type is always "application/json" + * + * This is a simple subclass of the parent::Request() method that ensures + * that all Compute requests use application/json as the Content-Type: + * + * @param string $url - the URL of the request + * @param string $method - the HTTP method ("GET" by default) + * @param array $headers - an associative array of headers to pass to + * the request + * @param string $body - optional body for POST or PUT requests + * @return \Rackspace\HttpResult object + */ + public function Request($url, $method = 'GET', array $headers = array(), $body = null) + { + $headers['Content-Type'] = RAXSDK_CONTENT_TYPE_JSON; + return parent::Request($url, $method, $headers, $body); + } + + /** + * Loads the available namespaces from the /extensions resource + */ + protected function load_namespaces() + { + $ext = $this->Extensions(); + foreach($ext as $obj) { + $this->_namespaces[] = $obj->alias; + } + } + +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/PersistentObject.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/PersistentObject.php new file mode 100644 index 00000000000..0257526d709 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/PersistentObject.php @@ -0,0 +1,939 @@ +<?php +/** + * An abstraction that defines persistent objects associated with a service + * + * @copyright 2012-2013 Rackspace Hosting, Inc. + * See COPYING for licensing information + * + * @package phpOpenCloud + * @version 1.0 + * @author Glen Campbell <glen.campbell@rackspace.com> + * @author Jamie Hannaford <jamie.hannaford@rackspace.com> + */ + +namespace OpenCloud\Common; + +/** + * Represents an object that can be retrieved, created, updated and deleted. + * + * This class abstracts much of the common functionality between: + * + * * Nova servers; + * * Swift containers and objects; + * * DBAAS instances; + * * Cinder volumes; + * * and various other objects that: + * * have a URL; + * * can be created, updated, deleted, or retrieved; + * * use a standard JSON format with a top-level element followed by + * a child object with attributes. + * + * In general, you can create a persistent object class by subclassing this + * class and defining some protected, static variables: + * + * * $url_resource - the sub-resource value in the URL of the parent. For + * example, if the parent URL is `http://something/parent`, then setting this + * value to "another" would result in a URL for the persistent object of + * `http://something/parent/another`. + * + * * $json_name - the top-level JSON object name. For example, if the + * persistent object is represented by `{"foo": {"attr":value, ...}}`, then + * set $json_name to "foo". + * + * * $json_collection_name - optional; this value is the name of a collection + * of the persistent objects. If not provided, it defaults to `json_name` + * with an appended "s" (e.g., if `json_name` is "foo", then + * `json_collection_name` would be "foos"). Set this value if the collection + * name doesn't follow this pattern. + * + * * $json_collection_element - the common pattern for a collection is: + * `{"collection": [{"attr":"value",...}, {"attr":"value",...}, ...]}` + * That is, each element of the array is a \stdClass object containing the + * object's attributes. In rare instances, the objects in the array + * are named, and `json_collection_element` contains the name of the + * collection objects. For example, in this JSON response: + * `{"allowedDomain":[{"allowedDomain":{"name":"foo"}}]}`, + * `json_collection_element` would be set to "allowedDomain". + * + * The PersistentObject class supports the standard CRUD methods; if these are + * not needed (i.e. not supported by the service), the subclass should redefine + * these to call the `noCreate`, `noUpdate`, or `noDelete` methods, which will + * trigger an appropriate exception. For example, if an object cannot be created: + * + * function create($params = array()) + * { + * $this->noCreate(); + * } + */ +abstract class PersistentObject extends Base +{ + + private $service; + + private $parent; + + protected $id; + + /** + * Retrieves the instance from persistent storage + * + * @param mixed $service The service object for this resource + * @param mixed $info The ID or array/object of data + */ + public function __construct($service = null, $info = null) + { + if ($service instanceof Service) { + $this->setService($service); + } + + if (property_exists($this, 'metadata')) { + $this->metadata = new Metadata; + } + + $this->populate($info); + } + + /** + * Validates properties that have a namespace: prefix + * + * If the property prefix: appears in the list of supported extension + * namespaces, then the property is applied to the object. Otherwise, + * an exception is thrown. + * + * @param string $name the name of the property + * @param mixed $value the property's value + * @return void + * @throws AttributeError + */ + public function __set($name, $value) + { + $this->setProperty($name, $value, $this->getService()->namespaces()); + } + + /** + * Sets the service associated with this resource object. + * + * @param \OpenCloud\Common\Service $service + */ + public function setService(Service $service) + { + $this->service = $service; + return $this; + } + + /** + * Returns the service object for this resource; required for making + * requests, etc. because it has direct access to the Connection. + * + * @return \OpenCloud\Common\Service + */ + public function getService() + { + if (null === $this->service) { + throw new Exceptions\ServiceValueError( + 'No service defined' + ); + } + return $this->service; + } + + /** + * Legacy shortcut to getService + * + * @return \OpenCloud\Common\Service + */ + public function service() + { + return $this->getService(); + } + + /** + * Set the parent object for this resource. + * + * @param \OpenCloud\Common\PersistentObject $parent + */ + public function setParent(PersistentObject $parent) + { + $this->parent = $parent; + return $this; + } + + /** + * Returns the parent. + * + * @return \OpenCloud\Common\PersistentObject + */ + public function getParent() + { + if (null === $this->parent) { + $this->parent = $this->getService(); + } + return $this->parent; + } + + /** + * Legacy shortcut to getParent + * + * @return \OpenCloud\Common\PersistentObject + */ + public function parent() + { + return $this->getParent(); + } + + + + + /** + * API OPERATIONS (CRUD & CUSTOM) + */ + + /** + * Creates a new object + * + * @api + * @param array $params array of values to set when creating the object + * @return HttpResponse + * @throws VolumeCreateError if HTTP status is not Success + */ + public function create($params = array()) + { + // set parameters + if (!empty($params)) { + $this->populate($params, false); + } + + // debug + $this->getLogger()->info('{class}::Create({name})', array( + 'class' => get_class($this), + 'name' => $this->Name() + )); + + // construct the JSON + $object = $this->createJson(); + $json = json_encode($object); + $this->checkJsonError(); + + $this->getLogger()->info('{class}::Create JSON [{json}]', array( + 'class' => get_class($this), + 'json' => $json + )); + + // send the request + $response = $this->getService()->request( + $this->createUrl(), + 'POST', + array('Content-Type' => 'application/json'), + $json + ); + + // check the return code + // @codeCoverageIgnoreStart + if ($response->httpStatus() > 204) { + throw new Exceptions\CreateError(sprintf( + Lang::translate('Error creating [%s] [%s], status [%d] response [%s]'), + get_class($this), + $this->Name(), + $response->HttpStatus(), + $response->HttpBody() + )); + } + + if ($response->HttpStatus() == "201" && ($location = $response->Header('Location'))) { + // follow Location header + $this->refresh(null, $location); + } else { + // set values from response + $object = json_decode($response->httpBody()); + + if (!$this->checkJsonError()) { + $top = $this->jsonName(); + if (isset($object->$top)) { + $this->populate($object->$top); + } + } + } + // @codeCoverageIgnoreEnd + + return $response; + } + + /** + * Updates an existing object + * + * @api + * @param array $params array of values to set when updating the object + * @return HttpResponse + * @throws VolumeCreateError if HTTP status is not Success + */ + public function update($params = array()) + { + // set parameters + if (!empty($params)) { + $this->populate($params); + } + + // debug + $this->getLogger()->info('{class}::Update({name})', array( + 'class' => get_class($this), + 'name' => $this->Name() + )); + + // construct the JSON + $obj = $this->updateJson($params); + $json = json_encode($obj); + + $this->checkJsonError(); + + $this->getLogger()->info('{class}::Update JSON [{json}]', array( + 'class' => get_class($this), + 'json' => $json + )); + + // send the request + $response = $this->getService()->Request( + $this->url(), + 'PUT', + array(), + $json + ); + + // check the return code + // @codeCoverageIgnoreStart + if ($response->HttpStatus() > 204) { + throw new Exceptions\UpdateError(sprintf( + Lang::translate('Error updating [%s] with [%s], status [%d] response [%s]'), + get_class($this), + $json, + $response->HttpStatus(), + $response->HttpBody() + )); + } + // @codeCoverageIgnoreEnd + + return $response; + } + + /** + * Deletes an object + * + * @api + * @return HttpResponse + * @throws DeleteError if HTTP status is not Success + */ + public function delete() + { + $this->getLogger()->info('{class}::Delete()', array('class' => get_class($this))); + + // send the request + $response = $this->getService()->request($this->url(), 'DELETE'); + + // check the return code + // @codeCoverageIgnoreStart + if ($response->HttpStatus() > 204) { + throw new Exceptions\DeleteError(sprintf( + Lang::translate('Error deleting [%s] [%s], status [%d] response [%s]'), + get_class(), + $this->Name(), + $response->HttpStatus(), + $response->HttpBody() + )); + } + // @codeCoverageIgnoreEnd + + return $response; + } + + /** + * Returns an object for the Create() method JSON + * Must be overridden in a child class. + * + * @throws CreateError if not overridden + */ + protected function createJson() + { + throw new Exceptions\CreateError(sprintf( + Lang::translate('[%s] CreateJson() must be overridden'), + get_class($this) + )); + } + + /** + * Returns an object for the Update() method JSON + * Must be overridden in a child class. + * + * @throws UpdateError if not overridden + */ + protected function updateJson($params = array()) + { + throw new Exceptions\UpdateError(sprintf( + Lang::translate('[%s] UpdateJson() must be overridden'), + get_class($this) + )); + } + + /** + * throws a CreateError for subclasses that don't support Create + * + * @throws CreateError + */ + protected function noCreate() + { + throw new Exceptions\CreateError(sprintf( + Lang::translate('[%s] does not support Create()'), + get_class() + )); + } + + /** + * throws a DeleteError for subclasses that don't support Delete + * + * @throws DeleteError + */ + protected function noDelete() + { + throw new Exceptions\DeleteError(sprintf( + Lang::translate('[%s] does not support Delete()'), + get_class() + )); + } + + /** + * throws a UpdateError for subclasses that don't support Update + * + * @throws UpdateError + */ + protected function noUpdate() + { + throw new Exceptions\UpdateError(sprintf( + Lang::translate('[%s] does not support Update()'), + get_class() + )); + } + + /** + * Returns the default URL of the object + * + * This may have to be overridden in subclasses. + * + * @param string $subresource optional sub-resource string + * @param array $qstr optional k/v pairs for query strings + * @return string + * @throws UrlError if URL is not defined + */ + public function url($subresource = null, $queryString = array()) + { + // find the primary key attribute name + $primaryKey = $this->primaryKeyField(); + + // first, see if we have a [self] link + $url = $this->findLink('self'); + + /** + * Next, check to see if we have an ID + * Note that we use Parent() instead of Service(), since the parent + * object might not be a service. + */ + if (!$url && $this->$primaryKey) { + $url = Lang::noslash($this->getParent()->url($this->resourceName())) . '/' . $this->$primaryKey; + } + + // add the subresource + if ($url) { + $url .= $subresource ? "/$subresource" : ''; + if (count($queryString)) { + $url .= '?' . $this->makeQueryString($queryString); + } + return $url; + } + + // otherwise, we don't have a URL yet + throw new Exceptions\UrlError(sprintf( + Lang::translate('%s does not have a URL yet'), + get_class($this) + )); + } + + /** + * Waits for the server/instance status to change + * + * This function repeatedly polls the system for a change in server + * status. Once the status reaches the `$terminal` value (or 'ERROR'), + * then the function returns. + * + * The polling interval is set by the constant RAXSDK_POLL_INTERVAL. + * + * The function will automatically terminate after RAXSDK_SERVER_MAXTIMEOUT + * seconds elapse. + * + * @api + * @param string $terminal the terminal state to wait for + * @param integer $timeout the max time (in seconds) to wait + * @param callable $callback a callback function that is invoked with + * each repetition of the polling sequence. This can be used, for + * example, to update a status display or to permit other operations + * to continue + * @return void + */ + public function waitFor( + $terminal = 'ACTIVE', + $timeout = RAXSDK_SERVER_MAXTIMEOUT, + $callback = NULL, + $sleep = RAXSDK_POLL_INTERVAL + ) { + // find the primary key field + $primaryKey = $this->PrimaryKeyField(); + + // save stats + $startTime = time(); + + $states = array('ERROR', $terminal); + + while (true) { + + $this->refresh($this->$primaryKey); + + if ($callback) { + call_user_func($callback, $this); + } + + if (in_array($this->status(), $states) || (time() - $startTime) > $timeout) { + return; + } + // @codeCoverageIgnoreStart + sleep($sleep); + } + } + // @codeCoverageIgnoreEnd + + /** + * Refreshes the object from the origin (useful when the server is + * changing states) + * + * @return void + * @throws IdRequiredError + */ + public function refresh($id = null, $url = null) + { + $primaryKey = $this->PrimaryKeyField(); + + if (!$url) { + if ($id === null) { + $id = $this->$primaryKey; + } + + if (!$id) { + throw new Exceptions\IdRequiredError(sprintf( + Lang::translate('%s has no ID; cannot be refreshed'), + get_class()) + ); + } + + // retrieve it + $this->getLogger()->info(Lang::translate('{class} id [{id}]'), array( + 'class' => get_class($this), + 'id' => $id + )); + + $this->$primaryKey = $id; + $url = $this->url(); + } + + // reset status, if available + if (property_exists($this, 'status')) { + $this->status = null; + } + + // perform a GET on the URL + $response = $this->getService()->Request($url); + + // check status codes + // @codeCoverageIgnoreStart + if ($response->HttpStatus() == 404) { + throw new Exceptions\InstanceNotFound( + sprintf(Lang::translate('%s [%s] not found [%s]'), + get_class($this), + $this->$primaryKey, + $url + )); + } + + if ($response->HttpStatus() >= 300) { + throw new Exceptions\UnknownError( + sprintf(Lang::translate('Unexpected %s error [%d] [%s]'), + get_class($this), + $response->HttpStatus(), + $response->HttpBody() + )); + } + + // check for empty response + if (!$response->HttpBody()) { + throw new Exceptions\EmptyResponseError( + sprintf(Lang::translate('%s::Refresh() unexpected empty response, URL [%s]'), + get_class($this), + $url + )); + } + + // we're ok, reload the response + if ($json = $response->HttpBody()) { + + $this->getLogger()->info('refresh() JSON [{json}]', array('json' => $json)); + + $response = json_decode($json); + + if ($this->CheckJsonError()) { + throw new Exceptions\ServerJsonError(sprintf( + Lang::translate('JSON parse error on %s refresh'), + get_class($this) + )); + } + + $top = $this->JsonName(); + + if ($top && isset($response->$top)) { + $content = $response->$top; + } else { + $content = $response; + } + + $this->populate($content); + + } + // @codeCoverageIgnoreEnd + } + + + /** + * OBJECT INFORMATION + */ + + /** + * Returns the displayable name of the object + * + * Can be overridden by child objects; *must* be overridden by child + * objects if the object does not have a `name` attribute defined. + * + * @api + * @return string + * @throws NameError if attribute 'name' is not defined + */ + public function name() + { + if (property_exists($this, 'name')) { + return $this->name; + } else { + throw new Exceptions\NameError(sprintf( + Lang::translate('Name attribute does not exist for [%s]'), + get_class($this) + )); + } + } + + /** + * Sends the json string to the /action resource + * + * This is used for many purposes, such as rebooting the server, + * setting the root password, creating images, etc. + * Since it can only be used on a live server, it checks for a valid ID. + * + * @param $object - this will be encoded as json, and we handle all the JSON + * error-checking in one place + * @throws ServerIdError if server ID is not defined + * @throws ServerActionError on other errors + * @returns boolean; TRUE if successful, FALSE otherwise + */ + protected function action($object) + { + $primaryKey = $this->primaryKeyField(); + + if (!$this->$primaryKey) { + throw new Exceptions\IdRequiredError(sprintf( + Lang::translate('%s is not defined'), + get_class($this) + )); + } + + if (!is_object($object)) { + throw new Exceptions\ServerActionError(sprintf( + Lang::translate('%s::Action() requires an object as its parameter'), + get_class($this) + )); + } + + // convert the object to json + $json = json_encode($object); + $this->getLogger()->info('JSON [{string}]', array('json' => $json)); + + $this->checkJsonError(); + + // debug - save the request + $this->getLogger()->info(Lang::translate('{class}::action [{json}]'), array( + 'class' => get_class($this), + 'json' => $json + )); + + // get the URL for the POST message + $url = $this->url('action'); + + // POST the message + $response = $this->getService()->request($url, 'POST', array(), $json); + + // @codeCoverageIgnoreStart + if (!is_object($response)) { + throw new Exceptions\HttpError(sprintf( + Lang::translate('Invalid response for %s::Action() request'), + get_class($this) + )); + } + + // check for errors + if ($response->HttpStatus() >= 300) { + throw new Exceptions\ServerActionError(sprintf( + Lang::translate('%s::Action() [%s] failed; response [%s]'), + get_class($this), + $url, + $response->HttpBody() + )); + } + // @codeCoverageIgnoreStart + + return $response; + } + + /** + * Execute a custom resource request. + * + * @param string $path + * @param string $method + * @param string|array|object $body + * @return boolean + * @throws Exceptions\InvalidArgumentError + * @throws Exceptions\HttpError + * @throws Exceptions\ServerActionError + */ + public function customAction($url, $method = 'GET', $body = null) + { + if (is_string($body) && (json_decode($body) === null)) { + throw new Exceptions\InvalidArgumentError( + 'Please provide either a well-formed JSON string, or an object ' + . 'for JSON serialization' + ); + } else { + $body = json_encode($body); + } + + // POST the message + $response = $this->service()->request($url, $method, array(), $body); + + if (!is_object($response)) { + throw new Exceptions\HttpError(sprintf( + Lang::translate('Invalid response for %s::customAction() request'), + get_class($this) + )); + } + + // check for errors + // @codeCoverageIgnoreStart + if ($response->HttpStatus() >= 300) { + throw new Exceptions\ServerActionError(sprintf( + Lang::translate('%s::customAction() [%s] failed; response [%s]'), + get_class($this), + $url, + $response->HttpBody() + )); + } + // @codeCoverageIgnoreEnd + + $object = json_decode($response->httpBody()); + + $this->checkJsonError(); + + return $object; + } + + /** + * returns the object's status or `N/A` if not available + * + * @api + * @return string + */ + public function status() + { + return (isset($this->status)) ? $this->status : 'N/A'; + } + + /** + * returns the object's identifier + * + * Can be overridden by a child class if the identifier is not in the + * `$id` property. Use of this function permits the `$id` attribute to + * be protected or private to prevent unauthorized overwriting for + * security. + * + * @api + * @return string + */ + public function id() + { + return $this->id; + } + + /** + * checks for `$alias` in extensions and throws an error if not present + * + * @throws UnsupportedExtensionError + */ + public function checkExtension($alias) + { + if (!in_array($alias, $this->getService()->namespaces())) { + throw new Exceptions\UnsupportedExtensionError(sprintf( + Lang::translate('Extension [%s] is not installed'), + $alias + )); + } + + return true; + } + + /** + * returns the region associated with the object + * + * navigates to the parent service to determine the region. + * + * @api + */ + public function region() + { + return $this->getService()->Region(); + } + + /** + * Since each server can have multiple links, this returns the desired one + * + * @param string $type - 'self' is most common; use 'bookmark' for + * the version-independent one + * @return string the URL from the links block + */ + public function findLink($type = 'self') + { + if (empty($this->links)) { + return false; + } + + foreach ($this->links as $link) { + if ($link->rel == $type) { + return $link->href; + } + } + + return false; + } + + /** + * returns the URL used for Create + * + * @return string + */ + protected function createUrl() + { + return $this->getParent()->Url($this->ResourceName()); + } + + /** + * Returns the primary key field for the object + * + * The primary key is usually 'id', but this function is provided so that + * (in rare cases where it is not 'id'), it can be overridden. + * + * @return string + */ + protected function primaryKeyField() + { + return 'id'; + } + + /** + * Returns the top-level document identifier for the returned response + * JSON document; must be overridden in child classes + * + * For example, a server document is (JSON) `{"server": ...}` and an + * Instance document is `{"instance": ...}` - this function must return + * the top level document name (either "server" or "instance", in + * these examples). + * + * @throws DocumentError if not overridden + */ + public static function jsonName() + { + if (isset(static::$json_name)) { + return static::$json_name; + } + + throw new Exceptions\DocumentError(sprintf( + Lang::translate('No JSON object defined for class [%s] in JsonName()'), + get_class() + )); + } + + /** + * returns the collection JSON element name + * + * When an object is returned in a collection, it usually has a top-level + * object that is an array holding child objects of the object types. + * This static function returns the name of the top-level element. Usually, + * that top-level element is simply the JSON name of the resource.'s'; + * however, it can be overridden by specifying the $json_collection_name + * attribute. + * + * @return string + */ + public static function jsonCollectionName() + { + if (isset(static::$json_collection_name)) { + return static::$json_collection_name; + } else { + return static::$json_name . 's'; + } + } + + /** + * returns the JSON name for each element in a collection + * + * Usually, elements in a collection are anonymous; this function, however, + * provides for an element level name: + * + * `{ "collection" : [ { "element" : ... } ] }` + * + * @return string + */ + public static function jsonCollectionElement() + { + if (isset(static::$json_collection_element)) { + return static::$json_collection_element; + } + } + + /** + * Returns the resource name for the URL of the object; must be overridden + * in child classes + * + * For example, a server is `/servers/`, a database instance is + * `/instances/`. Must be overridden in child classes. + * + * @throws UrlError + */ + public static function resourceName() + { + if (isset(static::$url_resource)) { + return static::$url_resource; + } + + throw new Exceptions\UrlError(sprintf( + Lang::translate('No URL resource defined for class [%s] in ResourceName()'), + get_class() + )); + } + +}
\ No newline at end of file diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Curl.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Curl.php new file mode 100644 index 00000000000..bb829afc5f6 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Curl.php @@ -0,0 +1,308 @@ +<?php + +namespace OpenCloud\Common\Request; + +use OpenCloud\Common\Base; +use OpenCloud\Common\Lang; +use OpenCloud\Common\Exceptions\HttpRetryError; +use OpenCloud\Common\Exceptions\HttpUrlError; +use OpenCloud\Common\Exceptions\HttpTimeoutError; +use OpenCloud\Common\Exceptions\HttpError; + +/** + * The CurlRequest class is a simple wrapper to CURL functions. Not only does + * this permit stubbing of the interface as described under the HttpRequest + * interface, it could potentially allow us to replace the interface methods + * with other function calls in the future. + * + * @api + * @author Glen Campbell <glen.campbell@rackspace.com> + */ +class Curl extends Base implements HttpRequestInterface +{ + + private $url; + private $method; + private $handle; + private $retries = 0; + private $headers = array(); + private $returnheaders = array(); + + /** + * Initializes the CURL handle and HTTP method + * + * The constructor also sets a number of default values for options. + * + * @param string $url the URL to connect to + * @param string $method the HTTP method (default "GET") + * @param array $options optional hashed array of options => value pairs + */ + public function __construct($url, $method = 'GET', array $options = array()) + { + $this->url = $url; + $this->method = $method; + $this->handle = curl_init($url); + + // set our options + $this->setOption(CURLOPT_CUSTOMREQUEST, $method); + + foreach($options as $opt => $value) { + $this->getLogger()->info(Lang::translate('Setting option {key}={val}'), array( + 'key' => $opt, + 'val' => $value + )); + $this->setOption($opt, $value); + } + + // @codeCoverageIgnoreStart + if (RAXSDK_SSL_VERIFYHOST != 2) { + $this->getLogger()->warning("WARNING: RAXSDK_SSL_VERIFYHOST has reduced security, value [{value}]", array( + 'value' => RAXSDK_SSL_VERIFYHOST + )); + } + + if (RAXSDK_SSL_VERIFYPEER !== true) { + $this->getLogger()->warning("WARNING: RAXSDK_SSL_VERIFYPEER has reduced security"); + } + // @codeCoverageIgnoreEnd + + $this->setOption(CURLOPT_SSL_VERIFYHOST, RAXSDK_SSL_VERIFYHOST); + $this->setOption(CURLOPT_SSL_VERIFYPEER, RAXSDK_SSL_VERIFYPEER); + + if (defined('RAXSDK_CACERTPEM') && file_exists(RAXSDK_CACERTPEM)) { + $this->setOption(CURLOPT_CAINFO, RAXSDK_CACERTPEM); + } + + // curl code [18] + // message [transfer closed with x bytes remaining to read] + if ($method === 'HEAD') { + $this->setOption(CURLOPT_NOBODY, true); + } + + // follow redirects + $this->setOption(CURLOPT_FOLLOWLOCATION, true); + + // don't return the headers in the request + $this->setOption(CURLOPT_HEADER, false); + + // retrieve headers via callback + $this->setOption(CURLOPT_HEADERFUNCTION, array($this, '_get_header_cb')); + + // return the entire request on curl_exec() + $this->setOption(CURLOPT_RETURNTRANSFER, true); + + // set default timeouts + $this->setConnectTimeout(RAXSDK_CONNECTTIMEOUT); + $this->setHttpTimeout(RAXSDK_TIMEOUT); + } + + /** + * Sets a CURL option + * + * @param const $name - a CURL named constant; e.g. CURLOPT_TIMEOUT + * @param mixed $value - the value for the option + */ + public function setOption($name, $value) + { + return curl_setopt($this->handle, $name, $value); + } + + /** + * Explicit method for setting the connect timeout + * + * The connect timeout is the time it takes for the initial connection + * request to be established. It is different than the HTTP timeout, which + * is the time for the entire request to be serviced. + * + * @param integer $value The connection timeout in seconds. + * Use 0 to wait indefinitely (NOT recommended) + */ + public function setConnectTimeout($value) + { + $this->setOption(CURLOPT_CONNECTTIMEOUT, $value); + } + + /** + * Explicit method for setting the HTTP timeout + * + * The HTTP timeout is the time it takes for the HTTP request to be + * serviced. This value is usually larger than the connect timeout + * value. + * + * @param integer $value - the number of seconds to wait before timing out + * the HTTP request. + */ + public function setHttpTimeout($value) + { + $this->setOption(CURLOPT_TIMEOUT, $value); + } + + /** + * Sets the number of retries + * + * If you set this to a non-zero value, then it will repeat the request + * up to that number. + */ + public function setRetries($value) + { + $this->retries = $value; + } + + /** + * Simplified method for setting lots of headers at once + * + * This method takes an associative array of header/value pairs and calls + * the setheader() method on each of them. + * + * @param array $arr an associative array of headers + */ + public function setheaders($array) + { + if (!is_array($array)) { + throw new HttpError(Lang::translate( + 'Value passed to CurlRequest::setheaders() must be array' + )); + } + + foreach ($array as $name => $value) { + $this->setHeader($name, $value); + } + } + + /** + * Sets a single header + * + * For example, to set the content type to JSON: + * `$request->SetHeader('Content-Type','application/json');` + * + * @param string $name The name of the header + * @param mixed $value The value of the header + */ + public function setHeader($name, $value) + { + $this->headers[$name] = $value; + } + + /** + * Executes the current request + * + * This method actually performs the request using the values set + * previously. It throws a OpenCloud\HttpError exception on + * any CURL error. + * + * @return OpenCloud\HttpResponse + * @throws OpenCloud\HttpError + * + * @codeCoverageIgnore + */ + public function execute() + { + // set all the headers + $headarr = array(); + + foreach ($this->headers as $name => $value) { + $headarr[] = $name.': '.$value; + } + + $this->setOption(CURLOPT_HTTPHEADER, $headarr); + + // set up to retry if necessary + $try_counter = 0; + + do { + $data = curl_exec($this->handle); + if (curl_errno($this->handle) && ($try_counter<$this->retries)) { + $this->getLogger()->info(Lang::translate('Curl error [%d]; retrying [%s]'), array( + 'error' => curl_errno($this->handle), + 'url' => $this->url + )); + } + + } while((++$try_counter <= $this->retries) && (curl_errno($this->handle) != 0)); + + // log retries error + if ($this->retries && curl_errno($this->handle)) { + throw new HttpRetryError(sprintf( + Lang::translate('No more retries available, last error [%d]'), + curl_errno($this->handle) + )); + } + + // check for CURL errors + switch(curl_errno($this->handle)) { + case 0: + // everything's ok + break; + case 3: + throw new HttpUrlError(sprintf(Lang::translate('Malformed URL [%s]'), $this->url)); + break; + case 28: + // timeout + throw new HttpTimeoutError(Lang::translate('Operation timed out; check RAXSDK_TIMEOUT value')); + break; + default: + throw new HttpError(sprintf( + Lang::translate('HTTP error on [%s], curl code [%d] message [%s]'), + $this->url, + curl_errno($this->handle), + curl_error($this->handle) + )); + } + + // otherwise, return the HttpResponse + return new Response\Http($this, $data); + } + + /** + * returns an array of information about the request + */ + public function info() + { + return curl_getinfo($this->handle); + } + + /** + * returns the most recent CURL error number + */ + public function errno() + { + return curl_errno($this->handle); + } + + /** + * returns the most recent CURL error string + */ + public function error() + { + return curl_error($this->handle); + } + + /** + * Closes the HTTP request + */ + public function close() + { + return curl_close($this->handle); + } + + /** + * Returns the headers as an array + */ + public function returnHeaders() + { + return $this->returnheaders; + } + + /** + * This is a callback method used to handle the returned HTTP headers + * + * @param mixed $ch a CURL handle + * @param string $header the header string in its entirety + */ + public function _get_header_cb($ch, $header) + { + $this->returnheaders[] = $header; + return strlen($header); + } + +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/HttpRequestInterface.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/HttpRequestInterface.php new file mode 100644 index 00000000000..cbe3b5412a1 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/HttpRequestInterface.php @@ -0,0 +1,23 @@ +<?php + +namespace OpenCloud\Common\Request; + +/** + * The HttpRequest interface defines methods for wrapping CURL; this allows + * those methods to be stubbed out for unit testing, thus allowing us to + * test without actually making live calls. + */ +interface HttpRequestInterface +{ + + public function SetOption($name, $value); + + public function setheaders($arr); + + public function SetHeader($header, $value); + + public function Execute(); + + public function close(); + +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Response/Blank.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Response/Blank.php new file mode 100644 index 00000000000..0c79adcef3a --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Response/Blank.php @@ -0,0 +1,27 @@ +<?php + +namespace OpenCloud\Common\Request\Response; + +class Blank extends Http +{ + public $errno; + public $error; + public $info; + public $body; + public $headers = array(); + public $status = 200; + public $rawdata; + + public function __construct(array $values = array()) + { + foreach($values as $name => $value) { + $this->$name = $value; + } + } + + public function httpStatus() + { + return $this->status; + } + +}
\ No newline at end of file diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Response/Http.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Response/Http.php new file mode 100644 index 00000000000..a7cb9e96346 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Response/Http.php @@ -0,0 +1,140 @@ +<?php + +namespace OpenCloud\Common\Request\Response; + +use OpenCloud\Common\Base; + +/** + * The HttpResponse returns an object with status information, separated + * headers, and any response body necessary. + * + * @api + * @author Glen Campbell <glen.campbell@rackspace.com> + */ + +class Http extends Base +{ + + private $errno; + private $error; + private $info = array(); + protected $body; + protected $headers = array(); + + /** + * The constructor parses everything necessary + */ + public function __construct($request, $data) + { + // save the raw data (who knows? we might need it) + $this->setBody($data); + + // and split each line into name: value pairs + foreach($request->returnHeaders() as $line) { + if (preg_match('/^([^:]+):\s+(.+?)\s*$/', $line, $matches)) { + $this->headers[$matches[1]] = $matches[2]; + } else { + $this->headers[$line] = trim($line); + } + } + + // @codeCoverageIgnoreStart + if (isset($this->headers['Cache-Control'])) { + $this->getLogger()->info('Cache-Control: {header}', array( + 'headers' => $this->headers['Cache-Control'] + )); + } + if (isset($this->headers['Expires'])) { + $this->getLogger()->info('Expires: {header}', array( + 'headers' => $this->headers['Expires'] + )); + } + // @codeCoverageIgnoreEnd + + // set some other data + $this->info = $request->info(); + $this->errno = $request->errno(); + $this->error = $request->error(); + } + + /** + * Returns the full body of the request + * + * @return string + */ + public function httpBody() + { + return $this->body; + } + + /** + * Sets the body. + * + * @param string $body + */ + public function setBody($body) + { + $this->body = $body; + } + + /** + * Returns an array of headers + * + * @return associative array('header'=>value) + */ + public function headers() + { + return $this->headers; + } + + /** + * Returns a single header + * + * @return string with the value of the requested header, or NULL + */ + public function header($name) + { + return isset($this->headers[$name]) ? $this->headers[$name] : null; + } + + /** + * Returns an array of information + * + * @return array + */ + public function info() + { + return $this->info; + } + + /** + * Returns the most recent error number + * + * @return integer + */ + public function errno() + { + return $this->errno; + } + + /** + * Returns the most recent error message + * + * @return string + */ + public function error() + { + return $this->error; + } + + /** + * Returns the HTTP status code + * + * @return integer + */ + public function httpStatus() + { + return $this->info['http_code']; + } + +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Service.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Service.php new file mode 100644 index 00000000000..5b3aa729a97 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Service.php @@ -0,0 +1,489 @@ +<?php +/** + * PHP OpenCloud library. + * + * @copyright Copyright 2013 Rackspace US, Inc. See COPYING for licensing information. + * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0 + * @version 1.6.0 + * @author Jamie Hannaford <jamie.hannaford@rackspace.com> + */ + +namespace OpenCloud\Common; + +use OpenCloud\Common\Base; +use OpenCloud\Common\Lang; +use OpenCloud\OpenStack; +use OpenCloud\Common\Exceptions; + +/** + * This class defines a cloud service; a relationship between a specific OpenStack + * and a provided service, represented by a URL in the service catalog. + * + * Because Service is an abstract class, it cannot be called directly. Provider + * services such as Rackspace Cloud Servers or OpenStack Swift are each + * subclassed from Service. + * + * @author Glen Campbell <glen.campbell@rackspace.com> + */ + +abstract class Service extends Base +{ + + protected $conn; + private $service_type; + private $service_name; + private $service_region; + private $service_url; + + protected $_namespaces = array(); + + /** + * Creates a service on the specified connection + * + * Usage: `$x = new Service($conn, $type, $name, $region, $urltype);` + * The service's URL is defined in the OpenStack's serviceCatalog; it + * uses the $type, $name, $region, and $urltype to find the proper URL + * and set it. If it cannot find a URL in the service catalog that matches + * the criteria, then an exception is thrown. + * + * @param OpenStack $conn - a Connection object + * @param string $type - the service type (e.g., "compute") + * @param string $name - the service name (e.g., "cloudServersOpenStack") + * @param string $region - the region (e.g., "ORD") + * @param string $urltype - the specified URL from the catalog + * (e.g., "publicURL") + */ + public function __construct( + OpenStack $conn, + $type, + $name, + $region, + $urltype = RAXSDK_URL_PUBLIC, + $customServiceUrl = null + ) { + $this->setConnection($conn); + $this->service_type = $type; + $this->service_name = $name; + $this->service_region = $region; + $this->service_url = $customServiceUrl ?: $this->getEndpoint($type, $name, $region, $urltype); + } + + /** + * Set this service's connection. + * + * @param type $connection + */ + public function setConnection($connection) + { + $this->conn = $connection; + } + + /** + * Get this service's connection. + * + * @return type + */ + public function getConnection() + { + return $this->conn; + } + + /** + * Returns the URL for the Service + * + * @param string $resource optional sub-resource + * @param array $query optional k/v pairs for query strings + * @return string + */ + public function url($resource = '', array $param = array()) + { + $baseurl = $this->service_url; + + // use strlen instead of boolean test because '0' is a valid name + if (strlen($resource) > 0) { + $baseurl = Lang::noslash($baseurl).'/'.$resource; + } + + if (!empty($param)) { + $baseurl .= '?'.$this->MakeQueryString($param); + } + + return $baseurl; + } + + /** + * Returns the /extensions for the service + * + * @api + * @return array of objects + */ + public function extensions() + { + $ext = $this->getMetaUrl('extensions'); + return (is_object($ext) && isset($ext->extensions)) ? $ext->extensions : array(); + } + + /** + * Returns the /limits for the service + * + * @api + * @return array of limits + */ + public function limits() + { + $limits = $this->getMetaUrl('limits'); + return (is_object($limits)) ? $limits->limits : array(); + } + + /** + * Performs an authenticated request + * + * This method handles the addition of authentication headers to each + * request. It always adds the X-Auth-Token: header and will add the + * X-Auth-Project-Id: header if there is a tenant defined on the + * connection. + * + * @param string $url The URL of the request + * @param string $method The HTTP method (defaults to "GET") + * @param array $headers An associative array of headers + * @param string $body An optional body for POST/PUT requests + * @return \OpenCloud\HttpResult + */ + public function request( + $url, + $method = 'GET', + array $headers = array(), + $body = null + ) { + + $headers['X-Auth-Token'] = $this->conn->Token(); + + if ($tenant = $this->conn->Tenant()) { + $headers['X-Auth-Project-Id'] = $tenant; + } + + return $this->conn->request($url, $method, $headers, $body); + } + + /** + * returns a collection of objects + * + * @param string $class the class of objects to fetch + * @param string $url (optional) the URL to retrieve + * @param mixed $parent (optional) the parent service/object + * @return OpenCloud\Common\Collection + */ + public function collection($class, $url = null, $parent = null) + { + // Set the element names + $collectionName = $class::JsonCollectionName(); + $elementName = $class::JsonCollectionElement(); + + // Set the parent if empty + if (!$parent) { + $parent = $this; + } + + // Set the URL if empty + if (!$url) { + $url = $parent->url($class::ResourceName()); + } + + // Save debug info + $this->getLogger()->info( + '{class}:Collection({url}, {collectionClass}, {collectionName})', + array( + 'class' => get_class($this), + 'url' => $url, + 'collectionClass' => $class, + 'collectionName' => $collectionName + ) + ); + + // Fetch the list + $response = $this->request($url); + + $this->getLogger()->info('Response {status} [{body}]', array( + 'status' => $response->httpStatus(), + 'body' => $response->httpBody() + )); + + // Check return code + if ($response->httpStatus() > 204) { + throw new Exceptions\CollectionError(sprintf( + Lang::translate('Unable to retrieve [%s] list from [%s], status [%d] response [%s]'), + $class, + $url, + $response->httpStatus(), + $response->httpBody() + )); + } + + // Handle empty response + if (strlen($response->httpBody()) == 0) { + return new Collection($parent, $class, array()); + } + + // Parse the return + $object = json_decode($response->httpBody()); + $this->checkJsonError(); + + // See if there's a "next" link + // Note: not sure if the current API offers links as top-level structures; + // might have to refactor to allow $nextPageUrl as method argument + // @codeCoverageIgnoreStart + if (isset($object->links) && is_array($object->links)) { + foreach($object->links as $link) { + if (isset($link->rel) && $link->rel == 'next') { + if (isset($link->href)) { + $nextPageUrl = $link->href; + } else { + $this->getLogger()->warning( + 'Unexpected [links] found with no [href]' + ); + } + } + } + } + // @codeCoverageIgnoreEnd + + // How should we populate the collection? + $data = array(); + + if (!$collectionName) { + // No element name, just a plain object + // @codeCoverageIgnoreStart + $data = $object; + // @codeCoverageIgnoreEnd + } elseif (isset($object->$collectionName)) { + if (!$elementName) { + // The object has a top-level collection name only + $data = $object->$collectionName; + } else { + // The object has element levels which need to be iterated over + $data = array(); + foreach($object->$collectionName as $item) { + $subValues = $item->$elementName; + unset($item->$elementName); + $data[] = array_merge((array)$item, (array)$subValues); + } + } + } + + $collectionObject = new Collection($parent, $class, $data); + + // if there's a $nextPageUrl, then we need to establish a callback + // @codeCoverageIgnoreStart + if (!empty($nextPageUrl)) { + $collectionObject->setNextPageCallback(array($this, 'Collection'), $nextPageUrl); + } + // @codeCoverageIgnoreEnd + + return $collectionObject; + } + + /** + * returns the Region associated with the service + * + * @api + * @return string + */ + public function region() + { + return $this->service_region; + } + + /** + * returns the serviceName associated with the service + * + * This is used by DNS for PTR record lookups + * + * @api + * @return string + */ + public function name() + { + return $this->service_name; + } + + /** + * Returns a list of supported namespaces + * + * @return array + */ + public function namespaces() + { + return (isset($this->_namespaces) && is_array($this->_namespaces)) ? $this->_namespaces : array(); + } + + /** + * Given a service type, name, and region, return the url + * + * This function ensures that services are represented by an entry in the + * service catalog, and NOT by an arbitrarily-constructed URL. + * + * Note that it will always return the first match found in the + * service catalog (there *should* be only one, but you never know...) + * + * @param string $type The OpenStack service type ("compute" or + * "object-store", for example + * @param string $name The name of the service in the service catlog + * @param string $region The region of the service + * @param string $urltype The URL type; defaults to "publicURL" + * @return string The URL of the service + */ + private function getEndpoint($type, $name, $region, $urltype = 'publicURL') + { + $catalog = $this->getConnection()->serviceCatalog(); + + // Search each service to find The One + foreach ($catalog as $service) { + // Find the service by comparing the type ("compute") and name ("openstack") + if (!strcasecmp($service->type, $type) && !strcasecmp($service->name, $name)) { + foreach($service->endpoints as $endpoint) { + // Only set the URL if: + // a. It is a regionless service (i.e. no region key set) + // b. The region matches the one we want + if (isset($endpoint->$urltype) && + (!isset($endpoint->region) || !strcasecmp($endpoint->region, $region)) + ) { + $url = $endpoint->$urltype; + } + } + } + } + + // error if not found + if (empty($url)) { + throw new Exceptions\EndpointError(sprintf( + 'No endpoints for service type [%s], name [%s], region [%s] and urlType [%s]', + $type, + $name, + $region, + $urltype + )); + } + + return $url; + } + + /** + * Constructs a specified URL from the subresource + * + * Given a subresource (e.g., "extensions"), this constructs the proper + * URL and retrieves the resource. + * + * @param string $resource The resource requested; should NOT have slashes + * at the beginning or end + * @return \stdClass object + */ + private function getMetaUrl($resource) + { + $urlBase = $this->getEndpoint( + $this->service_type, + $this->service_name, + $this->service_region, + RAXSDK_URL_PUBLIC + ); + + $url = Lang::noslash($urlBase) . '/' . $resource; + + $response = $this->request($url); + + // check for NOT FOUND response + if ($response->httpStatus() == 404) { + return array(); + } + + // @codeCoverageIgnoreStart + if ($response->httpStatus() >= 300) { + throw new Exceptions\HttpError(sprintf( + Lang::translate('Error accessing [%s] - status [%d], response [%s]'), + $urlBase, + $response->httpStatus(), + $response->httpBody() + )); + } + // @codeCoverageIgnoreEnd + + // we're good; proceed + $object = json_decode($response->httpBody()); + + $this->checkJsonError(); + + return $object; + } + + /** + * Get all associated resources for this service. + * + * @access public + * @return void + */ + public function getResources() + { + return $this->resources; + } + + /** + * Internal method for accessing child namespace from parent scope. + * + * @return type + */ + protected function getCurrentNamespace() + { + $namespace = get_class($this); + return substr($namespace, 0, strrpos($namespace, '\\')); + } + + /** + * Resolves fully-qualified classname for associated local resource. + * + * @param string $resourceName + * @return string + */ + protected function resolveResourceClass($resourceName) + { + $className = substr_count($resourceName, '\\') + ? $resourceName + : $this->getCurrentNamespace() . '\\Resource\\' . ucfirst($resourceName); + + if (!class_exists($className)) { + throw new Exceptions\UnrecognizedServiceError(sprintf( + '%s resource does not exist, please try one of the following: %s', + $resourceName, + implode(', ', $this->getResources()) + )); + } + + return $className; + } + + /** + * Factory method for instantiating resource objects. + * + * @access public + * @param string $resourceName + * @param mixed $info (default: null) + * @return object + */ + public function resource($resourceName, $info = null) + { + $className = $this->resolveResourceClass($resourceName); + return new $className($this, $info); + } + + /** + * Factory method for instantiate a resource collection. + * + * @param string $resourceName + * @param string|null $url + * @return Collection + */ + public function resourceList($resourceName, $url = null, $service = null) + { + $className = $this->resolveResourceClass($resourceName); + return $this->collection($className, $url, $service); + } + +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/ServiceCatalogItem.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/ServiceCatalogItem.php new file mode 100644 index 00000000000..3e20bcbc7b9 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/ServiceCatalogItem.php @@ -0,0 +1,18 @@ +<?php + +namespace OpenCloud\Common; + +/** + * Holds information on a single service from the Service Catalog + */ +class ServiceCatalogItem +{ + + public function __construct($info = array()) + { + foreach($info as $key => $value) { + $this->$key = $value; + } + } + +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Globals.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Globals.php new file mode 100644 index 00000000000..fbdc4355e02 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Globals.php @@ -0,0 +1,252 @@ +<?php +/** + * Defines global constants and functions + * + * @copyright 2012-2013 Rackspace Hosting, Inc. + * See COPYING for licensing information + * + * @package phpOpenCloud + * @version 1.0 + * @author Glen Campbell <glen.campbell@rackspace.com> + */ + +namespace OpenCloud; + +/** + * This file contains only configuration data such as constants. + * You can override these constants by defining them BEFORE you including + * any of the top-level files from the SDK. + * + * Definitions: + * * RAXSDK_TIMEZONE - the default timezone for interpreting date/time requests + * * RAXSDK_STRICT_PROPERTY_CHECKS - if TRUE, the library will strictly enforce + * property names on objects; only properties that are pre-defined or + * appear in the extensions aliases for the service will be permitted. + * When FALSE (the default), then any property can be set on an object. + * * RAXSDK_COMPUTE_NAME - the default name for the compute service + * * RAXSDK_COMPUTE_REGION - the default region for the compute service + * * RAXSDK_COMPUTE_URLTYPE - the default URL type for the compute service + * * RAXSDK_OBJSTORE_NAME - the default name for the object storage service + * * RAXSDK_OBJSTORE_REGION - the default region for the object storage service + * * RAXSDK_OBJSTORE_URLTYPE - the default URL type for the object storage + * service + * * RAXSDK_DATABASE_NAME - the default name for the DbService service + * * RAXSDK_DATABASE_REGION - the default region for the DbService service + * * RAXSDK_DATABASE_URLTYPE - the default URL type for the DbService service + * * RAXSDK_CONNECTTIMEOUT - the time (in seconds) to wait for a connection + * to a service + * * RAXSDK_TIMEOUT - the max time (in seconds) to wait for an HTTP request + * to complete + * * RAXSDK_SERVER_MAXTIMEOUT - the max time (in seconds) that a server + * will wait for a change in status (Server::WaitFor() method) + * * RAXSDK_POLL_INTERVAL - how often (in seconds) the Server::WaitFor() method + * will poll for a status change + * * RAXSDK_DEFAULT_IP_VERSION - the default IP version (4 or 6) to return for + * the server's primary IP address + * * RAXSDK_OVERLIMIT_TIMEOUT - the max time (in seconds) to wait before + * retrying a request that has failed because of rate limits. If the + * next available time for the request is more than (X) seconds away, + * then the request will fail; otherwise, the request will sleep until + * available. + */ + +if (!defined('RAXSDK_TIMEZONE')) + define('RAXSDK_TIMEZONE', 'America/Chicago'); +if (!defined('RAXSDK_STRICT_PROPERTY_CHECKS')) + define('RAXSDK_STRICT_PROPERTY_CHECKS', FALSE); +if (!defined('RAXSDK_COMPUTE_NAME')) + define('RAXSDK_COMPUTE_NAME', 'cloudServersOpenStack'); +if (!defined('RAXSDK_COMPUTE_REGION')) + define('RAXSDK_COMPUTE_REGION', NULL); +if (!defined('RAXSDK_COMPUTE_URLTYPE')) + define('RAXSDK_COMPUTE_URLTYPE', 'publicURL'); +if (!defined('RAXSDK_MONITORING_NAME')) + define('RAXSDK_MONITORING_NAME', 'cloudMonitoring'); +if (!defined('RAXSDK_MONITORING_REGION')) + define('RAXSDK_MONITORING_REGION', '{ignore}'); +if (!defined('RAXSDK_MONITORING_URLTYPE')) + define('RAXSDK_MONITORING_URLTYPE', 'publicURL'); +if (!defined('RAXSDK_ORCHESTRATION_NAME')) + define('RAXSDK_ORCHESTRATION_NAME', 'cloudOrchestration'); +if (!defined('RAXSDK_ORCHESTRATION_REGION')) + define('RAXSDK_ORCHESTRATION_REGION', NULL); +if (!defined('RAXSDK_ORCHESTRATION_URLTYPE')) + define('RAXSDK_ORCHESTRATION_URLTYPE', 'publicURL'); +if (!defined('RAXSDK_OBJSTORE_NAME')) + define('RAXSDK_OBJSTORE_NAME', 'cloudFiles'); +if (!defined('RAXSDK_OBJSTORE_REGION')) + define('RAXSDK_OBJSTORE_REGION', NULL); +if (!defined('RAXSDK_OBJSTORE_URLTYPE')) + define('RAXSDK_OBJSTORE_URLTYPE', 'publicURL'); +if (!defined('RAXSDK_DATABASE_NAME')) + define('RAXSDK_DATABASE_NAME', 'cloudDatabases'); +if (!defined('RAXSDK_DATABASE_REGION')) + define('RAXSDK_DATABASE_REGION', NULL); +if (!defined('RAXSDK_DATABASE_URLTYPE')) + define('RAXSDK_DATABASE_URLTYPE', 'publicURL'); +if (!defined('RAXSDK_VOLUME_NAME')) + define('RAXSDK_VOLUME_NAME', 'cloudBlockStorage'); +if (!defined('RAXSDK_VOLUME_REGION')) + define('RAXSDK_VOLUME_REGION', NULL); +if (!defined('RAXSDK_VOLUME_URLTYPE')) + define('RAXSDK_VOLUME_URLTYPE', 'publicURL'); +if (!defined('RAXSDK_LBSERVICE_NAME')) + define('RAXSDK_LBSERVICE_NAME', 'cloudLoadBalancers'); +if (!defined('RAXSDK_LBSERVICE_REGION')) + define('RAXSDK_LBSERVICE_REGION', NULL); +if (!defined('RAXSDK_LBSERVICE_URLTYPE')) + define('RAXSDK_LBSERVICE_URLTYPE', 'publicURL'); +if (!defined('RAXSDK_DNS_NAME')) + define('RAXSDK_DNS_NAME', 'cloudDNS'); +if (!defined('RAXSDK_DNS_REGION')) + define('RAXSDK_DNS_REGION', '{ignore}'); // DNS is regionless +if (!defined('RAXSDK_DNS_URLTYPE')) + define('RAXSDK_DNS_URLTYPE', 'publicURL'); +if (!defined('RAXSDK_AUTOSCALE_NAME')) + define('RAXSDK_AUTOSCALE_NAME', 'autoscale'); +if (!defined('RAXSDK_AUTOSCALE_REGION')) + define('RAXSDK_AUTOSCALE_REGION', NULL); +if (!defined('RAXSDK_AUTOSCALE_URLTYPE')) + define('RAXSDK_AUTOSCALE_URLTYPE', 'publicURL'); +if (!defined('RAXSDK_DNS_ASYNC_TIMEOUT')) + define('RAXSDK_DNS_ASYNC_TIMEOUT', 60); +if (!defined('RAXSDK_DNS_ASYNC_INTERVAL')) + define('RAXSDK_DNS_ASYNC_INTERVAL', 1); +if (!defined('RAXSDK_CONNECTTIMEOUT')) + define('RAXSDK_CONNECTTIMEOUT', 5); +if (!defined('RAXSDK_TIMEOUT')) + define('RAXSDK_TIMEOUT', 60); +if (!defined('RAXSDK_SERVER_MAXTIMEOUT')) + define('RAXSDK_SERVER_MAXTIMEOUT', 3600); +if (!defined('RAXSDK_POLL_INTERVAL')) + define('RAXSDK_POLL_INTERVAL', 10); +if (!defined('RAXSDK_DEFAULT_IP_VERSION')) + define('RAXSDK_DEFAULT_IP_VERSION', 4); +if (!defined('RAXSDK_OVERLIMIT_TIMEOUT')) + define('RAXSDK_OVERLIMIT_TIMEOUT', 300); +/** + * sets default (highly secure) value for CURLOPT_SSL_VERIFYHOST. If you + * are using a self-signed SSL certificate, you can reduce this setting, but + * you do so at your own risk. + */ +if (!defined('RAXSDK_SSL_VERIFYHOST')) + define('RAXSDK_SSL_VERIFYHOST', 2); +/** + * sets default (highly secure) value for CURLOPT_SSL_VERIFYPEER. If you + * are using a self-signed SSL certificate, you can reduce this setting, but + * you do so at your own risk. + */ +if (!defined('RAXSDK_SSL_VERIFYPEER')) + define('RAXSDK_SSL_VERIFYPEER', TRUE); + +/** + * edit and uncomment this to set the default location of cacert.pem file + */ +//define('RAXSDK_CACERTPEM', __DIR__ . DIRECTORY_SEPARATOR . 'cacert.pem'); + +/* these should not be overridden */ +define('RAXSDK_VERSION', '1.5.10'); +define('RAXSDK_USER_AGENT', 'php-opencloud/'.RAXSDK_VERSION.' (Rackspace)'); +define('RAXSDK_ERROR', 'Error:'); +define('RAXSDK_FATAL', 'FATAL ERROR:'); +define('RAXSDK_TERMINATED', '*** PROCESSING HALTED ***'); +define('RAXSDK_CONTENT_TYPE_JSON', 'application/json'); +define('RAXSDK_URL_PUBLIC', 'publicURL'); +define('RAXSDK_URL_INTERNAL', 'internalURL'); +define('RAXSDK_URL_VERSION_INFO', 'versionInfo'); +define('RAXSDK_URL_VERSION_LIST', 'versionList'); + +/** + * definitions for Rackspace authentication endpoints + */ +define('RACKSPACE_US', 'https://identity.api.rackspacecloud.com/v2.0/'); +define('RACKSPACE_UK', 'https://lon.identity.api.rackspacecloud.com/v2.0/'); + +/** + * We can re-authenticate this many seconds before the token expires + * + * Set this to a higher value if your service does not cache tokens; if + * it *does* cache them, then this value is not required. + */ +define('RAXSDK_FUDGE', 0); + +/** + * Readable constants + */ +define('RAXSDK_SOFT_REBOOT', 'soft'); +define('RAXSDK_HARD_REBOOT', 'hard'); +define('RAXSDK_DETAILS', TRUE); +define('RAXSDK_MAX_CONTAINER_NAME_LEN', 256); + +/** + * UUID of the Rackspace 'public' network + */ +define('RAX_PUBLIC','00000000-0000-0000-0000-000000000000'); +/** + * UUID of the Rackspace 'private' network + */ +define('RAX_PRIVATE','11111111-1111-1111-1111-111111111111'); + +// Turn off debug mode by default +define('RAXSDK_DEBUG', false); + +/********** TIMEZONE MAGIC **********/ + +/** + * This is called if there is an error getting the default timezone; + * that means that the default timezone isn't set. + * + * @codeCoverageIgnore + */ +function __raxsdk_timezone_set($errno, $errstr) { + if ($errno==2) + date_default_timezone_set(RAXSDK_TIMEZONE); + else + die(sprintf("Unknown error %d: %s\n", $errno, $errstr)); +} +set_error_handler('\OpenCloud\__raxsdk_timezone_set'); +@date_default_timezone_get(); +restore_error_handler(); + +/********** SOME GLOBAL FUNCTIONS **********/ + + /** + * \OpenCloud\Common\Lang::translate() - this function should be used to wrap all static strings. In the future, + * this may provide us with a hook for providing different language + * translations. + * + * @codeCoverageIgnore + */ + function define_gettext() { + function translate($str) { + return $str; + } + } + + if (!function_exists('_')) + define_gettext(); + + /** + * removes trailing slash(es) from a URL string + * + * Mainly, this is just for appearance's sake. I really hate to see + * URLs like .../servers//address, for some reason. + * + * @codeCoverageIgnore + */ + function noslash($str) { + while ($str && (substr($str, -1) == '/')) + $str = substr($str, 0, strlen($str)-1); + return $str; + } + + /** + * Turns debugging on or off + * + * @codeCoverageIgnore + */ + function setDebug($state=TRUE) { + global $RAXSDK_DEBUG; + $RAXSDK_DEBUG=$state; + } + diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/AbstractService.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/AbstractService.php new file mode 100644 index 00000000000..4a2298d60ed --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/AbstractService.php @@ -0,0 +1,57 @@ +<?php +/** + * PHP OpenCloud library. + * + * @copyright Copyright 2013 Rackspace US, Inc. See COPYING for licensing information. + * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0 + * @version 1.6.0 + * @author Glen Campbell <glen.campbell@rackspace.com> + * @author Jamie Hannaford <jamie.hannaford@rackspace.com> + */ + +namespace OpenCloud\ObjectStore; + +use OpenCloud\Common\Service as CommonService; + +define('SWIFT_MAX_OBJECT_SIZE', 5 * 1024 * 1024 * 1024 + 1); + +/** + * An abstract base class for common code shared between ObjectStore\Service + * (container) and ObjectStore\CDNService (CDN containers). + * + * @todo Maybe we use Traits instead of this small abstract class? + */ +abstract class AbstractService extends CommonService +{ + + const MAX_CONTAINER_NAME_LEN = 256; + const MAX_OBJECT_NAME_LEN = 1024; + const MAX_OBJECT_SIZE = SWIFT_MAX_OBJECT_SIZE; + + /** + * Creates a Container resource object. + * + * @param mixed $cdata The name of the container or an object from which to set values + * @return OpenCloud\ObjectStore\Resource\Container + */ + public function container($cdata = null) + { + return new Resource\Container($this, $cdata); + } + + /** + * Returns a Collection of Container objects. + * + * @param array $filter An array to filter the results + * @return OpenCloud\Common\Collection + */ + public function containerList(array $filter = array()) + { + $filter['format'] = 'json'; + + return $this->collection( + 'OpenCloud\ObjectStore\Resource\Container', $this->url(null, $filter) + ); + } + +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/CDNService.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/CDNService.php new file mode 100644 index 00000000000..132d5f47ad6 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/CDNService.php @@ -0,0 +1,62 @@ +<?php +/** + * PHP OpenCloud library. + * + * @copyright Copyright 2013 Rackspace US, Inc. See COPYING for licensing information. + * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0 + * @version 1.6.0 + * @author Glen Campbell <glen.campbell@rackspace.com> + * @author Jamie Hannaford <jamie.hannaford@rackspace.com> + */ + +namespace OpenCloud\ObjectStore; + +use OpenCloud\OpenStack; +use OpenCloud\Common\Exceptions; + +/** + * This is the CDN version of the ObjectStore service. + */ +class CDNService extends AbstractService +{ + + /** + * Creates a new CDNService object. + * + * This is a simple wrapper function around the parent Service construct, + * but supplies defaults for the service type. + * + * @param OpenCloud\OpenStack $connection The connection object + * @param string $serviceName The name of the service + * @param string $serviceRegion The service's region + * @param string $urlType The type of URL (normally 'publicURL') + */ + public function __construct( + OpenStack $connection, + $serviceName = RAXSDK_OBJSTORE_NAME, + $serviceRegion = RAXSDK_OBJSTORE_REGION, + $urltype = RAXSDK_URL_PUBLIC + ) { + $this->getLogger()->info('Initializing CDN Service...'); + + parent::__construct( + $connection, + 'rax:object-cdn', + $serviceName, + $serviceRegion, + $urltype + ); + } + + /** + * Helps catch errors if someone calls the method on the + * wrong object + */ + public function CDN() + { + throw new Exceptions\CdnError( + 'Invalid method call; no CDN() on the CDN object' + ); + } + +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/Resource/AbstractStorageObject.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/Resource/AbstractStorageObject.php new file mode 100644 index 00000000000..c6799b22b7e --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/Resource/AbstractStorageObject.php @@ -0,0 +1,170 @@ +<?php +/** + * PHP OpenCloud library. + * + * @copyright Copyright 2013 Rackspace US, Inc. See COPYING for licensing information. + * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0 + * @version 1.6.0 + * @author Glen Campbell <glen.campbell@rackspace.com> + * @author Jamie Hannaford <jamie.hannaford@rackspace.com> + */ + +namespace OpenCloud\ObjectStore\Resource; + +use OpenCloud\Common\Base; +use OpenCloud\Common\Metadata; +use OpenCloud\Common\Exceptions\NameError; +use OpenCloud\Common\Exceptions\MetadataPrefixError; +use OpenCloud\Common\Request\Response\Http; + +/** + * Abstract base class which implements shared functionality of ObjectStore + * resources. Provides support, for example, for metadata-handling and other + * features that are common to the ObjectStore components. + */ +abstract class AbstractStorageObject extends Base +{ + + const ACCOUNT_META_PREFIX = 'X-Account-'; + const CONTAINER_META_PREFIX = 'X-Container-Meta-'; + const OBJECT_META_PREFIX = 'X-Object-Meta-'; + const CDNCONTAINER_META_PREFIX = 'X-Cdn-'; + + /** + * Metadata belonging to a resource. + * + * @var OpenCloud\Common\Metadata + */ + public $metadata; + + /** + * Initializes the metadata component + */ + public function __construct() + { + $this->metadata = new Metadata; + } + + /** + * Given an Http response object, converts the appropriate headers + * to metadata + * + * @param OpenCloud\Common\Request\Response\Http + * @return void + */ + public function getMetadata(Http $response) + { + $this->metadata = new Metadata; + $this->metadata->setArray($response->headers(), $this->prefix()); + } + + /** + * If object has metadata, return an associative array of headers. + * + * For example, if a DataObject has a metadata item named 'FOO', + * then this would return array('X-Object-Meta-FOO'=>$value); + * + * @return array + */ + public function metadataHeaders() + { + $headers = array(); + + // only build if we have metadata + if (is_object($this->metadata)) { + foreach ($this->metadata as $key => $value) { + $headers[$this->prefix() . $key] = $value; + } + } + + return $headers; + } + + /** + * Returns the displayable name of the object + * + * Can be overridden by child objects; *must* be overridden by child + * objects if the object does not have a `name` attribute defined. + * + * @api + * @throws NameError if attribute 'name' is not defined + */ + public function name() + { + if (property_exists($this, 'name')) { + return $this->name; + } else { + throw new NameError(sprintf( + 'Name attribute does not exist for [%s]', + get_class($this) + )); + } + } + + /** + * Override parent method. + * + * @return null + */ + public static function jsonName() + { + return null; + } + + /** + * Override parent method. + * + * @return null + */ + public static function jsonCollectionName() + { + return null; + } + + /** + * Override parent method. + * + * @return null + */ + public static function jsonCollectionElement() + { + return null; + } + + /** + * Returns the proper prefix for the specified type of object + * + * @param string $type The type of object; derived from `get_class()` if not + * specified. + * @codeCoverageIgnore + */ + private function prefix($type = null) + { + if ($type === null) { + $parts = preg_split('/\\\/', get_class($this)); + $type = $parts[count($parts)-1]; + } + + switch($type) { + case 'Account': + $prefix = self::ACCOUNT_META_PREFIX; + break; + case 'CDNContainer': + $prefix = self::CDNCONTAINER_META_PREFIX; + break; + case 'Container': + $prefix = self::CONTAINER_META_PREFIX; + break; + case 'DataObject': + $prefix = self::OBJECT_META_PREFIX; + break; + default: + throw new MetadataPrefixError(sprintf( + 'Unrecognized metadata type [%s]', + $type + )); + } + + return $prefix; + } +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/Resource/CDNContainer.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/Resource/CDNContainer.php new file mode 100644 index 00000000000..9b6367c87e0 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/Resource/CDNContainer.php @@ -0,0 +1,298 @@ +<?php +/** + * PHP OpenCloud library. + * + * @copyright Copyright 2013 Rackspace US, Inc. See COPYING for licensing information. + * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0 + * @version 1.6.0 + * @author Glen Campbell <glen.campbell@rackspace.com> + * @author Jamie Hannaford <jamie.hannaford@rackspace.com> + */ + +namespace OpenCloud\ObjectStore\Resource; + +use OpenCloud\Common\Service as AbstractService; +use OpenCloud\Common\Lang; +use OpenCloud\Common\Exceptions; +use OpenCloud\ObjectStore\AbstractService as AbstractObjectService; + +/** + * A container that has been CDN-enabled. Each CDN-enabled container has a unique + * Uniform Resource Locator (URL) that can be combined with its object names and + * openly distributed in web pages, emails, or other applications. + */ +class CDNContainer extends AbstractStorageObject +{ + /** + * The name of the container. + * + * The only restrictions on container names is that they cannot contain a + * forward slash (/) and must be less than 256 bytes in length. Please note + * that the length restriction applies to the name after it has been URL + * encoded. For example, a container named Course Docs would be URL encoded + * as Course%20Docs - which is 13 bytes in length rather than the expected 11. + * + * @var string + */ + public $name; + + /** + * Count of how many objects exist in the container. + * + * @var int + */ + public $count = 0; + + /** + * The total bytes used in the container. + * + * @var int + */ + public $bytes = 0; + + /** + * The service object. + * + * @var AbstractService + */ + private $service; + + /** + * URL of the container. + * + * @var string + */ + private $containerUrl; + + /** + * Creates the container object + * + * Creates a new container object or, if the $cdata object is a string, + * retrieves the named container from the object store. If $cdata is an + * array or an object, then its values are used to set this object. + * + * @param OpenCloud\ObjectStore $service - the ObjectStore service + * @param mixed $cdata - if supplied, the name of the object + */ + public function __construct(AbstractService $service, $cdata = null) + { + $this->getLogger()->info('Initializing CDN Container Service...'); + + parent::__construct(); + + $this->service = $service; + + // Populate data if set + $this->populate($cdata); + } + + /** + * Allow other objects to know what the primary key is. + * + * @return string + */ + public function primaryKeyField() + { + return 'name'; + } + + /** + * Returns the Service associated with the Container + */ + public function getService() + { + return $this->service; + } + + /** + * Returns the URL of the container + * + * @return string + * @param string $subresource not used; required for compatibility + * @throws NoNameError + */ + public function url($subresource = '') + { + if (strlen($this->name) == 0) { + throw new Exceptions\NoNameError( + Lang::translate('Container does not have an identifier') + ); + } + + return Lang::noslash($this->getService()->url(rawurlencode($this->name))); + } + + /** + * Creates a new container with the specified attributes + * + * @param array $params array of parameters + * @return boolean TRUE on success; FALSE on failure + * @throws ContainerCreateError + */ + public function create($params = array()) + { + // Populate object and check container name + $this->populate($params); + $this->isValidName($this->name); + + // Dispatch + $this->containerUrl = $this->url(); + $response = $this->getService()->request($this->url(), 'PUT', $this->metadataHeaders()); + + // Check return code + // @codeCoverageIgnoreStart + if ($response->httpStatus() > 202) { + throw new Exceptions\ContainerCreateError(sprintf( + Lang::translate('Problem creating container [%s] status [%d] response [%s]'), + $this->url(), + $response->httpStatus(), + $response->httpBody() + )); + } + // @codeCoverageIgnoreEnd + + return true; + } + + /** + * Updates the metadata for a container + * + * @return boolean TRUE on success; FALSE on failure + * @throws ContainerCreateError + */ + public function update() + { + $response = $this->getService()->request($this->url(), 'POST', $this->metadataHeaders()); + + // check return code + // @codeCoverageIgnoreStart + if ($response->httpStatus() > 204) { + throw new Exceptions\ContainerCreateError(sprintf( + Lang::translate('Problem updating container [%s] status [%d] response [%s]'), + $this->Url(), + $response->httpStatus(), + $response->httpBody() + )); + } + // @codeCoverageIgnoreEnd + + return true; + } + + /** + * Deletes the specified container + * + * @return boolean TRUE on success; FALSE on failure + * @throws ContainerDeleteError + */ + public function delete() + { + $response = $this->getService()->request($this->url(), 'DELETE'); + + // validate the response code + // @codeCoverageIgnoreStart + if ($response->httpStatus() == 404) { + throw new Exceptions\ContainerNotFoundError(sprintf( + Lang::translate('Container [%s] not found'), + $this->name + )); + } + + if ($response->httpStatus() == 409) { + throw new Exceptions\ContainerNotEmptyError(sprintf( + Lang::translate('Container [%s] must be empty before deleting'), + $this->name + )); + } + + if ($response->httpStatus() >= 300) { + throw new Exceptions\ContainerDeleteError(sprintf( + Lang::translate('Problem deleting container [%s] status [%d] response [%s]'), + $this->url(), + $response->httpStatus(), + $response->httpBody() + )); + return false; + } + // @codeCoverageIgnoreEnd + + return true; + } + + /** + * Loads the object from the service + * + * @return void + */ + public function refresh($name = null, $url = null) + { + $response = $this->getService()->request( + $this->url($name), 'HEAD', array('Accept' => '*/*') + ); + + // validate the response code + // @codeCoverageIgnoreStart + if ($response->HttpStatus() == 404) { + throw new Exceptions\ContainerNotFoundError(sprintf( + 'Container [%s] (%s) not found', + $this->name, + $this->url() + )); + } + + if ($response->HttpStatus() >= 300) { + throw new Exceptions\HttpError(sprintf( + 'Error retrieving Container, status [%d] response [%s]', + $response->httpStatus(), + $response->httpBody() + )); + } + + // check for headers (not metadata) + foreach($response->headers() as $header => $value) { + switch($header) { + case 'X-Container-Object-Count': + $this->count = $value; + break; + case 'X-Container-Bytes-Used': + $this->bytes = $value; + break; + } + } + // @codeCoverageIgnoreEnd + + // parse the returned object + $this->getMetadata($response); + } + + /** + * Validates that the container name is acceptable + * + * @param string $name the container name to validate + * @return boolean TRUE if ok; throws an exception if not + * @throws ContainerNameError + */ + public function isValidName($name) + { + if (strlen($name) == 0) { + throw new Exceptions\ContainerNameError( + 'Container name cannot be blank' + ); + } + + if (strpos($name, '/') !== false) { + throw new Exceptions\ContainerNameError( + 'Container name cannot contain "/"' + ); + } + + if (strlen($name) > AbstractObjectService::MAX_CONTAINER_NAME_LEN) { + throw new Exceptions\ContainerNameError( + 'Container name is too long' + ); + } + + return true; + } + +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/Resource/Container.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/Resource/Container.php new file mode 100644 index 00000000000..3a56ebd9fca --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/Resource/Container.php @@ -0,0 +1,401 @@ +<?php +/** + * PHP OpenCloud library. + * + * @copyright Copyright 2013 Rackspace US, Inc. See COPYING for licensing information. + * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0 + * @version 1.6.0 + * @author Glen Campbell <glen.campbell@rackspace.com> + * @author Jamie Hannaford <jamie.hannaford@rackspace.com> + */ + +namespace OpenCloud\ObjectStore\Resource; + +use OpenCloud\Common\Exceptions; +use OpenCloud\Common\Lang; + +/** + * A container is a storage compartment for your data and provides a way for you + * to organize your data. You can think of a container as a folder in Windows® + * or a directory in UNIX®. The primary difference between a container and these + * other file system concepts is that containers cannot be nested. + * + * A container can also be CDN-enabled (for public access), in which case you + * will need to interact with a CDNContainer object instead of this one. + */ +class Container extends CDNContainer +{ + + /** + * CDN container (if set). + * + * @var CDNContainer|null + */ + private $cdn; + + /** + * Sets the CDN container. + * + * @param OpenCloud\ObjectStore\Resource\CDNContainer $cdn + */ + public function setCDN(CDNContainer $cdn) + { + $this->cdn = $cdn; + } + + /** + * Returns the CDN container. + * + * @returns CDNContainer + */ + public function getCDN() + { + if (!$this->cdn) { + throw new Exceptions\CdnNotAvailableError( + Lang::translate('CDN-enabled container is not available') + ); + } + + return $this->cdn; + } + + /** + * Backwards compatability. + */ + public function CDN() + { + return $this->getCDN(); + } + + /** + * Makes the container public via the CDN + * + * @api + * @param integer $TTL the Time-To-Live for the CDN container; if NULL, + * then the cloud's default value will be used for caching. + * @throws CDNNotAvailableError if CDN services are not available + * @return CDNContainer + */ + public function enableCDN($ttl = null) + { + $url = $this->getService()->CDN()->url() . '/' . rawurlencode($this->name); + + $headers = $this->metadataHeaders(); + + if ($ttl) { + + // Make sure we're dealing with a real figure + if (!is_integer($ttl)) { + throw new Exceptions\CdnTtlError(sprintf( + Lang::translate('TTL value [%s] must be an integer'), + $ttl + )); + } + + $headers['X-TTL'] = $ttl; + } + + $headers['X-Log-Retention'] = 'True'; + $headers['X-CDN-Enabled'] = 'True'; + + // PUT to the CDN container + $response = $this->getService()->request($url, 'PUT', $headers); + + // check the response status + // @codeCoverageIgnoreStart + if ($response->httpStatus() > 202) { + throw new Exceptions\CdnHttpError(sprintf( + Lang::translate('HTTP error publishing to CDN, status [%d] response [%s]'), + $response->httpStatus(), + $response->httpBody() + )); + } + // @codeCoverageIgnoreEnd + + // refresh the data + $this->refresh(); + + // return the CDN container object + $cdn = new CDNContainer($this->getService()->getCDNService(), $this->name); + $this->setCDN($cdn); + + return $cdn; + } + + /** + * Backwards compatability. + */ + public function publishToCDN($ttl = null) + { + return $this->enableCDN($ttl); + } + + /** + * Disables the containers CDN function. + * + * Note that the container will still be available on the CDN until + * its TTL expires. + * + * @api + * @return void + */ + public function disableCDN() + { + // Set necessary headers + $headers['X-Log-Retention'] = 'False'; + $headers['X-CDN-Enabled'] = 'False'; + + // PUT it to the CDN service + $response = $this->getService()->request($this->CDNURL(), 'PUT', $headers); + + // check the response status + // @codeCoverageIgnoreStart + if ($response->httpStatus() != 201) { + throw new Exceptions\CdnHttpError(sprintf( + Lang::translate('HTTP error disabling CDN, status [%d] response [%s]'), + $response->httpStatus(), + $response->httpBody() + )); + } + // @codeCoverageIgnoreEnd + + return true; + } + + /** + * Creates a static website from the container + * + * @api + * @link http://docs.rackspace.com/files/api/v1/cf-devguide/content/Create_Static_Website-dle4000.html + * @param string $index the index page (starting page) of the website + * @return \OpenCloud\HttpResponse + */ + public function createStaticSite($indexHtml) + { + $headers = array('X-Container-Meta-Web-Index' => $indexHtml); + $response = $this->getService()->request($this->url(), 'POST', $headers); + + // check return code + // @codeCoverageIgnoreStart + if ($response->HttpStatus() > 204) { + throw new Exceptions\ContainerError(sprintf( + Lang::translate('Error creating static website for [%s], status [%d] response [%s]'), + $this->name, + $response->httpStatus(), + $response->httpBody() + )); + } + // @codeCoverageIgnoreEnd + + return $response; + } + + /** + * Sets the error page(s) for the static website + * + * @api + * @link http://docs.rackspace.com/files/api/v1/cf-devguide/content/Set_Error_Pages_for_Static_Website-dle4005.html + * @param string $name the name of the error page + * @return \OpenCloud\HttpResponse + */ + public function staticSiteErrorPage($name) + { + $headers = array('X-Container-Meta-Web-Error' => $name); + $response = $this->getService()->request($this->url(), 'POST', $headers); + + // check return code + // @codeCoverageIgnoreStart + if ($response->httpStatus() > 204) { + throw new Exceptions\ContainerError(sprintf( + Lang::translate('Error creating static site error page for [%s], status [%d] response [%s]'), + $this->name, + $response->httpStatus(), + $response->httpBody() + )); + } + + return $response; + // @codeCoverageIgnoreEnd + } + + /** + * Returns the CDN URL of the container (if enabled) + * + * The CDNURL() is used to manage the container. Note that it is different + * from the PublicURL() of the container, which is the publicly-accessible + * URL on the network. + * + * @api + * @return string + */ + public function CDNURL() + { + return $this->getCDN()->url(); + } + + /** + * Returns the Public URL of the container (on the CDN network) + * + */ + public function publicURL() + { + return $this->CDNURI(); + } + + /** + * Returns the CDN info about the container + * + * @api + * @return stdClass + */ + public function CDNinfo($property = null) + { + // Not quite sure why this is here... + // @codeCoverageIgnoreStart + if ($this->getService() instanceof CDNService) { + return $this->metadata; + } + // @codeCoverageIgnoreEnd + + // return NULL if the CDN container is not enabled + if (!isset($this->getCDN()->metadata->Enabled) + || $this->getCDN()->metadata->Enabled == 'False' + ) { + return null; + } + + // check to see if it's set + if (isset($this->getCDN()->metadata->$property)) { + return trim($this->getCDN()->metadata->$property); + } elseif ($property !== null) { + return null; + } + + // otherwise, return the whole metadata object + return $this->getCDN()->metadata; + } + + /** + * Returns the CDN container URI prefix + * + * @api + * @return string + */ + public function CDNURI() + { + return $this->CDNinfo('Uri'); + } + + /** + * Returns the SSL URI for the container + * + * @api + * @return string + */ + public function SSLURI() + { + return $this->CDNinfo('Ssl-Uri'); + } + + /** + * Returns the streaming URI for the container + * + * @api + * @return string + */ + public function streamingURI() + { + return $this->CDNinfo('Streaming-Uri'); + } + + /** + * Returns the IOS streaming URI for the container + * + * @api + * @link http://docs.rackspace.com/files/api/v1/cf-devguide/content/iOS-Streaming-d1f3725.html + * @return string + */ + public function iosStreamingURI() + { + return $this->CDNinfo('Ios-Uri'); + } + + /** + * Creates a Collection of objects in the container + * + * @param array $params associative array of parameter values. + * * account/tenant - The unique identifier of the account/tenant. + * * container- The unique identifier of the container. + * * limit (Optional) - The number limit of results. + * * marker (Optional) - Value of the marker, that the object names + * greater in value than are returned. + * * end_marker (Optional) - Value of the marker, that the object names + * less in value than are returned. + * * prefix (Optional) - Value of the prefix, which the returned object + * names begin with. + * * format (Optional) - Value of the serialized response format, either + * json or xml. + * * delimiter (Optional) - Value of the delimiter, that all the object + * names nested in the container are returned. + * @link http://api.openstack.org for a list of possible parameter + * names and values + * @return OpenCloud\Collection + * @throws ObjFetchError + */ + public function objectList($params = array()) + { + // construct a query string out of the parameters + $params['format'] = 'json'; + + $queryString = $this->makeQueryString($params); + + // append the query string to the URL + $url = $this->url(); + if (strlen($queryString) > 0) { + $url .= '?' . $queryString; + } + + return $this->getService()->collection( + 'OpenCloud\ObjectStore\Resource\DataObject', $url, $this + ); + } + + /** + * Returns a new DataObject associated with this container + * + * @param string $name if supplied, the name of the object to return + * @return DataObject + */ + public function dataObject($name = null) + { + return new DataObject($this, $name); + } + + /** + * Refreshes, then associates the CDN container + */ + public function refresh($id = null, $url = null) + { + parent::refresh($id, $url); + + // @codeCoverageIgnoreStart + if ($this->getService() instanceof CDNService) { + return; + } + + + if (null !== ($cdn = $this->getService()->CDN())) { + try { + $this->cdn = new CDNContainer( + $cdn, + $this->name + ); + } catch (Exceptions\ContainerNotFoundError $e) { + $this->cdn = new CDNContainer($cdn); + $this->cdn->name = $this->name; + } + } + // @codeCoverageIgnoreEnd + } + +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/Resource/DataObject.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/Resource/DataObject.php new file mode 100644 index 00000000000..443df1f651f --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/Resource/DataObject.php @@ -0,0 +1,941 @@ +<?php +/** + * PHP OpenCloud library. + * + * @copyright Copyright 2013 Rackspace US, Inc. See COPYING for licensing information. + * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0 + * @version 1.6.0 + * @author Glen Campbell <glen.campbell@rackspace.com> + * @author Jamie Hannaford <jamie.hannaford@rackspace.com> + */ + +namespace OpenCloud\ObjectStore\Resource; + +use finfo as FileInfo; +use OpenCloud\Common\Lang; +use OpenCloud\Common\Exceptions; +use OpenCloud\ObjectStore\AbstractService; +use OpenCloud\Common\Request\Response\Http; + +/** + * Objects are the basic storage entities in Cloud Files. They represent the + * files and their optional metadata you upload to the system. When you upload + * objects to Cloud Files, the data is stored as-is (without compression or + * encryption) and consists of a location (container), the object's name, and + * any metadata you assign consisting of key/value pairs. + */ +class DataObject extends AbstractStorageObject +{ + /** + * Object name. The only restriction on object names is that they must be + * less than 1024 bytes in length after URL encoding. + * + * @var string + */ + public $name; + + /** + * Hash value of the object. + * + * @var string + */ + public $hash; + + /** + * Size of object in bytes. + * + * @var string + */ + public $bytes; + + /** + * Date of last modification. + * + * @var string + */ + public $last_modified; + + /** + * Object's content type. + * + * @var string + */ + public $content_type; + + /** + * Object's content length. + * + * @var string + */ + public $content_length; + + /** + * Other headers set for this object (e.g. Access-Control-Allow-Origin) + * + * @var array + */ + public $extra_headers = array(); + + /** + * Whether or not to calculate and send an ETag on create. + * + * @var bool + */ + public $send_etag = true; + + /** + * The data contained by the object. + * + * @var string + */ + private $data; + + /** + * The ETag value. + * + * @var string + */ + private $etag; + + /** + * The parent container of this object. + * + * @var CDNContainer + */ + private $container; + + /** + * Is this data object a pseudo directory? + * + * @var bool + */ + private $directory = false; + + /** + * Used to translate header values (returned by requests) into properties. + * + * @var array + */ + private $headerTranslate = array( + 'Etag' => 'hash', + 'ETag' => 'hash', + 'Last-Modified' => 'last_modified', + 'Content-Length' => array('bytes', 'content_length'), + ); + + /** + * These properties can be freely set by the user for CRUD operations. + * + * @var array + */ + private $allowedProperties = array( + 'name', + 'content_type', + 'extra_headers', + 'send_etag' + ); + + /** + * Option for clearing the status cache when objects are uploaded to API. + * By default, it is set to FALSE for performance; but if you have files + * that are rapidly and very often updated, you might want to clear the status + * cache so PHP reads the files directly, instead of relying on the cache. + * + * @link http://php.net/manual/en/function.clearstatcache.php + * @var bool + */ + public $clearStatusCache = false; + + /** + * A DataObject is related to a container and has a name + * + * If `$name` is specified, then it attempts to retrieve the object from the + * object store. + * + * @param Container $container the container holding this object + * @param mixed $cdata if an object or array, it is treated as values + * with which to populate the object. If it is a string, it is + * treated as a name and the object's info is retrieved from + * the service. + * @return void + */ + public function __construct($container, $cdata = null) + { + parent::__construct(); + + $this->container = $container; + + // For pseudo-directories, we need to ensure the name is set + if (!empty($cdata->subdir)) { + $this->name = $cdata->subdir; + $this->directory = true; + } else { + $this->populate($cdata); + } + } + + /** + * Is this data object a pseudo-directory? + * + * @return bool + */ + public function isDirectory() + { + return $this->directory; + } + + /** + * Allow other objects to know what the primary key is. + * + * @return string + */ + public function primaryKeyField() + { + return 'name'; + } + + /** + * Is this a real file? + * + * @param string $filename + * @return bool + */ + private function isRealFile($filename) + { + return $filename != '/dev/null' && $filename != 'NUL'; + } + + /** + * Set this file's content type. + * + * @param string $contentType + */ + public function setContentType($contentType) + { + $this->content_type = $contentType; + } + + /** + * Return the content type. + * + * @return string + */ + public function getContentType() + { + return $this->content_type; + } + + /** + * Returns the URL of the data object + * + * If the object is new and doesn't have a name, then an exception is + * thrown. + * + * @param string $subresource Not used + * @return string + * @throws NoNameError + */ + public function url($subresource = '') + { + if (!$this->name) { + throw new Exceptions\NoNameError(Lang::translate('Object has no name')); + } + + return Lang::noslash( + $this->container->url()) . '/' . str_replace('%2F', '/', rawurlencode($this->name) + ); + } + + /** + * Creates (or updates; both the same) an instance of the object + * + * @api + * @param array $params an optional associative array that can contain the + * 'name' and 'content_type' of the object + * @param string $filename if provided, then the object is loaded from the + * specified file + * @return boolean + * @throws CreateUpdateError + */ + public function create($params = array(), $filename = null, $extractArchive = null) + { + // Set and validate params + $this->setParams($params); + + // assume no file upload + $fp = false; + + // if the filename is provided, process it + if ($filename) { + + if (!$fp = @fopen($filename, 'r')) { + throw new Exceptions\IOError(sprintf( + Lang::translate('Could not open file [%s] for reading'), + $filename + )); + } + + // @todo Maybe, for performance, we could set the "clear status cache" + // feature to false by default - but allow users to set to true if required + clearstatcache($this->clearStatusCache === true, $filename); + + // Cast filesize as a floating point + $filesize = (float) filesize($filename); + + // Check it's below a reasonable size, and set + // @codeCoverageIgnoreStart + if ($filesize > AbstractService::MAX_OBJECT_SIZE) { + throw new Exceptions\ObjectError("File size exceeds maximum object size."); + } + // @codeCoverageIgnoreEnd + $this->content_length = $filesize; + + // Guess the content type if necessary + if (!$this->getContentType() && $this->isRealFile($filename)) { + $this->setContentType($this->inferContentType($filename)); + } + + // Send ETag checksum if necessary + if ($this->send_etag) { + $this->etag = md5_file($filename); + } + + // Announce to the world + $this->getLogger()->info('Uploading {size} bytes from {name}', array( + 'size' => $filesize, + 'name' => $filename + )); + + } else { + // compute the length + $this->content_length = strlen($this->data); + + if ($this->send_etag) { + $this->etag = md5($this->data); + } + } + + // Only allow supported archive types + // http://docs.rackspace.com/files/api/v1/cf-devguide/content/Extract_Archive-d1e2338.html + $extractArchiveUrlArg = ''; + + if ($extractArchive) { + if ($extractArchive !== "tar.gz" && $extractArchive !== "tar.bz2") { + throw new Exceptions\ObjectError( + "Extract Archive only supports tar.gz and tar.bz2" + ); + } else { + $extractArchiveUrlArg = "?extract-archive=" . $extractArchive; + $this->etag = null; + $this->setContentType(''); + } + } + + // Set headers + $headers = $this->metadataHeaders(); + + if (!empty($this->etag)) { + $headers['ETag'] = $this->etag; + } + + // Content-Type is no longer required; if not specified, it will + // attempt to guess based on the file extension. + if (!$this->getContentType()) { + $headers['Content-Type'] = $this->getContentType(); + } + + $headers['Content-Length'] = $this->content_length; + + // Merge in extra headers + if (!empty($this->extra_headers)) { + $headers = $this->extra_headers + $headers; + } + + // perform the request + $response = $this->getService()->request( + $this->url() . $extractArchiveUrlArg, + 'PUT', + $headers, + $fp ? $fp : $this->data + ); + + // check the status + // @codeCoverageIgnoreStart + if (($status = $response->httpStatus()) >= 300) { + throw new Exceptions\CreateUpdateError(sprintf( + Lang::translate('Problem saving/updating object [%s] HTTP status [%s] response [%s]'), + $this->url() . $extractArchiveUrlArg, + $status, + $response->httpBody() + )); + } + // @codeCoverageIgnoreEnd + + // set values from response + $this->saveResponseHeaders($response); + + // close the file handle + if ($fp) { + fclose($fp); + } + + return $response; + } + + /** + * Update() is provided as an alias for the Create() method + * + * Since update and create both use a PUT request, the different functions + * may allow the developer to distinguish between the semantics in his or + * her application. + * + * @api + * @param array $params an optional associative array that can contain the + * 'name' and 'type' of the object + * @param string $filename if provided, the object is loaded from the file + * @return boolean + */ + public function update($params = array(), $filename = '') + { + return $this->create($params, $filename); + } + + /** + * UpdateMetadata() - updates headers + * + * Updates metadata headers + * + * @api + * @param array $params an optional associative array that can contain the + * 'name' and 'type' of the object + * @return boolean + */ + public function updateMetadata($params = array()) + { + $this->setParams($params); + + // set the headers + $headers = $this->metadataHeaders(); + $headers['Content-Type'] = $this->getContentType(); + + $response = $this->getService()->request( + $this->url(), + 'POST', + $headers + ); + + // check the status + // @codeCoverageIgnoreStart + if (($stat = $response->httpStatus()) >= 204) { + throw new Exceptions\UpdateError(sprintf( + Lang::translate('Problem updating object [%s] HTTP status [%s] response [%s]'), + $this->url(), + $stat, + $response->httpBody() + )); + } + // @codeCoverageIgnoreEnd + + return $response; + } + + /** + * Deletes an object from the Object Store + * + * Note that we can delete without retrieving by specifying the name in the + * parameter array. + * + * @api + * @param array $params an array of parameters + * @return HttpResponse if successful; FALSE if not + * @throws DeleteError + */ + public function delete($params = array()) + { + $this->setParams($params); + + $response = $this->getService()->request($this->url(), 'DELETE'); + + // check the status + // @codeCoverageIgnoreStart + if (($stat = $response->httpStatus()) >= 300) { + throw new Exceptions\DeleteError(sprintf( + Lang::translate('Problem deleting object [%s] HTTP status [%s] response [%s]'), + $this->url(), + $stat, + $response->httpBody() + )); + } + // @codeCoverageIgnoreEnd + + return $response; + } + + /** + * Copies the object to another container/object + * + * Note that this function, because it operates within the Object Store + * itself, is much faster than downloading the object and re-uploading it + * to a new object. + * + * @param DataObject $target the target of the COPY command + */ + public function copy(DataObject $target) + { + $uri = sprintf('/%s/%s', $target->container()->name(), $target->name()); + + $this->getLogger()->info('Copying object to [{uri}]', array('uri' => $uri)); + + $response = $this->getService()->request( + $this->url(), + 'COPY', + array('Destination' => $uri) + ); + + // check response code + // @codeCoverageIgnoreStart + if ($response->httpStatus() > 202) { + throw new Exceptions\ObjectCopyError(sprintf( + Lang::translate('Error copying object [%s], status [%d] response [%s]'), + $this->url(), + $response->httpStatus(), + $response->httpBody() + )); + } + // @codeCoverageIgnoreEnd + + return $response; + } + + /** + * Returns the container of the object + * + * @return Container + */ + public function container() + { + return $this->container; + } + + /** + * returns the TEMP_URL for the object + * + * Some notes: + * * The `$secret` value is arbitrary; it must match the value set for + * the `X-Account-Meta-Temp-URL-Key` on the account level. This can be + * set by calling `$service->SetTempUrlSecret($secret)`. + * * The `$expires` value is the number of seconds you want the temporary + * URL to be valid for. For example, use `60` to make it valid for a + * minute + * * The `$method` must be either GET or PUT. No other methods are + * supported. + * + * @param string $secret the shared secret + * @param integer $expires the expiration time (in seconds) + * @param string $method either GET or PUT + * @return string the temporary URL + */ + public function tempUrl($secret, $expires, $method) + { + $method = strtoupper($method); + $expiry_time = time() + $expires; + + // check for proper method + if ($method != 'GET' && $method != 'PUT') { + throw new Exceptions\TempUrlMethodError(sprintf( + Lang::translate( + 'Bad method [%s] for TempUrl; only GET or PUT supported'), + $method + )); + } + + // construct the URL + $url = $this->url(); + $path = urldecode(parse_url($url, PHP_URL_PATH)); + + $hmac_body = "$method\n$expiry_time\n$path"; + $hash = hash_hmac('sha1', $hmac_body, $secret); + + $this->getLogger()->info('URL [{url}]; SIG [{sig}]; HASH [{hash}]', array( + 'url' => $url, + 'sig' => $hmac_body, + 'hash' => $hash + )); + + $temp_url = sprintf('%s?temp_url_sig=%s&temp_url_expires=%d', $url, $hash, $expiry_time); + + // debug that stuff + $this->getLogger()->info('TempUrl generated [{url}]', array( + 'url' => $temp_url + )); + + return $temp_url; + } + + /** + * Sets object data from string + * + * This is a convenience function to permit the use of other technologies + * for setting an object's content. + * + * @param string $data + * @return void + */ + public function setData($data) + { + $this->data = (string) $data; + } + + /** + * Return object's data as a string + * + * @return string the entire object + */ + public function saveToString() + { + return $this->getService()->request($this->url())->httpBody(); + } + + /** + * Saves the object's data to local filename + * + * Given a local filename, the Object's data will be written to the newly + * created file. + * + * Example: + * <code> + * # ... authentication/connection/container code excluded + * # ... see previous examples + * + * # Whoops! I deleted my local README, let me download/save it + * # + * $my_docs = $conn->get_container("documents"); + * $doc = $my_docs->get_object("README"); + * + * $doc->SaveToFilename("/home/ej/cloudfiles/readme.restored"); + * </code> + * + * @param string $filename name of local file to write data to + * @return boolean <kbd>TRUE</kbd> if successful + * @throws IOException error opening file + * @throws InvalidResponseException unexpected response + */ + public function saveToFilename($filename) + { + if (!$fp = @fopen($filename, "wb")) { + throw new Exceptions\IOError(sprintf( + Lang::translate('Could not open file [%s] for writing'), + $filename + )); + } + + $result = $this->getService()->request($this->url(), 'GET', array(), $fp); + + fclose($fp); + + return $result; + } + + /** + * Saves the object's to a stream filename + * + * Given a local filename, the Object's data will be written to the stream + * + * Example: + * <code> + * # ... authentication/connection/container code excluded + * # ... see previous examples + * + * # If I want to write the README to a temporary memory string I + * # do : + * # + * $my_docs = $conn->get_container("documents"); + * $doc = $my_docs->DataObject(array("name"=>"README")); + * + * $fp = fopen('php://temp', 'r+'); + * $doc->SaveToStream($fp); + * fclose($fp); + * </code> + * + * @param string $filename name of local file to write data to + * @return boolean <kbd>TRUE</kbd> if successful + * @throws IOException error opening file + * @throws InvalidResponseException unexpected response + */ + public function saveToStream($resource) + { + if (!is_resource($resource)) { + throw new Exceptions\ObjectError( + Lang::translate("Resource argument not a valid PHP resource." + )); + } + + return $this->getService()->request($this->url(), 'GET', array(), $resource); + } + + + /** + * Returns the object's MD5 checksum + * + * Accessor method for reading Object's private ETag attribute. + * + * @api + * @return string MD5 checksum hexidecimal string + */ + public function getETag() + { + return $this->etag; + } + + /** + * Purges the object from the CDN + * + * Note that the object will still be served up to the time of its + * TTL value. + * + * @api + * @param string $email An email address that will be notified when + * the object is purged. + * @return void + * @throws CdnError if the container is not CDN-enabled + * @throws CdnHttpError if there is an HTTP error in the transaction + */ + public function purgeCDN($email) + { + // @codeCoverageIgnoreStart + if (!$cdn = $this->Container()->CDNURL()) { + throw new Exceptions\CdnError(Lang::translate('Container is not CDN-enabled')); + } + // @codeCoverageIgnoreEnd + + $url = $cdn . '/' . $this->name; + $headers['X-Purge-Email'] = $email; + $response = $this->getService()->request($url, 'DELETE', $headers); + + // check the status + // @codeCoverageIgnoreStart + if ($response->httpStatus() > 204) { + throw new Exceptions\CdnHttpError(sprintf( + Lang::translate('Error purging object, status [%d] response [%s]'), + $response->httpStatus(), + $response->httpBody() + )); + } + // @codeCoverageIgnoreEnd + + return true; + } + + /** + * Returns the CDN URL (for managing the object) + * + * Note that the DataObject::PublicURL() method is used to return the + * publicly-available URL of the object, while the CDNURL() is used + * to manage the object. + * + * @return string + */ + public function CDNURL() + { + return $this->container()->CDNURL() . '/' . $this->name; + } + + /** + * Returns the object's Public CDN URL, if available + * + * @api + * @param string $type can be 'streaming', 'ssl', 'ios-streaming', + * or anything else for the + * default URL. For example, `$object->PublicURL('ios-streaming')` + * @return string + */ + public function publicURL($type = null) + { + if (!$prefix = $this->container()->CDNURI()) { + return null; + } + + switch(strtoupper($type)) { + case 'SSL': + $url = $this->container()->SSLURI().'/'.$this->name; + break; + case 'STREAMING': + $url = $this->container()->streamingURI().'/'.$this->name; + break; + case 'IOS': + case 'IOS-STREAMING': + $url = $this->container()->iosStreamingURI().'/'.$this->name; + break; + default: + $url = $prefix.'/'.$this->name; + break; + } + + return $url; + } + + /** + * Sets parameters from an array and validates them. + * + * @param array $params Associative array of parameters + * @return void + */ + private function setParams(array $params = array()) + { + // Inspect the user's array for any unapproved keys, and unset if necessary + foreach (array_diff(array_keys($params), $this->allowedProperties) as $key) { + $this->getLogger()->warning('You cannot use the {keyName} key when creating an object', array( + 'keyName' => $key + )); + unset($params[$key]); + } + + $this->populate($params); + } + + /** + * Retrieves a single object, parses headers + * + * @return void + * @throws NoNameError, ObjFetchError + */ + private function fetch() + { + if (!$this->name) { + throw new Exceptions\NoNameError(Lang::translate('Cannot retrieve an unnamed object')); + } + + $response = $this->getService()->request($this->url(), 'HEAD', array('Accept' => '*/*')); + + // check for errors + // @codeCoverageIgnoreStart + if ($response->httpStatus() >= 300) { + throw new Exceptions\ObjFetchError(sprintf( + Lang::translate('Problem retrieving object [%s]'), + $this->url() + )); + } + // @codeCoverageIgnoreEnd + + // set headers as metadata? + $this->saveResponseHeaders($response); + + // parse the metadata + $this->getMetadata($response); + } + + /** + * Extracts the headers from the response, and saves them as object + * attributes. Additional name conversions are done where necessary. + * + * @param Http $response + */ + private function saveResponseHeaders(Http $response, $fillExtraIfNotFound = true) + { + foreach ($response->headers() as $header => $value) { + if (isset($this->headerTranslate[$header])) { + // This header needs to be translated + $property = $this->headerTranslate[$header]; + // Are there multiple properties that need to be set? + if (is_array($property)) { + foreach ($property as $subProperty) { + $this->$subProperty = $value; + } + } else { + $this->$property = $value; + } + } elseif ($fillExtraIfNotFound === true) { + // Otherwise, stock extra headers + $this->extra_headers[$header] = $value; + } + } + } + + /** + * Compatability. + */ + public function refresh() + { + return $this->fetch(); + } + + /** + * Returns the service associated with this object + * + * It's actually the object's container's service, so this method will + * simplify things a bit. + */ + private function getService() + { + return $this->container->getService(); + } + + /** + * Performs an internal check to get the proper MIME type for an object + * + * This function would go over the available PHP methods to get + * the MIME type. + * + * By default it will try to use the PHP fileinfo library which is + * available from PHP 5.3 or as an PECL extension + * (http://pecl.php.net/package/Fileinfo). + * + * It will get the magic file by default from the system wide file + * which is usually available in /usr/share/magic on Unix or try + * to use the file specified in the source directory of the API + * (share directory). + * + * if fileinfo is not available it will try to use the internal + * mime_content_type function. + * + * @param string $handle name of file or buffer to guess the type from + * @return boolean <kbd>TRUE</kbd> if successful + * @throws BadContentTypeException + * @codeCoverageIgnore + */ + private function inferContentType($handle) + { + if ($contentType = $this->getContentType()) { + return $contentType; + } + + $contentType = false; + + $filePath = (is_string($handle)) ? $handle : (string) $handle; + + if (function_exists("finfo_open")) { + + $magicPath = dirname(__FILE__) . "/share/magic"; + $finfo = new FileInfo(FILEINFO_MIME, file_exists($magicPath) ? $magicPath : null); + + if ($finfo) { + + $contentType = is_file($filePath) + ? $finfo->file($handle) + : $finfo->buffer($handle); + + /** + * PHP 5.3 fileinfo display extra information like charset so we + * remove everything after the ; since we are not into that stuff + */ + if (null !== ($extraInfo = strpos($contentType, "; "))) { + $contentType = substr($contentType, 0, $extraInfo); + } + } + + //unset($finfo); + } + + if (!$contentType) { + // Try different native function instead + if (is_file((string) $handle) && function_exists("mime_content_type")) { + $contentType = mime_content_type($handle); + } else { + $this->getLogger()->error('Content-Type cannot be found'); + } + } + + return $contentType; + } + +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/Service.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/Service.php new file mode 100644 index 00000000000..571b33378ac --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/ObjectStore/Service.php @@ -0,0 +1,115 @@ +<?php +/** + * PHP OpenCloud library. + * + * @copyright Copyright 2013 Rackspace US, Inc. See COPYING for licensing information. + * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0 + * @version 1.6.0 + * @author Glen Campbell <glen.campbell@rackspace.com> + * @author Jamie Hannaford <jamie.hannaford@rackspace.com> + */ + +namespace OpenCloud\ObjectStore; + +use OpenCloud\OpenStack; +use OpenCloud\Common\Exceptions; +use OpenCloud\Common\Lang; + +/** + * The ObjectStore (Cloud Files) service. + */ +class Service extends AbstractService +{ + + /** + * This holds the associated CDN service (for Rackspace public cloud) + * or is NULL otherwise. The existence of an object here is + * indicative that the CDN service is available. + */ + private $cdn; + + /** + * Creates a new ObjectStore service object. + * + * @param OpenCloud\OpenStack $connection The connection object + * @param string $serviceName The name of the service + * @param string $serviceRegion The service's region + * @param string $urlType The type of URL (normally 'publicURL') + */ + public function __construct( + OpenStack $connection, + $serviceName = RAXSDK_OBJSTORE_NAME, + $serviceRegion = RAXSDK_OBJSTORE_REGION, + $urltype = RAXSDK_OBJSTORE_URLTYPE + ) { + $this->getLogger()->info('Initializing Container Service...'); + + parent::__construct( + $connection, + 'object-store', + $serviceName, + $serviceRegion, + $urltype + ); + + // establish the CDN container, if available + try { + $this->cdn = new CDNService( + $connection, + $serviceName . 'CDN', + $serviceRegion, + $urltype + ); + } catch (Exceptions\EndpointError $e) { + // If we have an endpoint error, then the CDN functionality is not + // available. In this case, we silently ignore it. + } + } + + /** + * Sets the shared secret value for the TEMP_URL + * + * @param string $secret the shared secret + * @return HttpResponse + */ + public function setTempUrlSecret($secret) + { + $response = $this->request( + $this->url(), + 'POST', + array('X-Account-Meta-Temp-Url-Key' => $secret) + ); + + // @codeCoverageIgnoreStart + if ($response->httpStatus() > 204) { + throw new Exceptions\HttpError(sprintf( + Lang::translate('Error in request, status [%d] for URL [%s] [%s]'), + $response->httpStatus(), + $this->url(), + $response->httpBody() + )); + } + // @codeCoverageIgnoreEnd + + return $response; + } + + /** + * Get the CDN service. + * + * @return null|CDNService + */ + public function getCDNService() + { + return $this->cdn; + } + + /** + * Backwards compability. + */ + public function CDN() + { + return $this->getCDNService(); + } + +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/OpenStack.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/OpenStack.php new file mode 100644 index 00000000000..c3e645a5406 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/OpenStack.php @@ -0,0 +1,1198 @@ +<?php +/** + * PHP OpenCloud library. + * + * @copyright Copyright 2013 Rackspace US, Inc. See COPYING for licensing information. + * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0 + * @version 1.6.0 + * @author Glen Campbell <glen.campbell@rackspace.com> + * @author Jamie Hannaford <jamie.hannaford@rackspace.com> + */ + +namespace OpenCloud; + +require_once __DIR__ . '/Globals.php'; + +use OpenCloud\Common\Base; +use OpenCloud\Common\Lang; +use OpenCloud\Common\Exceptions; +use OpenCloud\Common\ServiceCatalogItem; + +/** + * The OpenStack class represents a relationship (or "connection") + * between a user and a service. + * + * This is the primary entry point into an OpenStack system, and the only one + * where the developer is required to know and provide the endpoint URL (in + * all other cases, the endpoint is derived from the Service Catalog provided + * by the authentication system). + * + * Since various providers have different mechanisms for authentication, users + * will often use a subclass of OpenStack. For example, the Rackspace + * class is provided for users of Rackspace's cloud services, and other cloud + * providers are welcome to add their own subclasses as well. + * + * General usage example: + * <code> + * $username = 'My Username'; + * $secret = 'My Secret'; + * $connection = new OpenCloud\OpenStack($username, $secret); + * // having established the connection, we can set some defaults + * // this sets the default name and region of the Compute service + * $connection->SetDefaults('Compute', 'cloudServersOpenStack', 'ORD'); + * // access a Compute service + * $chicago = $connection->Compute(); + * // if we want to access a different service, we can: + * $dallas = $connection->Compute('cloudServersOpenStack', 'DFW'); + * </code> + */ +class OpenStack extends Base +{ + + /** + * This holds the HTTP User-Agent: used for all requests to the services. It + * is public so that, if necessary, it can be entirely overridden by the + * developer. However, it's strongly recomended that you use the + * appendUserAgent() method to APPEND your own User Agent identifier to the + * end of this string; the user agent information can be very valuable to + * service providers to track who is using their service. + * + * @var string + */ + public $useragent = RAXSDK_USER_AGENT; + + protected $url; + protected $secret = array(); + protected $token; + protected $expiration = 0; + protected $tenant; + protected $catalog; + protected $connectTimeout = RAXSDK_CONNECTTIMEOUT; + protected $httpTimeout = RAXSDK_TIMEOUT; + protected $overlimitTimeout = RAXSDK_OVERLIMIT_TIMEOUT; + + /** + * This associative array holds default values used to identify each + * service (and to select it from the Service Catalog). Use the + * Compute::SetDefaults() method to change the default values, or + * define the global constants (for example, RAXSDK_COMPUTE_NAME) + * BEFORE loading the OpenCloud library: + * + * <code> + * define('RAXSDK_COMPUTE_NAME', 'cloudServersOpenStack'); + * include('openstack.php'); + * </code> + */ + protected $defaults = array( + 'Compute' => array( + 'name' => RAXSDK_COMPUTE_NAME, + 'region' => RAXSDK_COMPUTE_REGION, + 'urltype' => RAXSDK_COMPUTE_URLTYPE + ), + 'ObjectStore' => array( + 'name' => RAXSDK_OBJSTORE_NAME, + 'region' => RAXSDK_OBJSTORE_REGION, + 'urltype' => RAXSDK_OBJSTORE_URLTYPE + ), + 'Database' => array( + 'name' => RAXSDK_DATABASE_NAME, + 'region' => RAXSDK_DATABASE_REGION, + 'urltype' => RAXSDK_DATABASE_URLTYPE + ), + 'Volume' => array( + 'name' => RAXSDK_VOLUME_NAME, + 'region' => RAXSDK_VOLUME_REGION, + 'urltype' => RAXSDK_VOLUME_URLTYPE + ), + 'LoadBalancer' => array( + 'name' => RAXSDK_LBSERVICE_NAME, + 'region' => RAXSDK_LBSERVICE_REGION, + 'urltype' => RAXSDK_LBSERVICE_URLTYPE + ), + 'DNS' => array( + 'name' => RAXSDK_DNS_NAME, + 'region' => RAXSDK_DNS_REGION, + 'urltype' => RAXSDK_DNS_URLTYPE + ), + 'Orchestration' => array( + 'name' => RAXSDK_ORCHESTRATION_NAME, + 'region' => RAXSDK_ORCHESTRATION_REGION, + 'urltype' => RAXSDK_ORCHESTRATION_URLTYPE + ), + 'CloudMonitoring' => array( + 'name' => RAXSDK_MONITORING_NAME, + 'region' => RAXSDK_MONITORING_REGION, + 'urltype' => RAXSDK_MONITORING_URLTYPE + ), + 'Autoscale' => array( + 'name' => RAXSDK_AUTOSCALE_NAME, + 'region' => RAXSDK_AUTOSCALE_REGION, + 'urltype' => RAXSDK_AUTOSCALE_URLTYPE + ) + ); + + private $_user_write_progress_callback_func; + private $_user_read_progress_callback_func; + + /** + * Tracks file descriptors used by streaming downloads + * + * This will permit multiple simultaneous streaming downloads; the + * key is the URL of the object, and the value is its file descriptor. + * + * To prevent memory overflows, each array element is deleted when + * the end of the file is reached. + */ + private $fileDescriptors = array(); + + /** + * array of options to pass to the CURL request object + */ + private $curlOptions = array(); + + /** + * list of attributes to export/import + */ + private $exportItems = array( + 'token', + 'expiration', + 'tenant', + 'catalog' + ); + + /** + * Creates a new OpenStack object + * + * The OpenStack object needs two bits of information: the URL to + * authenticate against, and a "secret", which is an associative array + * of name/value pairs. Usually, the secret will be a username and a + * password, but other values may be required by different authentication + * systems. For example, OpenStack Keystone requires a username and + * password, but Rackspace uses a username, tenant ID, and API key. + * (See OpenCloud\Rackspace for that.) + * + * @param string $url - the authentication endpoint URL + * @param array $secret - an associative array of auth information: + * * username + * * password + * @param array $options - CURL options to pass to the HttpRequest object + */ + public function __construct($url, array $secret, array $options = array()) + { + // check for supported version + // @codeCoverageIgnoreStart + $version = phpversion(); + if ($version < '5.3.1') { + throw new Exceptions\UnsupportedVersionError(sprintf( + Lang::translate('PHP version [%s] is not supported'), + $version + )); + } + // @codeCoverageIgnoreEnd + + // Start processing + $this->getLogger()->info(Lang::translate('Initializing OpenStack client')); + + // Set properties + $this->setUrl($url); + $this->setSecret($secret); + $this->setCurlOptions($options); + } + + /** + * Set user agent. + * + * @param string $useragent + * @return OpenCloud\OpenStack + */ + public function setUserAgent($useragent) + { + $this->useragent = $useragent; + + return $this; + } + + /** + * Allows the user to append a user agent string + * + * Programs that are using these bindings are encouraged to add their + * user agent to the one supplied by this SDK. This will permit cloud + * providers to track users so that they can provide better service. + * + * @param string $agent an arbitrary user-agent string; e.g. "My Cloud App" + * @return OpenCloud\OpenStack + */ + public function appendUserAgent($useragent) + { + $this->useragent .= ';' . $useragent; + + return $this; + } + + /** + * Get user agent. + * + * @return string + */ + public function getUserAgent() + { + return $this->useragent; + } + + /** + * Sets the URL which the client will access. + * + * @param string $url + * @return OpenCloud\OpenStack + */ + public function setUrl($url) + { + $this->url = $url; + + return $this; + } + + /** + * Get the URL. + * + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * Set the secret for the client. + * + * @param array $secret + * @return OpenCloud\OpenStack + */ + public function setSecret(array $secret = array()) + { + $this->secret = $secret; + + return $this; + } + + /** + * Get the secret. + * + * @return array + */ + public function getSecret() + { + return $this->secret; + } + + /** + * Set the token for this client. + * + * @param string $token + * @return OpenCloud\OpenStack + */ + public function setToken($token) + { + $this->token = $token; + + return $this; + } + + /** + * Get the token for this client. + * + * @return string + */ + public function getToken() + { + return $this->token; + } + + /** + * Set the expiration for this token. + * + * @param int $expiration + * @return OpenCloud\OpenStack + */ + public function setExpiration($expiration) + { + $this->expiration = $expiration; + + return $this; + } + + /** + * Get the expiration time. + * + * @return int + */ + public function getExpiration() + { + return $this->expiration; + } + + /** + * Set the tenant for this client. + * + * @param string $tenant + * @return OpenCloud\OpenStack + */ + public function setTenant($tenant) + { + $this->tenant = $tenant; + + return $this; + } + + /** + * Get the tenant for this client. + * + * @return string + */ + public function getTenant() + { + return $this->tenant; + } + + /** + * Set the service catalog. + * + * @param mixed $catalog + * @return OpenCloud\OpenStack + */ + public function setCatalog($catalog) + { + $this->catalog = $catalog; + + return $this; + } + + /** + * Get the service catalog. + * + * @return array + */ + public function getCatalog() + { + return $this->catalog; + } + + /** + * Set (all) the cURL options. + * + * @param array $options + * @return OpenCloud\OpenStack + */ + public function setCurlOptions(array $options) + { + $this->curlOptions = $options; + + return $this; + } + + /** + * Get the cURL options. + * + * @return array + */ + public function getCurlOptions() + { + return $this->curlOptions; + } + + /** + * Set a specific file descriptor (associated with a URL) + * + * @param string $key + * @param resource $value + * @return OpenCloud\OpenStack + */ + public function setFileDescriptor($key, $value) + { + $this->descriptors[$key] = $value; + + return $this; + } + + /** + * Get a specific file descriptor (associated with a URL) + * + * @param string $key + * @return resource|false + */ + public function getFileDescriptor($key) + { + return (!isset($this->descriptors[$key])) ? false : $this->descriptors[$key]; + } + + /** + * Get the items to be exported. + * + * @return array + */ + public function getExportItems() + { + return $this->exportItems; + } + + /** + * Sets the connect timeout. + * + * @param int $timeout + * @return OpenCloud\OpenStack + */ + public function setConnectTimeout($timeout) + { + $this->connectTimeout = $timeout; + + return $this; + } + + /** + * Get the connect timeout. + * + * @return int + */ + public function getConnectTimeout() + { + return $this->connectTimeout; + } + + /** + * Set the HTTP timeout. + * + * @param int $timeout + * @return OpenCloud\OpenStack + */ + public function setHttpTimeout($timeout) + { + $this->httpTimeout = $timeout; + + return $this; + } + + /** + * Get the HTTP timeout. + * + * @return int + */ + public function getHttpTimeout() + { + return $this->httpTimeout; + } + + /** + * Set the overlimit timeout. + * + * @param int $timeout + * @return OpenCloud\OpenStack + */ + public function setOverlimitTimeout($timeout) + { + $this->overlimitTimeout = $timeout; + + return $this; + } + + /** + * Get the overlimit timeout. + * + * @return int + */ + public function getOverlimitTimeout() + { + return $this->overlimitTimeout; + } + + /** + * Sets default values (an array) for a service. Each array must contain a + * "name", "region" and "urltype" key. + * + * @param string $service + * @param array $value + * @return OpenCloud\OpenStack + */ + public function setDefault($service, array $value = array()) + { + if (isset($value['name']) && isset($value['region']) && isset($value['urltype'])) { + $this->defaults[$service] = $value; + } + + return $this; + } + + /** + * Get a specific default value for a service. If none exist, return FALSE. + * + * @param string $service + * @return array|false + */ + public function getDefault($service) + { + return (!isset($this->defaults[$service])) ? false : $this->defaults[$service]; + } + +/** + * Sets the timeouts for the current connection + * + * @api + * @param integer $t_http the HTTP timeout value (the max period that + * the OpenStack object will wait for any HTTP request to complete). + * Value is in seconds. + * @param integer $t_conn the Connect timeout value (the max period + * that the OpenStack object will wait to establish an HTTP + * connection). Value is in seconds. + * @param integer $t_overlimit the overlimit timeout value (the max period + * that the OpenStack object will wait to retry on an overlimit + * condition). Value is in seconds. + * @return void + */ + public function setTimeouts($httpTimeout, $connectTimeout = null, $overlimitTimeout = null) + { + $this->setHttpTimeout($httpTimeout); + + if (isset($connectTimeout)) { + $this->setConnectTimeout($connectTimeout); + } + + if (isset($overlimitTimeout)) { + $this->setOverlimitTimeout($overlimitTimeout); + } + } + + /** + * Returns the URL of this object + * + * @api + * @param string $subresource specified subresource + * @return string + */ + public function url($subresource='tokens') + { + return Lang::noslash($this->url) . '/' . $subresource; + } + + /** + * Returns the stored secret + * + * @return array + */ + public function secret() + { + return $this->getSecret(); + } + + /** + * Re-authenticates session if expired. + */ + public function checkExpiration() + { + if ($this->hasExpired()) { + $this->authenticate(); + } + } + + /** + * Checks whether token has expired. + * + * @return bool + */ + public function hasExpired() + { + return time() > ($this->getExpiration() - RAXSDK_FUDGE); + } + + /** + * Returns the cached token; if it has expired, then it re-authenticates + * + * @api + * @return string + */ + public function token() + { + $this->checkExpiration(); + + return $this->getToken(); + } + + /** + * Returns the cached expiration time; + * if it has expired, then it re-authenticates + * + * @api + * @return string + */ + public function expiration() + { + $this->checkExpiration(); + + return $this->getExpiration(); + } + + /** + * Returns the tenant ID, re-authenticating if necessary + * + * @api + * @return string + */ + public function tenant() + { + $this->checkExpiration(); + + return $this->getTenant(); + } + + /** + * Returns the service catalog object from the auth service + * + * @return \stdClass + */ + public function serviceCatalog() + { + $this->checkExpiration(); + + return $this->getCatalog(); + } + + /** + * Returns a Collection of objects with information on services + * + * Note that these are informational (read-only) and are not actually + * 'Service'-class objects. + */ + public function serviceList() + { + return new Common\Collection($this, 'ServiceCatalogItem', $this->serviceCatalog()); + } + + /** + * Creates and returns the formatted credentials to POST to the auth + * service. + * + * @return string + */ + public function credentials() + { + if (isset($this->secret['username']) && isset($this->secret['password'])) { + + $credentials = array( + 'auth' => array( + 'passwordCredentials' => array( + 'username' => $this->secret['username'], + 'password' => $this->secret['password'] + ) + ) + ); + + if (isset($this->secret['tenantName'])) { + $credentials['auth']['tenantName'] = $this->secret['tenantName']; + } + + return json_encode($credentials); + + } else { + throw new Exceptions\CredentialError( + Lang::translate('Unrecognized credential secret') + ); + } + } + + /** + * Authenticates using the supplied credentials + * + * @api + * @return void + * @throws AuthenticationError + */ + public function authenticate() + { + // try to auth + $response = $this->request( + $this->url(), + 'POST', + array('Content-Type'=>'application/json'), + $this->credentials() + ); + + $json = $response->httpBody(); + + // check for errors + if ($response->HttpStatus() >= 400) { + throw new Exceptions\AuthenticationError(sprintf( + Lang::translate('Authentication failure, status [%d], response [%s]'), + $response->httpStatus(), + $json + )); + } + + // Decode and check + $object = json_decode($json); + $this->checkJsonError(); + + // Save the token information as well as the ServiceCatalog + $this->setToken($object->access->token->id); + $this->setExpiration(strtotime($object->access->token->expires)); + $this->setCatalog($object->access->serviceCatalog); + + /** + * In some cases, the tenant name/id is not returned + * as part of the auth token, so we check for it before + * we set it. This occurs with pure Keystone, but not + * with the Rackspace auth. + */ + if (isset($object->access->token->tenant)) { + $this->setTenant($object->access->token->tenant->id); + } + } + + /** + * Performs a single HTTP request + * + * The request() method is one of the most frequently-used in the entire + * library. It performs an HTTP request using the specified URL, method, + * and with the supplied headers and body. It handles error and + * exceptions for the request. + * + * @api + * @param string url - the URL of the request + * @param string method - the HTTP method (defaults to GET) + * @param array headers - an associative array of headers + * @param string data - either a string or a resource (file pointer) to + * use as the request body (for PUT or POST) + * @return HttpResponse object + * @throws HttpOverLimitError, HttpUnauthorizedError, HttpForbiddenError + */ + public function request($url, $method = 'GET', $headers = array(), $data = null) + { + $this->getLogger()->info('Resource [{url}] method [{method}] body [{body}]', array( + 'url' => $url, + 'method' => $method, + 'data' => $data + )); + + // get the request object + $http = $this->getHttpRequestObject($url, $method, $this->getCurlOptions()); + + // set various options + $this->getLogger()->info('Headers: [{headers}]', array( + 'headers' => print_r($headers, true) + )); + + $http->setheaders($headers); + $http->setHttpTimeout($this->getHttpTimeout()); + $http->setConnectTimeout($this->getConnectTimeout()); + $http->setOption(CURLOPT_USERAGENT, $this->getUserAgent()); + + // data can be either a resource or a string + if (is_resource($data)) { + // loading from or writing to a file + // set the appropriate callback functions + switch($method) { + // @codeCoverageIgnoreStart + case 'GET': + // need to save the file descriptor + $this->setFileDescriptor($url, $data); + // set the CURL options + $http->setOption(CURLOPT_FILE, $data); + $http->setOption(CURLOPT_WRITEFUNCTION, array($this, '_write_cb')); + break; + // @codeCoverageIgnoreEnd + case 'PUT': + case 'POST': + // need to save the file descriptor + $this->setFileDescriptor($url, $data); + if (!isset($headers['Content-Length'])) { + throw new Exceptions\HttpError( + Lang::translate('The Content-Length: header must be specified for file uploads') + ); + } + $http->setOption(CURLOPT_UPLOAD, TRUE); + $http->setOption(CURLOPT_INFILE, $data); + $http->setOption(CURLOPT_INFILESIZE, $headers['Content-Length']); + $http->setOption(CURLOPT_READFUNCTION, array($this, '_read_cb')); + break; + default: + // do nothing + break; + } + } elseif (is_string($data)) { + $http->setOption(CURLOPT_POSTFIELDS, $data); + } elseif (isset($data)) { + throw new Exceptions\HttpError( + Lang::translate('Unrecognized data type for PUT/POST body, must be string or resource') + ); + } + + // perform the HTTP request; returns an HttpResult object + $response = $http->execute(); + + // handle and retry on overlimit errors + if ($response->httpStatus() == 413) { + + $object = json_decode($response->httpBody()); + $this->checkJsonError(); + + // @codeCoverageIgnoreStart + if (isset($object->overLimit)) { + /** + * @TODO(glen) - The documentation says "retryAt", but + * the field returned is "retryAfter". If the doc changes, + * then there's no problem, but we'll need to fix this if + * they change the code to match the docs. + */ + $retryAfter = $object->overLimit->retryAfter; + $sleepInterval = strtotime($retryAfter) - time(); + + if ($sleepInterval && $sleepInterval <= $this->getOverlimitTimeout()) { + sleep($sleepInterval); + $response = $http->Execute(); + } else { + throw new Exceptions\HttpOverLimitError(sprintf( + Lang::translate('Over limit; next available request [%s][%s] is not for [%d] seconds at [%s]'), + $method, + $url, + $sleepInterval, + $retryAfter + )); + } + } + // @codeCoverageIgnoreEnd + } + + // do some common error checking + switch ($response->httpStatus()) { + case 401: + throw new Exceptions\HttpUnauthorizedError(sprintf( + Lang::translate('401 Unauthorized for [%s] [%s]'), + $url, + $response->HttpBody() + )); + break; + case 403: + throw new Exceptions\HttpForbiddenError(sprintf( + Lang::translate('403 Forbidden for [%s] [%s]'), + $url, + $response->HttpBody() + )); + break; + case 413: // limit + throw new Exceptions\HttpOverLimitError(sprintf( + Lang::translate('413 Over limit for [%s] [%s]'), + $url, + $response->HttpBody() + )); + break; + default: + // everything is fine here, we're fine, how are you? + break; + } + + // free the handle + $http->close(); + + // return the HttpResponse object + $this->getLogger()->info('HTTP STATUS [{code}]', array( + 'code' => $response->httpStatus() + )); + + return $response; + } + + /** + * Sets default values for name, region, URL type for a service + * + * Once these are set (and they can also be set by defining global + * constants), then you do not need to specify these values when + * creating new service objects. + * + * @api + * @param string $service the name of a supported service; e.g. 'Compute' + * @param string $name the service name; e.g., 'cloudServersOpenStack' + * @param string $region the region name; e.g., 'LON' + * @param string $urltype the type of URL to use; e.g., 'internalURL' + * @return void + * @throws UnrecognizedServiceError + */ + public function setDefaults( + $service, + $name = null, + $region = null, + $urltype = null + ) { + + if (!isset($this->defaults[$service])) { + throw new Exceptions\UnrecognizedServiceError(sprintf( + Lang::translate('Service [%s] is not recognized'), $service + )); + } + + if (isset($name)) { + $this->defaults[$service]['name'] = $name; + } + + if (isset($region)) { + $this->defaults[$service]['region'] = $region; + } + + if (isset($urltype)) { + $this->defaults[$service]['urltype'] = $urltype; + } + } + + /** + * Allows the user to define a function for tracking uploads + * + * This can be used to implement a progress bar or similar function. The + * callback function is called with a single parameter, the length of the + * data that is being uploaded on this call. + * + * @param callable $callback the name of a global callback function, or an + * array($object, $functionname) + * @return void + */ + public function setUploadProgressCallback($callback) + { + $this->_user_write_progress_callback_func = $callback; + } + + /** + * Allows the user to define a function for tracking downloads + * + * This can be used to implement a progress bar or similar function. The + * callback function is called with a single parameter, the length of the + * data that is being downloaded on this call. + * + * @param callable $callback the name of a global callback function, or an + * array($object, $functionname) + * @return void + */ + public function setDownloadProgressCallback($callback) + { + $this->_user_read_progress_callback_func = $callback; + } + + /** + * Callback function to handle reads for file uploads + * + * Internal function for handling file uploads. Note that, although this + * function's visibility is public, this is only because it must be called + * from the HttpRequest interface. This should NOT be called by users + * directly. + * + * @param resource $ch a CURL handle + * @param resource $fd a file descriptor + * @param integer $length the amount of data to read + * @return string the data read + * @codeCoverageIgnore + */ + public function _read_cb($ch, $fd, $length) + { + $data = fread($fd, $length); + $len = strlen($data); + if (isset($this->_user_write_progress_callback_func)) { + call_user_func($this->_user_write_progress_callback_func, $len); + } + return $data; + } + + /** + * Callback function to handle writes for file downloads + * + * Internal function for handling file downloads. Note that, although this + * function's visibility is public, this is only because it must be called + * via the HttpRequest interface. This should NOT be called by users + * directly. + * + * @param resource $ch a CURL handle + * @param string $data the data to be written to a file + * @return integer the number of bytes written + * @codeCoverageIgnore + */ + public function _write_cb($ch, $data) + { + $url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); + + if (false === ($fp = $this->getFileDescriptor($url))) { + throw new Exceptions\HttpUrlError(sprintf( + Lang::translate('Cannot find file descriptor for URL [%s]'), $url) + ); + } + + $dlen = strlen($data); + fwrite($fp, $data, $dlen); + + // call used callback function + if (isset($this->_user_read_progress_callback_func)) { + call_user_func($this->_user_read_progress_callback_func, $dlen); + } + + // MUST return the length to CURL + return $dlen; + } + + /** + * exports saved token, expiration, tenant, and service catalog as an array + * + * This could be stored in a cache (APC or disk file) and reloaded using + * ImportCredentials() + * + * @return array + */ + public function exportCredentials() + { + $this->authenticate(); + + $array = array(); + + foreach ($this->getExportItems() as $key) { + $array[$key] = $this->$key; + } + + return $array; + } + + /** + * imports credentials from an array + * + * Takes the same values as ExportCredentials() and reuses them. + * + * @return void + */ + public function importCredentials(array $values) + { + foreach ($this->getExportItems() as $item) { + $this->$item = $values[$item]; + } + } + + /********** FACTORY METHODS ********** + * + * These methods are provided to permit easy creation of services + * (for example, Nova or Swift) from a connection object. As new + * services are supported, factory methods should be provided here. + */ + + /** + * Creates a new ObjectStore object (Swift/Cloud Files) + * + * @api + * @param string $name the name of the Object Storage service to attach to + * @param string $region the name of the region to use + * @param string $urltype the URL type (normally "publicURL") + * @return ObjectStore + */ + public function objectStore($name = null, $region = null, $urltype = null) + { + return $this->service('ObjectStore', $name, $region, $urltype); + } + + /** + * Creates a new Compute object (Nova/Cloud Servers) + * + * @api + * @param string $name the name of the Compute service to attach to + * @param string $region the name of the region to use + * @param string $urltype the URL type (normally "publicURL") + * @return Compute + */ + public function compute($name = null, $region = null, $urltype = null) + { + return $this->service('Compute', $name, $region, $urltype); + } + + /** + * Creates a new Orchestration (heat) service object + * + * @api + * @param string $name the name of the Compute service to attach to + * @param string $region the name of the region to use + * @param string $urltype the URL type (normally "publicURL") + * @return Orchestration\Service + * @codeCoverageIgnore + */ + public function orchestration($name = null, $region = null, $urltype = null) + { + return $this->service('Orchestration', $name, $region, $urltype); + } + + /** + * Creates a new VolumeService (cinder) service object + * + * This is a factory method that is Rackspace-only (NOT part of OpenStack). + * + * @param string $name the name of the service (e.g., 'cloudBlockStorage') + * @param string $region the region (e.g., 'DFW') + * @param string $urltype the type of URL (e.g., 'publicURL'); + */ + public function volumeService($name = null, $region = null, $urltype = null) + { + return $this->service('Volume', $name, $region, $urltype); + } + + /** + * Generic Service factory method + * + * Contains code reused by the other service factory methods. + * + * @param string $class the name of the Service class to produce + * @param string $name the name of the Compute service to attach to + * @param string $region the name of the region to use + * @param string $urltype the URL type (normally "publicURL") + * @return Service (or subclass such as Compute, ObjectStore) + * @throws ServiceValueError + */ + public function service($class, $name = null, $region = null, $urltype = null) + { + // debug message + $this->getLogger()->info('Factory for class [{class}] [{name}/{region}/{urlType}]', array( + 'class' => $class, + 'name' => $name, + 'region' => $region, + 'urlType' => $urltype + )); + + // Strips off base namespace + $class = preg_replace('#\\\?OpenCloud\\\#', '', $class); + + // check for defaults + $default = $this->getDefault($class); + + // report errors + if (!$name = $name ?: $default['name']) { + throw new Exceptions\ServiceValueError(sprintf( + Lang::translate('No value for %s name'), + $class + )); + } + + if (!$region = $region ?: $default['region']) { + throw new Exceptions\ServiceValueError(sprintf( + Lang::translate('No value for %s region'), + $class + )); + } + + if (!$urltype = $urltype ?: $default['urltype']) { + throw new Exceptions\ServiceValueError(sprintf( + Lang::translate('No value for %s URL type'), + $class + )); + } + + // return the object + $fullclass = 'OpenCloud\\' . $class . '\\Service'; + + return new $fullclass($this, $name, $region, $urltype); + } + + /** + * returns a service catalog item + * + * This is a helper function used to list service catalog items easily + */ + public function serviceCatalogItem($info = array()) + { + return new ServiceCatalogItem($info); + } + +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Rackspace.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Rackspace.php new file mode 100644 index 00000000000..41be608b347 --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Rackspace.php @@ -0,0 +1,132 @@ +<?php +/** + * The Rackspace cloud/connection class (which uses different authentication + * than the pure OpenStack class) + * + * @copyright 2012-2013 Rackspace Hosting, Inc. + * See COPYING for licensing information + * + * @package phpOpenCloud + * @version 1.0 + * @author Glen Campbell <glen.campbell@rackspace.com> + */ + +namespace OpenCloud; + +/** + * Rackspace extends the OpenStack class with support for Rackspace's + * API key and tenant requirements. + * + * The only difference between Rackspace and OpenStack is that the + * Rackspace class generates credentials using the username + * and API key, as required by the Rackspace authentication + * service. + * + * Example: + * <code> + * $username = 'FRED'; + * $apiKey = '0900af093093788912388fc09dde090ffee09'; + * $conn = new Rackspace( + * 'https://identity.api.rackspacecloud.com/v2.0/', + * array( + * 'username' => $username, + * 'apiKey' => $apiKey + * )); + * </code> + */ +class Rackspace extends OpenStack +{ + + //this is the JSON string for our new credentials +const APIKEYTEMPLATE = <<<ENDCRED +{ "auth": { "RAX-KSKEY:apiKeyCredentials": { "username": "%s", + "apiKey": "%s" + } + } +} +ENDCRED; + + /** + * Generates Rackspace API key credentials + * + * @return string + */ + public function Credentials() + { + $sec = $this->Secret(); + if (isset($sec['username']) + && isset($sec['apiKey']) + ) { + return sprintf( + self::APIKEYTEMPLATE, + $sec['username'], + $sec['apiKey'] + ); + } else { + return parent::Credentials(); + } + } + + /** + * Creates a new DbService (Database as a Service) object + * + * This is a factory method that is Rackspace-only (NOT part of OpenStack). + * + * @param string $name the name of the service (e.g., 'Cloud Databases') + * @param string $region the region (e.g., 'DFW') + * @param string $urltype the type of URL (e.g., 'publicURL'); + */ + public function DbService($name = null, $region = null, $urltype = null) + { + return $this->Service('Database', $name, $region, $urltype); + } + + /** + * Creates a new LoadBalancerService object + * + * This is a factory method that is Rackspace-only (NOT part of OpenStack). + * + * @param string $name the name of the service + * (e.g., 'Cloud Load Balancers') + * @param string $region the region (e.g., 'DFW') + * @param string $urltype the type of URL (e.g., 'publicURL'); + */ + public function LoadBalancerService($name = null, $region = null, $urltype = null) + { + return $this->Service('LoadBalancer', $name, $region, $urltype); + } + + /** + * creates a new DNS service object + * + * This is a factory method that is currently Rackspace-only + * (not available via the OpenStack class) + */ + public function DNS($name = null, $region = null, $urltype = null) + { + return $this->Service('DNS', $name, $region, $urltype); + } + + /** + * creates a new CloudMonitoring service object + * + * This is a factory method that is currently Rackspace-only + * (not available via the OpenStack class) + */ + public function CloudMonitoring($name=null, $region=null, $urltype=null) + { + return $this->Service('CloudMonitoring', $name, $region, $urltype); + } + + /** + * creates a new Autoscale service object + * + * This is a factory method that is currently Rackspace-only + * (not available via the OpenStack class) + */ + public function Autoscale($name=null, $region=null, $urltype=null) + { + return $this->Service('Autoscale', $name, $region, $urltype); + } + +} diff --git a/apps/files_external/3rdparty/php-opencloud/lib/openstack.php b/apps/files_external/3rdparty/php-opencloud/lib/openstack.php new file mode 100644 index 00000000000..738902d244e --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/openstack.php @@ -0,0 +1,8 @@ +<?php +/** + * provided for backwards compatibility + * + * @copyright 2013 Rackspace Hosting, Inc. + * @license http://www.apache.org/licenses/LICENSE-2.0 + */ +require_once __DIR__.'/php-opencloud.php'; diff --git a/apps/files_external/3rdparty/php-opencloud/lib/php-opencloud.php b/apps/files_external/3rdparty/php-opencloud/lib/php-opencloud.php new file mode 100644 index 00000000000..15ff034b92d --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/php-opencloud.php @@ -0,0 +1,15 @@ +<?php +/** + * entry point for PHP-OpenCloud library + * + * @copyright 2013 Rackspace Hosting, Inc. + * @license http://www.apache.org/licenses/LICENSE-2.0 + */ +require_once(__DIR__ . '/Autoload.php'); +require_once(__DIR__ . '/OpenCloud/Globals.php'); + +$classLoader = new ClassLoader; +$classLoader->registerNamespaces(array( + 'OpenCloud' => array(__DIR__, __DIR__ . '/../tests') +)); +$classLoader->register();
\ No newline at end of file diff --git a/apps/files_external/3rdparty/php-opencloud/lib/rackspace.php b/apps/files_external/3rdparty/php-opencloud/lib/rackspace.php new file mode 100644 index 00000000000..738902d244e --- /dev/null +++ b/apps/files_external/3rdparty/php-opencloud/lib/rackspace.php @@ -0,0 +1,8 @@ +<?php +/** + * provided for backwards compatibility + * + * @copyright 2013 Rackspace Hosting, Inc. + * @license http://www.apache.org/licenses/LICENSE-2.0 + */ +require_once __DIR__.'/php-opencloud.php'; diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php index dd0b76ed9d7..f78f3abf0fa 100644 --- a/apps/files_external/appinfo/app.php +++ b/apps/files_external/appinfo/app.php @@ -10,7 +10,7 @@ OC::$CLASSPATH['OC\Files\Storage\StreamWrapper'] = 'files_external/lib/streamwra OC::$CLASSPATH['OC\Files\Storage\FTP'] = 'files_external/lib/ftp.php'; OC::$CLASSPATH['OC\Files\Storage\DAV'] = 'files_external/lib/webdav.php'; OC::$CLASSPATH['OC\Files\Storage\Google'] = 'files_external/lib/google.php'; -OC::$CLASSPATH['OC\Files\Storage\SWIFT'] = 'files_external/lib/swift.php'; +OC::$CLASSPATH['OC\Files\Storage\Swift'] = 'files_external/lib/swift.php'; OC::$CLASSPATH['OC\Files\Storage\SMB'] = 'files_external/lib/smb.php'; OC::$CLASSPATH['OC\Files\Storage\AmazonS3'] = 'files_external/lib/amazons3.php'; OC::$CLASSPATH['OC\Files\Storage\Dropbox'] = 'files_external/lib/dropbox.php'; diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 659959e662e..43643076519 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -84,14 +84,22 @@ class OC_Mount_Config { 'token' => '#token'), 'custom' => 'google'); - $backends['\OC\Files\Storage\SWIFT']=array( - 'backend' => 'OpenStack Swift', - 'configuration' => array( - 'host' => 'URL', - 'user' => 'Username', - 'token' => '*Token', - 'root' => '&Root', - 'secure' => '!Secure ftps://')); + if(OC_Mount_Config::checkcurl()) { + $backends['\OC\Files\Storage\Swift'] = array( + 'backend' => 'OpenStack Object Storage', + 'configuration' => array( + 'user' => 'Username (required)', + 'bucket' => 'Bucket (required)', + 'region' => '&Region (optional for OpenStack Object Storage)', + 'key' => '*API Key (required for Rackspace Cloud Files)', + 'tenant' => '&Tenantname (required for OpenStack Object Storage)', + 'password' => '*Password (required for OpenStack Object Storage)', + 'service_name' => '&Service Name (required for OpenStack Object Storage)', + 'url' => '&URL of identity endpoint (required for OpenStack Object Storage)', + 'timeout' => '&Timeout of HTTP requests in seconds (optional)', + ) + ); + } if (!OC_Util::runningOnWindows()) { if (OC_Mount_Config::checksmbclient()) { diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php index a9cfe5bd20f..bb650dacc7b 100644 --- a/apps/files_external/lib/swift.php +++ b/apps/files_external/lib/swift.php @@ -1,392 +1,271 @@ <?php + /** - * Copyright (c) 2012 Robin Appelman <icewind@owncloud.com> - * This file is licensed under the Affero General Public License version 3 or - * later. - * See the COPYING-README file. + * ownCloud + * + * @author Christian Berendt + * @copyright 2013 Christian Berendt berendt@b1-systems.de + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ namespace OC\Files\Storage; -require_once 'php-cloudfiles/cloudfiles.php'; - -class SWIFT extends \OC\Files\Storage\Common{ - private $id; - private $host; - private $root; - private $user; - private $token; - private $secure; - private $ready = false; - /** - * @var \CF_Authentication auth - */ - private $auth; - /** - * @var \CF_Connection conn - */ - private $conn; - /** - * @var \CF_Container rootContainer - */ - private $rootContainer; - - private static $tempFiles=array(); - private $objects=array(); - private $containers=array(); - - const SUBCONTAINER_FILE='.subcontainers'; - - /** - * translate directory path to container name - * @param string $path - * @return string - */ - private function getContainerName($path) { - $path=trim(trim($this->root, '/') . "/".$path, '/.'); - return str_replace('/', '\\', $path); - } +set_include_path(get_include_path() . PATH_SEPARATOR . + \OC_App::getAppPath('files_external') . '/3rdparty/php-opencloud/lib'); +require_once 'openstack.php'; - /** - * get container by path - * @param string $path - * @return \CF_Container - */ - private function getContainer($path) { - if ($path=='' or $path=='/') { - return $this->rootContainer; - } - if (isset($this->containers[$path])) { - return $this->containers[$path]; - } - try { - $container=$this->conn->get_container($this->getContainerName($path)); - $this->containers[$path]=$container; - return $container; - } catch(\NoSuchContainerException $e) { - return null; - } - } +use \OpenCloud; +use \OpenCloud\Common\Exceptions; - /** - * create container - * @param string $path - * @return \CF_Container - */ - private function createContainer($path) { - if ($path=='' or $path=='/' or $path=='.') { - return $this->conn->create_container($this->getContainerName($path)); - } - $parent=dirname($path); - if ($parent=='' or $parent=='/' or $parent=='.') { - $parentContainer=$this->rootContainer; - } else { - if ( ! $this->containerExists($parent)) { - $parentContainer=$this->createContainer($parent); - } else { - $parentContainer=$this->getContainer($parent); - } +class Swift extends \OC\Files\Storage\Common { + + /** + * @var \OpenCloud\ObjectStore + */ + private $connection; + /** + * @var \OpenCloud\ObjectStore\Container + */ + private $container; + /** + * @var \OpenCloud\OpenStack + */ + private $anchor; + /** + * @var string + */ + private $bucket; + /** + * @var array + */ + private static $tmpFiles = array(); + + private function normalizePath($path) { + $path = trim($path, '/'); + + if (!$path) { + $path = '.'; } - $this->addSubContainer($parentContainer, basename($path)); - return $this->conn->create_container($this->getContainerName($path)); + + return $path; } - /** - * get object by path - * @param string $path - * @return \CF_Object - */ - private function getObject($path) { - if (isset($this->objects[$path])) { - return $this->objects[$path]; - } - $container=$this->getContainer(dirname($path)); - if (is_null($container)) { - return null; - } else { - if ($path=="/" or $path=='') { - return null; - } - try { - $obj=$container->get_object(basename($path)); - $this->objects[$path]=$obj; - return $obj; - } catch(\NoSuchObjectException $e) { - return null; - } + private function doesObjectExist($path) { + try { + $object = $this->container->DataObject($path); + return true; + } catch (Exceptions\ObjFetchError $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); + return false; + } catch (Exceptions\HttpError $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); + return false; } } - /** - * get the names of all objects in a container - * @param CF_Container - * @return array - */ - private function getObjects($container) { - if (is_null($container)) { - return array(); - } else { - $files=$container->get_objects(); - foreach ($files as &$file) { - $file=$file->name; - } - return $files; + public function __construct($params) { + if ((!isset($params['key']) and !isset($params['password'])) + or !isset($params['user']) or !isset($params['bucket']) + or !isset($params['region'])) { + throw new \Exception("API Key or password, Username, Bucket and Region have to be configured."); } - } - /** - * create object - * @param string $path - * @return \CF_Object - */ - private function createObject($path) { - $container=$this->getContainer(dirname($path)); - if ( ! is_null($container)) { - $container=$this->createContainer(dirname($path)); - } - return $container->create_object(basename($path)); - } + $this->id = 'swift::' . $params['user'] . md5($params['bucket']); + $this->bucket = $params['bucket']; - /** - * check if an object exists - * @param string - * @return bool - */ - private function objectExists($path) { - return !is_null($this->getObject($path)); - } + if (!isset($params['url'])) { + $params['url'] = 'https://identity.api.rackspacecloud.com/v2.0/'; + } - /** - * check if container for path exists - * @param string $path - * @return bool - */ - private function containerExists($path) { - return !is_null($this->getContainer($path)); - } + if (!isset($params['service_name'])) { + $params['service_name'] = 'cloudFiles'; + } - /** - * get the list of emulated sub containers - * @param \CF_Container $container - * @return array - */ - private function getSubContainers($container) { - $tmpFile=\OCP\Files::tmpFile(); - $obj=$this->getSubContainerFile($container); - try { - $obj->save_to_filename($tmpFile); - } catch(\Exception $e) { - return array(); + $settings = array( + 'username' => $params['user'], + + ); + + if (isset($params['password'])) { + $settings['password'] = $params['password']; + } else if (isset($params['key'])) { + $settings['apiKey'] = $params['key']; } - $obj->save_to_filename($tmpFile); - $containers=file($tmpFile); - unlink($tmpFile); - foreach ($containers as &$sub) { - $sub=trim($sub); + + if (isset($params['tenant'])) { + $settings['tenantName'] = $params['tenant']; } - return $containers; - } - /** - * add an emulated sub container - * @param \CF_Container $container - * @param string $name - * @return bool - */ - private function addSubContainer($container, $name) { - if ( ! $name) { - return false; + $this->anchor = new \OpenCloud\OpenStack($params['url'], $settings); + + if (isset($params['timeout'])) { + $this->anchor->setHttpTimeout($params['timeout']); } - $tmpFile=\OCP\Files::tmpFile(); - $obj=$this->getSubContainerFile($container); + + $this->connection = $this->anchor->ObjectStore($params['service_name'], $params['region'], 'publicURL'); + try { - $obj->save_to_filename($tmpFile); - $containers=file($tmpFile); - foreach ($containers as &$sub) { - $sub=trim($sub); - } - if(array_search($name, $containers) !== false) { - unlink($tmpFile); - return false; - } else { - $fh=fopen($tmpFile, 'a'); - fwrite($fh, $name . "\n"); - } - } catch(\Exception $e) { - file_put_contents($tmpFile, $name . "\n"); + $this->container = $this->connection->Container($this->bucket); + } catch (Exceptions\ContainerNotFoundError $e) { + $this->container = $this->connection->Container(); + $this->container->Create(array('name' => $this->bucket)); } - $obj->load_from_filename($tmpFile); - unlink($tmpFile); - return true; + if (!$this->file_exists('.')) { + $this->mkdir('.'); + } } - /** - * remove an emulated sub container - * @param \CF_Container $container - * @param string $name - * @return bool - */ - private function removeSubContainer($container, $name) { - if ( ! $name) { - return false; - } - $tmpFile=\OCP\Files::tmpFile(); - $obj=$this->getSubContainerFile($container); - try { - $obj->save_to_filename($tmpFile); - $containers=file($tmpFile); - } catch (\Exception $e) { + public function mkdir($path) { + $path = $this->normalizePath($path); + + if ($this->is_dir($path)) { return false; } - foreach ($containers as &$sub) { - $sub=trim($sub); + + if($path !== '.') { + $path .= '/'; } - $i=array_search($name, $containers); - if ($i===false) { - unlink($tmpFile); + + try { + $object = $this->container->DataObject(); + $object->Create(array( + 'name' => $path, + 'content_type' => 'httpd/unix-directory' + )); + } catch (Exceptions\CreateUpdateError $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); return false; - } else { - unset($containers[$i]); - file_put_contents($tmpFile, implode("\n", $containers)."\n"); } - $obj->load_from_filename($tmpFile); - unlink($tmpFile); return true; } - /** - * ensure a subcontainer file exists and return it's object - * @param \CF_Container $container - * @return \CF_Object - */ - private function getSubContainerFile($container) { - try { - return $container->get_object(self::SUBCONTAINER_FILE); - } catch(\NoSuchObjectException $e) { - return $container->create_object(self::SUBCONTAINER_FILE); - } - } + public function file_exists($path) { + $path = $this->normalizePath($path); - public function __construct($params) { - if (isset($params['token']) && isset($params['host']) && isset($params['user'])) { - $this->token=$params['token']; - $this->host=$params['host']; - $this->user=$params['user']; - $this->root=isset($params['root'])?$params['root']:'/'; - if (isset($params['secure'])) { - if (is_string($params['secure'])) { - $this->secure = ($params['secure'] === 'true'); - } else { - $this->secure = (bool)$params['secure']; - } - } else { - $this->secure = false; - } - if ( ! $this->root || $this->root[0]!='/') { - $this->root='/'.$this->root; - } - $this->id = 'swift:' . $this->host . ':'.$this->root . ':' . $this->user; - } else { - throw new \Exception(); + if ($path !== '.' && $this->is_dir($path)) { + $path .= '/'; } + return $this->doesObjectExist($path); } - private function init(){ - if($this->ready) { - return; + public function rmdir($path) { + $path = $this->normalizePath($path); + + if (!$this->is_dir($path)) { + return false; } - $this->ready = true; - $this->auth = new \CF_Authentication($this->user, $this->token, null, $this->host); - $this->auth->authenticate(); + $dh = $this->opendir($path); + while ($file = readdir($dh)) { + if ($file === '.' || $file === '..') { + continue; + } - $this->conn = new \CF_Connection($this->auth); + if ($this->is_dir($path . '/' . $file)) { + $this->rmdir($path . '/' . $file); + } else { + $this->unlink($path . '/' . $file); + } + } - if ( ! $this->containerExists('/')) { - $this->rootContainer=$this->createContainer('/'); - } else { - $this->rootContainer=$this->getContainer('/'); + try { + $object = $this->container->DataObject($path . '/'); + $object->Delete(); + } catch (Exceptions\DeleteError $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); + return false; } - } - public function getId(){ - return $this->id; + return true; } + public function opendir($path) { + $path = $this->normalizePath($path); - public function mkdir($path) { - $this->init(); - if ($this->containerExists($path)) { - return false; + if ($path === '.') { + $path = ''; } else { - $this->createContainer($path); - return true; + $path .= '/'; } - } - public function rmdir($path) { - $this->init(); - if (!$this->containerExists($path)) { - return false; - } else { - $this->emptyContainer($path); - if ($path!='' and $path!='/') { - $parentContainer=$this->getContainer(dirname($path)); - $this->removeSubContainer($parentContainer, basename($path)); + try { + $files = array(); + $objects = $this->container->ObjectList(array( + 'prefix' => $path, + 'delimiter' => '/' + )); + + while ($object = $objects->Next()) { + $file = basename($object->Name()); + if ($file !== basename($path)) { + $files[] = $file; + } } - $this->conn->delete_container($this->getContainerName($path)); - unset($this->containers[$path]); - return true; + \OC\Files\Stream\Dir::register('swift' . $path, $files); + return opendir('fakedir://swift' . $path); + } catch (Exception $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); + return false; } + } - private function emptyContainer($path) { - $container=$this->getContainer($path); - if (is_null($container)) { - return; - } - $subContainers=$this->getSubContainers($container); - foreach ($subContainers as $sub) { - if ($sub) { - $this->emptyContainer($path.'/'.$sub); - $this->conn->delete_container($this->getContainerName($path.'/'.$sub)); - unset($this->containers[$path.'/'.$sub]); - } + public function stat($path) { + $path = $this->normalizePath($path); + + if ($this->is_dir($path) && $path != '.') { + $path .= '/'; } - $objects=$this->getObjects($container); - foreach ($objects as $object) { - $container->delete_object($object); - unset($this->objects[$path.'/'.$object]); + try { + $object = $this->container->DataObject($path); + } catch (Exceptions\ObjFetchError $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); + return false; } - } - public function opendir($path) { - $this->init(); - $container=$this->getContainer($path); - $files=$this->getObjects($container); - $i=array_search(self::SUBCONTAINER_FILE, $files); - if ($i!==false) { - unset($files[$i]); - } - $subContainers=$this->getSubContainers($container); - $files=array_merge($files, $subContainers); - $id=$this->getContainerName($path); - \OC\Files\Stream\Dir::register($id, $files); - return opendir('fakedir://'.$id); + $mtime = $object->extra_headers['X-Timestamp']; + if (isset($object->extra_headers['X-Object-Meta-Timestamp'])) { + $mtime = $object->extra_headers['X-Object-Meta-Timestamp']; + } + + $stat = array(); + $stat['size'] = $object->content_length; + $stat['mtime'] = $mtime; + $stat['atime'] = time(); + return $stat; } public function filetype($path) { - $this->init(); - if ($this->containerExists($path)) { - return 'dir'; - } else { + $path = $this->normalizePath($path); + + if ($path !== '.' && $this->doesObjectExist($path)) { return 'file'; } + + if ($path !== '.') { + $path .= '/'; + } + + if ($this->doesObjectExist($path)) { + return 'dir'; + } } public function isReadable($path) { @@ -397,66 +276,44 @@ class SWIFT extends \OC\Files\Storage\Common{ return true; } - public function file_exists($path) { - $this->init(); - if ($this->is_dir($path)) { - return true; - } else { - return $this->objectExists($path); - } - } + public function unlink($path) { + $path = $this->normalizePath($path); - public function file_get_contents($path) { - $this->init(); - $obj=$this->getObject($path); - if (is_null($obj)) { + try { + $object = $this->container->DataObject($path); + $object->Delete(); + } catch (Exceptions\DeleteError $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); return false; - } - return $obj->read(); - } - - public function file_put_contents($path, $content) { - $this->init(); - $obj=$this->getObject($path); - if (is_null($obj)) { - $container=$this->getContainer(dirname($path)); - if (is_null($container)) { - return false; - } - $obj=$container->create_object(basename($path)); - } - $this->resetMTime($obj); - return $obj->write($content); - } - - public function unlink($path) { - $this->init(); - if ($this->containerExists($path)) { - return $this->rmdir($path); - } - if ($this->objectExists($path)) { - $container=$this->getContainer(dirname($path)); - $container->delete_object(basename($path)); - unset($this->objects[$path]); - } else { + } catch (Exceptions\ObjFetchError $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); return false; } + + return true; } public function fopen($path, $mode) { - $this->init(); - switch($mode) { + $path = $this->normalizePath($path); + + switch ($mode) { case 'r': case 'rb': - $obj=$this->getObject($path); - if (is_null($obj)) { + $tmpFile = \OC_Helper::tmpFile(); + self::$tmpFiles[$tmpFile] = $path; + try { + $object = $this->container->DataObject($path); + } catch (Exceptions\ObjFetchError $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); return false; } - $fp = fopen('php://temp', 'r+'); - $obj->stream($fp); - - rewind($fp); - return $fp; + try { + $object->SaveToFilename($tmpFile); + } catch (Exceptions\IOError $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); + return false; + } + return fopen($tmpFile, 'r'); case 'w': case 'wb': case 'a': @@ -469,119 +326,166 @@ class SWIFT extends \OC\Files\Storage\Common{ case 'x+': case 'c': case 'c+': - $tmpFile=$this->getTmpFile($path); + if (strrpos($path, '.') !== false) { + $ext = substr($path, strrpos($path, '.')); + } else { + $ext = ''; + } + $tmpFile = \OC_Helper::tmpFile($ext); \OC\Files\Stream\Close::registerCallback($tmpFile, array($this, 'writeBack')); - self::$tempFiles[$tmpFile]=$path; - return fopen('close://'.$tmpFile, $mode); + if ($this->file_exists($path)) { + $source = $this->fopen($path, 'r'); + file_put_contents($tmpFile, $source); + } + self::$tmpFiles[$tmpFile] = $path; + + return fopen('close://' . $tmpFile, $mode); } } - public function writeBack($tmpFile) { - if (isset(self::$tempFiles[$tmpFile])) { - $this->fromTmpFile($tmpFile, self::$tempFiles[$tmpFile]); - unlink($tmpFile); + public function getMimeType($path) { + $path = $this->normalizePath($path); + + if ($this->is_dir($path)) { + return 'httpd/unix-directory'; + } else if ($this->file_exists($path)) { + $object = $this->container->DataObject($path); + return $object->extra_headers["Content-Type"]; } + return false; } - public function touch($path, $mtime=null) { - $this->init(); - $obj=$this->getObject($path); - if (is_null($obj)) { - return false; + public function touch($path, $mtime = null) { + $path = $this->normalizePath($path); + if ($this->file_exists($path)) { + if ($this->is_dir($path) && $path != '.') { + $path .= '/'; + } + + $object = $this->container->DataObject($path); + if( is_null($mtime)) { + $mtime = time(); + } + $settings = array( + 'name' => $path, + 'extra_headers' => array( + 'X-Object-Meta-Timestamp' => $mtime + ) + ); + $object->Update($settings); + } else { + $object = $this->container->DataObject(); + if (is_null($mtime)) { + $mtime = time(); + } + $settings = array( + 'name' => $path, + 'content_type' => 'text/plain', + 'extra_headers' => array( + 'X-Object-Meta-Timestamp' => $mtime + ) + ); + $object->Create($settings); } - if (is_null($mtime)) { - $mtime=time(); + } + + public function copy($path1, $path2) { + $path1 = $this->normalizePath($path1); + $path2 = $this->normalizePath($path2); + + if ($this->is_file($path1)) { + try { + $source = $this->container->DataObject($path1); + $target = $this->container->DataObject(); + $target->Create(array( + 'name' => $path2, + )); + $source->Copy($target); + } catch (Exceptions\ObjectCopyError $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); + return false; + } + } else { + if ($this->file_exists($path2)) { + return false; + } + + try { + $source = $this->container->DataObject($path1 . '/'); + $target = $this->container->DataObject(); + $target->Create(array( + 'name' => $path2 . '/', + )); + $source->Copy($target); + } catch (Exceptions\ObjectCopyError $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); + return false; + } + + $dh = $this->opendir($path1); + while ($file = readdir($dh)) { + if ($file === '.' || $file === '..') { + continue; + } + + $source = $path1 . '/' . $file; + $target = $path2 . '/' . $file; + $this->copy($source, $target); + } } - //emulate setting mtime with metadata - $obj->metadata['Mtime']=$mtime; - $obj->sync_metadata(); + return true; } public function rename($path1, $path2) { - $this->init(); - $sourceContainer=$this->getContainer(dirname($path1)); - $targetContainer=$this->getContainer(dirname($path2)); - $result=$sourceContainer->move_object_to(basename($path1), $targetContainer, basename($path2)); - unset($this->objects[$path1]); - if ($result) { - $targetObj=$this->getObject($path2); - $this->resetMTime($targetObj); - } - return $result; - } + $path1 = $this->normalizePath($path1); + $path2 = $this->normalizePath($path2); - public function copy($path1, $path2) { - $this->init(); - $sourceContainer=$this->getContainer(dirname($path1)); - $targetContainer=$this->getContainer(dirname($path2)); - $result=$sourceContainer->copy_object_to(basename($path1), $targetContainer, basename($path2)); - if ($result) { - $targetObj=$this->getObject($path2); - $this->resetMTime($targetObj); - } - return $result; - } + if ($this->is_file($path1)) { + if ($this->copy($path1, $path2) === false) { + return false; + } - public function stat($path) { - $this->init(); - $container=$this->getContainer($path); - if ( ! is_null($container)) { - return array( - 'mtime'=>-1, - 'size'=>$container->bytes_used, - 'ctime'=>-1 - ); - } + if ($this->unlink($path1) === false) { + $this->unlink($path2); + return false; + } + } else { + if ($this->file_exists($path2)) { + return false; + } - $obj=$this->getObject($path); + if ($this->copy($path1, $path2) === false) { + return false; + } - if (is_null($obj)) { - return false; + if ($this->rmdir($path1) === false) { + $this->rmdir($path2); + return false; + } } - if (isset($obj->metadata['Mtime']) and $obj->metadata['Mtime']>-1) { - $mtime=$obj->metadata['Mtime']; - } else { - $mtime=strtotime($obj->last_modified); - } - return array( - 'mtime'=>$mtime, - 'size'=>$obj->content_length, - 'ctime'=>-1, - ); + return true; } - private function getTmpFile($path) { - $this->init(); - $obj=$this->getObject($path); - if ( ! is_null($obj)) { - $tmpFile=\OCP\Files::tmpFile(); - $obj->save_to_filename($tmpFile); - return $tmpFile; - } else { - return \OCP\Files::tmpFile(); - } + public function getId() { + return $this->id; } - private function fromTmpFile($tmpFile, $path) { - $this->init(); - $obj=$this->getObject($path); - if (is_null($obj)) { - $obj=$this->createObject($path); - } - $obj->load_from_filename($tmpFile); - $this->resetMTime($obj); + public function getConnection() { + return $this->connection; } - /** - * remove custom mtime metadata - * @param \CF_Object $obj - */ - private function resetMTime($obj) { - if (isset($obj->metadata['Mtime'])) { - $obj->metadata['Mtime']=-1; - $obj->sync_metadata(); + public function writeBack($tmpFile) { + if (!isset(self::$tmpFiles[$tmpFile])) { + return false; } + + $object = $this->container->DataObject(); + $object->Create(array( + 'name' => self::$tmpFiles[$tmpFile], + 'content_type' => \OC_Helper::getMimeType($tmpFile) + ), $tmpFile); + unlink($tmpFile); } } diff --git a/apps/files_external/tests/config.php b/apps/files_external/tests/config.php index d4a69d29c0f..a523809e2f9 100644 --- a/apps/files_external/tests/config.php +++ b/apps/files_external/tests/config.php @@ -30,12 +30,17 @@ return array( 'client_secret' => '', 'token' => '', ), - 'swift'=>array( - 'run'=>false, - 'user'=>'test:tester', - 'token'=>'testing', - 'host'=>'localhost.local:8080/auth', - 'root'=>'/', + 'swift' => array( + 'run' => false, + 'user' => 'test', + 'bucket' => 'test', + 'region' => 'DFW', + 'key' => 'test', //to be used only with Rackspace Cloud Files + //'tenant' => 'test', //to be used only with OpenStack Object Storage + //'password' => 'test', //to be use only with OpenStack Object Storage + //'service_name' => 'swift', //should be 'swift' for OpenStack Object Storage and 'cloudFiles' for Rackspace Cloud Files (default value) + //'url' => 'https://identity.api.rackspacecloud.com/v2.0/', //to be used with Rackspace Cloud Files and OpenStack Object Storage + //'timeout' => 5 // timeout of HTTP requests in seconds ), 'smb'=>array( 'run'=>false, diff --git a/apps/files_external/tests/swift.php b/apps/files_external/tests/swift.php index 5c782840246..bdfdbdeebe9 100644 --- a/apps/files_external/tests/swift.php +++ b/apps/files_external/tests/swift.php @@ -1,30 +1,51 @@ <?php + /** - * Copyright (c) 2012 Robin Appelman <icewind@owncloud.com> - * This file is licensed under the Affero General Public License version 3 or - * later. - * See the COPYING-README file. + * ownCloud + * + * @author Christian Berendt + * @copyright 2013 Christian Berendt berendt@b1-systems.de + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ namespace Test\Files\Storage; -class SWIFT extends Storage { +class Swift extends Storage { + private $config; public function setUp() { - $id = uniqid(); $this->config = include('files_external/tests/config.php'); - if ( ! is_array($this->config) or ! isset($this->config['swift']) or ! $this->config['swift']['run']) { - $this->markTestSkipped('OpenStack SWIFT backend not configured'); + if (!is_array($this->config) or !isset($this->config['swift']) + or !$this->config['swift']['run']) { + $this->markTestSkipped('OpenStack Object Storage backend not configured'); } - $this->config['swift']['root'] .= '/' . $id; //make sure we have an new empty folder to work in - $this->instance = new \OC\Files\Storage\SWIFT($this->config['swift']); + $this->instance = new \OC\Files\Storage\Swift($this->config['swift']); } - public function tearDown() { if ($this->instance) { - $this->instance->rmdir(''); + $connection = $this->instance->getConnection(); + $container = $connection->Container($this->config['swift']['bucket']); + + $objects = $container->ObjectList(); + while($object = $objects->Next()) { + $object->Delete(); + } + + $container->Delete(); } } } diff --git a/apps/files_sharing/css/public.css b/apps/files_sharing/css/public.css index 3e1dec9bbe1..801c27506f1 100644 --- a/apps/files_sharing/css/public.css +++ b/apps/files_sharing/css/public.css @@ -4,14 +4,14 @@ body { #header { background: #1d2d44 url('%webroot%/core/img/noise.png') repeat; - height:2.5em; + height:32px; left:0; - line-height:2.5em; + line-height:32px; position:fixed; right:0; top:0; z-index:100; - padding:.5em; + padding:7px; } #details { @@ -24,13 +24,18 @@ body { font-weight:700; margin: 0 0.4em 0 0; padding: 0 5px; - height: 27px; + height: 32px; float: left; } .header-right #details { - margin-right: 2em; + margin-right: 28px; +} + +.header-right { + padding: 0; + height: 32px; } #public_upload { @@ -90,7 +95,7 @@ thead{ #data-upload-form { position: relative; right: 0; - height: 27px; + height: 32px; overflow: hidden; padding: 0; float: right; @@ -109,27 +114,20 @@ thead{ width: 100% !important; } -#download span { - position: relative; - bottom: 3px; -} - #publicUploadButtonMock { position:relative; display:block; width:100%; - height:27px; + height:32px; cursor:pointer; z-index:10; background-image:url('%webroot%/core/img/actions/upload.svg'); background-repeat:no-repeat; - background-position:7px 6px; + background-position:7px 8px; } #publicUploadButtonMock span { margin: 0 5px 0 28px; - position: relative; - top: -2px; color: #555; } diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 68f6f3ba76f..340e0939445 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -35,14 +35,14 @@ $(document).ready(function() { if ($(tr).data('id') != $('#dropdown').attr('data-item-source')) { OC.Share.hideDropDown(function () { $(tr).addClass('mouseOver'); - OC.Share.showDropDown(itemType, $(tr).data('id'), appendTo, true, possiblePermissions); + OC.Share.showDropDown(itemType, $(tr).data('id'), appendTo, true, possiblePermissions, filename); }); } else { OC.Share.hideDropDown(); } } else { $(tr).addClass('mouseOver'); - OC.Share.showDropDown(itemType, $(tr).data('id'), appendTo, true, possiblePermissions); + OC.Share.showDropDown(itemType, $(tr).data('id'), appendTo, true, possiblePermissions, filename); } }); } diff --git a/apps/files_sharing/l10n/ca.php b/apps/files_sharing/l10n/ca.php index e5e5910f8cf..96e59992967 100644 --- a/apps/files_sharing/l10n/ca.php +++ b/apps/files_sharing/l10n/ca.php @@ -1,5 +1,6 @@ <?php $TRANSLATIONS = array( +"This share is password-protected" => "Aquest compartit està protegit amb contrasenya", "The password is wrong. Try again." => "la contrasenya és incorrecta. Intenteu-ho de nou.", "Password" => "Contrasenya", "Sorry, this link doesn’t seem to work anymore." => "Aquest enllaç sembla que no funciona.", @@ -13,6 +14,7 @@ $TRANSLATIONS = array( "Download" => "Baixa", "Upload" => "Puja", "Cancel upload" => "Cancel·la la pujada", -"No preview available for" => "No hi ha vista prèvia disponible per a" +"No preview available for" => "No hi ha vista prèvia disponible per a", +"Direct link" => "Enllaç directe" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_sharing/l10n/pl.php b/apps/files_sharing/l10n/pl.php index 63d373917e5..4c7498ee1b7 100644 --- a/apps/files_sharing/l10n/pl.php +++ b/apps/files_sharing/l10n/pl.php @@ -1,5 +1,6 @@ <?php $TRANSLATIONS = array( +"This share is password-protected" => "Udział ten jest chroniony hasłem", "The password is wrong. Try again." => "To hasło jest niewłaściwe. Spróbuj ponownie.", "Password" => "Hasło", "Sorry, this link doesn’t seem to work anymore." => "Przepraszamy ale wygląda na to, że ten link już nie działa.", @@ -13,6 +14,7 @@ $TRANSLATIONS = array( "Download" => "Pobierz", "Upload" => "Wyślij", "Cancel upload" => "Anuluj wysyłanie", -"No preview available for" => "Podgląd nie jest dostępny dla" +"No preview available for" => "Podgląd nie jest dostępny dla", +"Direct link" => "Bezpośredni link" ); $PLURAL_FORMS = "nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/files_sharing/lib/updater.php b/apps/files_sharing/lib/updater.php index 3381f75f16d..171999ea652 100644 --- a/apps/files_sharing/lib/updater.php +++ b/apps/files_sharing/lib/updater.php @@ -49,13 +49,6 @@ class Shared_Updater { } $users = $reshareUsers; } - // Correct folders of shared file owner - $target = substr($target, 8); - if ($uidOwner !== $uid && $source = \OC_Share_Backend_File::getSource($target)) { - \OC\Files\Filesystem::initMountPoints($uidOwner); - $source = '/'.$uidOwner.'/'.$source['path']; - \OC\Files\Cache\Updater::correctFolder($source, $info['mtime']); - } } } diff --git a/apps/files_trashbin/js/trash.js b/apps/files_trashbin/js/trash.js index 4e83afcdb06..4e6a1e93fa4 100644 --- a/apps/files_trashbin/js/trash.js +++ b/apps/files_trashbin/js/trash.js @@ -228,9 +228,4 @@ function disableActions() { $(".action").css("display", "none"); $(":input:checkbox").css("display", "none"); } -function onClickBreadcrumb(e){ - var $el = $(e.target).closest('.crumb'); - e.preventDefault(); - FileList.changeDirectory(decodeURIComponent($el.data('dir'))); -} diff --git a/apps/files_trashbin/l10n/mk.php b/apps/files_trashbin/l10n/mk.php index 9200be01cd1..06a9dcfb241 100644 --- a/apps/files_trashbin/l10n/mk.php +++ b/apps/files_trashbin/l10n/mk.php @@ -1,7 +1,14 @@ <?php $TRANSLATIONS = array( +"Couldn't delete %s permanently" => "Не можеше трајно да се избрише %s", +"Couldn't restore %s" => "Не можеше да се поврати %s", "Error" => "Грешка", +"restored" => "повратени", +"Nothing in here. Your trash bin is empty!" => "Тука нема ништо. Вашата корпа за отпадоци е празна!", "Name" => "Име", -"Delete" => "Избриши" +"Restore" => "Поврати", +"Deleted" => "Избришан", +"Delete" => "Избриши", +"Deleted Files" => "Избришани датотеки" ); $PLURAL_FORMS = "nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;"; diff --git a/apps/files_versions/l10n/mk.php b/apps/files_versions/l10n/mk.php index 01a98808cff..d5c883b894f 100644 --- a/apps/files_versions/l10n/mk.php +++ b/apps/files_versions/l10n/mk.php @@ -1,5 +1,10 @@ <?php $TRANSLATIONS = array( -"Versions" => "Версии" +"Could not revert: %s" => "Не можев да го вратам: %s", +"Versions" => "Версии", +"Failed to revert {file} to revision {timestamp}." => "Не успеав да го вратам {file} на ревизијата {timestamp}.", +"More versions..." => "Повеќе верзии...", +"No other versions available" => "Не постојат други верзии", +"Restore" => "Врати" ); $PLURAL_FORMS = "nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;"; diff --git a/apps/user_ldap/l10n/ca.php b/apps/user_ldap/l10n/ca.php index 26f1d98ea4f..4be7478d3f2 100644 --- a/apps/user_ldap/l10n/ca.php +++ b/apps/user_ldap/l10n/ca.php @@ -5,6 +5,10 @@ $TRANSLATIONS = array( "The configuration is valid and the connection could be established!" => "La configuració és vàlida i s'ha pogut establir la comunicació!", "The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "La configuració és vàlida, però ha fallat el Bind. Comproveu les credencials i l'arranjament del servidor.", "The configuration is invalid. Please look in the ownCloud log for further details." => "La configuració no és vàlida. Per més detalls mireu al registre d'ownCloud.", +"No action specified" => "No heu especificat cap acció", +"No configuration specified" => "No heu especificat cap configuració", +"No data specified" => "No heu especificat cap dada", +" Could not set configuration %s" => "No s'ha pogut establir la configuració %s", "Deletion failed" => "Eliminació fallida", "Take over settings from recent server configuration?" => "Voleu prendre l'arranjament de la configuració actual del servidor?", "Keep settings?" => "Voleu mantenir la configuració?", @@ -13,14 +17,29 @@ $TRANSLATIONS = array( "Success" => "Èxit", "Error" => "Error", "Select groups" => "Selecciona els grups", +"Select object classes" => "Seleccioneu les classes dels objectes", +"Select attributes" => "Seleccioneu els atributs", "Connection test succeeded" => "La prova de connexió ha reeixit", "Connection test failed" => "La prova de connexió ha fallat", "Do you really want to delete the current Server Configuration?" => "Voleu eliminar la configuració actual del servidor?", "Confirm Deletion" => "Confirma l'eliminació", -"_%s group found_::_%s groups found_" => array("",""), -"_%s user found_::_%s users found_" => array("",""), +"_%s group found_::_%s groups found_" => array("S'ha trobat %s grup","S'han trobat %s grups"), +"_%s user found_::_%s users found_" => array("S'ha trobat %s usuari","S'han trobat %s usuaris"), +"Invalid Host" => "Ordinador central no vàlid", +"Could not find the desired feature" => "La característica desitjada no s'ha trobat", "Test Configuration" => "Comprovació de la configuració", "Help" => "Ajuda", +"Limit the access to %s to groups meeting this criteria:" => "Limita l'accés a %s grups que compleixin amb el criteri:", +"only those object classes:" => "només aquestes classes d'objecte:", +"only from those groups:" => "només d'aquests grups", +"Edit raw filter instead" => "Edita filtre raw", +"Raw LDAP filter" => "Filtre raw LDAP", +"The filter specifies which LDAP groups shall have access to the %s instance." => "El filtre especifica quins grups LDAP haurien de tenir accés a la instància %s.", +"groups found" => "grups trobats", +"What attribute shall be used as login name:" => "Quin atribut s'hauria d'utilitzar com a nom per a l'acreditació:", +"LDAP Username:" => "Nom d'usuari LDAP:", +"LDAP Email Address:" => "Adreça de correu electrònic LDAP:", +"Other Attributes:" => "Altres atributs:", "Add Server Configuration" => "Afegeix la configuració del servidor", "Host" => "Equip remot", "You can omit the protocol, except you require SSL. Then start with ldaps://" => "Podeu ometre el protocol, excepte si requeriu SSL. Llavors comenceu amb ldaps://", @@ -31,6 +50,9 @@ $TRANSLATIONS = array( "For anonymous access, leave DN and Password empty." => "Per un accés anònim, deixeu la DN i la contrasenya en blanc.", "One Base DN per line" => "Una DN Base per línia", "You can specify Base DN for users and groups in the Advanced tab" => "Podeu especificar DN Base per usuaris i grups a la pestanya Avançat", +"Limit the access to %s to users meeting this criteria:" => "Limita l'accés a %s usuaris que compleixin amb el criteri:", +"The filter specifies which LDAP users shall have access to the %s instance." => "El filtre especifica quins usuaris LDAP haurien de tenir accés a la instància %s", +"users found" => "usuaris trobats", "Back" => "Enrera", "Continue" => "Continua", "<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them." => "<b>Avís:</b> Les aplicacions user_ldap i user_webdavauth són incompatibles. Podeu experimentar comportaments inesperats. Demaneu a l'administrador del sistema que en desactivi una.", @@ -75,6 +97,8 @@ $TRANSLATIONS = array( "Internal Username Attribute:" => "Atribut nom d'usuari intern:", "Override UUID detection" => "Sobrescriu la detecció UUID", "By default, the UUID attribute is automatically detected. The UUID attribute is used to doubtlessly identify LDAP users and groups. Also, the internal username will be created based on the UUID, if not specified otherwise above. You can override the setting and pass an attribute of your choice. You must make sure that the attribute of your choice can be fetched for both users and groups and it is unique. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users and groups." => "Per defecte, owncloud autodetecta l'atribut UUID. L'atribut UUID s'utilitza per identificar usuaris i grups de forma indubtable. També el nom d'usuari intern es crearà en base a la UUIS, si no heu especificat res diferent a dalt. Podeu sobreescriure l'arranjament i passar l'atribut que desitgeu. Heu d'assegurar-vos que l'atribut que escolliu pot ser recollit tant pels usuaris com pels grups i que és únic. Deixeu-ho en blanc si preferiu el comportament per defecte. els canvis s'aplicaran als usuaris i grups LDAP mapats de nou (afegits).", +"UUID Attribute for Users:" => "Atribut UUID per Usuaris:", +"UUID Attribute for Groups:" => "Atribut UUID per Grups:", "Username-LDAP User Mapping" => "Mapatge d'usuari Nom d'usuari-LDAP", "Usernames are used to store and assign (meta) data. In order to precisely identify and recognize users, each LDAP user will have a internal username. This requires a mapping from username to LDAP user. The created username is mapped to the UUID of the LDAP user. Additionally the DN is cached as well to reduce LDAP interaction, but it is not used for identification. If the DN changes, the changes will be found. The internal username is used all over. Clearing the mappings will have leftovers everywhere. Clearing the mappings is not configuration sensitive, it affects all LDAP configurations! Never clear the mappings in a production environment, only in a testing or experimental stage." => "Els noms d'usuari s'usen per desar i assignar (meta)dades. Per tal d'identificar amb precisió i reconèixer els usuaris, cada usuari LDAP tindrà un nom d'usuari intern. Això requereix mapatge del nom d'usuari a l'usuari LDAP. El nom d'usuari creat es mapa a la UUID de l'usuari LDAP. A més, la DN es posa a la memòria de cau per reduir la interacció LDAP, però no s'usa per identificació. En cas que la DN canvïi, els canvis es trobaran. El nom d'usuari intern s'usa a tot arreu. Si esborreu els mapatges quedaran sobrants a tot arreu. Esborrar els mapatges no és sensible a la configuració, afecta a totes les configuracions LDAP! No esborreu mai els mapatges en un entorn de producció, només en un estadi de prova o experimental.", "Clear Username-LDAP User Mapping" => "Elimina el mapatge d'usuari Nom d'usuari-LDAP", diff --git a/apps/user_ldap/l10n/de.php b/apps/user_ldap/l10n/de.php index 4a66e0ad452..b9a41d91d8b 100644 --- a/apps/user_ldap/l10n/de.php +++ b/apps/user_ldap/l10n/de.php @@ -29,7 +29,7 @@ $TRANSLATIONS = array( "Could not find the desired feature" => "Konnte die gewünschte Funktion nicht finden", "Test Configuration" => "Testkonfiguration", "Help" => "Hilfe", -"Limit the access to %s to groups meeting this criteria:" => "Beschränken Sie den Zugriff auf %s für die Gruppen-Sitzungen durch folgende Kriterien:", +"Limit the access to %s to groups meeting this criteria:" => "Beschränke den Zugriff auf %s auf Gruppen, die die folgenden Kriterien erfüllen:", "only those object classes:" => "Nur diese Objekt-Klassen:", "only from those groups:" => "Nur von diesen Gruppen:", "Edit raw filter instead" => "Original-Filter stattdessen bearbeiten", @@ -50,7 +50,7 @@ $TRANSLATIONS = array( "For anonymous access, leave DN and Password empty." => "Lasse die Felder DN und Passwort für anonymen Zugang leer.", "One Base DN per line" => "Ein Basis-DN pro Zeile", "You can specify Base DN for users and groups in the Advanced tab" => "Du kannst Basis-DN für Benutzer und Gruppen in dem \"Erweitert\"-Reiter konfigurieren", -"Limit the access to %s to users meeting this criteria:" => "Beschränken Sie den Zugriff auf %s für die Benutzer-Sitzungen durch folgende Kriterien:", +"Limit the access to %s to users meeting this criteria:" => "Beschränke den Zugriff auf %s auf Benutzer, die die folgenden Kriterien erfüllen:", "The filter specifies which LDAP users shall have access to the %s instance." => "Der Filter definiert welche LDAP-Benutzer Zugriff auf die %s Instanz haben sollen.", "users found" => "Benutzer gefunden", "Back" => "Zurück", diff --git a/apps/user_ldap/l10n/de_DE.php b/apps/user_ldap/l10n/de_DE.php index 184c59aba72..52082761c9a 100644 --- a/apps/user_ldap/l10n/de_DE.php +++ b/apps/user_ldap/l10n/de_DE.php @@ -29,7 +29,7 @@ $TRANSLATIONS = array( "Could not find the desired feature" => "Konnte die gewünschte Funktion nicht finden", "Test Configuration" => "Testkonfiguration", "Help" => "Hilfe", -"Limit the access to %s to groups meeting this criteria:" => "Beschränken Sie den Zugriff auf %s für die Gruppen-Sitzungen durch folgende Kriterien:", +"Limit the access to %s to groups meeting this criteria:" => "Beschränke den Zugriff auf %s auf Gruppen, die die folgenden Kriterien erfüllen:", "only those object classes:" => "Nur diese Objekt-Klassen:", "only from those groups:" => "Nur von diesen Gruppen:", "Edit raw filter instead" => "Original-Filter stattdessen bearbeiten", @@ -50,7 +50,7 @@ $TRANSLATIONS = array( "For anonymous access, leave DN and Password empty." => "Lassen Sie die Felder DN und Passwort für einen anonymen Zugang leer.", "One Base DN per line" => "Ein Basis-DN pro Zeile", "You can specify Base DN for users and groups in the Advanced tab" => "Sie können Basis-DN für Benutzer und Gruppen in dem \"Erweitert\"-Reiter konfigurieren", -"Limit the access to %s to users meeting this criteria:" => "Beschränken Sie den Zugriff auf %s für die Benutzer-Sitzungen durch folgende Kriterien:", +"Limit the access to %s to users meeting this criteria:" => "Beschränke den Zugriff auf %s auf Benutzer, die die folgenden Kriterien erfüllen:", "The filter specifies which LDAP users shall have access to the %s instance." => "Der Filter definiert welche LDAP-Benutzer Zugriff auf die %s Instanz haben sollen.", "users found" => "Benutzer gefunden", "Back" => "Zurück", diff --git a/apps/user_ldap/l10n/en_GB.php b/apps/user_ldap/l10n/en_GB.php index 733a5744aab..7c186f5bdee 100644 --- a/apps/user_ldap/l10n/en_GB.php +++ b/apps/user_ldap/l10n/en_GB.php @@ -5,6 +5,10 @@ $TRANSLATIONS = array( "The configuration is valid and the connection could be established!" => "The configuration is valid and the connection could be established!", "The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "The configuration is valid, but the Bind failed. Please check the server settings and credentials.", "The configuration is invalid. Please look in the ownCloud log for further details." => "The configuration is invalid. Please look in the ownCloud log for further details.", +"No action specified" => "No action specified", +"No configuration specified" => "No configuration specified", +"No data specified" => "No data specified", +" Could not set configuration %s" => " Could not set configuration %s", "Deletion failed" => "Deletion failed", "Take over settings from recent server configuration?" => "Take over settings from recent server configuration?", "Keep settings?" => "Keep settings?", @@ -13,14 +17,29 @@ $TRANSLATIONS = array( "Success" => "Success", "Error" => "Error", "Select groups" => "Select groups", +"Select object classes" => "Select object classes", +"Select attributes" => "Select attributes", "Connection test succeeded" => "Connection test succeeded", "Connection test failed" => "Connection test failed", "Do you really want to delete the current Server Configuration?" => "Do you really want to delete the current Server Configuration?", "Confirm Deletion" => "Confirm Deletion", -"_%s group found_::_%s groups found_" => array("",""), -"_%s user found_::_%s users found_" => array("",""), +"_%s group found_::_%s groups found_" => array("%s group found","%s groups found"), +"_%s user found_::_%s users found_" => array("%s user found","%s users found"), +"Invalid Host" => "Invalid Host", +"Could not find the desired feature" => "Could not find the desired feature", "Test Configuration" => "Test Configuration", "Help" => "Help", +"Limit the access to %s to groups meeting this criteria:" => "Limit the access to %s to groups meeting this criteria:", +"only those object classes:" => "only those object classes:", +"only from those groups:" => "only from those groups:", +"Edit raw filter instead" => "Edit raw filter instead", +"Raw LDAP filter" => "Raw LDAP filter", +"The filter specifies which LDAP groups shall have access to the %s instance." => "The filter specifies which LDAP groups shall have access to the %s instance.", +"groups found" => "groups found", +"What attribute shall be used as login name:" => "What attribute should be used as login name:", +"LDAP Username:" => "LDAP Username:", +"LDAP Email Address:" => "LDAP Email Address:", +"Other Attributes:" => "Other Attributes:", "Add Server Configuration" => "Add Server Configuration", "Host" => "Host", "You can omit the protocol, except you require SSL. Then start with ldaps://" => "You can omit the protocol, except you require SSL. Then start with ldaps://", @@ -31,6 +50,10 @@ $TRANSLATIONS = array( "For anonymous access, leave DN and Password empty." => "For anonymous access, leave DN and Password empty.", "One Base DN per line" => "One Base DN per line", "You can specify Base DN for users and groups in the Advanced tab" => "You can specify Base DN for users and groups in the Advanced tab", +"Limit the access to %s to users meeting this criteria:" => "Limit the access to %s to users meeting this criteria:", +"The filter specifies which LDAP users shall have access to the %s instance." => "The filter specifies which LDAP users shall have access to the %s instance.", +"users found" => "users found", +"Back" => "Back", "Continue" => "Continue", "<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them." => "<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them.", "<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it.", diff --git a/apps/user_ldap/l10n/es.php b/apps/user_ldap/l10n/es.php index cb69e136171..45d3410a7d9 100644 --- a/apps/user_ldap/l10n/es.php +++ b/apps/user_ldap/l10n/es.php @@ -5,6 +5,10 @@ $TRANSLATIONS = array( "The configuration is valid and the connection could be established!" => "¡La configuración es válida y la conexión puede establecerse!", "The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "La configuración es válida, pero falló el Enlace. Por favor, compruebe la configuración del servidor y las credenciales.", "The configuration is invalid. Please look in the ownCloud log for further details." => "La configuración no es válida. Por favor, busque en el log de ownCloud para más detalles.", +"No action specified" => "No se ha especificado la acción", +"No configuration specified" => "No se ha especificado la configuración", +"No data specified" => "No se ha especificado los datos", +" Could not set configuration %s" => "No se pudo establecer la configuración %s", "Deletion failed" => "Falló el borrado", "Take over settings from recent server configuration?" => "¿Asumir los ajustes actuales de la configuración del servidor?", "Keep settings?" => "¿Mantener la configuración?", @@ -13,14 +17,29 @@ $TRANSLATIONS = array( "Success" => "Éxito", "Error" => "Error", "Select groups" => "Seleccionar grupos", +"Select object classes" => "Seleccionar la clase de objeto", +"Select attributes" => "Seleccionar atributos", "Connection test succeeded" => "La prueba de conexión fue exitosa", "Connection test failed" => "La prueba de conexión falló", "Do you really want to delete the current Server Configuration?" => "¿Realmente desea eliminar la configuración actual del servidor?", "Confirm Deletion" => "Confirmar eliminación", -"_%s group found_::_%s groups found_" => array("",""), -"_%s user found_::_%s users found_" => array("",""), +"_%s group found_::_%s groups found_" => array("Grupo %s encontrado","Grupos %s encontrados"), +"_%s user found_::_%s users found_" => array("Usuario %s encontrado","Usuarios %s encontrados"), +"Invalid Host" => "Host inválido", +"Could not find the desired feature" => "No se puede encontrar la función deseada.", "Test Configuration" => "Configuración de prueba", "Help" => "Ayuda", +"Limit the access to %s to groups meeting this criteria:" => "Limitar el acceso a %s a los grupos que cumplan este criterio:", +"only those object classes:" => "Solamente de estas clases:", +"only from those groups:" => "Solamente de estos grupos:", +"Edit raw filter instead" => "Editar el filtro", +"Raw LDAP filter" => "Filtro LDAP", +"The filter specifies which LDAP groups shall have access to the %s instance." => "El filtro especifica que grupos LDAP tendrán acceso a %s.", +"groups found" => "grupos encontrados", +"What attribute shall be used as login name:" => "Que atributo debe ser usado como login:", +"LDAP Username:" => "Nombre de usuario LDAP:", +"LDAP Email Address:" => "Dirección e-mail LDAP:", +"Other Attributes:" => "Otros atributos:", "Add Server Configuration" => "Agregar configuracion del servidor", "Host" => "Servidor", "You can omit the protocol, except you require SSL. Then start with ldaps://" => "Puede omitir el protocolo, excepto si requiere SSL. En ese caso, empiece con ldaps://", @@ -31,6 +50,9 @@ $TRANSLATIONS = array( "For anonymous access, leave DN and Password empty." => "Para acceso anónimo, deje DN y contraseña vacíos.", "One Base DN per line" => "Un DN Base por línea", "You can specify Base DN for users and groups in the Advanced tab" => "Puede especificar el DN base para usuarios y grupos en la pestaña Avanzado", +"Limit the access to %s to users meeting this criteria:" => "Limitar el acceso a %s a los usuarios que cumplan el siguiente criterio:", +"The filter specifies which LDAP users shall have access to the %s instance." => "El filtro especifica que usuarios LDAP pueden tener acceso a %s.", +"users found" => "Usuarios encontrados", "Back" => "Atrás", "Continue" => "Continuar", "<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them." => "<b>Advertencia:</b> Las apps user_ldap y user_webdavauth son incompatibles. Puede que experimente un comportamiento inesperado. Pregunte al su administrador de sistemas para desactivar uno de ellos.", diff --git a/apps/user_ldap/l10n/et_EE.php b/apps/user_ldap/l10n/et_EE.php index 968a9f0d165..2282db81afb 100644 --- a/apps/user_ldap/l10n/et_EE.php +++ b/apps/user_ldap/l10n/et_EE.php @@ -5,6 +5,10 @@ $TRANSLATIONS = array( "The configuration is valid and the connection could be established!" => "Seadistus on korrektne ning ühendus on olemas!", "The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "Seadistus on korrektne, kuid ühendus ebaõnnestus. Palun kontrolli serveri seadeid ja ühenduseks kasutatavaid kasutajatunnuseid.", "The configuration is invalid. Please look in the ownCloud log for further details." => "Seadistus on vigane. Palun vaata ownCloud logist täpsemalt.", +"No action specified" => "Tegevusi pole määratletud", +"No configuration specified" => "Seadistust pole määratletud", +"No data specified" => "Andmeid pole määratletud", +" Could not set configuration %s" => "Ei suutnud seadistada %s", "Deletion failed" => "Kustutamine ebaõnnestus", "Take over settings from recent server configuration?" => "Võta sätted viimasest serveri seadistusest?", "Keep settings?" => "Säilitada seadistused?", @@ -13,14 +17,29 @@ $TRANSLATIONS = array( "Success" => "Korras", "Error" => "Viga", "Select groups" => "Vali grupid", +"Select object classes" => "Vali objekti klassid", +"Select attributes" => "Vali atribuudid", "Connection test succeeded" => "Ühenduse testimine õnnestus", "Connection test failed" => "Ühenduse testimine ebaõnnestus", "Do you really want to delete the current Server Configuration?" => "Oled kindel, et tahad kustutada praegust serveri seadistust?", "Confirm Deletion" => "Kinnita kustutamine", -"_%s group found_::_%s groups found_" => array("",""), -"_%s user found_::_%s users found_" => array("",""), +"_%s group found_::_%s groups found_" => array("%s grupp leitud","%s gruppi leitud"), +"_%s user found_::_%s users found_" => array("%s kasutaja leitud","%s kasutajat leitud"), +"Invalid Host" => "Vigane server", +"Could not find the desired feature" => "Ei suuda leida soovitud funktsioonaalsust", "Test Configuration" => "Testi seadistust", "Help" => "Abiinfo", +"Limit the access to %s to groups meeting this criteria:" => "Piira ligipääs %s grupile, mis sobivad kriteeriumiga:", +"only those object classes:" => "ainult need objektiklassid:", +"only from those groups:" => "ainult nendest gruppidest:", +"Edit raw filter instead" => "Selle asemel muuda filtrit", +"Raw LDAP filter" => "LDAP filter", +"The filter specifies which LDAP groups shall have access to the %s instance." => "Filter määrab millised LDAP grupid saavad ligipääsu sellele %s instantsile.", +"groups found" => "gruppi leitud", +"What attribute shall be used as login name:" => "Mis atribuuti kasutada sisselogimise kasutajatunnusena:", +"LDAP Username:" => "LDAP kasutajanimi:", +"LDAP Email Address:" => "LDAP e-posti aadress:", +"Other Attributes:" => "Muud atribuudid:", "Add Server Configuration" => "Lisa serveri seadistus", "Host" => "Host", "You can omit the protocol, except you require SSL. Then start with ldaps://" => "Sa ei saa protokolli ära jätta, välja arvatud siis, kui sa nõuad SSL-ühendust. Sel juhul alusta eesliitega ldaps://", @@ -31,6 +50,9 @@ $TRANSLATIONS = array( "For anonymous access, leave DN and Password empty." => "Anonüümseks ligipääsuks jäta DN ja parool tühjaks.", "One Base DN per line" => "Üks baas-DN rea kohta", "You can specify Base DN for users and groups in the Advanced tab" => "Sa saad kasutajate ja gruppide baas DN-i määrata lisavalikute vahekaardilt", +"Limit the access to %s to users meeting this criteria:" => "Piira ligipääs %s kasutajale, mis sobivad kriteeriumiga:", +"The filter specifies which LDAP users shall have access to the %s instance." => "Filter määrab millised LDAP kasutajad pääsevad ligi %s instantsile.", +"users found" => "kasutajat leitud", "Back" => "Tagasi", "Continue" => "Jätka", "<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them." => "<b>Hoiatus:</b> rakendused user_ldap ja user_webdavauht ei ole ühilduvad. Töös võib esineda ootamatuid tõrkeid.\nPalu oma süsteemihalduril üks neist rakendustest kasutusest eemaldada.", diff --git a/apps/user_ldap/l10n/fr.php b/apps/user_ldap/l10n/fr.php index 33626480b93..013a1031b4a 100644 --- a/apps/user_ldap/l10n/fr.php +++ b/apps/user_ldap/l10n/fr.php @@ -5,6 +5,10 @@ $TRANSLATIONS = array( "The configuration is valid and the connection could be established!" => "La configuration est valide et la connexion peut être établie !", "The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "La configuration est valide, mais le lien ne peut être établi. Veuillez vérifier les paramètres du serveur ainsi que vos identifiants de connexion.", "The configuration is invalid. Please look in the ownCloud log for further details." => "La configuration est invalide. Veuillez vous référer aux fichiers de journaux ownCloud pour plus d'information.", +"No action specified" => "Aucune action spécifiée", +"No configuration specified" => "Aucune configuration spécifiée", +"No data specified" => "Aucune donnée spécifiée", +" Could not set configuration %s" => "Impossible de spécifier la configuration %s", "Deletion failed" => "La suppression a échoué", "Take over settings from recent server configuration?" => "Récupérer les paramètres depuis une configuration récente du serveur ?", "Keep settings?" => "Garder ces paramètres ?", @@ -13,14 +17,29 @@ $TRANSLATIONS = array( "Success" => "Succès", "Error" => "Erreur", "Select groups" => "Sélectionnez les groupes", +"Select object classes" => "Sélectionner les classes d'objet", +"Select attributes" => "Sélectionner les attributs", "Connection test succeeded" => "Test de connexion réussi", "Connection test failed" => "Test de connexion échoué", "Do you really want to delete the current Server Configuration?" => "Êtes-vous vraiment sûr de vouloir effacer la configuration actuelle du serveur ?", "Confirm Deletion" => "Confirmer la suppression", -"_%s group found_::_%s groups found_" => array("",""), -"_%s user found_::_%s users found_" => array("",""), +"_%s group found_::_%s groups found_" => array("%s groupe trouvé","%s groupes trouvés"), +"_%s user found_::_%s users found_" => array("%s utilisateur trouvé","%s utilisateurs trouvés"), +"Invalid Host" => "Hôte invalide", +"Could not find the desired feature" => "Impossible de trouver la fonction souhaitée", "Test Configuration" => "Tester la configuration", "Help" => "Aide", +"Limit the access to %s to groups meeting this criteria:" => "Limiter l'accès à %s aux groupes respectant ce critère :", +"only those object classes:" => "seulement ces classes d'objet :", +"only from those groups:" => "seulement de ces groupes :", +"Edit raw filter instead" => "Éditer le filtre raw à la place", +"Raw LDAP filter" => "Filtre Raw LDAP", +"The filter specifies which LDAP groups shall have access to the %s instance." => "Le filtre spécifie quels groupes LDAP doivent avoir accès à l'instance %s.", +"groups found" => "groupes trouvés", +"What attribute shall be used as login name:" => "Quel attribut doit être utilisé comme nom de login:", +"LDAP Username:" => "Nom d'utilisateur LDAP :", +"LDAP Email Address:" => "Adresse email LDAP :", +"Other Attributes:" => "Autres attributs :", "Add Server Configuration" => "Ajouter une configuration du serveur", "Host" => "Hôte", "You can omit the protocol, except you require SSL. Then start with ldaps://" => "Vous pouvez omettre le protocole, sauf si vous avez besoin de SSL. Dans ce cas préfixez avec ldaps://", @@ -31,6 +50,9 @@ $TRANSLATIONS = array( "For anonymous access, leave DN and Password empty." => "Pour un accès anonyme, laisser le DN utilisateur et le mot de passe vides.", "One Base DN per line" => "Un DN racine par ligne", "You can specify Base DN for users and groups in the Advanced tab" => "Vous pouvez spécifier les DN Racines de vos utilisateurs et groupes via l'onglet Avancé", +"Limit the access to %s to users meeting this criteria:" => "Limiter l'accès à %s aux utilisateurs respectant ce critère :", +"The filter specifies which LDAP users shall have access to the %s instance." => "Le filtre spécifie quels utilisateurs LDAP doivent avoir accès à l'instance %s.", +"users found" => "utilisateurs trouvés", "Back" => "Retour", "Continue" => "Poursuivre", "<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them." => "<b>Avertissement :</b> Les applications user_ldap et user_webdavauth sont incompatibles. Des dysfonctionnements peuvent survenir. Contactez votre administrateur système pour qu'il désactive l'une d'elles.", diff --git a/apps/user_ldap/l10n/it.php b/apps/user_ldap/l10n/it.php index 9cd3b9548ed..0b361a92ffd 100644 --- a/apps/user_ldap/l10n/it.php +++ b/apps/user_ldap/l10n/it.php @@ -5,6 +5,10 @@ $TRANSLATIONS = array( "The configuration is valid and the connection could be established!" => "La configurazione è valida e la connessione può essere stabilita.", "The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "La configurazione è valida, ma il Bind non è riuscito. Controlla le impostazioni del server e le credenziali.", "The configuration is invalid. Please look in the ownCloud log for further details." => "La configurazione non è valida. Controlla il log di ownCloud per ulteriori dettagli.", +"No action specified" => "Nessuna azione specificata", +"No configuration specified" => "Nessuna configurazione specificata", +"No data specified" => "Nessun dato specificato", +" Could not set configuration %s" => "Impossibile impostare la configurazione %s", "Deletion failed" => "Eliminazione non riuscita", "Take over settings from recent server configuration?" => "Vuoi recuperare le impostazioni dalla configurazione recente del server?", "Keep settings?" => "Vuoi mantenere le impostazioni?", @@ -13,14 +17,27 @@ $TRANSLATIONS = array( "Success" => "Riuscito", "Error" => "Errore", "Select groups" => "Seleziona gruppi", +"Select object classes" => "Seleziona le classi oggetto", +"Select attributes" => "Seleziona gli attributi", "Connection test succeeded" => "Prova di connessione riuscita", "Connection test failed" => "Prova di connessione non riuscita", "Do you really want to delete the current Server Configuration?" => "Vuoi davvero eliminare la configurazione attuale del server?", "Confirm Deletion" => "Conferma l'eliminazione", -"_%s group found_::_%s groups found_" => array("",""), -"_%s user found_::_%s users found_" => array("",""), +"_%s group found_::_%s groups found_" => array("%s gruppo trovato","%s gruppi trovati"), +"_%s user found_::_%s users found_" => array("%s utente trovato","%s utenti trovati"), +"Invalid Host" => "Host non valido", +"Could not find the desired feature" => "Impossibile trovare la caratteristica desiderata", "Test Configuration" => "Prova configurazione", "Help" => "Aiuto", +"Limit the access to %s to groups meeting this criteria:" => "Limita l'accesso a %s gruppi che rispettano questi criteri:", +"only those object classes:" => "solo queste classi di oggetti:", +"only from those groups:" => "solo da questi gruppi:", +"The filter specifies which LDAP groups shall have access to the %s instance." => "Il filtro specifica quale gruppo LDAP deve ricevere l'accesso all'istanza %s.", +"groups found" => "gruppi trovati", +"What attribute shall be used as login name:" => "Quale attributo deve essere usato come nome di login:", +"LDAP Username:" => "Nome utente LDAP:", +"LDAP Email Address:" => "Indirizzo email LDAP:", +"Other Attributes:" => "Altri Attributi:", "Add Server Configuration" => "Aggiungi configurazione del server", "Host" => "Host", "You can omit the protocol, except you require SSL. Then start with ldaps://" => "È possibile omettere il protocollo, ad eccezione se è necessario SSL. Quindi inizia con ldaps://", @@ -31,6 +48,9 @@ $TRANSLATIONS = array( "For anonymous access, leave DN and Password empty." => "Per l'accesso anonimo, lasciare vuoti i campi DN e Password", "One Base DN per line" => "Un DN base per riga", "You can specify Base DN for users and groups in the Advanced tab" => "Puoi specificare una DN base per gli utenti ed i gruppi nella scheda Avanzate", +"Limit the access to %s to users meeting this criteria:" => "Limita l'accesso a %s gruppi che rispettano questi criteri:", +"The filter specifies which LDAP users shall have access to the %s instance." => "Il filtro specifica quale utente LDAP deve ricevere l'accesso all'istanza %s.", +"users found" => "utenti trovati", "Back" => "Indietro", "Continue" => "Continua", "<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them." => "<b>Avviso:</b> le applicazioni user_ldap e user_webdavauth sono incompatibili. Potresti riscontrare un comportamento inatteso. Chiedi al tuo amministratore di sistema di disabilitarne una.", diff --git a/apps/user_ldap/l10n/ja_JP.php b/apps/user_ldap/l10n/ja_JP.php index 1faaadc2e59..ca30e7f820d 100644 --- a/apps/user_ldap/l10n/ja_JP.php +++ b/apps/user_ldap/l10n/ja_JP.php @@ -5,6 +5,10 @@ $TRANSLATIONS = array( "The configuration is valid and the connection could be established!" => "設定は有効であり、接続を確立しました!", "The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "設定は有効ですが、接続に失敗しました。サーバ設定と資格情報を確認して下さい。", "The configuration is invalid. Please look in the ownCloud log for further details." => "設定は無効です。詳細は ownCloud のログを見て下さい。", +"No action specified" => "アクションが指定されていません", +"No configuration specified" => "構成が指定されていません", +"No data specified" => "データが指定されていません", +" Could not set configuration %s" => "構成 %s を設定できませんでした", "Deletion failed" => "削除に失敗しました", "Take over settings from recent server configuration?" => "最近のサーバ設定から設定を引き継ぎますか?", "Keep settings?" => "設定を保持しますか?", @@ -13,14 +17,29 @@ $TRANSLATIONS = array( "Success" => "成功", "Error" => "エラー", "Select groups" => "グループを選択", +"Select object classes" => "オブジェクトクラスを選択", +"Select attributes" => "属性を選択", "Connection test succeeded" => "接続テストに成功しました", "Connection test failed" => "接続テストに失敗しました", "Do you really want to delete the current Server Configuration?" => "現在のサーバ設定を本当に削除してもよろしいですか?", "Confirm Deletion" => "削除の確認", -"_%s group found_::_%s groups found_" => array(""), -"_%s user found_::_%s users found_" => array(""), +"_%s group found_::_%s groups found_" => array("%s グループが見つかりました"), +"_%s user found_::_%s users found_" => array("%s ユーザが見つかりました"), +"Invalid Host" => "無効なホスト", +"Could not find the desired feature" => "望ましい機能は見つかりませんでした", "Test Configuration" => "設定をテスト", "Help" => "ヘルプ", +"Limit the access to %s to groups meeting this criteria:" => "この基準に合致するグループに %s へのアクセスを制限:", +"only those object classes:" => "それらのオブジェクトクラスのみ:", +"only from those groups:" => "それらのグループからのみ:", +"Edit raw filter instead" => "フィルタを編集", +"Raw LDAP filter" => "LDAP フィルタ", +"The filter specifies which LDAP groups shall have access to the %s instance." => "フィルタは、どの LDAP グループが %s にアクセスするかを指定します。", +"groups found" => "グループが見つかりました", +"What attribute shall be used as login name:" => "ログイン名として利用する属性:", +"LDAP Username:" => "LDAP ユーザ名:", +"LDAP Email Address:" => "LDAP メールアドレス:", +"Other Attributes:" => "他の属性:", "Add Server Configuration" => "サーバ設定を追加", "Host" => "ホスト", "You can omit the protocol, except you require SSL. Then start with ldaps://" => "SSL通信しない場合には、プロトコル名を省略することができます。そうでない場合には、ldaps:// から始めてください。", @@ -31,6 +50,9 @@ $TRANSLATIONS = array( "For anonymous access, leave DN and Password empty." => "匿名アクセスの場合は、DNとパスワードを空にしてください。", "One Base DN per line" => "1行に1つのベースDN", "You can specify Base DN for users and groups in the Advanced tab" => "拡張タブでユーザとグループのベースDNを指定することができます。", +"Limit the access to %s to users meeting this criteria:" => "この基準に合致するユーザに %s へのアクセスを制限:", +"The filter specifies which LDAP users shall have access to the %s instance." => "フィルタは、どの LDAP ユーザが %s にアクセスするかを指定します。", +"users found" => "ユーザが見つかりました", "Back" => "戻る", "Continue" => "続ける", "<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them." => "<b>警告:</b> user_ldap と user_webdavauth のアプリには互換性がありません。予期せぬ動作をする可能性があります。システム管理者にどちらかを無効にするよう問い合わせてください。", diff --git a/apps/user_ldap/l10n/lt_LT.php b/apps/user_ldap/l10n/lt_LT.php index 69abaec4dfc..ee8bb28425c 100644 --- a/apps/user_ldap/l10n/lt_LT.php +++ b/apps/user_ldap/l10n/lt_LT.php @@ -2,8 +2,10 @@ $TRANSLATIONS = array( "Failed to clear the mappings." => "Nepavyko išvalyti sąsajų.", "Failed to delete the server configuration" => "Nepavyko pašalinti serverio konfigūracijos", +"The configuration is valid and the connection could be established!" => "Konfigūracija yra tinkama bei prisijungta sėkmingai!", "Deletion failed" => "Ištrinti nepavyko", "Keep settings?" => "Išlaikyti nustatymus?", +"Cannot add server configuration" => "Negalima pridėti serverio konfigūracijos", "mappings cleared" => "susiejimai išvalyti", "Success" => "Sėkmingai", "Error" => "Klaida", diff --git a/apps/user_ldap/l10n/pt_BR.php b/apps/user_ldap/l10n/pt_BR.php index bc4327699c3..29ed1ef44ea 100644 --- a/apps/user_ldap/l10n/pt_BR.php +++ b/apps/user_ldap/l10n/pt_BR.php @@ -5,6 +5,10 @@ $TRANSLATIONS = array( "The configuration is valid and the connection could be established!" => "A configuração é válida e a conexão foi estabelecida!", "The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "A configuração é válida, mas o Bind falhou. Confira as configurações do servidor e as credenciais.", "The configuration is invalid. Please look in the ownCloud log for further details." => "A configuração é inválida. Leia o log do ownCloud para mais detalhes.", +"No action specified" => "Nenhuma ação especificada", +"No configuration specified" => "Nenhuma configuração especificada", +"No data specified" => "Não há dados especificados", +" Could not set configuration %s" => "Não foi possível definir a configuração %s", "Deletion failed" => "Remoção falhou", "Take over settings from recent server configuration?" => "Tomar parámetros de recente configuração de servidor?", "Keep settings?" => "Manter ajustes?", @@ -13,14 +17,29 @@ $TRANSLATIONS = array( "Success" => "Sucesso", "Error" => "Erro", "Select groups" => "Selecionar grupos", +"Select object classes" => "Selecione classes de objetos", +"Select attributes" => "Selecione os atributos", "Connection test succeeded" => "Teste de conexão bem sucedida", "Connection test failed" => "Teste de conexão falhou", "Do you really want to delete the current Server Configuration?" => "Você quer realmente deletar as atuais Configurações de Servidor?", "Confirm Deletion" => "Confirmar Exclusão", -"_%s group found_::_%s groups found_" => array("",""), -"_%s user found_::_%s users found_" => array("",""), +"_%s group found_::_%s groups found_" => array("grupo% s encontrado","grupos% s encontrado"), +"_%s user found_::_%s users found_" => array("usuário %s encontrado","usuários %s encontrados"), +"Invalid Host" => "Host inválido", +"Could not find the desired feature" => "Não foi possível encontrar a função desejada", "Test Configuration" => "Teste de Configuração", "Help" => "Ajuda", +"Limit the access to %s to groups meeting this criteria:" => "Limitar o acesso a %s para grupos que coincidam com estes critérios:", +"only those object classes:" => "apenas essas classes de objetos:", +"only from those groups:" => "apenas a partir dos grupos:", +"Edit raw filter instead" => "Editar filtro raw ao invéz", +"Raw LDAP filter" => "Filtro LDAP Raw", +"The filter specifies which LDAP groups shall have access to the %s instance." => "O filtro especifica quais grupos LDAP devem ter acesso à instância do %s.", +"groups found" => "grupos encontrados", +"What attribute shall be used as login name:" => "O atributo deve ser usado como nome de login:", +"LDAP Username:" => "Usuário LDAP:", +"LDAP Email Address:" => "LDAP Endereço de E-mail:", +"Other Attributes:" => "Outros atributos:", "Add Server Configuration" => "Adicionar Configuração de Servidor", "Host" => "Servidor", "You can omit the protocol, except you require SSL. Then start with ldaps://" => "Você pode omitir o protocolo, exceto quando requerer SSL. Então inicie com ldaps://", @@ -31,6 +50,9 @@ $TRANSLATIONS = array( "For anonymous access, leave DN and Password empty." => "Para acesso anônimo, deixe DN e Senha vazios.", "One Base DN per line" => "Uma base DN por linha", "You can specify Base DN for users and groups in the Advanced tab" => "Você pode especificar DN Base para usuários e grupos na guia Avançada", +"Limit the access to %s to users meeting this criteria:" => "Limitar o acesso a %s para usuários que coincidam com estes critérios:", +"The filter specifies which LDAP users shall have access to the %s instance." => "O filtro especifica quais usuários LDAP devem ter acesso à instância do %s.", +"users found" => "usuários encontrados", "Back" => "Voltar", "Continue" => "Continuar", "<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them." => "<b>Aviso:</b> Os aplicativos user_ldap e user_webdavauth são incompatíveis. Você pode experimentar comportamento inesperado. Por favor, peça ao seu administrador do sistema para desabilitar um deles.", diff --git a/apps/user_ldap/l10n/tr.php b/apps/user_ldap/l10n/tr.php index 5537c94f98b..709c01b533e 100644 --- a/apps/user_ldap/l10n/tr.php +++ b/apps/user_ldap/l10n/tr.php @@ -5,6 +5,10 @@ $TRANSLATIONS = array( "The configuration is valid and the connection could be established!" => "Yapılandırma geçerli ve bağlantı kuruldu!", "The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "Yapılandırma geçerli fakat bağlanma(bind) başarısız. Lütfen Sunucu ayarları ve kimlik bilgilerini kontrol ediniz.", "The configuration is invalid. Please look in the ownCloud log for further details." => "Yapılandırma geçersiz. Daha fazla detay için lütfen ownCloud günlüklerine bakınız.", +"No action specified" => "Eylem belirtilmedi", +"No configuration specified" => "Yapılandırma belirtilmemiş", +"No data specified" => "Veri belirtilmemiş", +" Could not set configuration %s" => "Yapılandırma %s olarak ayarlanamadı", "Deletion failed" => "Silme başarısız oldu", "Take over settings from recent server configuration?" => "Ayarları son sunucu yapılandırmalarından devral?", "Keep settings?" => "Ayarlar kalsın mı?", @@ -13,14 +17,29 @@ $TRANSLATIONS = array( "Success" => "Başarılı", "Error" => "Hata", "Select groups" => "Grupları seç", +"Select object classes" => "Nesne sınıflarını seç", +"Select attributes" => "Nitelikleri seç", "Connection test succeeded" => "Bağlantı testi başarılı oldu", "Connection test failed" => "Bağlantı testi başarısız oldu", "Do you really want to delete the current Server Configuration?" => "Şu anki sunucu yapılandırmasını silmek istediğinizden emin misiniz?", "Confirm Deletion" => "Silmeyi onayla", -"_%s group found_::_%s groups found_" => array("",""), -"_%s user found_::_%s users found_" => array("",""), +"_%s group found_::_%s groups found_" => array("%s grup bulundu","%s grup bulundu"), +"_%s user found_::_%s users found_" => array("%s kullanıcı bulundu","%s kullanıcı bulundu"), +"Invalid Host" => "Geçersiz Makine", +"Could not find the desired feature" => "İstenen özellik bulunamadı", "Test Configuration" => "Test Yapılandırması", "Help" => "Yardım", +"Limit the access to %s to groups meeting this criteria:" => "%s erişimini, şu kriterle eşleşen gruplara sınırla:", +"only those object classes:" => "sadece bu nesne sınıflarına:", +"only from those groups:" => "sadece bu gruplardan:", +"Edit raw filter instead" => "Bunun yerine ham filtreyi düzenle", +"Raw LDAP filter" => "Ham LDAP filtresi", +"The filter specifies which LDAP groups shall have access to the %s instance." => "Filtre, %s örneğine erişmesi gereken LDAP gruplarını belirtir.", +"groups found" => "grup bulundu", +"What attribute shall be used as login name:" => "Oturum ismi olarak hangi nitelik kullanılmalı:", +"LDAP Username:" => "LDAP Kullanıcı Adı:", +"LDAP Email Address:" => "LDAP E-posta Adresi:", +"Other Attributes:" => "Diğer Nitelikler", "Add Server Configuration" => "Sunucu Uyunlama birlemek ", "Host" => "Sunucu", "You can omit the protocol, except you require SSL. Then start with ldaps://" => "Protokol atlamak edesin, sadece SSL istiyorsaniz. O zaman, idapsile baslamak. ", @@ -31,13 +50,18 @@ $TRANSLATIONS = array( "For anonymous access, leave DN and Password empty." => "Anonim erişim için DN ve Parola alanlarını boş bırakın.", "One Base DN per line" => "Bir Tabani DN herbir dizi. ", "You can specify Base DN for users and groups in the Advanced tab" => "Base DN kullanicileri ve kaynaklari icin tablosu Advanced tayin etmek ederiz. ", +"Limit the access to %s to users meeting this criteria:" => "%s erişimini, şu kriterle eşleşen kullanıcılara sınırla:", +"The filter specifies which LDAP users shall have access to the %s instance." => "Filtre, %s örneğine erişmesi gereken LDAP kullanıcılarını belirtir.", +"users found" => "kullanıcı bulundu", "Back" => "Geri", "Continue" => "Devam et", +"<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them." => "<b>Uyarı:</b> user_ldap ve user_webdavauth uygulamaları uyumlu değil. Beklenmedik bir davranışla karşılaşabilirsiniz. Lütfen ikisinden birini devre dışı bırakmak için sistem yöneticinizle iletişime geçin.", "<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "<b>Ihbar <b> Modulu PHP LDAP yuklemdi degil, backend calismacak. Lutfen sistem yonetici sormak yuklemek icin.", "Connection Settings" => "Bağlantı ayarları", "Configuration Active" => "Yapılandırma Etkin", "When unchecked, this configuration will be skipped." => "Ne zaman iptal, bu uynnlama isletici ", "User Login Filter" => "Kullanıcı Oturum Filtresi", +"Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action. Example: \"uid=%%uid\"" => "Oturum açma girişimi olduğunda uygulanacak filtreyi tanımlar. %%uid, oturum işleminde kullanıcı adı ile değiştirilir. Örneğin: \"uid=%%uid\"", "Backup (Replica) Host" => "Sigorta Kopya Cephe ", "Give an optional backup host. It must be a replica of the main LDAP/AD server." => "Bir kopya cevre vermek, kopya sunucu onemli olmali. ", "Backup (Replica) Port" => "Kopya Port ", @@ -45,15 +69,18 @@ $TRANSLATIONS = array( "Only connect to the replica server." => "Sadece kopya sunucuya bağlan.", "Case insensitve LDAP server (Windows)" => "Dusme sunucu LDAP zor degil. (Windows)", "Turn off SSL certificate validation." => "SSL sertifika doğrulamasını kapat.", +"Not recommended, use it for testing only! If connection only works with this option, import the LDAP server's SSL certificate in your %s server." => "Önerilmez, sadece test için kullanın! Eğer bağlantı sadece bu seçenekle çalışıyorsa %s sunucunuza LDAP sunucusunun SSL sertifikasını ekleyin.", "Cache Time-To-Live" => "Cache Time-To-Live ", "in seconds. A change empties the cache." => "saniye cinsinden. Bir değişiklik önbelleği temizleyecektir.", "Directory Settings" => "Parametrar Listesin Adresinin ", "User Display Name Field" => "Ekran Adi Kullanici, (Alan Adi Kullanici Ekrane)", +"The LDAP attribute to use to generate the user's display name." => "Kullanıcının görünen adını oluşturmak için kullanılacak LDAP niteliği.", "Base User Tree" => "Temel Kullanıcı Ağacı", "One User Base DN per line" => "Bir Temel Kullanici DN her dizgi ", "User Search Attributes" => "Kategorii Arama Kullanici ", "Optional; one attribute per line" => "Tercihe bağlı; her bir satırd bir öznitelik", "Group Display Name Field" => "Grub Ekrane Alani Adi", +"The LDAP attribute to use to generate the groups's display name." => "Grubun görünen adını oluşturmak için kullanılacak LDAP niteliği.", "Base Group Tree" => "Temel Grup Ağacı", "One Group Base DN per line" => "Bir Grubu Tabani DN her dizgi. ", "Group Search Attributes" => "Kategorii Arama Grubu", @@ -66,11 +93,14 @@ $TRANSLATIONS = array( "User Home Folder Naming Rule" => "Kullanıcı Ana Dizini İsimlendirm Kuralı", "Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Kullanıcı adı bölümünü boş bırakın (varsayılan). ", "Internal Username" => "Dahili Kullanıcı Adı", +"By default the internal username will be created from the UUID attribute. It makes sure that the username is unique and characters do not need to be converted. The internal username has the restriction that only these characters are allowed: [ a-zA-Z0-9_.@- ]. Other characters are replaced with their ASCII correspondence or simply omitted. On collisions a number will be added/increased. The internal username is used to identify a user internally. It is also the default name for the user home folder. It is also a part of remote URLs, for instance for all *DAV services. With this setting, the default behavior can be overridden. To achieve a similar behavior as before ownCloud 5 enter the user display name attribute in the following field. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users." => "Öntanımlı olarak UUID niteliğinden dahili bir kullanıcı adı oluşturulacak. Bu, kullanıcı adının benzersiz ve karakterlerinin dönüştürme gereksinimini ortadan kaldırır. Dahili kullanıcı adı, sadece bu karakterlerin izin verildiği kısıtlamaya sahip: [ a-zA-Z0-9_.@- ]. Diğer karakterler ise ASCII karşılıkları ile yer değiştirilir veya basitçe yoksayılır. Çakışmalar olduğunda ise bir numara eklenir veya arttırılır. Dahili kullanıcı adı, bir kullanıcıyı dahili olarak tanımlamak için kullanılır. Ayrıca kullanıcı ev klasörü için öntanımlı bir isimdir. Bu ayrıca uzak adreslerin (örneğin tüm *DAV hizmetleri) bir parçasıdır. Bu yar ise, öntanımlı davranışın üzerine yazılabilir. ownCloud 5'ten önce benzer davranışı yapabilmek için aşağıdaki alana bir kullanıcı görünen adı niteliği girin. Öntanımlı davranış için boş bırakın. Değişiklikler, sadece yeni eşleştirilen (eklenen) LDAP kullanıcılarında etkili olacaktır.", "Internal Username Attribute:" => "Dahili Kullanıcı adı Özniteliği:", "Override UUID detection" => "UUID tespitinin üzerine yaz", +"By default, the UUID attribute is automatically detected. The UUID attribute is used to doubtlessly identify LDAP users and groups. Also, the internal username will be created based on the UUID, if not specified otherwise above. You can override the setting and pass an attribute of your choice. You must make sure that the attribute of your choice can be fetched for both users and groups and it is unique. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users and groups." => "Öntanımlı olarak, UUID niteliği otomatik olarak tespit edilmez. UUID niteliği LDAP kullanıcılarını ve gruplarını şüphesiz biçimde tanımlamak için kullanılır. Ayrıca yukarıda belirtilmemişse, bu UUID'ye bağlı olarak dahili bir kullanıcı adı oluşturulacaktır. Bu ayarın üzerine yazabilir ve istediğiniz bir nitelik belirtebilirsiniz. Ancak istediğiniz niteliğin benzersiz olduğundan ve hem kullanıcı hem de gruplar tarafından getirilebileceğinden emin olmalısınız. Öntanımlı davranış için boş bırakın. Değişiklikler sadece yeni eşleştirilen (eklenen) LDAP kullanıcı ve gruplarında etkili olacaktır.", "UUID Attribute for Users:" => "Kullanıcılar için UUID Özniteliği:", "UUID Attribute for Groups:" => "Gruplar için UUID Özniteliği:", "Username-LDAP User Mapping" => "Kullanıcı Adı-LDAP Kullanıcısı dönüşümü", +"Usernames are used to store and assign (meta) data. In order to precisely identify and recognize users, each LDAP user will have a internal username. This requires a mapping from username to LDAP user. The created username is mapped to the UUID of the LDAP user. Additionally the DN is cached as well to reduce LDAP interaction, but it is not used for identification. If the DN changes, the changes will be found. The internal username is used all over. Clearing the mappings will have leftovers everywhere. Clearing the mappings is not configuration sensitive, it affects all LDAP configurations! Never clear the mappings in a production environment, only in a testing or experimental stage." => "Kullanıcı adları, (üst) veri depolaması ve ataması için kullanılır. Kullanıcıları kesin olarak tanımlamak ve algılamak için, her LDAP kullanıcısı bir dahili kullanıcı adına sahip olacak. Bu kullanıcı adı ile LDAP kullanıcısı arasında bir eşleşme gerektirir. Oluşturulan kullanıcı adı LDAP kullanıcısının UUID'si ile eşleştirilir. Ek olarak LDAP etkileşimini azaltmak için DN de önbelleğe alınır ancak bu kimlik tanıma için kullanılmaz. Eğer DN değişirse, değişiklikler tespit edilir. Dahili kullanıcı her yerde kullanılır. Eşleştirmeleri temizlemek, her yerde kalıntılar bırakacaktır. Eşleştirmeleri temizlemek yapılandırmaya hassas bir şekilde bağlı değildir, tüm LDAP yapılandırmalarını etkiler! Üretim ortamında eşleştirmeleri asla temizlemeyin, sadece sınama veya deneysel aşamada kullanın.", "Clear Username-LDAP User Mapping" => "Kullanıcı Adı-LDAP Kullanıcısı Dönüşümünü Temizle", "Clear Groupname-LDAP Group Mapping" => "Grup Adı-LDAP Grubu Dönüşümü" ); |