Cli: add serve command

This commit is contained in:
Benjamin Renard 2023-02-28 01:15:11 +01:00
parent c626bc177a
commit f79be675fb
9 changed files with 379 additions and 143 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"POT-Creation-Date: 2023-02-25 17:17+0100\n" "POT-Creation-Date: 2023-02-28 01:28+0100\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: Benjamin Renard <brenard@zionetrix.net>\n" "Last-Translator: Benjamin Renard <brenard@zionetrix.net>\n"
"Language-Team: \n" "Language-Team: \n"
@ -12,46 +12,70 @@ msgstr ""
"X-Generator: Poedit 2.4.2\n" "X-Generator: Poedit 2.4.2\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: Cli.php:34 #: Cli.php:44
msgid "Create a new project using EesyPHP framework"
msgstr "Créer un nouveau projet utilisant le framework EesyPHP"
#: Cli.php:47
msgid ""
"This command could be used to easily build the structure of a new project "
"using the EesyPHP framework."
msgstr ""
"Cette commande peut-être utilisée pour construire facilement la structure "
"d'un nouveau projet utilisant le framework EesyPHP."
#: Cli.php:55
msgid "Start the PHP built-in HTTP server to serve the application"
msgstr "Démarrer le service HTTP intégré à PHP pour servir l'application"
#: Cli.php:58
msgid ""
"This command could be used to start the PHP built-in HTTP server to serve "
"the application."
msgstr ""
"Cette commande peut-être utilisée pour démarrer le service HTTP intégré à "
"PHP pour servir l'application."
#: Cli.php:89
#, php-format #, php-format
msgid "The CLI command '%s' already exists." msgid "The CLI command '%s' already exists."
msgstr "La commande CLI '%s' n'existe pas." msgstr "La commande CLI '%s' n'existe pas."
#: Cli.php:39 #: Cli.php:94
#, php-format #, php-format
msgid "The CLI command '%s' handler is not callable !" msgid "The CLI command '%s' handler is not callable !"
msgstr "La fonction implémentant la commande CLI '%s' n'est pas exécutable !" msgstr "La fonction implémentant la commande CLI '%s' n'est pas exécutable !"
#: Cli.php:71 #: Cli.php:126
#, php-format #, php-format
msgid "Usage: %s [-h] [-qd] command\n" msgid "Usage: %s [-h] [-qd] command\n"
msgstr "Utilisation: %s [-h] [-qd] commande\n" msgstr "Utilisation: %s [-h] [-qd] commande\n"
#: Cli.php:72 #: Cli.php:127
msgid " -h Show this message\n" msgid " -h Show this message\n"
msgstr " -h Affiche ce message\n" msgstr " -h Affiche ce message\n"
#: Cli.php:73 #: Cli.php:128
msgid " -q / -d Quiet/Debug mode\n" msgid " -q / -d Quiet/Debug mode\n"
msgstr " -q / -d Mode silencieux/debug\n" msgstr " -q / -d Mode silencieux/debug\n"
#: Cli.php:74 #: Cli.php:129
msgid " --trace Trace mode (the most verbose)\n" msgid " --trace Trace mode (the most verbose)\n"
msgstr " --trace Mode trace (le plus verbeux)\n" msgstr " --trace Mode trace (le plus verbeux)\n"
#: Cli.php:75 #: Cli.php:130
msgid " command Command to run\n" msgid " command Command to run\n"
msgstr " command La commande à exécuter\n" msgstr " command La commande à exécuter\n"
#: Cli.php:77 #: Cli.php:132
msgid "Available commands:\n" msgid "Available commands:\n"
msgstr "Commandes disponibles:\n" msgstr "Commandes disponibles:\n"
#: Cli.php:125 #: Cli.php:182
msgid "Only one command could be executed !" msgid "Only one command could be executed !"
msgstr "Une seul commande peut-être exécutée !" msgstr "Une seul commande peut-être exécutée !"
#: Cli.php:153 #: Cli.php:210
#, php-format #, php-format
msgid "" msgid ""
"Invalid parameter \"%s\".\n" "Invalid parameter \"%s\".\n"
@ -61,20 +85,48 @@ msgstr ""
"Note : Les paramètres/arguments de la requête doivent être placés après " "Note : Les paramètres/arguments de la requête doivent être placés après "
"celle-ci." "celle-ci."
#: Cli.php:178 #: Cli.php:235
#, php-format #, php-format
msgid "An exception occured running command %s" msgid "An exception occured running command %s"
msgstr "Une exception est survenue en exécutant la commande %s" msgstr "Une exception est survenue en exécutant la commande %s"
#: Cli.php:296
msgid ""
"This command only accept one argument: the listen address in format \"host:"
"port\" or \":port\" (= 0.0.0.0:port)."
msgstr ""
"Cette commande n'accepte qu'un seul paramètre : l'adresse d'écoute au format "
"\"hôte:port\" ou \":port\" (= 0.0.0.0:port)."
#: Cli.php:307
msgid ""
"Invalid listen address specify. Must be in formart host:port (or :port)."
msgstr ""
"Adresse d'écoute spécifiée invalide. Elle doit être au format hôte:port (ou :"
"port)."
#: Cli.php:317
msgid "Invalid listen host specified. Must be an IPv4 or IPv6 address."
msgstr ""
"Hôte d'écoute spécifié invalide. Il doit s'agir d'une adresse IPv4 ou IPv6."
#: Cli.php:324
msgid ""
"Invalid listen port specified. Must be a positive integer between 1 and "
"65535."
msgstr ""
"Port d'écoute spécifié invalide. Il doit s'agir d'un entier positif entre 1 "
"et 65535."
#: Db.php:74 #: Db.php:74
msgid "Unable to connect to the database." msgid "Unable to connect to the database."
msgstr "Impossible de se connecter à la base de données." msgstr "Impossible de se connecter à la base de données."
#: Auth/Form.php:32 #: Auth/Form.php:33
msgid "Invalid username or password." msgid "Invalid username or password."
msgstr "Nom d'utilisateur ou mot de passe invalide." msgstr "Nom d'utilisateur ou mot de passe invalide."
#: Auth/Form.php:64 #: Auth/Form.php:65
msgid "Sign in" msgid "Sign in"
msgstr "Connexion" msgstr "Connexion"
@ -122,11 +174,11 @@ msgstr ""
"\n" "\n"
"%s: %s" "%s: %s"
#: Tpl.php:394 #: Tpl.php:405
msgid "No template specified." msgid "No template specified."
msgstr "Aucun template spécifié." msgstr "Aucun template spécifié."
#: Tpl.php:425 #: Tpl.php:438
msgid "An error occurred while displaying this page." msgid "An error occurred while displaying this page."
msgstr "Une erreur est survenue en affichant cette page." msgstr "Une erreur est survenue en affichant cette page."
@ -196,7 +248,7 @@ msgstr "Authentification requise mais impossible pour vous authentifier."
msgid "This request could not be processed correctly." msgid "This request could not be processed correctly."
msgstr "Cette requête n'a put être traitée correctement." msgstr "Cette requête n'a put être traitée correctement."
#: I18n.php:122 App.php:124 #: I18n.php:122 App.php:181
msgid "Hello world !" msgid "Hello world !"
msgstr "Bonjour tout le monde !" msgstr "Bonjour tout le monde !"
@ -240,34 +292,34 @@ msgstr ""
"Cette commande peut-être utilisée pour compiler les fichiers PO dans les " "Cette commande peut-être utilisée pour compiler les fichiers PO dans les "
"dossiers locales/*/LC_MESSAGES and les catalogues JS dans le dossier locales." "dossiers locales/*/LC_MESSAGES and les catalogues JS dans le dossier locales."
#: I18n.php:341 #: I18n.php:340
msgid "Fail to list EesyPHP PHP files." msgid "Fail to list EesyPHP PHP files."
msgstr "Une erreur est survenue en listant les fichiers PHP d'EesyPHP." msgstr "Une erreur est survenue en listant les fichiers PHP d'EesyPHP."
#: I18n.php:361 #: I18n.php:360
msgid "Fail to extract messages from EesyPHP PHP files using xgettext." msgid "Fail to extract messages from EesyPHP PHP files using xgettext."
msgstr "" msgstr ""
"Une erreur est survenue en extrayant les messages depuis les fichiers PHP " "Une erreur est survenue en extrayant les messages depuis les fichiers PHP "
"d'EesyPHP en utilisant xgettext." "d'EesyPHP en utilisant xgettext."
#: I18n.php:378 #: I18n.php:377
msgid "Fail to list application PHP files." msgid "Fail to list application PHP files."
msgstr "Une erreur est survenue en listant les fichiers PHP de l'application." msgstr "Une erreur est survenue en listant les fichiers PHP de l'application."
#: I18n.php:398 #: I18n.php:397
msgid "Fail to extract messages from PHP files using xgettext." msgid "Fail to extract messages from PHP files using xgettext."
msgstr "" msgstr ""
"Impossible d'extraire les messages depuis les fichiers PHP en utilisant " "Impossible d'extraire les messages depuis les fichiers PHP en utilisant "
"xgettext." "xgettext."
#: I18n.php:414 #: I18n.php:413
#, php-format #, php-format
msgid "Fail to list JS files in the directory of static files '%s'." msgid "Fail to list JS files in the directory of static files '%s'."
msgstr "" msgstr ""
"Une erreur est survenue en listant les fichiers JS dans le dossier des " "Une erreur est survenue en listant les fichiers JS dans le dossier des "
"fichiers statiques '%s'." "fichiers statiques '%s'."
#: I18n.php:436 #: I18n.php:435
#, php-format #, php-format
msgid "" msgid ""
"Fail to extract messages from JS files in the directory of static files '%s' " "Fail to extract messages from JS files in the directory of static files '%s' "
@ -276,7 +328,7 @@ msgstr ""
"Une erreur est survenue en extrayant les messages depuis les fichiers JS du " "Une erreur est survenue en extrayant les messages depuis les fichiers JS du "
"dossier des fichiers statiques '%s' en utilisant xgettext." "dossier des fichiers statiques '%s' en utilisant xgettext."
#: I18n.php:458 #: I18n.php:457
#, php-format #, php-format
msgid "" msgid ""
"Fail to extract messages from templates directory '%s' using tsmarty2c.php " "Fail to extract messages from templates directory '%s' using tsmarty2c.php "
@ -285,118 +337,118 @@ msgstr ""
"Impossible d'extraire les messages depuis le dossier de templates '%s' en " "Impossible d'extraire les messages depuis le dossier de templates '%s' en "
"utilisant le script tsmarty2c.php." "utilisant le script tsmarty2c.php."
#: I18n.php:494 #: I18n.php:493
msgid "Fail to merge messages using msgcat." msgid "Fail to merge messages using msgcat."
msgstr "Impossible de fusionner les messages en utilisant msgcat." msgstr "Impossible de fusionner les messages en utilisant msgcat."
#: I18n.php:511 #: I18n.php:507
#, php-format #, php-format
msgid "Compendium file %s not found." msgid "Compendium file %s not found."
msgstr "Fichier compendium %s introuvable." msgstr "Fichier compendium %s introuvable."
#: I18n.php:522 #: I18n.php:518
#, php-format #, php-format
msgid "POT file not found (%s). Please run extract_messages first." msgid "POT file not found (%s). Please run extract_messages first."
msgstr "" msgstr ""
"Fichier POT introuvable (%s). Merci de lancer la commande extract_messages " "Fichier POT introuvable (%s). Merci de lancer la commande extract_messages "
"pour commencer." "pour commencer."
#: I18n.php:534 I18n.php:645 #: I18n.php:530 I18n.php:640
#, php-format #, php-format
msgid "Lang directory '%s' found" msgid "Lang directory '%s' found"
msgstr "Dossier de langue '%s' trouvé" msgstr "Dossier de langue '%s' trouvé"
#: I18n.php:540 I18n.php:651 #: I18n.php:536 I18n.php:646
#, php-format #, php-format
msgid "LC_MESSAGES directory not found in lang '%s' directory, ignore it." msgid "LC_MESSAGES directory not found in lang '%s' directory, ignore it."
msgstr "" msgstr ""
"Le dossier LC_MESSAGES est introuvable dans le dossier de langue '%s', on " "Le dossier LC_MESSAGES est introuvable dans le dossier de langue '%s', on "
"l'ignore." "l'ignore."
#: I18n.php:555 #: I18n.php:551
#, php-format #, php-format
msgid "Fail to init messages in %s PO file using msginit (%s)." msgid "Fail to init messages in %s PO file using msginit (%s)."
msgstr "" msgstr ""
"Impossible d'initialiser les messages dans le fichier PO %s en utilisant " "Impossible d'initialiser les messages dans le fichier PO %s en utilisant "
"msginit (%s)." "msginit (%s)."
#: I18n.php:573 #: I18n.php:569
#, php-format #, php-format
msgid "Fail to update messages in %s PO file using msgmerge (%s)." msgid "Fail to update messages in %s PO file using msgmerge (%s)."
msgstr "" msgstr ""
"Impossible de mettre à jour les messages dans les fichiers PO %s en " "Impossible de mettre à jour les messages dans les fichiers PO %s en "
"utilisant msgmerge (%s)." "utilisant msgmerge (%s)."
#: I18n.php:579 I18n.php:659 #: I18n.php:575 I18n.php:654
#, php-format #, php-format
msgid "PO file not found in lang '%s' directory, ignore it." msgid "PO file not found in lang '%s' directory, ignore it."
msgstr "" msgstr ""
"Le fichier PO est introuvable dans le dossier de langue '%s', on l'ignore." "Le fichier PO est introuvable dans le dossier de langue '%s', on l'ignore."
#: I18n.php:586 I18n.php:699 #: I18n.php:582 I18n.php:694
#, php-format #, php-format
msgid "Fail to open root lang directory (%s)." msgid "Fail to open root lang directory (%s)."
msgstr "Impossible d'ouvrir le dossier racine des langues (%s)." msgstr "Impossible d'ouvrir le dossier racine des langues (%s)."
#: I18n.php:615 #: I18n.php:610
#, php-format #, php-format
msgid "Lang alias symlink found: %s -> %s" msgid "Lang alias symlink found: %s -> %s"
msgstr "Lien symbolique d'alias de langue trouvé : %s -> %s" msgstr "Lien symbolique d'alias de langue trouvé : %s -> %s"
#: I18n.php:622 #: I18n.php:617
#, php-format #, php-format
msgid "JS catalog symlink for %s -> %s created (%s)" msgid "JS catalog symlink for %s -> %s created (%s)"
msgstr "Lien symbolique de catalogue JS pour %s -> %s créé (%s)" msgstr "Lien symbolique de catalogue JS pour %s -> %s créé (%s)"
#: I18n.php:626 #: I18n.php:621
#, php-format #, php-format
msgid "Fail to create JS catalog symlink for %s -> %s (%s)" msgid "Fail to create JS catalog symlink for %s -> %s (%s)"
msgstr "" msgstr ""
"Impossible de créer le lien symbolique de catalogue JS pour %s -> %s (%s)" "Impossible de créer le lien symbolique de catalogue JS pour %s -> %s (%s)"
#: I18n.php:632 #: I18n.php:627
#, php-format #, php-format
msgid "JS catalog symlink for %s -> %s already exist (%s)" msgid "JS catalog symlink for %s -> %s already exist (%s)"
msgstr "Le lien symbolique du catalogue JS pour %s -> %s existe déjà (%s)" msgstr "Le lien symbolique du catalogue JS pour %s -> %s existe déjà (%s)"
#: I18n.php:637 #: I18n.php:632
#, php-format #, php-format
msgid "JS catalog file for %s already exist, but it's not a symlink to %s (%s)" msgid "JS catalog file for %s already exist, but it's not a symlink to %s (%s)"
msgstr "" msgstr ""
"Le catalogue JS pour %s existe, mais il ne s'agit par d'un lien symbolique " "Le catalogue JS pour %s existe, mais il ne s'agit par d'un lien symbolique "
"vers %s (%s)" "vers %s (%s)"
#: I18n.php:672 #: I18n.php:667
#, php-format #, php-format
msgid "Fail to compile messages from %s PO file as MO file using msgfmt (%s)." msgid "Fail to compile messages from %s PO file as MO file using msgfmt (%s)."
msgstr "" msgstr ""
"Impossible de compiler les messages depuis le fichier PO %s en tant que " "Impossible de compiler les messages depuis le fichier PO %s en tant que "
"fichier MO en utilisant msgfmt (%s)." "fichier MO en utilisant msgfmt (%s)."
#: I18n.php:682 #: I18n.php:677
#, php-format #, php-format
msgid "Fail to open %s JS catalog file in write mode (%s)." msgid "Fail to open %s JS catalog file in write mode (%s)."
msgstr "Impossible d'ouvrir le catalogue JS %s en mode écriture (%s)." msgstr "Impossible d'ouvrir le catalogue JS %s en mode écriture (%s)."
#: I18n.php:687 #: I18n.php:682
#, php-format #, php-format
msgid "Fail to write %s JS catalog in file (%s)." msgid "Fail to write %s JS catalog in file (%s)."
msgstr "Impossible d'écrire le fichier du catalogue JS %s (%s)." msgstr "Impossible d'écrire le fichier du catalogue JS %s (%s)."
#: I18n.php:692 #: I18n.php:687
#, php-format #, php-format
msgid "%s JS catalog writed (%s)." msgid "%s JS catalog writed (%s)."
msgstr "Catalogue JS %s créé (%s)." msgstr "Catalogue JS %s créé (%s)."
#: App.php:126 #: App.php:183
msgid "Hello world!" msgid "Hello world!"
msgstr "Salut tout le monde !" msgstr "Salut tout le monde !"
#: App.php:137 #: App.php:194
msgid "Disconnected" msgid "Disconnected"
msgstr "Déconnecté" msgstr "Déconnecté"
#: App.php:139 #: App.php:196
msgid "You are now disconnected." msgid "You are now disconnected."
msgstr "Vous êtes maintenant déconnecté." msgstr "Vous êtes maintenant déconnecté."

