Voici les classes du SL framework :
This PHP class aims at simplifying the developement of new plugin for Wordpress and especially if you do not know how to develop it.
Therefore, your plugin class should inherit from this class. Please refer to the HOW TO manual to learn more.
Voici les méthodes de la classe:
This PHP class enables the creation of tables in the admin backend
Voici les méthodes de la classe:
Méthodes | Détails |
---|---|
Méthodes | Détails |
adminTable[METHODE] Constructor of the class |
Paramètres : $nb_all_Items [optionnelle] (integer) the number of all items. If the number of submitted lines are less than this number, a navigation bar will be added at the top of the table (par défaut, sa valeur est : 0) $nb_max_per_page [optionnelle] (integer) the number of item per page. This parameter is useful if you have submitted the previous parameter. (par défaut, sa valeur est : 0) $order [optionnelle] (boolean) allow the ordering of the columns with small arrows (par défaut, sa valeur est : ) $search [optionnelle] (??) ?? (par défaut, sa valeur est : ) Valeur de retour : adminTable the table Exemple d'appel :
|
title[METHODE] Set the titles of the columns |
Paramètres : $array (array) it is an array of string which is of the size of the number of columns. Each string is the title for a different column Valeur de retour : void Exemple d'appel :
|
current_page[METHODE] Get the current page of the table. This is relevant if the number of your items is greater than the number of lines |
Paramètres : Pas de paramètre Valeur de retour : integer the page number Exemple d'appel :
|
set_nb_all_Items[METHODE] Set the number of items (all). |
Paramètres : $nb (??) ?? Valeur de retour : void Exemple d'appel :
|
current_filter[METHODE] Get the currentfilter of the table. |
Paramètres : Pas de paramètre Valeur de retour : string the filter Exemple d'appel :
|
current_ordercolumn[METHODE] Get the current column order of the table. |
Paramètres : Pas de paramètre Valeur de retour : integer the column number Exemple d'appel :
|
current_orderdir[METHODE] Get the current column direction of the table. |
Paramètres : Pas de paramètre Valeur de retour : string the column direction "ASC" or "DESC" Exemple d'appel :
|
removeFooter[METHODE] Remove the showed title at the footer of the table By default, titles of the columns are displayed at the top of the table and at its footer. |
Paramètres : Pas de paramètre Valeur de retour : void Exemple d'appel :
|
add_line[METHODE] Add a line in your table For instance
This code will display a table with a unique line |
Paramètres : $array (array) it is an array of adminCell object. The length of this array is the same size of the number of your columns $id (id) it is the id of this line. It is useful when you add an action on a cell Valeur de retour : void Exemple d'appel :
Voir aussi : |
flush[METHODE] Return the table HTML code. You just have to echo it |
Paramètres : Pas de paramètre Valeur de retour : string the HTML code of the table Exemple d'appel :
|
This PHP class create cells to be used with the adminTable::add_line method
Voici les méthodes de la classe:
This PHP class enables the creation of tabulation in the admin backend
Voici les méthodes de la classe:
Méthodes | Détails |
---|---|
Méthodes | Détails |
adminTabs[METHODE] Constructor of the class |
Paramètres : Pas de paramètre Valeur de retour : adminTabs the tabs Exemple d'appel :
|
add_tab[METHODE] Add a tabulation For instance,
will create to basic tabulation. |
Paramètres : $title (string) the title of the tabulation $content (string) the HTML content of the tab $image [optionnelle] (string) the path of an image that will be display before the title. Please indicate a 20x20px image. (par défaut, sa valeur est : ) Valeur de retour : void Exemple d'appel :
|
activate[METHODE] Change the tabs activated by default (normally it is the first tab i.e. 1) 1 is the first, 2 is the second, etc. |
Paramètres : $nb (integer) the tabultaion index to activate Valeur de retour : void Exemple d'appel :
|
flush[METHODE] Print the tabulation HTML code. |
Paramètres : Pas de paramètre Valeur de retour : void Exemple d'appel :
|
This PHP class enables the creation of a box in the admin backend
Voici les méthodes de la classe:
Méthodes | Détails |
---|---|
Méthodes | Détails |
boxAdmin[METHODE] Constructor of the class |
Paramètres : $title (string) the title of the box $content (string) the HTML code of the content of the box Valeur de retour : boxAdmin the box object Exemple d'appel :
|
flush[METHODE] Print the box HTML code. |
Paramètres : Pas de paramètre Valeur de retour : void Exemple d'appel :
|
This PHP class enables the Browser and OS detection
Voici les méthodes de la classe:
Méthodes | Détails |
---|---|
Méthodes | Détails |
browsersOsDetection[METHODE] Constructor of the class |
Paramètres : $agent (??) ?? Valeur de retour : browsersOsDetection Exemple d'appel :
|
getBrowserName[METHODE] Get the browser name |
Paramètres : Pas de paramètre Valeur de retour : string The browser name Exemple d'appel :
|
getBrowserVersion[METHODE] Get the browser version |
Paramètres : Pas de paramètre Valeur de retour : string The browser version Exemple d'appel :
|
getPlatformName[METHODE] Get the platform name |
Paramètres : Pas de paramètre Valeur de retour : string The platform name Exemple d'appel :
|
getPlatformVersion[METHODE] Get the platform version |
Paramètres : Pas de paramètre Valeur de retour : string The platform version Exemple d'appel :
|
This PHP class creates an export of the database
Voici les méthodes de la classe:
Méthodes | Détails |
---|---|
Méthodes | Détails |
progress[METHODE] Return the progression ratio |
Paramètres : $file (string) the sql file that is being created Valeur de retour : string the progress nb_table_extracted/nb_table Exemple d'appel :
|
reset[METHODE] Reset the process |
Paramètres : $path (string) the path in which the database sql file should be created Valeur de retour : void Exemple d'appel :
|
createSQL[METHODE] Create the sql file |
Paramètres : $sqlfilename (string) the path of the sql file to create $maxExecutionTime [optionnelle] (integer) the maximum execution time (in second) (par défaut, sa valeur est : 20) $maxAllocatedMemory [optionnelle] (integer) the maximum memory allocated by the process (in bytes) (par défaut, sa valeur est : 4000000) Valeur de retour : array with the name of the file (or 'finished' => false and if an error occured see 'error' for the error message) Exemple d'appel :
|
This PHP class allow to log debug information regarding the execution of plugins
For instance :
SL_Debug::log(get_class(), "An error occurred!", $error_level);
the error_level may be 1=critical ; 2=error ; 3=warning ; 4=information ; 5=verbose.
Voici les méthodes de la classe:
Méthodes | Détails |
---|---|
Méthodes | Détails |
get_log_path[METHODE] Get log file |
Paramètres : Pas de paramètre Valeur de retour : string the path of the log file Exemple d'appel :
|
log[METHODE] Log function |
Paramètres : $where (string) the name of the plugin which call the log function $text (string) the text to be logged $error_level [optionnelle] (integer) 1=critical ; 2=error ; 3=warning ; 4=information ; 5=verbose (par défaut, sa valeur est : 5) Valeur de retour : void Exemple d'appel :
|
This PHP class enables the creation of a box in the admin backend
Voici les méthodes de la classe:
Méthodes | Détails |
---|---|
Méthodes | Détails |
This PHP class enables the translation of the plugin using the framework
Voici les méthodes de la classe:
Méthodes | Détails |
---|---|
Méthodes | Détails |
feedbackSL[METHODE] Constructor of the class |
Paramètres : $plugin (string) the name of the plugin (probably <code>str_replace("/","",str_replace(basename(__FILE__),"",plugin_basename( __FILE__)))</code>) $pluginID (string) the pluginID of the plugin (probably <code>$this->pluginID</code>) Valeur de retour : feedbackSL the feedbackSL object Exemple d'appel :
|
enable_feedback[METHODE] Display the feedback form Please note that the users will send you their comments/feedback at the email used is in the header of the main file of your plugin |
Paramètres : Pas de paramètre Valeur de retour : void Exemple d'appel :
|
This PHP class allows to compare two folder to find differences
Voici les méthodes de la classe:
Méthodes | Détails |
---|---|
Méthodes | Détails |
diff[METHODE] Compute differences between the two folders |
Paramètres : $path1 (string) the path of the first folder $path2 (string) the path of the second folder $racine [optionnelle] (boolean) true if it the the first level (par défaut, sa valeur est : 1) Valeur de retour : void Exemple d'appel :
|
render[METHODE] Display the difference |
Paramètres : $closeNotModifiedFolders [optionnelle] (boolean) close folders if their contents have not been modified (par défaut, sa valeur est : 1) $withTick [optionnelle] (boolean) display ticks (par défaut, sa valeur est : ) $withRandom [optionnelle] (boolean) set to true if there are a plurality of rendering (par défaut, sa valeur est : ) Valeur de retour : string the random number that should be used to know which button has been clicked Exemple d'appel :
|
This PHP class create a page with the other plugins of the author referenced
Voici les méthodes de la classe:
Méthodes | Détails |
---|---|
Méthodes | Détails |
otherPlugins[METHODE] Constructor of the class |
Paramètres : $nameAuthor [optionnelle] (string) the name of the author for which the plugins has to be listed (par défaut, sa valeur est : ) $exclu [optionnelle] (array) a list of excluded plugin (slug name) (par défaut, sa valeur est : []) Valeur de retour : void Exemple d'appel :
|
list_plugins[METHODE] Display the list of plugins |
Paramètres : Pas de paramètre Valeur de retour : void Exemple d'appel :
|
get_list_plugins[METHODE] Get the list of plugins and save it on the disk |
Paramètres : Pas de paramètre Valeur de retour : void Exemple d'appel :
|
pluginInfo[METHODE] Display the plugin Info |
Paramètres : $plugin (string) the name of the plugin (slug name) Valeur de retour : array the first cell is for the synthesis, the second is for the description and the screenshot Exemple d'appel :
|
This PHP class enable the creation of form to manage the parameter of your plugin
Voici les méthodes de la classe:
flush
)Méthodes | Détails |
---|---|
Méthodes | Détails |
parametersSedLex[METHODE] Constructor of the object |
Paramètres : $obj (class) a reference to the object containing the parameter (usually, you need to provide "$this"). If it is "new rootSLframework()", it means that it is the framework parameters. $tab [optionnelle] (string) if you want to activate a tabulation after the submission of the form (par défaut, sa valeur est : ) Valeur de retour : parametersSedLex the form class to manage parameter/options of your plugin Exemple d'appel :
Voir aussi : |
add_title[METHODE] Add title in the form |
Paramètres : $title (string) the title to add Valeur de retour : void Exemple d'appel :
|
add_comment[METHODE] Add a comment in the form |
Paramètres : $comment (string) the comment to add Valeur de retour : void Exemple d'appel :
|
add_comment_default_value[METHODE] Add a comment in the form which display the default value of the param |
Paramètres : $param (??) ?? Valeur de retour : void Exemple d'appel :
|
add_param[METHODE] Add a textarea, input, checkbox, etc. in the form to enable the modification of parameter of the plugin Please note that the default value of the parameter (defined in the |
Paramètres : $param (string) the name of the parameter/option as defined in your plugin and especially in the <code>get_default_option</code> of your plugin $name (string) the displayed name of the parameter in the form $forbid [optionnelle] (string) regexp which will delete some characters in the submitted string (only a warning is raised) : For instance <code>$forbid = "/[^a-zA-Z0-9]/"</code> will remove all the non alphanumeric value (par défaut, sa valeur est : ) $allow [optionnelle] (string) regexp which will verify that the submitted string will respect this rexexp, if not, the submitted value is not saved and an erreor is raised : For instance, <code>$allow = "/^[a-zA-Z]/"</code> require that the submitted string begin with a nalpha character (par défaut, sa valeur est : ) $related [optionnelle] (array) a list of the other params that will be actived/deactivated when this parameter is set to true/false (thus, this param should be a boolean) (par défaut, sa valeur est : []) Valeur de retour : void Exemple d'appel :
|
get_new_value[METHODE] Get the new value of the parameter after its update (with happen upon calling |
Paramètres : $param (string) the name of the parameter/option as defined in your plugin and especially in the <code>get_default_option</code> of your plugin Valeur de retour : mixed the value of the param (array if there is an error or null if there is no new value) Exemple d'appel :
|
remove_param[METHODE] Remove a parameter of the plugin which has been previously added through add_param (then it can be useful if you want to update a parameter without printing the form) It will also remove any comment for the same |
Paramètres : $param (string) the name of the parameter/option as defined in your plugin and especially in the <code>get_default_option</code> of your plugin Valeur de retour : void Exemple d'appel :
|
flush[METHODE] Print the form with parameters |
Paramètres : Pas de paramètre Valeur de retour : void Exemple d'appel :
|
This PHP class enables the generation of the documentation of the PHP files used for the framework
Please note that the methods of this class is not supposed to be called from your plugin. Thus, its methods are not displayed here.
Voici les méthodes de la classe:
Méthodes | Détails |
---|---|
Méthodes | Détails |
This PHP class create a page with the other plugins of the author listed
Voici les méthodes de la classe:
Méthodes | Détails |
---|---|
Méthodes | Détails |
popupAdmin[METHODE] Constructor of the class |
Paramètres : $title (string) the title which will be displayed in the top of the popup $content (string) the content of the popup $css [optionnelle] (string) the css of the popup if needed. (par défaut, sa valeur est : ) $callback [optionnelle] (??) ?? (par défaut, sa valeur est : ) Valeur de retour : void Exemple d'appel :
|
render[METHODE] Display the popup |
Paramètres : Pas de paramètre Valeur de retour : void Exemple d'appel :
|
This PHP class enables the creation of a progress bar
Voici les méthodes de la classe:
Méthodes | Détails |
---|---|
Méthodes | Détails |
progressBarAdmin[METHODE] Constructor of the class |
Paramètres : $length [optionnelle] (integer) the width in pixel of the progress bar (par défaut, sa valeur est : 300) $height [optionnelle] (integer) the height in pixel of the progress bar (par défaut, sa valeur est : 20) $start [optionnelle] (integer) the % of the start (progression) (par défaut, sa valeur est : 0) $insideText [optionnelle] (string) the text to put in the progress bar (par défaut, sa valeur est : ) $id [optionnelle] (string) the identifieur if there is a pluralitu of progress bar (the image which moves is named $id."_image", the text is named $id."_txt") (par défaut, sa valeur est : progressbar) Valeur de retour : boxAdmin the box object Exemple d'appel :
|
flush[METHODE] Print the progress bar code Once the progress bar is displayed, you may modify the progression by calling in javascript Once the progress bar is displayed, you may modify the text by calling in javascript |
Paramètres : Pas de paramètre Valeur de retour : void Exemple d'appel :
|
This PHP class enables the translation of the plugin using the framework
Voici les méthodes de la classe:
Méthodes | Détails |
---|---|
Méthodes | Détails |
translationSL[METHODE] Constructor of the class |
Paramètres : $domain (string) the name of the domain (probably <code>$this->pluginID</code>) $plugin (string) the name of the plugin (probably <code>str_replace("/","",str_replace(basename(__FILE__),"",plugin_basename( __FILE__)))</code>) Valeur de retour : translationSL the translationSL object Exemple d'appel :
|
enable_translation[METHODE] Enable the translation and display the management interface Please note that the translators will be able to send you their translation so that you can add them to your repository (the email used is in the header of the main file of your plugin |
Paramètres : Pas de paramètre Valeur de retour : void Exemple d'appel :
|
set_locale[METHODE] Set the language ... according to the configuration |
Paramètres : $loc (??) ?? Valeur de retour : void Exemple d'appel :
|
This PHP class allows to determine which part of a text has been removed and added
Voici les méthodes de la classe:
Méthodes | Détails |
---|---|
Méthodes | Détails |
diff[METHODE] Identify the added part |
Paramètres : $text1 (string) the reference text $text2 (string) the text to compare with Valeur de retour : void Exemple d'appel :
|
This PHP class allows to display hierachical list in a smart way
Voici les méthodes de la classe:
Méthodes | Détails |
---|---|
Méthodes | Détails |
render[METHODE] Display the tree list according to the array given For instance :
if the array have 1 elements i.e. array('title element') the first element is the title (no children) if the array have 2 elements i.e. array('title element', "E45AF"), the second element will be considered as the id of the array if the array have 3 elements i.e. array('title element', "E45AF", null) the third element is the children (array or null) if the array have 4 elements i.e. array('title element', "E45AF", null, false), the fourth element will be considered as an indication whether the node is to be expanded or not (by default it is true) |
Paramètres : $array (array) list to display, each item of the list is an array : array('title', null) if the node is the last one in the tree or array(title, array(...)) if there is other son nodes. $reduce_develop [optionnelle] (boolean) to enable the reduction and the expansion of the tree with javascript (par défaut, sa valeur est : ) $reorder_callback (string) if you want to make the tree (nested list) sortable, please indicate what is the ajax callback function to be called upon sort. This function will receive the array in the $_POST['result'] variable. This function should return "OK". Otherwise, the return message will be 'alerted' $classPerso [optionnelle] (string) a CSS custom class to customize the apparence of the tree (par défaut, sa valeur est : ) Valeur de retour : void Exemple d'appel :
|
This PHP class enables the svn management of the plugin with the wordpress.org repository
Voici les méthodes de la classe:
Méthodes | Détails |
---|---|
Méthodes | Détails |
svnAdmin[METHODE] Constructor of the class |
Paramètres : $host (string) the host of the svn repository (for instance svn.wp-plugins.org) $port [optionnelle] (interger) the port of the webdav repository (par défaut, sa valeur est : 80) $login [optionnelle] (string) your login (par défaut, sa valeur est : ) $mdp [optionnelle] (string) your password (par défaut, sa valeur est : ) Valeur de retour : svnAdmin the box object Exemple d'appel :
|
listFilesInRepository[METHODE] List the files and folder on the repository |
Paramètres : $base (string) the relative path of the folder to be looked into (from the repository) $rec [optionnelle] (boolean) true if the listing should be reccursive (useful if you want the list of an entire repository with sub-folders) (par défaut, sa valeur est : 1) $credentials [optionnelle] (boolean) true if the repository requires credentials to list files (par défaut, sa valeur est : ) Valeur de retour : array 'isOk' => whether the request is successful, 'list' => the list of files and folders, 'raw_result' the request and the respond in an array (useful for debugging purpose) Exemple d'appel :
|
getActivityFolder[METHODE] Get the activity collection folder (required to put/delete file in the repo) |
Paramètres : $base (string) the relative path of the folder (for instance /yourplugin/trunk/) $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : ) Valeur de retour : array 'isOk' => whether the request is successful, 'activity_folder' => the activity folder, 'raw_result' the request and the respond in an array (useful for debugging purpose) Exemple d'appel :
|
getVCC[METHODE] Get VCC (Version Controlled Resource) |
Paramètres : $base (string) the relative path of the folder (for instance /yourplugin/trunk/) $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : ) Valeur de retour : array 'isOk' => whether the request is successful, 'vcc' => the version controlled folder, 'raw_result' the request and the respond in an array (useful for debugging purpose) Exemple d'appel :
|
getRevision[METHODE] Get Repository Revision |
Paramètres : $base (string) the relative path of the folder (for instance /yourplugin/trunk/) $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : ) Valeur de retour : array 'isOk' => whether the request is successful, 'revision' => the revision number, 'raw_result' the request and the respond in an array (useful for debugging purpose) Exemple d'appel :
|
createActivity[METHODE] Create an activity |
Paramètres : $activity_n_uuid (string) it is the activity folder concatenated with an random UUID (composed with hexadecimal digit xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : ) Valeur de retour : array 'isOk' => whether the request is successful, 'raw_result' the request and the respond in an array (useful for debugging purpose) Exemple d'appel :
Voir aussi : |
getCommitCommentURL[METHODE] Get the commit comment URL |
Paramètres : $vcc (string) the VCC of the repository $activity_n_uuid (string) it is the activity folder concatenated with the random UUID (composed with hexadecimal digit xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : ) Valeur de retour : array 'isOk' => whether the request is successful, 'url' the comment url, 'raw_result' the request and the respond in an array (useful for debugging purpose) Exemple d'appel :
Voir aussi : |
setCommitComment[METHODE] Set a commit comment |
Paramètres : $comment (string) the comment to be added $comment_url (string) the comment url $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : ) Valeur de retour : array 'isOk' => whether the request is successful,'raw_result' the request and the respond in an array (useful for debugging purpose) Exemple d'appel :
Voir aussi : |
getVersionFolder[METHODE] Get the version folder |
Paramètres : $base (string) the relative path of the folder (for instance /yourplugin/trunk/) $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : ) Valeur de retour : array 'isOk' => whether the request is successful, 'version_folder' => the version folder,'raw_result' the request and the respond in an array (useful for debugging purpose) Exemple d'appel :
|
getPutFolder[METHODE] Get the folder to put files or delete files |
Paramètres : $version (string) the version folder $activity_n_uuid (string) it is the activity folder concatenated with the random UUID (composed with hexadecimal digit xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : ) Valeur de retour : array 'isOk' => whether the request is successful, 'put_folder' the put url, 'raw_result' the request and the respond in an array (useful for debugging purpose) Exemple d'appel :
Voir aussi : |
putFile[METHODE] Put a file in the repo |
Paramètres : $put_folder_n_file (string) the put folder concatenated with the file name $file (string) the complete url of the file on your disk $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : ) Valeur de retour : array 'isOk' => whether the request is successful, 'svn_header' the svn header sent (useful for debugging), 'raw_result' the request and the respond in an array (useful for debugging purpose) Exemple d'appel :
Voir aussi : |
putFolder[METHODE] Put folder in the repository |
Paramètres : $put_folder_n_folder (string) the put folder concatenated with the folder to add $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : 1) Valeur de retour : array 'isOk' => whether the request is successful,'raw_result' the request and the respond in an array (useful for debugging purpose) Exemple d'appel :
Voir aussi : |
deleteFileFolder[METHODE] Put folder in the repository |
Paramètres : $put_folder_n_filefolder (string) the put folder concatenated with the folder/file to add $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : 1) Valeur de retour : array 'isOk' => whether the request is successful,'raw_result' the request and the respond in an array (useful for debugging purpose) Exemple d'appel :
Voir aussi : |
merge[METHODE] Merge the commit ... thus all the change will be taken in account |
Paramètres : $base (string) the relative path of the folder (for instance /yourplugin/trunk/) $activity_n_uuid (string) it is the activity folder concatenated with the random UUID (composed with hexadecimal digit xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : ) Valeur de retour : array 'isOk' => whether the request is successful, 'commit_info' the commit information, 'raw_result' the request and the respond in an array (useful for debugging purpose) Exemple d'appel :
Voir aussi : |
getFile[METHODE] Get a single file of the repository |
Paramètres : $base_file (string) the relative path of the file to get (for instance /yourplugin/trunk/file1.txt) $store (string) the local path to store the file retrieved (for instance /home/foo/yourplugin/file1.txt) $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : 1) Valeur de retour : array 'isOk' => whether the request is successful, 'siez' the size in bytes of the retrieved file Exemple d'appel :
|
getAllFiles[METHODE] Get all files of the repository |
Paramètres : $base (string) the relative path of the folder (for instance /yourplugin/trunk/) $vcc (string) the VCC $rev (string) the revision number $store (string) the local path to store the file retrieved (for instance /home/foo/yourplugin/) $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : 1) Valeur de retour : array 'isOk' => whether the request is successful, 'info' the list of retrieved files/folder, 'raw_result' the request and the respond in an array (useful for debugging purpose) Exemple d'appel :
Voir aussi : |
prepareCommit[METHODE] Prepare the commit |
Paramètres : $base (string) the relative path of the folder (for instance /yourplugin/trunk/) $comment (string) the comment for the commit $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : ) Valeur de retour : array 'isOk' => whether the request is successful, 'step' indicated the step which fails, 'putFolder' the put folder , 'activityFolder' the acivity folder, 'uuid' the random uuid used for this commit, 'raw_result' the request and the respond in an array (useful for debugging purpose) Exemple d'appel :
|
sendSVNRequest[METHODE] Send a SVN request |
Paramètres : $host (string) the host (for instance svn.wp-plugins.org) $relative_uri (string) the base url (for instance /yourplugin/trunk/) $type (string) the type of request (e.g. GET, PROPFIND, PROPPATCH, etc.) $content (string) the content of the http request $additional_headers [optionnelle] (array) if addiotionnal header are required (for instance array('Content-Type: text/plain')) (par défaut, sa valeur est : []) $credentials [optionnelle] (boolean) true if the repository requires credentials (par défaut, sa valeur est : ) Valeur de retour : array the response and the content sent Exemple d'appel :
|
This PHP class regroups a few useful method to manage directory, string, ...
Voici les méthodes de la classe:
Méthodes | Détails |
---|---|
Méthodes | Détails |
convertUTF8[METHODE] To convert into UTF8 |
Paramètres : $content (string) the string to convert into UTF8 Valeur de retour : string the converted string Exemple d'appel :
|
dirSize[METHODE] Compute the size of a directory (reccursively or not) |
Paramètres : $path (string) the path of the directory to scan $recursive [optionnelle] (boolean) set to FALSE if you do NOT want to reccurse in the folder of the directory (par défaut, sa valeur est : 1) Valeur de retour : integer the size of the directory Exemple d'appel :
|
is_really_int[METHODE] Test if the argument is really an integer (even if string) For instance :
|
Paramètres : $int (mixed) the integer, float, string, ... to check Valeur de retour : boolean TRUE if it is an integer, FALSE otherwise Exemple d'appel :
|
rand_str[METHODE] Randomize a string For instance, |
Paramètres : $length (integer) the length of the randomized result string $chars (string) the available characters for the randomized result string Valeur de retour : string the randomized result string Exemple d'appel :
|
create_identifier[METHODE] Create an simple identifier from a given string. It removes all non alphanumeric characters and strip spaces For instance :
|
Paramètres : $text (string) the text to be sanitized Valeur de retour : string the sanitized string (identifier) Exemple d'appel :
|
byteSize[METHODE] Convert an integer into a string which represent a size in a computer format (ie. MB, KB, GB, etc.) |
Paramètres : $bytes (integer) the number to convert into a byte-format (ie. MB, KB, GB, etc.) Valeur de retour : string the size with a byte-format at the end (ie. MB, KB, GB, etc.) Exemple d'appel :
|
multicolumn_sort[METHODE] Sort a table against the n-th column |
Paramètres : $data (array) the table (i.e. array of array) to be sorted $num (integer) the n-th column to be considered in order to sort the table $asc [optionnelle] (boolean) the order will be ascendant if true and descendant otherwise (par défaut, sa valeur est : 1) Valeur de retour : array the sorted table Exemple d'appel :
|
copy_rec[METHODE] Copy a file or a directory (recursively) |
Paramètres : $source (string) the source directory $destination (string) the destination directory Valeur de retour : void Exemple d'appel :
|
rm_rec[METHODE] Delete a file or a directory (recursively) |
Paramètres : $path (string) the path to delete Valeur de retour : boolean true if the dir or file does not exists at the end of the rm process Exemple d'appel :
|
md5_rec[METHODE] Compute the md5 of a file or a directory (recursively) |
Paramètres : $path (string) the path to compute hash $exclu [optionnelle] (array) a list of filename/folder to exclude from the hash (par défaut, sa valeur est : []) Valeur de retour : string md5 hash Exemple d'appel :
|
is_writable[METHODE] Check if a folder or a file is writable |
Paramètres : $path (string) the path to the folder or the file Valeur de retour : boolean true if the folder or the file is writable Exemple d'appel :
|
is_readable[METHODE] Check if a folder or a file is readable |
Paramètres : $path (string) the path to the folder or the file Valeur de retour : boolean true if the folder or the file is writable Exemple d'appel :
|
This PHP class creates zip file (multipart if needed)
It requires the gzcompress function. Otherwise, a fatal error will be raised
For instance :
$z = new SL_Zip;
$z -> addFile("/www/test/File.txt","/www/test/","/newroot/");
$z -> addDir("/www/test/Folder","/www/test/","/newroot/") ;
$z -> createZip("/pathToZip/backup.zip",1048576);
Voici les méthodes de la classe:
Méthodes | Détails |
---|---|
Méthodes | Détails |
progress[METHODE] Return the progression ratio |
Paramètres : $file (??) ?? Valeur de retour : string the progress nb_file_included/nb_file Exemple d'appel :
|
addFile[METHODE] Add files to the archive |
Paramètres : $filename (string) the path of the file to add $remove [optionnelle] (string) the part of the path to remove (par défaut, sa valeur est : ) $add [optionnelle] (string) the part of the path to add (par défaut, sa valeur est : ) Valeur de retour : void Exemple d'appel :
|
addDir[METHODE] Add directory to the archive (reccursively) |
Paramètres : $dirname (string) the path of the folder to add $remove [optionnelle] (string) the part of the path to remove (par défaut, sa valeur est : ) $add [optionnelle] (string) the part of the path to add (par défaut, sa valeur est : ) $exclu [optionnelle] (array) a list of folder that are no to be included in the zip file (par défaut, sa valeur est : []) Valeur de retour : void Exemple d'appel :
|
reset[METHODE] reset the zip process |
Paramètres : $path (??) ?? Valeur de retour : void Exemple d'appel :
|
is_inProgress[METHODE] Tells whether a zip file is being created or not |
Paramètres : $path (??) ?? Valeur de retour : array the 'step' could be 'in progress' (a process is still running), 'nothing' (no zip is being zipped) or 'to be completed' (and the 'name_zip' will be the name of the zip file being zipped) or 'error' (and the 'error' will display the error messgae) Exemple d'appel :
|
createZip[METHODE] Create the archive and split it if necessary |
Paramètres : $splitfilename (string) the path of the zip file to create $chunk_size [optionnelle] (integer) the maximum size of the archive (par défaut, sa valeur est : 1.0E+15) $maxExecutionTime [optionnelle] (integer) the maximum execution time in second (if this time is exceeded, the function will return false. You just have to relaunch this function to complete the zip from where it has stopped) (par défaut, sa valeur est : 150) $maxAllocatedMemory [optionnelle] (??) ?? (par défaut, sa valeur est : 4000000) Valeur de retour : array with the name of the file (or 'finished' => false if an error occured see 'error' for the error message) Exemple d'appel :
|