Return to Snippet

Revision: 65513
at December 11, 2013 03:35 by PLATANIUM


Initial Code
<?php 
defined('_JEXEC') or die('Restricted access');

$this->path = JInstaller::getInstance()->getPath('extension_administrator');

$path = $this->path;

$path2 = JInstaller::getInstance()->getPath('extension_site');
//Fichero controlador Back

if(JFolder::create(JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'media')){}
if(JFolder::create(JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'media'.DS.'css')){}
if(JFolder::create(JPATH_ROOT.DS.'components'.DS.'com_virtuemart'.DS.'models')){}
if(JFolder::create(JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'views'.DS.'kiala')){}
if(JFolder::create(JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'views'.DS.'kiala'.DS.'tmpl')) {}
if(JFolder::create(JPATH_ROOT.DS.'components'.DS.'com_virtuemart'.DS.'views'.DS.'kiala')){}
if(JFolder::create(JPATH_ROOT.DS.'components'.DS.'com_virtuemart'.DS.'views'.DS.'kiala'.DS.'tmpl')) {}

if(JFile::exists($path .DS. 'controllers' .DS. 'kiala.php')){


					JFile::copy($path .DS.'controllers'.DS.'kiala.php', JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'controllers'.DS.'kiala.php');
				
			}
			
//Fichero modelo Back
			
if(JFile::exists($path .DS. 'models' .DS. 'kiala.php')){


					JFile::copy($path .DS.'models'.DS.'kiala.php', JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'models'.DS.'kiala.php');
				
			}
			
//Fichero controlador Front

if(JFile::exists($path2 .DS. 'controllersfront' .DS. 'kiala.php')){


					JFile::copy($path2 .DS.'controllersfront'.DS.'kiala.php', JPATH_ROOT.DS.'components'.DS.'com_virtuemart'.DS.'controllers'.DS.'kiala.php');
				
			}


			
//Fichero modelo Front


			
if(JFile::exists($path2 .DS. 'modelsfront' .DS. 'kiala.php')){


					JFile::copy($path2 .DS.'modelsfront'.DS.'kiala.php', JPATH_ROOT.DS.'components'.DS.'com_virtuemart'.DS.'models'.DS.'kiala.php');
				
			}			
			
if(JFile::exists($path .DS. 'models' .DS. 'kiala_ws.php')){


					JFile::copy($path .DS.'models'.DS.'kiala_ws.php', JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'models'.DS.'kiala_ws.php');
				
			}
			
//Carpeta Vistas Back