View file

@ -1,7 +1,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"POT-Creation-Date: 2023-02-25 17:17+0100\n" "POT-Creation-Date: 2023-02-28 01:28+0100\n"
"PO-Revision-Date: 2023-02-25 17:17+0100\n" "PO-Revision-Date: 2023-02-28 01:28+0100\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"

View file

@ -1,71 +1,112 @@
msgid "" msgid ""
msgstr "" msgstr ""
"POT-Creation-Date: 2023-02-25 17:17+0100\n" "POT-Creation-Date: 2023-02-28 01:28+0100\n"
"PO-Revision-Date: 2023-02-25 17:17+0100\n" "PO-Revision-Date: 2023-02-28 01:28+0100\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: Cli.php:34 #: Cli.php:44
msgid "Create a new project using EesyPHP framework"
msgstr ""
#: Cli.php:47
msgid ""
"This command could be used to easily build the structure of a new project "
"using the EesyPHP framework."
msgstr ""
#: Cli.php:55
msgid "Start the PHP built-in HTTP server to serve the application"
msgstr ""
#: Cli.php:58
msgid ""
"This command could be used to start the PHP built-in HTTP server to serve "
"the application."
msgstr ""
#: Cli.php:89
#, php-format #, php-format
msgid "The CLI command '%s' already exists." msgid "The CLI command '%s' already exists."
msgstr "" msgstr ""
#: Cli.php:39 #: Cli.php:94
#, php-format #, php-format
msgid "The CLI command '%s' handler is not callable !" msgid "The CLI command '%s' handler is not callable !"
msgstr "" msgstr ""
#: Cli.php:71 #: Cli.php:126
#, php-format #, php-format
msgid "Usage: %s [-h] [-qd] command\n" msgid "Usage: %s [-h] [-qd] command\n"
msgstr "" msgstr ""
#: Cli.php:72 #: Cli.php:127
msgid " -h Show this message\n" msgid " -h Show this message\n"
msgstr "" msgstr ""
#: Cli.php:73 #: Cli.php:128
msgid " -q / -d Quiet/Debug mode\n" msgid " -q / -d Quiet/Debug mode\n"
msgstr "" msgstr ""
#: Cli.php:74 #: Cli.php:129
msgid " --trace Trace mode (the most verbose)\n" msgid " --trace Trace mode (the most verbose)\n"
msgstr "" msgstr ""
#: Cli.php:75 #: Cli.php:130
msgid " command Command to run\n" msgid " command Command to run\n"
msgstr "" msgstr ""
#: Cli.php:77 #: Cli.php:132
msgid "Available commands:\n" msgid "Available commands:\n"
msgstr "" msgstr ""
#: Cli.php:125 #: Cli.php:182
msgid "Only one command could be executed !" msgid "Only one command could be executed !"
msgstr "" msgstr ""
#: Cli.php:153 #: Cli.php:210
#, php-format #, php-format
msgid "" msgid ""
"Invalid parameter \"%s\".\n" "Invalid parameter \"%s\".\n"
"Note: Command's parameter/argument must be place after the command." "Note: Command's parameter/argument must be place after the command."
msgstr "" msgstr ""
#: Cli.php:178 #: Cli.php:235
#, php-format #, php-format
msgid "An exception occured running command %s" msgid "An exception occured running command %s"
msgstr "" msgstr ""
#: Cli.php:296
msgid ""
"This command only accept one argument: the listen address in format \"host:"
"port\" or \":port\" (= 0.0.0.0:port)."
msgstr ""
#: Cli.php:307
msgid ""
"Invalid listen address specify. Must be in formart host:port (or :port)."
msgstr ""
#: Cli.php:317
msgid "Invalid listen host specified. Must be an IPv4 or IPv6 address."
msgstr ""
#: Cli.php:324
msgid ""
"Invalid listen port specified. Must be a positive integer between 1 and "
"65535."
msgstr ""
#: Db.php:74 #: Db.php:74
msgid "Unable to connect to the database." msgid "Unable to connect to the database."
msgstr "" msgstr ""
#: Auth/Form.php:32 #: Auth/Form.php:33
msgid "Invalid username or password." msgid "Invalid username or password."
msgstr "" msgstr ""
#: Auth/Form.php:64 #: Auth/Form.php:65
msgid "Sign in" msgid "Sign in"
msgstr "" msgstr ""
@ -107,11 +148,11 @@ msgid ""
"%s: %s" "%s: %s"
msgstr "" msgstr ""
#: Tpl.php:394 #: Tpl.php:405
msgid "No template specified." msgid "No template specified."
msgstr "" msgstr ""
#: Tpl.php:425 #: Tpl.php:438
msgid "An error occurred while displaying this page." msgid "An error occurred while displaying this page."
msgstr "" msgstr ""
@ -173,7 +214,7 @@ msgstr ""
msgid "This request could not be processed correctly." msgid "This request could not be processed correctly."
msgstr "" msgstr ""
#: I18n.php:122 App.php:124 #: I18n.php:122 App.php:181
msgid "Hello world !" msgid "Hello world !"
msgstr "" msgstr ""
@ -208,139 +249,139 @@ msgid ""
"directories to MO files and as JS catalogs in locales directory." "directories to MO files and as JS catalogs in locales directory."
msgstr "" msgstr ""
#: I18n.php:341 #: I18n.php:340
msgid "Fail to list EesyPHP PHP files." msgid "Fail to list EesyPHP PHP files."
msgstr "" msgstr ""
#: I18n.php:361 #: I18n.php:360
msgid "Fail to extract messages from EesyPHP PHP files using xgettext." msgid "Fail to extract messages from EesyPHP PHP files using xgettext."
msgstr "" msgstr ""
#: I18n.php:378 #: I18n.php:377
msgid "Fail to list application PHP files." msgid "Fail to list application PHP files."
msgstr "" msgstr ""
#: I18n.php:398 #: I18n.php:397
msgid "Fail to extract messages from PHP files using xgettext." msgid "Fail to extract messages from PHP files using xgettext."
msgstr "" msgstr ""
#: I18n.php:414 #: I18n.php:413
#, php-format #, php-format
msgid "Fail to list JS files in the directory of static files '%s'." msgid "Fail to list JS files in the directory of static files '%s'."
msgstr "" msgstr ""
#: I18n.php:436 #: I18n.php:435
#, php-format #, php-format
msgid "" msgid ""
"Fail to extract messages from JS files in the directory of static files '%s' " "Fail to extract messages from JS files in the directory of static files '%s' "
"using xgettext." "using xgettext."
msgstr "" msgstr ""
#: I18n.php:458 #: I18n.php:457
#, php-format #, php-format
msgid "" msgid ""
"Fail to extract messages from templates directory '%s' using tsmarty2c.php " "Fail to extract messages from templates directory '%s' using tsmarty2c.php "
"script." "script."
msgstr "" msgstr ""
#: I18n.php:494 #: I18n.php:493
msgid "Fail to merge messages using msgcat." msgid "Fail to merge messages using msgcat."
msgstr "" msgstr ""
#: I18n.php:511 #: I18n.php:507
#, php-format #, php-format
msgid "Compendium file %s not found." msgid "Compendium file %s not found."
msgstr "" msgstr ""
#: I18n.php:522 #: I18n.php:518
#, php-format #, php-format
msgid "POT file not found (%s). Please run extract_messages first." msgid "POT file not found (%s). Please run extract_messages first."
msgstr "" msgstr ""
#: I18n.php:534 I18n.php:645 #: I18n.php:530 I18n.php:640
#, php-format #, php-format
msgid "Lang directory '%s' found" msgid "Lang directory '%s' found"
msgstr "" msgstr ""
#: I18n.php:540 I18n.php:651 #: I18n.php:536 I18n.php:646
#, php-format #, php-format
msgid "LC_MESSAGES directory not found in lang '%s' directory, ignore it." msgid "LC_MESSAGES directory not found in lang '%s' directory, ignore it."
msgstr "" msgstr ""
#: I18n.php:555 #: I18n.php:551
#, php-format #, php-format
msgid "Fail to init messages in %s PO file using msginit (%s)." msgid "Fail to init messages in %s PO file using msginit (%s)."
msgstr "" msgstr ""
#: I18n.php:573 #: I18n.php:569
#, php-format #, php-format
msgid "Fail to update messages in %s PO file using msgmerge (%s)." msgid "Fail to update messages in %s PO file using msgmerge (%s)."
msgstr "" msgstr ""
#: I18n.php:579 I18n.php:659 #: I18n.php:575 I18n.php:654
#, php-format #, php-format
msgid "PO file not found in lang '%s' directory, ignore it." msgid "PO file not found in lang '%s' directory, ignore it."
msgstr "" msgstr ""
#: I18n.php:586 I18n.php:699 #: I18n.php:582 I18n.php:694
#, php-format #, php-format
msgid "Fail to open root lang directory (%s)." msgid "Fail to open root lang directory (%s)."
msgstr "" msgstr ""
#: I18n.php:615 #: I18n.php:610
#, php-format #, php-format
msgid "Lang alias symlink found: %s -> %s" msgid "Lang alias symlink found: %s -> %s"
msgstr "" msgstr ""
#: I18n.php:622 #: I18n.php:617
#, php-format #, php-format
msgid "JS catalog symlink for %s -> %s created (%s)" msgid "JS catalog symlink for %s -> %s created (%s)"
msgstr "" msgstr ""
#: I18n.php:626 #: I18n.php:621
#, php-format #, php-format
msgid "Fail to create JS catalog symlink for %s -> %s (%s)" msgid "Fail to create JS catalog symlink for %s -> %s (%s)"
msgstr "" msgstr ""
#: I18n.php:632 #: I18n.php:627
#, php-format #, php-format
msgid "JS catalog symlink for %s -> %s already exist (%s)" msgid "JS catalog symlink for %s -> %s already exist (%s)"
msgstr "" msgstr ""
#: I18n.php:637 #: I18n.php:632
#, php-format #, php-format
msgid "JS catalog file for %s already exist, but it's not a symlink to %s (%s)" msgid "JS catalog file for %s already exist, but it's not a symlink to %s (%s)"
msgstr "" msgstr ""
#: I18n.php:672 #: I18n.php:667
#, php-format #, php-format
msgid "Fail to compile messages from %s PO file as MO file using msgfmt (%s)." msgid "Fail to compile messages from %s PO file as MO file using msgfmt (%s)."
msgstr "" msgstr ""
#: I18n.php:682 #: I18n.php:677
#, php-format #, php-format
msgid "Fail to open %s JS catalog file in write mode (%s)." msgid "Fail to open %s JS catalog file in write mode (%s)."
msgstr "" msgstr ""
#: I18n.php:687 #: I18n.php:682
#, php-format #, php-format
msgid "Fail to write %s JS catalog in file (%s)." msgid "Fail to write %s JS catalog in file (%s)."
msgstr "" msgstr ""
#: I18n.php:692 #: I18n.php:687
#, php-format #, php-format
msgid "%s JS catalog writed (%s)." msgid "%s JS catalog writed (%s)."
msgstr "" msgstr ""
#: App.php:126 #: App.php:183
msgid "Hello world!" msgid "Hello world!"
msgstr "" msgstr ""
#: App.php:137 #: App.php:194
msgid "Disconnected" msgid "Disconnected"
msgstr "" msgstr ""
#: App.php:139 #: App.php:196
msgid "You are now disconnected." msgid "You are now disconnected."
msgstr "" msgstr ""

