J3.x

Difference between revisions of "Creating a simple module/Adding Auto Update/es"

From Joomla! Documentation

< J3.x:Creating a simple module
(Created page with "Recuerdas el archivo sql de actualización que hemos mencionado en la sección Utilizar la base de datos? Es...")
Line 6: Line 6:
 
La primera cosa a hacer es leer el tutorial [[S:MyLanguage/J2.5:Managing_Component_Updates|Gestionar Actualizaciones de Componentes con Joomla 2.5 - Parte 1]] para tener una idea cómo funciona el proceso de actualización en Joomla. Si bien fue escrito para 2.5 el proceso no ha cambiado para Joomla 3.x. Lee también [[S:MyLanguage/Deploying_an_Update_Server|Desarrollo de un servidor de actualización]] - esto es lo que vamos a implementar en este tutorial.
 
La primera cosa a hacer es leer el tutorial [[S:MyLanguage/J2.5:Managing_Component_Updates|Gestionar Actualizaciones de Componentes con Joomla 2.5 - Parte 1]] para tener una idea cómo funciona el proceso de actualización en Joomla. Si bien fue escrito para 2.5 el proceso no ha cambiado para Joomla 3.x. Lee también [[S:MyLanguage/Deploying_an_Update_Server|Desarrollo de un servidor de actualización]] - esto es lo que vamos a implementar en este tutorial.
  
Remember that sql update file we mentioned in the [[S:MyLanguage/J3.1:Creating_a_simple_module/Using_the_Database|Using the database]] section? That will be used to update our database still. Whilst a new zipped version of our module will be used to update all the php files. To keep this simple for now we will update the files and sql database without any checks for Joomla version and the version of the module that is currently installed (it is recommended these are used in a production module).
+
Recuerdas el archivo sql de actualización que hemos mencionado en la sección [[S:MyLanguage/J3.1:Creating_a_simple_module/Using_the_Database|Utilizar la base de datos]]? Es el que se utilizará para actualizar nuestra base de datos ahora. Mientras que una nueva versión comprimida de nuestro módulo se utilizará para actualizar todos los archivos php. Para mantener esto sencillo, por ahora vamos a actualizar los archivos y base de datos sql sin ningún tipo de comprobaciones de la versión de Joomla y la versión del módulo que está actualmente instalado (se recomienda que esto se utilice en un módulo de producción).
  
 
== Updating our module ==
 
== Updating our module ==

Revision as of 08:45, 29 August 2015

Other languages:
Bahasa Indonesia • ‎English • ‎Nederlands • ‎español • ‎français • ‎português • ‎中文(台灣)‎
Joomla! 
3.x
Tutorial
Crear un módulo simple

Esta es una serie de artículos múltiples sobre cómo crear un módulo para Joomla! Versión Joomla 3.x. Puedes navegar por los artículos en esta serie usando el menú desplegable de navegación.

Comienza con la Introducción y navega por los artículos de esta serie usando el botón de navegación en la parte inferior o en el cuadro de la derecha ("Artículos de esta serie").




Esta sección del tutorial te ayudará a crear un servidor de actualización para que el módulo pueda utilizar el sistema de actualización de un clic de Joomla.

Introducción y Lectura previa

La primera cosa a hacer es leer el tutorial Gestionar Actualizaciones de Componentes con Joomla 2.5 - Parte 1 para tener una idea cómo funciona el proceso de actualización en Joomla. Si bien fue escrito para 2.5 el proceso no ha cambiado para Joomla 3.x. Lee también Desarrollo de un servidor de actualización - esto es lo que vamos a implementar en este tutorial.

Recuerdas el archivo sql de actualización que hemos mencionado en la sección Utilizar la base de datos? Es el que se utilizará para actualizar nuestra base de datos ahora. Mientras que una nueva versión comprimida de nuestro módulo se utilizará para actualizar todos los archivos php. Para mantener esto sencillo, por ahora vamos a actualizar los archivos y base de datos sql sin ningún tipo de comprobaciones de la versión de Joomla y la versión del módulo que está actualmente instalado (se recomienda que esto se utilice en un módulo de producción).

Updating our module

The only way to update our existing module is to add in a update server into the xml file.

<updateservers>
	<server type="extension" name="Helloworld" priority="1">http://www.example.com/helloworld_update.xml</server>
</updateservers>

Joomla! will now search http://www.example.com/helloworld_update.xml for updates with a frequency set in the extension manager options.

Creating an update

So now that Joomla is searching for updates to our extension - lets create one to test out our process.

Create a copy of the module as it is now. Then lets update the version number to 1.0.1, and also we'll add something into our Update SQL file - in this case an extra German Language file.

<version>1.0.1</version>
INSERT INTO `#__helloworld` (`hello`, `lang`) VALUES ('Hallo Welt', 'de-DE');

Note we can also edit any of our php files - all the existing php files will be overridden by the ones in the update file (Note: This is the reason why core hacks of any extension are discouraged - they will be lost on the extension update).

Now we must create the xml file at http://www.example.com/helloworld_update.xml to let Joomla know an update is available.

<updates>
	<update>
		<name>Helloworld</name>
		<description>This is mod_helloworld 1.0.1</description>
		<element>mod_helloworld</element>
		<type>module</type>
		<version>1.0.1</version>
		<downloads>
			<downloadurl type="full" format="zip">http://www.example.com/mod_helloworld_101.zip</downloadurl>
		</downloads>
		<maintainer>Joomla</maintainer>
		<maintainerurl>http://www.example.com</maintainerurl>
		<targetplatform name="joomla" version="3.1"/>
		<client>site</client>
	</update>
</updates>

where http://www.example.com/mod_helloworld_101.zip is the zip of our newly created update. If you now log into the backend of Joomla you should now see in the control panel that an automatic update is available (if not you may need to purge your cache in the update section of the extension manager). Simply click update and you'll find your module has been updated to version 1.0.1.

Commercial Modules

Note that in our files we have linked to the extensions updates xml file. And from that xml file we have a location for the zip of the module. This means that if someone were to track this backwards they could find the physical source of your modules zip file (and make it available/use it after a subscription has expired etc.). For this reason generally commercial modules do not contain automatic updates (although they often will inform you of updates in some alternative way).

Conclusion

Updating modules in Joomla is really easy for both users and the extension developers to perform and should be expected as standard with any module since Joomla! 3.1.