if(JFile::exists($path .DS. 'media' .DS.'css'.DS. 'kiala.css')){


					JFile::copy($path .DS.'media'.DS.'css'.DS.'kiala.css', JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'media' .DS.'css'.DS.'kiala.css');
				
			}


				
				if(JFile::exists($path .DS. 'views' .DS.'kiala'.DS. 'view.html.php')){


					JFile::copy($path .DS.'views'.DS.'kiala'.DS.'view.html.php', JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'views' .DS.'kiala'.DS.'view.html.php');
				
			}

			if(JFile::exists($path .DS. 'views' .DS.'kiala'.DS. 'index.html')){


					JFile::copy($path .DS.'views'.DS.'kiala'.DS.'index.html', JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'views' .DS.'kiala'.DS.'index.html');
				
			}

				

		
				if(JFile::exists($path .DS. 'views' .DS.'kiala'.DS. 'tmpl'.DS. 'index.html')){


					JFile::copy($path .DS.'views'.DS.'kiala'.DS. 'tmpl'.DS. 'index.html', JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'views' .DS.'kiala' .DS.'tmpl'.DS.'index.html');
				
			}
			
			if(JFile::exists($path .DS. 'views' .DS.'kiala'.DS. 'tmpl'.DS. 'kialacp.php')){


					JFile::copy($path .DS.'views'.DS.'kiala'.DS. 'tmpl'.DS. 'kialacp.php', JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'views' .DS.'kiala' .DS.'tmpl'.DS.'kialacp.php');
				
			}
			
			if(JFile::exists($path .DS. 'views' .DS.'kiala'.DS. 'tmpl'.DS. 'order.php')){


					JFile::copy($path .DS.'views'.DS.'kiala'.DS. 'tmpl'.DS. 'order.php', JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'views' .DS.'kiala' .DS.'tmpl'.DS.'order.php');
				
			}
			
			if(JFile::exists($path .DS. 'views' .DS.'kiala'.DS. 'tmpl'.DS. 'order_editstatus.php')){


					JFile::copy($path .DS.'views'.DS.'kiala'.DS. 'tmpl'.DS. 'order_editstatus.php', JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'views' .DS.'kiala' .DS.'tmpl'.DS.'order_editstatus.php');
				
			}
			
			if(JFile::exists($path .DS. 'views' .DS.'kiala'.DS. 'tmpl'.DS. 'order_print.php')){


					JFile::copy($path .DS.'views'.DS.'kiala'.DS. 'tmpl'.DS. 'order_print.php', JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'views' .DS.'kiala' .DS.'tmpl'.DS.'order_print.php');
				
			}
			
			if(JFile::exists($path .DS. 'views' .DS.'kiala'.DS. 'tmpl'.DS. 'orders.php')){


					JFile::copy($path .DS.'views'.DS.'kiala'.DS. 'tmpl'.DS. 'orders.php', JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'views' .DS.'kiala' .DS.'tmpl'.DS.'orders.php');
				
			}
			
//View Front

if(JFile::exists($path2 .DS. 'viewsfront' .DS.'kiala'.DS. 'view.html.php')){


					JFile::copy($path2 .DS.'viewsfront'.DS.'kiala'.DS.'view.html.php', JPATH_ROOT.DS.'components'.DS.'com_virtuemart'.DS.'views' .DS.'kiala'.DS.'view.html.php');
				
			}

if(JFile::exists($path2 .DS. 'viewsfront' .DS.'kiala'.DS. 'tmpl'.DS. 'index.html')){


					JFile::copy($path2 .DS.'viewsfront'.DS.'kiala'.DS. 'tmpl'.DS. 'index.html', JPATH_ROOT.DS.'components'.DS.'com_virtuemart'.DS.'views' .DS.'kiala' .DS.'tmpl'.DS.'index.html');
				
			}

if(JFile::exists($path2 .DS. 'viewsfront' .DS.'kiala'.DS. 'tmpl'.DS. 'kiala.php')){


					JFile::copy($path2 .DS.'viewsfront'.DS.'kiala'.DS. 'tmpl'.DS. 'kiala.php', JPATH_ROOT.DS.'components'.DS.'com_virtuemart'.DS.'views' .DS.'kiala' .DS.'tmpl'.DS.'kiala.php');
				
			}			

if(JFile::exists($path2 .DS. 'viewsfront' .DS.'kiala'.DS. 'tmpl'.DS. 'details_kiala.php')){


					JFile::copy($path2 .DS.'viewsfront'.DS.'kiala'.DS. 'tmpl'.DS. 'details_kiala.php', JPATH_ROOT.DS.'components'.DS.'com_virtuemart'.DS.'views' .DS.'kiala' .DS.'tmpl'.DS.'details_kiala.php');
				
}	
			
?>

Initial URL


Initial Description
I created myself an install file using PHP. What this file does is creates folders and puts in each folder the corresponding file from the zip. Afterwards these files are moved to other folders which are already created or will be created by the install file. (I know this might sound as a stupid procces instead of just moving the files to the folders the first place but theres a reason for this).

The problem is that when I install the zip it creates the folders with the files and creates the newer folders where the files are supposed to be move but I have to install the zip two or three times for all of the proccess to be done properly.

Why could this be?

Here is the file I have and hopefully I have explained myself :).

Initial Title
PHP Installation file issue

Initial Tags
php

Initial Language
PHP