plugin

init()

6: 	public function init() {
8: 		$repositories = file(DIR_LIB . '/plugin/repositories');
10: 		$plugins = array();
12: 		foreach ($repositories as $repo) {
13: 			exec("svn list " . trim($repo), $plugins);
14: 			foreach ($plugins as $plugin) {
15: 				$this->repositories[rtrim($plugin, '/')] = trim($repo);
16: 			}
17: 		}
18: 	}

File: lib/plugin/plugin.php, #line 6

_list()

24: 	public function _list() {
25: 		$active_support = new ActiveSupport;
26: 		$this->init();
27: 		foreach ($this->repositories as $plugin => $repository) {
28: 			echo $active_support->rjust(rtrim($plugin, '/'), 25) . "{$repository} n";
29: 		}
30: 	}

File: lib/plugin/plugin.php, #line 24

cretae_plugin_folder()

32: 	public function cretae_plugin_folder() {
34: 		$path = DIR_VENDOR . '/';
36: 		$structure = array (
37: 			'plugins'
38: 		);
40: 		$this->create_dir_templates($structure, $path);
41: 	}

File: lib/plugin/plugin.php, #line 32

create($plugin)

43: 	public function create($plugin) {
45: 		$this->cretae_plugin_folder();
47: 		$path = DIR_VENDOR . '/';
49: 		$structure = array (
50: 			'plugins/' . $plugin
51: 		);
53: 		$this->create_dir_templates($structure, $path);
55: 		$dir_structure = array (
56: 			'lib',
57: 			'test'
58: 		);
60: 		$file_structure = array (
61: 			'init' => 'init.php',
62: 			'install' => 'install.php',
63: 			'uninstall' => 'uninstall.php',
64: 			'README' => 'README'
65: 		);
67: 		$path .= 'plugins/' . $plugin . '/';
69: 		$this->create_dir_templates($dir_structure, $path);
71: 		$this->create_file_templates($file_structure, $path);
72: 	}

File: lib/plugin/plugin.php, #line 43

install($plugin)

102: 	public function install($plugin) {
104: 		$this->init();
106: 		$repo = $this->find_plugin($plugin);
108: 		$plugin_path = DIR_VENDOR . '/plugins/' . $plugin;
109:
110: 		if (is_dir($plugin_path)) {
111: 			echo  "Plugin already exists in vendor/plugins n";
112: 		} else {
114: 			$this->cretae_plugin_folder();
116: 			exec("svn export {$repo}/{$plugin} " . $plugin_path, $directories);
118: 			$msg = array_pop($directories);
120: 			foreach($directories as $entry) {
121: 				echo "t export " . str_replace(array(realpath(APP_ROOT),' ','A/'),'',$entry) . "n";
122: 			}
123:
125: 			if (is_file($plugin_path . '/install.php')) {
126: 				echo "Installing... n";
127: 				include_once $plugin_path . '/install.php';
128: 			}
129:
130: 			echo "t {$msg} n";
131: 		}
132: 	}

File: lib/plugin/plugin.php, #line 102

uninstall($plugin)

134: 	public function uninstall($plugin) {
136: 		$this->init();
138: 		$plugin_path = DIR_VENDOR . '/plugins/' . $plugin;
139: 		if (is_dir($plugin_path)) {
141: 			$uninstall_path = $plugin_path . '/uninstall.php';
143: 			if (is_file($uninstall_path)) {
144: 				echo "Uninstalling... n";
145: 				include_once $uninstall_path;
146: 			}
148: 			exec("rm -r " . $plugin_path, $output, $return);
149: 			if (!$return)
150: 				echo "Plugin has been removed '{$plugin}' n";
151: 		} else {
152: 			echo "Plugin not exists in vendor/plugins n";
153: 		}
154: 	}

File: lib/plugin/plugin.php, #line 134

reinstall($plugin)

156: 	public function reinstall($plugin) {
157: 		$this->uninstall($plugin);
158: 		$this->install($plugin);
159: 	}

File: lib/plugin/plugin.php, #line 156

update()

161: 	public function update() {
162:
163: 	}

File: lib/plugin/plugin.php, #line 161

sources()

169: 	public function sources() {
170: 		$this->init();
171: 		foreach ($this->repositories as $repo) {
172: 			echo trim($repo) . "n";
173: 		}
174: 	}

File: lib/plugin/plugin.php, #line 169

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>