ultimix
package_manager_controller.php
Go to the documentation of this file.
1 <?php
2 
3  /*
4  * This source code is a part of the Ultimix Project.
5  * It is distributed under BSD license. All other third side source code (like tinyMCE) is distributed under
6  * it's own license wich could be found from the corresponding files or sources.
7  * This source code is provided "as is" without any warranties or garanties.
8  *
9  * Have a nice day!
10  *
11  * @url http://ultimix.sorceforge.net
12  *
13  * @author Alexey "gdever" Dodonov
14  */
15 
27 
46  function install_package( $Options )
47  {
48  try
49  {
50  $Security = get_package( 'security' , 'last' , __FILE__ );
51  $PackageAlgoritms = get_package( 'core::package_algorithms' , 'last' , __FILE__ );
52  $MasterPackage = explode( '#' , $Security->get_gp( 'package_selection' , 'string' ) );
53  $PackageAlgoritms->install_package(
54  $UploadFileAccess->UploadedFilePath , $MasterPackage[ 0 ] , $MasterPackage[ 1 ]
55  );
56  }
57  catch( Exception $e )
58  {
59  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
60  }
61  }
62 
81  function delete_package( $Options )
82  {
83  try
84  {
85  $Security = get_package( 'security' , 'last' , __FILE__ );
86  $PackageName = $Security->get_gp( 'package_name' , 'string' );
87  $PackageVersion = $Security->get_gp( 'package_version' , 'string' );
88 
89  $ROOT_DIR = _get_root_dir( $PackageName , $PackageVersion , INSTALL_DIR );
90  $PackageDirectory = _get_package_path( $PackageName , $PackageVersion , $ROOT_DIR );
91 
92  _delete_package( $PackageName , $PackageVersion );
93  }
94  catch( Exception $e )
95  {
96  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
97  }
98  }
99 
118  function controller( $Options )
119  {
120  try
121  {
122  $Context = get_package( 'gui::context' , 'last' , __FILE__ );
123 
124  $Context->load_config( dirname( __FILE__ ).'/conf/cfcx_delete_package' );
125  if( $Context->execute( $Options , $this ) )return;
126 
127  $Context->load_config( dirname( __FILE__ ).'/conf/cfcx_install_package' );
128  if( $Context->execute( $Options , $this ) )return;
129  }
130  catch( Exception $e )
131  {
132  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
133  }
134  }
135  }
136 
137 ?>