Changeset 110765 in spip-zone
- Timestamp:
- Jun 20, 2018, 8:59:04 AM (3 years ago)
- Location:
- _outils_/spip-cli/trunk
- Files:
-
- 11 added
- 22 edited
- 2 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
_outils_/spip-cli/trunk/bin/spip
r110764 r110765 1 1 #!/usr/bin/env php 2 2 <?php 3 // spip4 3 5 $dossier_cli = dirname(__FILE__); 6 7 include_once "$dossier_cli/vendor/autoload.php"; 8 use Symfony\Component\Console\Application; 9 if( ! ini_get('date.timezone') ) { date_default_timezone_set('GMT'); } 10 11 /** 12 * Trouver toutes les sous-classes qui étendent une classe donnée 13 * 14 * @param string $parent 15 * Nom de la classe dont on veut chercher les extensions. 16 * @return array 17 * Retourne un tableau de chaînes contenant chacune le nom d'une classe. 18 */ 19 function getSubclassesOf($parent) { 20 $result = array(); 21 foreach (get_declared_classes() as $class) { 22 if (is_subclass_of($class, $parent)) { 23 $result[] = $class; 24 } 25 } 26 return $result; 4 if (file_exists(__DIR__ . '/../vendor/autoload.php')) { 5 require_once __DIR__ . '/../vendor/autoload.php'; 6 } elseif (file_exists(__DIR__ . '/../../../autoload.php')) { 7 require_once __DIR__ . '/../../../autoload.php'; 8 } else { 9 throw new \Exception("Can't find autoloader. Need Composer install ?"); 27 10 } 28 11 29 /** 30 * Transforme un chemin avec les bons séparateurs de dossiers 31 * 32 * Si on est sur un OS qui n'utilise pas des / comme séparateur de 33 * dossier dans les chemins, on remplace les / par le bon 34 * séparateur. 35 * 36 * @param string $path 37 * Un chemin au format UNIX. 38 * @return string 39 * Retourne le même chemin au format approprié à 40 * l'environnement dans lequel on se trouve. 41 */ 42 function prep_path($path) { 43 if (DIRECTORY_SEPARATOR !== '/') { 44 return str_replace('/', DIRECTORY_SEPARATOR, $path); 45 } else { 46 return $path; 47 } 48 } 12 use Spip\Cli\Application; 49 13 50 /** 51 * Cherche la racine d'un site SPIP 52 * 53 * Retourne le chemin absolu vers la racine du site SPIP dans 54 * lequel se trouve le répertoire courant. Retourne FALSE si l'on 55 * est pas dans l'arborescence d'un site SPIP. 56 * 57 * @return string|bool 58 * Retourne le chemin vers la racine du SPIP dans lequel on se trouve. 59 * Retourne false si on n'est pas dans l'arborescence d'une installation SPIP. 60 */ 61 function spip_chercher_racine() { 62 $cwd = getcwd(); 14 #ini_set('display_errors', 'On'); 63 15 64 while ($cwd) { 65 if (file_exists(prep_path("$cwd/ecrire/inc_version.php"))) { 66 return $cwd; 67 } else { 68 /* On remonte d'un dossier dans l'arborescence */ 69 $cwd_array = explode(DIRECTORY_SEPARATOR, $cwd); 70 array_pop($cwd_array); 71 $cwd = implode(DIRECTORY_SEPARATOR, $cwd_array); 72 } 73 } 74 75 return false; 76 } 77 78 /** 79 * Lance le SPIP dans lequel on se trouve 80 * 81 * Inclut ecrire/inc_version.php, ce qui permet ensuite d'utiliser 82 * toutes les fonctions de SPIP comme lors du chargement d'une 83 * page. 84 * 85 * @param string $spip_racine 86 * Le chemin vers la racine du SPIP que l'on veut charger. 87 * @return bool 88 * Retourne true si on a pu charger SPIP correctement, false sinon. 89 */ 90 function spip_charger($spip_racine) { 91 // On liste toutes les globales déclarées au démarrage de SPIP (55 !!) 92 global 93 $nombre_de_logs, 94 $taille_des_logs, 95 $table_prefix, 96 $cookie_prefix, 97 $dossier_squelettes, 98 $filtrer_javascript, 99 $type_urls, 100 $debut_date_publication, 101 $ip, 102 $mysql_rappel_connexion, 103 $mysql_rappel_nom_base, 104 $test_i18n, 105 $ignore_auth_http, 106 $ignore_remote_user, 107 $derniere_modif_invalide, 108 $quota_cache, 109 $home_server, 110 $help_server, 111 $url_glossaire_externe, 112 $tex_server, 113 $traiter_math, 114 $xhtml, 115 $xml_indent, 116 $source_vignettes, 117 $formats_logos, 118 $controler_dates_rss, 119 $spip_pipeline, 120 $spip_matrice, 121 $plugins, 122 $surcharges, 123 $exceptions_des_tables, 124 $tables_principales, 125 $table_des_tables, 126 $tables_auxiliaires, 127 $table_primary, 128 $table_date, 129 $table_titre, 130 $tables_jointures, 131 $liste_des_statuts, 132 $liste_des_etats, 133 $liste_des_authentifications, 134 $spip_version_branche, 135 $spip_version_code, 136 $spip_version_base, 137 $spip_sql_version, 138 $spip_version_affichee, 139 $visiteur_session, 140 $auteur_session, 141 $connect_statut, 142 $connect_toutes_rubriques, 143 $hash_recherche, 144 $hash_recherche_strict, 145 $ldap_present, 146 $meta, 147 $connect_id_rubrique, 148 $puce; 149 150 // Pour que les include dans les fichiers php de SPIP fonctionnent correctement, 151 // il faut être à la racine du site. 152 // On change de répertoire courant le temps de charger tout ça. 153 $cwd = getcwd(); 154 chdir($spip_racine); 155 156 // Si jamais la base n'est pas installé on anhile la redirection et on affirme qu'on est sur la page d'installation 157 if (!is_file('config/connect.php')) { 158 $_GET['exec'] = 'install'; 159 define('_FILE_CONNECT', 'config/connect.tmp.php'); 160 } 161 162 // TIMEOUT de 24h… 163 define('_UPGRADE_TIME_OUT', 24*3600); 164 165 // On charge la machinerie de SPIP 166 include_once prep_path("$spip_racine/ecrire/inc_version.php"); 167 168 // On revient dans le répertoire dans lequel la commande a été appelée 169 chdir($cwd); 170 171 // Si _ECRIRE_INC_VERSION existe, inc_version.php a été chargé correctement 172 if (_ECRIRE_INC_VERSION) { 173 // Charge l'API SQL, pour être sûr de l'avoir déjà 174 include_spip('base/abstract_sql'); 175 // Tout s'est bien passé 176 return TRUE; 177 } else { 178 // Mauvais chargement 179 return FALSE; 180 } 181 } 182 183 // Création de la ligne de commande 184 $spip = new Application('Ligne de commande pour SPIP', '0.2.3'); 185 186 // Inclusion des fichiers contenant les commandes de base 187 foreach (glob("$dossier_cli/spip-cli/*.php") as $commande_fichier) { 188 include_once $commande_fichier; 189 } 190 191 if (($spip_racine = spip_chercher_racine()) and spip_charger($spip_racine)) { 192 $spip_loaded = TRUE; 193 194 // charger toutes les commandes qui se trouvent dans le path de SPIP. 195 $cwd = getcwd(); 196 chdir($spip_racine); 197 $commandes = find_all_in_path('spip-cli/', '.*[.]php$'); 198 foreach ($commandes as $commande_fichier) { 199 include_once $commande_fichier; 200 } 201 chdir($cwd); 202 } else { 203 $spip_loaded = FALSE; 204 } 205 206 // Ajouter automatiquement toutes les commandes trouvées (= un objet de chaque classe Command) 207 if ($commandes = getSubclassesOf('Symfony\Component\Console\Command\Command')){ 208 foreach ($commandes as $class){ 209 $spip->add(new $class); 210 } 211 } 212 213 // Lancement de l'application 214 $spip->run(); 215 16 $app = new Application(); 17 $app->run(); -
_outils_/spip-cli/trunk/bin/spip_console_autocomplete
r110764 r110765 1 1 #!/bin/sh 2 #3 # Source :4 # https://github.com/jaytaph/SFConsole/blob/master/console_completion.sh5 2 # 6 3 # Symfony2 App/Console autocompletion (commands and arguments only) 7 4 # Copyright (c) 2014, Joshua Thijssen 8 5 # All rights reserved. 9 # 6 # 10 7 # Redistribution and use in source and binary forms, with or without modification, 11 8 # are permitted provided that the following conditions are met: 12 # 9 # 13 10 # * Redistributions of source code must retain the above copyright notice, this 14 11 # list of conditions and the following disclaimer. 15 # 12 # 16 13 # * Redistributions in binary form must reproduce the above copyright notice, this 17 14 # list of conditions and the following disclaimer in the documentation and/or 18 15 # other materials provided with the distribution. 19 # 16 # 20 17 # * Neither the name of the {organization} nor the names of its 21 18 # contributors may be used to endorse or promote products derived from 22 19 # this software without specific prior written permission. 23 # 20 # 24 21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 25 22 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED … … 33 30 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 31 # 35 # 32 # 36 33 # Usable for both bash and zsh (probably) 37 34 # … … 52 49 fi 53 50 54 _complete_s f2_app_console() {51 _complete_spip_app_console() { 55 52 local cur 56 53 … … 63 60 if [[ ${COMP_CWORD} == 1 ]] ; then 64 61 # No command found, return the list of available commands 65 cmds=` ${console} --no-ansi | sed -n -e '/^Available commands/,//p' | grep -n '^ ' | sed -e 's/^ \+//' | awk '{ print $2 }'` 62 #cmds=` ${console} --no-ansi | sed -n -e '/^Available commands/,//p' | grep -n '^ ' | sed -e 's/^ \+//' | awk '{ print $2 }'` 63 # seulement si la commande a une description, ce qui permet de ne pas présenter le nom d’une commande racine (ie: 'spip' si commande 'spip:sql:dump') 64 cmds=` ${console} --no-ansi | sed -n -e '/^Available commands/,//p' | grep -n '^ ' | sed -e 's/^ \+//' | awk '{ if ($3) { print $2} }'` 65 66 66 else 67 67 # Commands found, parse options 68 cmds=` ${console} ${COMP_WORDS[1]} --no-ansi --help | sed -n -e '/^Options/,/^$/p' | grep -n 68 cmds=` ${console} ${COMP_WORDS[1]} --no-ansi --help | sed -n -e '/^Options/,/^$/p' | grep -n '^ ' | sed -e 's/^ \+//' | awk '{ print $2 }'` 69 69 fi 70 70 … … 74 74 75 75 export COMP_WORDBREAKS="\ \"\\'><=;|&(" 76 complete -F _complete_sf2_app_console spip 77 76 complete -F _complete_spip_app_console spip -
_outils_/spip-cli/trunk/composer.json
r109657 r110765 1 1 { 2 2 "name": "spip/spip-cli", 3 "description" : "Command Line for SPIP", 4 "keywords" : ["spip","cli"], 3 5 "minimum-stability": "stable", 4 6 "require": { 5 7 "php": "^5.4|^7", 6 "symfony/console": "^2.8" 8 "symfony/console": "^2.8", 9 "symfony/finder": "^2.8", 10 "pimple/pimple" : "^3.2" 7 11 }, 8 12 "config": { … … 10 14 "php": "5.4.45" 11 15 } 12 } 16 }, 17 "autoload": { 18 "psr-4": {"Spip\\Cli\\": "src"} 19 }, 20 "bin": [ 21 "bin/spip", 22 "bin/spip_console_autocomplete" 23 ] 13 24 } -
_outils_/spip-cli/trunk/composer.lock
r109657 r110765 2 2 "_readme": [ 3 3 "This file locks the dependencies of your project to a known state", 4 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md# composer-lock-the-lock-file",4 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 5 "This file is @generated automatically" 6 6 ], 7 "content-hash": " a91ac1874d9da17b1d4a34c6c15e6f53",7 "content-hash": "fd4b6a8b34cc1d268719913a320e7576", 8 8 "packages": [ 9 { 10 "name": "pimple/pimple", 11 "version": "v3.2.3", 12 "source": { 13 "type": "git", 14 "url": "https://github.com/silexphp/Pimple.git", 15 "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32" 16 }, 17 "dist": { 18 "type": "zip", 19 "url": "https://api.github.com/repos/silexphp/Pimple/zipball/9e403941ef9d65d20cba7d54e29fe906db42cf32", 20 "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32", 21 "shasum": "" 22 }, 23 "require": { 24 "php": ">=5.3.0", 25 "psr/container": "^1.0" 26 }, 27 "require-dev": { 28 "symfony/phpunit-bridge": "^3.2" 29 }, 30 "type": "library", 31 "extra": { 32 "branch-alias": { 33 "dev-master": "3.2.x-dev" 34 } 35 }, 36 "autoload": { 37 "psr-0": { 38 "Pimple": "src/" 39 } 40 }, 41 "notification-url": "https://packagist.org/downloads/", 42 "license": [ 43 "MIT" 44 ], 45 "authors": [ 46 { 47 "name": "Fabien Potencier", 48 "email": "fabien@symfony.com" 49 } 50 ], 51 "description": "Pimple, a simple Dependency Injection Container", 52 "homepage": "http://pimple.sensiolabs.org", 53 "keywords": [ 54 "container", 55 "dependency injection" 56 ], 57 "time": "2018-01-21T07:42:36+00:00" 58 }, 59 { 60 "name": "psr/container", 61 "version": "1.0.0", 62 "source": { 63 "type": "git", 64 "url": "https://github.com/php-fig/container.git", 65 "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" 66 }, 67 "dist": { 68 "type": "zip", 69 "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", 70 "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", 71 "shasum": "" 72 }, 73 "require": { 74 "php": ">=5.3.0" 75 }, 76 "type": "library", 77 "extra": { 78 "branch-alias": { 79 "dev-master": "1.0.x-dev" 80 } 81 }, 82 "autoload": { 83 "psr-4": { 84 "Psr\\Container\\": "src/" 85 } 86 }, 87 "notification-url": "https://packagist.org/downloads/", 88 "license": [ 89 "MIT" 90 ], 91 "authors": [ 92 { 93 "name": "PHP-FIG", 94 "homepage": "http://www.php-fig.org/" 95 } 96 ], 97 "description": "Common Container Interface (PHP FIG PSR-11)", 98 "homepage": "https://github.com/php-fig/container", 99 "keywords": [ 100 "PSR-11", 101 "container", 102 "container-interface", 103 "container-interop", 104 "psr" 105 ], 106 "time": "2017-02-14T16:28:37+00:00" 107 }, 9 108 { 10 109 "name": "psr/log", … … 56 155 { 57 156 "name": "symfony/console", 58 "version": "v2.8. 36",157 "version": "v2.8.41", 59 158 "source": { 60 159 "type": "git", 61 160 "url": "https://github.com/symfony/console.git", 62 "reference": " a6ff8b2ffa4eb43046828b303af2e3fedadacc27"63 }, 64 "dist": { 65 "type": "zip", 66 "url": "https://api.github.com/repos/symfony/console/zipball/ a6ff8b2ffa4eb43046828b303af2e3fedadacc27",67 "reference": " a6ff8b2ffa4eb43046828b303af2e3fedadacc27",161 "reference": "e8e59b74ad1274714dad2748349b55e3e6e630c7" 162 }, 163 "dist": { 164 "type": "zip", 165 "url": "https://api.github.com/repos/symfony/console/zipball/e8e59b74ad1274714dad2748349b55e3e6e630c7", 166 "reference": "e8e59b74ad1274714dad2748349b55e3e6e630c7", 68 167 "shasum": "" 69 168 }, … … 79 178 }, 80 179 "suggest": { 81 "psr/log ": "For using the console logger",180 "psr/log-implementation": "For using the console logger", 82 181 "symfony/event-dispatcher": "", 83 182 "symfony/process": "" … … 113 212 "description": "Symfony Console Component", 114 213 "homepage": "https://symfony.com", 115 "time": "2018-0 2-26T15:33:21+00:00"214 "time": "2018-05-15T21:17:45+00:00" 116 215 }, 117 216 { 118 217 "name": "symfony/debug", 119 "version": "v2.8. 36",218 "version": "v2.8.41", 120 219 "source": { 121 220 "type": "git", 122 221 "url": "https://github.com/symfony/debug.git", 123 "reference": "f 693ba88189b6384370c13d114cfd010649c31af"124 }, 125 "dist": { 126 "type": "zip", 127 "url": "https://api.github.com/repos/symfony/debug/zipball/f 693ba88189b6384370c13d114cfd010649c31af",128 "reference": "f 693ba88189b6384370c13d114cfd010649c31af",222 "reference": "fe8838e11cf7dbaf324bd6f51d065d873ccf78a2" 223 }, 224 "dist": { 225 "type": "zip", 226 "url": "https://api.github.com/repos/symfony/debug/zipball/fe8838e11cf7dbaf324bd6f51d065d873ccf78a2", 227 "reference": "fe8838e11cf7dbaf324bd6f51d065d873ccf78a2", 129 228 "shasum": "" 130 229 }, … … 170 269 "description": "Symfony Debug Component", 171 270 "homepage": "https://symfony.com", 172 "time": "2018-02-28T21:47:46+00:00" 271 "time": "2018-05-15T21:17:45+00:00" 272 }, 273 { 274 "name": "symfony/finder", 275 "version": "v2.8.41", 276 "source": { 277 "type": "git", 278 "url": "https://github.com/symfony/finder.git", 279 "reference": "79764d21163db295f0daf8bd9d9b91f97e65db6a" 280 }, 281 "dist": { 282 "type": "zip", 283 "url": "https://api.github.com/repos/symfony/finder/zipball/79764d21163db295f0daf8bd9d9b91f97e65db6a", 284 "reference": "79764d21163db295f0daf8bd9d9b91f97e65db6a", 285 "shasum": "" 286 }, 287 "require": { 288 "php": ">=5.3.9" 289 }, 290 "type": "library", 291 "extra": { 292 "branch-alias": { 293 "dev-master": "2.8-dev" 294 } 295 }, 296 "autoload": { 297 "psr-4": { 298 "Symfony\\Component\\Finder\\": "" 299 }, 300 "exclude-from-classmap": [ 301 "/Tests/" 302 ] 303 }, 304 "notification-url": "https://packagist.org/downloads/", 305 "license": [ 306 "MIT" 307 ], 308 "authors": [ 309 { 310 "name": "Fabien Potencier", 311 "email": "fabien@symfony.com" 312 }, 313 { 314 "name": "Symfony Community", 315 "homepage": "https://symfony.com/contributors" 316 } 317 ], 318 "description": "Symfony Finder Component", 319 "homepage": "https://symfony.com", 320 "time": "2018-05-15T21:17:45+00:00" 173 321 }, 174 322 { 175 323 "name": "symfony/polyfill-mbstring", 176 "version": "v1. 7.0",324 "version": "v1.8.0", 177 325 "source": { 178 326 "type": "git", 179 327 "url": "https://github.com/symfony/polyfill-mbstring.git", 180 "reference": " 78be803ce01e55d3491c1397cf1c64beb9c1b63b"181 }, 182 "dist": { 183 "type": "zip", 184 "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/ 78be803ce01e55d3491c1397cf1c64beb9c1b63b",185 "reference": " 78be803ce01e55d3491c1397cf1c64beb9c1b63b",328 "reference": "3296adf6a6454a050679cde90f95350ad604b171" 329 }, 330 "dist": { 331 "type": "zip", 332 "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171", 333 "reference": "3296adf6a6454a050679cde90f95350ad604b171", 186 334 "shasum": "" 187 335 }, … … 195 343 "extra": { 196 344 "branch-alias": { 197 "dev-master": "1. 7-dev"345 "dev-master": "1.8-dev" 198 346 } 199 347 }, … … 229 377 "shim" 230 378 ], 231 "time": "2018-0 1-30T19:27:44+00:00"379 "time": "2018-04-26T10:06:28+00:00" 232 380 } 233 381 ], -
_outils_/spip-cli/trunk/spip.php
r104005 r110765 2 2 <?php 3 3 // spip 4 5 $dossier_cli = dirname(__FILE__); 6 7 include_once "$dossier_cli/vendor/autoload.php"; 8 use Symfony\Component\Console\Application; 9 if( ! ini_get('date.timezone') ) { date_default_timezone_set('GMT'); } 10 11 /** 12 * Trouver toutes les sous-classes qui étendent une classe donnée 13 * 14 * @param string $parent 15 * Nom de la classe dont on veut chercher les extensions. 16 * @return array 17 * Retourne un tableau de chaînes contenant chacune le nom d'une classe. 18 */ 19 function getSubclassesOf($parent) { 20 $result = array(); 21 foreach (get_declared_classes() as $class) { 22 if (is_subclass_of($class, $parent)) { 23 $result[] = $class; 24 } 25 } 26 return $result; 27 } 28 29 /** 30 * Transforme un chemin avec les bons séparateurs de dossiers 31 * 32 * Si on est sur un OS qui n'utilise pas des / comme séparateur de 33 * dossier dans les chemins, on remplace les / par le bon 34 * séparateur. 35 * 36 * @param string $path 37 * Un chemin au format UNIX. 38 * @return string 39 * Retourne le même chemin au format approprié à 40 * l'environnement dans lequel on se trouve. 41 */ 42 function prep_path($path) { 43 if (DIRECTORY_SEPARATOR !== '/') { 44 return str_replace('/', DIRECTORY_SEPARATOR, $path); 45 } else { 46 return $path; 47 } 48 } 49 50 /** 51 * Cherche la racine d'un site SPIP 52 * 53 * Retourne le chemin absolu vers la racine du site SPIP dans 54 * lequel se trouve le répertoire courant. Retourne FALSE si l'on 55 * est pas dans l'arborescence d'un site SPIP. 56 * 57 * @return string|bool 58 * Retourne le chemin vers la racine du SPIP dans lequel on se trouve. 59 * Retourne false si on n'est pas dans l'arborescence d'une installation SPIP. 60 */ 61 function spip_chercher_racine() { 62 $cwd = getcwd(); 63 64 while ($cwd) { 65 if (file_exists(prep_path("$cwd/ecrire/inc_version.php"))) { 66 return $cwd; 67 } else { 68 /* On remonte d'un dossier dans l'arborescence */ 69 $cwd_array = explode(DIRECTORY_SEPARATOR, $cwd); 70 array_pop($cwd_array); 71 $cwd = implode(DIRECTORY_SEPARATOR, $cwd_array); 72 } 73 } 74 75 return false; 76 } 77 78 /** 79 * Lance le SPIP dans lequel on se trouve 80 * 81 * Inclut ecrire/inc_version.php, ce qui permet ensuite d'utiliser 82 * toutes les fonctions de SPIP comme lors du chargement d'une 83 * page. 84 * 85 * @param string $spip_racine 86 * Le chemin vers la racine du SPIP que l'on veut charger. 87 * @return bool 88 * Retourne true si on a pu charger SPIP correctement, false sinon. 89 */ 90 function spip_charger($spip_racine) { 91 // On liste toutes les globales déclarées au démarrage de SPIP (55 !!) 92 global 93 $nombre_de_logs, 94 $taille_des_logs, 95 $table_prefix, 96 $cookie_prefix, 97 $dossier_squelettes, 98 $filtrer_javascript, 99 $type_urls, 100 $debut_date_publication, 101 $ip, 102 $mysql_rappel_connexion, 103 $mysql_rappel_nom_base, 104 $test_i18n, 105 $ignore_auth_http, 106 $ignore_remote_user, 107 $derniere_modif_invalide, 108 $quota_cache, 109 $home_server, 110 $help_server, 111 $url_glossaire_externe, 112 $tex_server, 113 $traiter_math, 114 $xhtml, 115 $xml_indent, 116 $source_vignettes, 117 $formats_logos, 118 $controler_dates_rss, 119 $spip_pipeline, 120 $spip_matrice, 121 $plugins, 122 $surcharges, 123 $exceptions_des_tables, 124 $tables_principales, 125 $table_des_tables, 126 $tables_auxiliaires, 127 $table_primary, 128 $table_date, 129 $table_titre, 130 $tables_jointures, 131 $liste_des_statuts, 132 $liste_des_etats, 133 $liste_des_authentifications, 134 $spip_version_branche, 135 $spip_version_code, 136 $spip_version_base, 137 $spip_sql_version, 138 $spip_version_affichee, 139 $visiteur_session, 140 $auteur_session, 141 $connect_statut, 142 $connect_toutes_rubriques, 143 $hash_recherche, 144 $hash_recherche_strict, 145 $ldap_present, 146 $meta, 147 $connect_id_rubrique, 148 $puce; 149 150 // Pour que les include dans les fichiers php de SPIP fonctionnent correctement, 151 // il faut être à la racine du site. 152 // On change de répertoire courant le temps de charger tout ça. 153 $cwd = getcwd(); 154 chdir($spip_racine); 155 156 // Si jamais la base n'est pas installé on anhile la redirection et on affirme qu'on est sur la page d'installation 157 if (!is_file('config/connect.php')) { 158 $_GET['exec'] = 'install'; 159 define('_FILE_CONNECT', 'config/connect.tmp.php'); 160 } 161 162 // TIMEOUT de 24h… 163 define('_UPGRADE_TIME_OUT', 24*3600); 164 165 // On charge la machinerie de SPIP 166 include_once prep_path("$spip_racine/ecrire/inc_version.php"); 167 168 // On revient dans le répertoire dans lequel la commande a été appelée 169 chdir($cwd); 170 171 // Si _ECRIRE_INC_VERSION existe, inc_version.php a été chargé correctement 172 if (_ECRIRE_INC_VERSION) { 173 // Charge l'API SQL, pour être sûr de l'avoir déjà 174 include_spip('base/abstract_sql'); 175 // Tout s'est bien passé 176 return TRUE; 177 } else { 178 // Mauvais chargement 179 return FALSE; 180 } 181 } 182 183 // Création de la ligne de commande 184 $spip = new Application('Ligne de commande pour SPIP', '0.2.3'); 185 186 // Inclusion des fichiers contenant les commandes de base 187 foreach (glob("$dossier_cli/spip-cli/*.php") as $commande_fichier) { 188 include_once $commande_fichier; 189 } 190 191 if (($spip_racine = spip_chercher_racine()) and spip_charger($spip_racine)) { 192 $spip_loaded = TRUE; 193 194 // charger toutes les commandes qui se trouvent dans le path de SPIP. 195 $cwd = getcwd(); 196 chdir($spip_racine); 197 $commandes = find_all_in_path('spip-cli/', '.*[.]php$'); 198 foreach ($commandes as $commande_fichier) { 199 include_once $commande_fichier; 200 } 201 chdir($cwd); 202 } else { 203 $spip_loaded = FALSE; 204 } 205 206 // Ajouter automatiquement toutes les commandes trouvées (= un objet de chaque classe Command) 207 if ($commandes = getSubclassesOf('Symfony\Component\Console\Command\Command')){ 208 foreach ($commandes as $class){ 209 $spip->add(new $class); 210 } 211 } 212 213 // Lancement de l'application 214 $spip->run(); 215 4 echo "\n[deprecated] Veuillez utiliser les executables SPIP-Cli du répertoire bin.\n"; 5 include_once(__DIR__ . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'spip'); -
_outils_/spip-cli/trunk/spip_completion.sh
r87309 r110765 1 1 #!/bin/sh 2 #3 # Source :4 # https://github.com/jaytaph/SFConsole/blob/master/console_completion.sh5 #6 # Symfony2 App/Console autocompletion (commands and arguments only)7 # Copyright (c) 2014, Joshua Thijssen8 # All rights reserved.9 #10 # Redistribution and use in source and binary forms, with or without modification,11 # are permitted provided that the following conditions are met:12 #13 # * Redistributions of source code must retain the above copyright notice, this14 # list of conditions and the following disclaimer.15 #16 # * Redistributions in binary form must reproduce the above copyright notice, this17 # list of conditions and the following disclaimer in the documentation and/or18 # other materials provided with the distribution.19 #20 # * Neither the name of the {organization} nor the names of its21 # contributors may be used to endorse or promote products derived from22 # this software without specific prior written permission.23 #24 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND25 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED26 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE27 # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR28 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES29 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;30 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON31 # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT32 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS33 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.34 #35 #36 # Usable for both bash and zsh (probably)37 #38 # Usage:39 # Load the script (or add to your .bashrc)40 #41 # source ./console_completion.sh42 #43 # Autocomplete:44 #45 # ./app/console <TAB>46 #47 # Will autocomplete both commands and its arguments.48 #49 2 50 if [[ -n ${ZSH_VERSION-} ]]; then 51 autoload -U +X bashcompinit && bashcompinit 52 fi 53 54 _complete_sf2_app_console() { 55 local cur 56 57 COMPREPLY=() 58 cur="${COMP_WORDS[COMP_CWORD]}" 59 60 # Assume first word is the actual app/console command 61 console="${COMP_WORDS[0]}" 62 63 if [[ ${COMP_CWORD} == 1 ]] ; then 64 # No command found, return the list of available commands 65 cmds=` ${console} --no-ansi | sed -n -e '/^Available commands/,//p' | grep -n '^ ' | sed -e 's/^ \+//' | awk '{ print $2 }'` 66 else 67 # Commands found, parse options 68 cmds=` ${console} ${COMP_WORDS[1]} --no-ansi --help | sed -n -e '/^Options/,/^$/p' | grep -n '^ ' | sed -e 's/^ \+//' | awk '{ print $2 }'` 69 fi 70 71 COMPREPLY=( $(compgen -W "${cmds}" -- ${cur}) ) 72 return 0 73 } 74 75 export COMP_WORDBREAKS="\ \"\\'><=;|&(" 76 complete -F _complete_sf2_app_console spip 77 3 # Deprecated : utiliser/lier bin/spip_console_autocomplete 4 $(dirname $0)/bin/spip_console_autocomplete -
_outils_/spip-cli/trunk/src/Command/CacheDesactiver.php
r81933 r110765 1 1 <?php 2 3 namespace Spip\Cli\Command; 2 4 3 5 use Symfony\Component\Console\Command\Command; -
_outils_/spip-cli/trunk/src/Command/CacheReactiver.php
r81933 r110765 1 1 <?php 2 3 namespace Spip\Cli\Command; 2 4 3 5 use Symfony\Component\Console\Command\Command; -
_outils_/spip-cli/trunk/src/Command/CacheVider.php
r81934 r110765 1 1 <?php 2 3 namespace Spip\Cli\Command; 2 4 3 5 use Symfony\Component\Console\Command\Command; -
_outils_/spip-cli/trunk/src/Command/CoreInstaller.php
r97272 r110765 1 1 <?php 2 3 namespace Spip\Cli\Command; 2 4 3 5 use Symfony\Component\Console\Command\Command; -
_outils_/spip-cli/trunk/src/Command/CoreListerVersions.php
r109709 r110765 1 1 <?php 2 3 namespace Spip\Cli\Command; 2 4 3 5 use Symfony\Component\Console\Command\Command; -
_outils_/spip-cli/trunk/src/Command/CoreMettreajour.php
r94662 r110765 1 1 <?php 2 3 namespace Spip\Cli\Command; 2 4 3 5 use Symfony\Component\Console\Command\Command; -
_outils_/spip-cli/trunk/src/Command/CorePreparer.php
r83661 r110765 1 1 <?php 2 3 namespace Spip\Cli\Command; 2 4 3 5 use Symfony\Component\Console\Command\Command; -
_outils_/spip-cli/trunk/src/Command/CoreTelecharger.php
r109863 r110765 1 1 <?php 2 3 namespace Spip\Cli\Command; 2 4 3 5 use Symfony\Component\Console\Command\Command; -
_outils_/spip-cli/trunk/src/Command/IntegraalGenerer.php
r107688 r110765 1 1 <?php 2 3 namespace Spip\Cli\Command; 2 4 3 5 use Symfony\Component\Console\Command\Command; -
_outils_/spip-cli/trunk/src/Command/PhpEval.php
r98930 r110765 1 1 <?php 2 3 namespace Spip\Cli\Command; 2 4 3 5 use Symfony\Component\Console\Command\Command; -
_outils_/spip-cli/trunk/src/Command/PluginsActiver.php
r105891 r110765 1 1 <?php 2 3 namespace Spip\Cli\Command; 2 4 3 5 use Symfony\Component\Console\Command\Command; -
_outils_/spip-cli/trunk/src/Command/PluginsDesactiver.php
r105891 r110765 1 1 <?php 2 3 namespace Spip\Cli\Command; 2 4 3 5 use Symfony\Component\Console\Command\Command; -
_outils_/spip-cli/trunk/src/Command/PluginsLister.php
r93594 r110765 1 1 <?php 2 3 namespace Spip\Cli\Command; 2 4 3 5 use Symfony\Component\Console\Command\Command; -
_outils_/spip-cli/trunk/src/Command/PluginsSvpDepoter.php
r106506 r110765 1 1 <?php 2 3 namespace Spip\Cli\Command; 2 4 3 5 use Symfony\Component\Console\Command\Command; -
_outils_/spip-cli/trunk/src/Command/PluginsSvpTelecharger.php
r98365 r110765 1 1 <?php 2 3 namespace Spip\Cli\Command; 2 4 3 5 use Symfony\Component\Console\Command\Command; -
_outils_/spip-cli/trunk/src/Command/ServerLocate.php
r98347 r110765 1 1 <?php 2 3 namespace Spip\Cli\Command; 2 4 3 5 use Symfony\Component\Console\Command\Command; -
_outils_/spip-cli/trunk/src/Command/TextePropre.php
r93597 r110765 1 1 <?php 2 3 namespace Spip\Cli\Command; 2 4 3 5 use Symfony\Component\Console\Command\Command; -
_outils_/spip-cli/trunk/src/Command/TexteTypo.php
r93597 r110765 1 1 <?php 2 3 namespace Spip\Cli\Command; 2 4 3 5 use Symfony\Component\Console\Command\Command;
Note: See TracChangeset
for help on using the changeset viewer.