View file

@ -1,63 +1,104 @@
#: Cli.php:34 #: Cli.php:44
msgid "Create a new project using EesyPHP framework"
msgstr ""
#: Cli.php:47
msgid ""
"This command could be used to easily build the structure of a new project "
"using the EesyPHP framework."
msgstr ""
#: Cli.php:55
msgid "Start the PHP built-in HTTP server to serve the application"
msgstr ""
#: Cli.php:58
msgid ""
"This command could be used to start the PHP built-in HTTP server to serve "
"the application."
msgstr ""
#: Cli.php:89
#, php-format #, php-format
msgid "The CLI command '%s' already exists." msgid "The CLI command '%s' already exists."
msgstr "" msgstr ""
#: Cli.php:39 #: Cli.php:94
#, php-format #, php-format
msgid "The CLI command '%s' handler is not callable !" msgid "The CLI command '%s' handler is not callable !"
msgstr "" msgstr ""
#: Cli.php:71 #: Cli.php:126
#, php-format #, php-format
msgid "Usage: %s [-h] [-qd] command\n" msgid "Usage: %s [-h] [-qd] command\n"
msgstr "" msgstr ""
#: Cli.php:72 #: Cli.php:127
msgid " -h Show this message\n" msgid " -h Show this message\n"
msgstr "" msgstr ""
#: Cli.php:73 #: Cli.php:128
msgid " -q / -d Quiet/Debug mode\n" msgid " -q / -d Quiet/Debug mode\n"
msgstr "" msgstr ""
#: Cli.php:74 #: Cli.php:129
msgid " --trace Trace mode (the most verbose)\n" msgid " --trace Trace mode (the most verbose)\n"
msgstr "" msgstr ""
#: Cli.php:75 #: Cli.php:130
msgid " command Command to run\n" msgid " command Command to run\n"
msgstr "" msgstr ""
#: Cli.php:77 #: Cli.php:132
msgid "Available commands:\n" msgid "Available commands:\n"
msgstr "" msgstr ""
#: Cli.php:125 #: Cli.php:182
msgid "Only one command could be executed !" msgid "Only one command could be executed !"
msgstr "" msgstr ""
#: Cli.php:153 #: Cli.php:210
#, php-format #, php-format
msgid "" msgid ""
"Invalid parameter \"%s\".\n" "Invalid parameter \"%s\".\n"
"Note: Command's parameter/argument must be place after the command." "Note: Command's parameter/argument must be place after the command."
msgstr "" msgstr ""
#: Cli.php:178 #: Cli.php:235
#, php-format #, php-format
msgid "An exception occured running command %s" msgid "An exception occured running command %s"
msgstr "" msgstr ""
#: Cli.php:296
msgid ""
"This command only accept one argument: the listen address in format \"host:"
"port\" or \":port\" (= 0.0.0.0:port)."
msgstr ""
#: Cli.php:307
msgid ""
"Invalid listen address specify. Must be in formart host:port (or :port)."
msgstr ""
#: Cli.php:317
msgid "Invalid listen host specified. Must be an IPv4 or IPv6 address."
msgstr ""
#: Cli.php:324
msgid ""
"Invalid listen port specified. Must be a positive integer between 1 and "
"65535."
msgstr ""
#: Db.php:74 #: Db.php:74
msgid "Unable to connect to the database." msgid "Unable to connect to the database."
msgstr "" msgstr ""
#: Auth/Form.php:32 #: Auth/Form.php:33
msgid "Invalid username or password." msgid "Invalid username or password."
msgstr "" msgstr ""
#: Auth/Form.php:64 #: Auth/Form.php:65
msgid "Sign in" msgid "Sign in"
msgstr "" msgstr ""
@ -99,11 +140,11 @@ msgid ""
"%s: %s" "%s: %s"
msgstr "" msgstr ""
#: Tpl.php:394 #: Tpl.php:405
msgid "No template specified." msgid "No template specified."
msgstr "" msgstr ""
#: Tpl.php:425 #: Tpl.php:438
msgid "An error occurred while displaying this page." msgid "An error occurred while displaying this page."
msgstr "" msgstr ""
@ -165,7 +206,7 @@ msgstr ""
msgid "This request could not be processed correctly." msgid "This request could not be processed correctly."
msgstr "" msgstr ""
#: I18n.php:122 App.php:124 #: I18n.php:122 App.php:181
msgid "Hello world !" msgid "Hello world !"
msgstr "" msgstr ""
@ -200,138 +241,138 @@ msgid ""
"directories to MO files and as JS catalogs in locales directory." "directories to MO files and as JS catalogs in locales directory."
msgstr "" msgstr ""
#: I18n.php:341 #: I18n.php:340
msgid "Fail to list EesyPHP PHP files." msgid "Fail to list EesyPHP PHP files."
msgstr "" msgstr ""
#: I18n.php:361 #: I18n.php:360
msgid "Fail to extract messages from EesyPHP PHP files using xgettext." msgid "Fail to extract messages from EesyPHP PHP files using xgettext."
msgstr "" msgstr ""
#: I18n.php:378 #: I18n.php:377
msgid "Fail to list application PHP files." msgid "Fail to list application PHP files."
msgstr "" msgstr ""
#: I18n.php:398 #: I18n.php:397
msgid "Fail to extract messages from PHP files using xgettext." msgid "Fail to extract messages from PHP files using xgettext."
msgstr "" msgstr ""
#: I18n.php:414 #: I18n.php:413
#, php-format #, php-format
msgid "Fail to list JS files in the directory of static files '%s'." msgid "Fail to list JS files in the directory of static files '%s'."
msgstr "" msgstr ""
#: I18n.php:436 #: I18n.php:435
#, php-format #, php-format
msgid "" msgid ""
"Fail to extract messages from JS files in the directory of static files '%s' " "Fail to extract messages from JS files in the directory of static files '%s' "
"using xgettext." "using xgettext."
msgstr "" msgstr ""
#: I18n.php:458 #: I18n.php:457
#, php-format #, php-format
msgid "" msgid ""
"Fail to extract messages from templates directory '%s' using tsmarty2c.php " "Fail to extract messages from templates directory '%s' using tsmarty2c.php "
"script." "script."
msgstr "" msgstr ""
#: I18n.php:494 #: I18n.php:493
msgid "Fail to merge messages using msgcat." msgid "Fail to merge messages using msgcat."
msgstr "" msgstr ""
#: I18n.php:511 #: I18n.php:507
#, php-format #, php-format
msgid "Compendium file %s not found." msgid "Compendium file %s not found."
msgstr "" msgstr ""
#: I18n.php:522 #: I18n.php:518
#, php-format #, php-format
msgid "POT file not found (%s). Please run extract_messages first." msgid "POT file not found (%s). Please run extract_messages first."
msgstr "" msgstr ""
#: I18n.php:534 I18n.php:645 #: I18n.php:530 I18n.php:640
#, php-format #, php-format
msgid "Lang directory '%s' found" msgid "Lang directory '%s' found"
msgstr "" msgstr ""
#: I18n.php:540 I18n.php:651 #: I18n.php:536 I18n.php:646
#, php-format #, php-format
msgid "LC_MESSAGES directory not found in lang '%s' directory, ignore it." msgid "LC_MESSAGES directory not found in lang '%s' directory, ignore it."
msgstr "" msgstr ""
#: I18n.php:555 #: I18n.php:551
#, php-format #, php-format
msgid "Fail to init messages in %s PO file using msginit (%s)." msgid "Fail to init messages in %s PO file using msginit (%s)."
msgstr "" msgstr ""
#: I18n.php:573 #: I18n.php:569
#, php-format #, php-format
msgid "Fail to update messages in %s PO file using msgmerge (%s)." msgid "Fail to update messages in %s PO file using msgmerge (%s)."
msgstr "" msgstr ""
#: I18n.php:579 I18n.php:659 #: I18n.php:575 I18n.php:654
#, php-format #, php-format
msgid "PO file not found in lang '%s' directory, ignore it." msgid "PO file not found in lang '%s' directory, ignore it."
msgstr "" msgstr ""
#: I18n.php:586 I18n.php:699 #: I18n.php:582 I18n.php:694
#, php-format #, php-format
msgid "Fail to open root lang directory (%s)." msgid "Fail to open root lang directory (%s)."
msgstr "" msgstr ""
#: I18n.php:615 #: I18n.php:610
#, php-format #, php-format
msgid "Lang alias symlink found: %s -> %s" msgid "Lang alias symlink found: %s -> %s"
msgstr "" msgstr ""
#: I18n.php:622 #: I18n.php:617
#, php-format #, php-format
msgid "JS catalog symlink for %s -> %s created (%s)" msgid "JS catalog symlink for %s -> %s created (%s)"
msgstr "" msgstr ""
#: I18n.php:626 #: I18n.php:621
#, php-format #, php-format
msgid "Fail to create JS catalog symlink for %s -> %s (%s)" msgid "Fail to create JS catalog symlink for %s -> %s (%s)"
msgstr "" msgstr ""
#: I18n.php:632 #: I18n.php:627
#, php-format #, php-format
msgid "JS catalog symlink for %s -> %s already exist (%s)" msgid "JS catalog symlink for %s -> %s already exist (%s)"
msgstr "" msgstr ""
#: I18n.php:637 #: I18n.php:632
#, php-format #, php-format
msgid "JS catalog file for %s already exist, but it's not a symlink to %s (%s)" msgid "JS catalog file for %s already exist, but it's not a symlink to %s (%s)"
msgstr "" msgstr ""
#: I18n.php:672 #: I18n.php:667
#, php-format #, php-format
msgid "Fail to compile messages from %s PO file as MO file using msgfmt (%s)." msgid "Fail to compile messages from %s PO file as MO file using msgfmt (%s)."
msgstr "" msgstr ""
#: I18n.php:682 #: I18n.php:677
#, php-format #, php-format
msgid "Fail to open %s JS catalog file in write mode (%s)." msgid "Fail to open %s JS catalog file in write mode (%s)."
msgstr "" msgstr ""
#: I18n.php:687 #: I18n.php:682
#, php-format #, php-format
msgid "Fail to write %s JS catalog in file (%s)." msgid "Fail to write %s JS catalog in file (%s)."
msgstr "" msgstr ""
#: I18n.php:692 #: I18n.php:687
#, php-format #, php-format
msgid "%s JS catalog writed (%s)." msgid "%s JS catalog writed (%s)."
msgstr "" msgstr ""
#: App.php:126 #: App.php:183
msgid "Hello world!" msgid "Hello world!"
msgstr "" msgstr ""
#: App.php:137 #: App.php:194
msgid "Disconnected" msgid "Disconnected"
msgstr "" msgstr ""
#: App.php:139 #: App.php:196
msgid "You are now disconnected." msgid "You are now disconnected."
msgstr "" msgstr ""

View file

@ -75,6 +75,38 @@ class Check {
return true; return true;
} }
public static function ip_address($ip, $allow_private_ip_address=true, $allow_reserved_ip_address=true,
$ipv4_only=false, $ipv6_only=false) {
$flag = null;
if ($ipv4_only)
$flag |= FILTER_FLAG_IPV4;
if ($ipv6_only)
$flag |= FILTER_FLAG_IPV6;
if (!isset($allow_private_ip_address) || !$allow_private_ip_address)
$flag |= FILTER_FLAG_NO_PRIV_RANGE;
if (!isset($allow_reserved_ip_address) || !$allow_reserved_ip_address)
$flag |= FILTER_FLAG_NO_RES_RANGE;
if (!is_null($flag))
return (bool)filter_var($ip, FILTER_VALIDATE_IP, $flag);
else
return (bool)filter_var($ip, FILTER_VALIDATE_IP);
}
public static function tcp_or_udp_port($value) {
if (!is_int($value)) {
if (!preg_match('/^[0-9]+$/', $value))
return false;
$value = intval($value);
}
if ($value <= 0) return false;
if ($value > 65635) return false;
return true;
}
public static function is_empty($val) { public static function is_empty($val) {
switch(gettype($val)) { switch(gettype($val)) {
case "boolean": case "boolean":

View file

@ -30,7 +30,7 @@ class Cli {
} }
return self :: $core_mode; return self :: $core_mode;
} }
/** /**
* On CLI set core mode hook * On CLI set core mode hook
* @param \EesyPHP\HookEvent $event * @param \EesyPHP\HookEvent $event
@ -48,6 +48,17 @@ class Cli {
"EesyPHP framework.") "EesyPHP framework.")
); );
} }
else {
self :: add_command(
'serve',
array('\\EesyPHP\\Cli', 'cli_serve'),
I18n :: ___("Start the PHP built-in HTTP server to serve the application"),
null,
I18n :: ___(
"This command could be used to start the PHP built-in HTTP server to serve the ".
"application.")
);
}
} }
/** /**
@ -272,4 +283,62 @@ class Cli {
echo "done. Start coding!\n"; echo "done. Start coding!\n";
} }
/**
* Command to start PHP built-in HTTP server to serve the EesyPHP project
*
* @param array $command_args The command arguments
* @return void
*/
public static function cli_serve($command_args) {
if (count($command_args) > 1) {
self :: usage(
I18n::_(
'This command only accept one argument: the listen address in format "host:port" or '.
'":port" (= 0.0.0.0:port).')
);
return;
}
// Check listen address
$listen_address = ($command_args?$command_args[0]:'127.0.0.1:8000');
$parts = explode(':', $listen_address);
if (count($parts) != 2) {
self :: usage(
I18n::_('Invalid listen address specify. Must be in formart host:port (or :port).')
);
return;
}
if (empty($parts[0])) {
$parts[0] = '0.0.0.0';
}
else if (!Check::ip_address($parts[0])) {
self :: usage(
I18n::_('Invalid listen host specified. Must be an IPv4 or IPv6 address.')
);
return;
}
if (!Check::tcp_or_udp_port($parts[1])) {
self :: usage(
I18n::_('Invalid listen port specified. Must be a positive integer between 1 and 65535.')
);
return;
}
$listen_address = implode(':', $parts);
$public_html = App::get('root_directory_path')."/public_html";
chdir($public_html) or die(
sprintf(
'Fail to enter in the public_html directory of the application (%s).',
$public_html
)
);
passthru(
"EESYPHP_SERVE_URL=http://$listen_address ".PHP_BINARY." -S $listen_address index.php",
$exit_code
);
exit($exit_code);
}
} }

View file

@ -64,12 +64,13 @@ class Url {
* @return void * @return void
*/ */
public static function init($public_root_url=null, $api_mode=false) { public static function init($public_root_url=null, $api_mode=false) {
if (is_null($public_root_url)) if (php_sapi_name() == 'cli-server' && getenv('EESYPHP_SERVE_URL'))
$public_root_url = getenv('EESYPHP_SERVE_URL');
else if (is_null($public_root_url))
$public_root_url = App::get('public_root_url', null, 'string'); $public_root_url = App::get('public_root_url', null, 'string');
if (is_string($public_root_url) && $public_root_url) { if (is_string($public_root_url) && $public_root_url) {
// Check URL end // Remove trailing slash
if (substr(self :: $public_root_url, -1) == '/') $public_root_url = rtrim($public_root_url, '/');
$public_root_url = substr($public_root_url, 0, -1);
self :: $public_root_url = $public_root_url?$public_root_url:null; self :: $public_root_url = $public_root_url?$public_root_url:null;
} }
self :: $_api_mode = boolval($api_mode); self :: $_api_mode = boolval($api_mode);