This repository has been archived by the owner on May 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makelos
68 lines (54 loc) · 1.79 KB
/
makelos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env php
<?php
array_shift($argv);
defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR);
$task = empty($argv) ? false : array_shift($argv);
$task = !in_array($task,get_class_methods('Makelos')) ? 'help' : $task;
include(dirname(__FILE__).str_repeat(DS.'..', 4).DS.'config'.DS.'config.php');
class Makelos
{
var $repository = 'http://svn.akelos.org/plugins/acts_as_creditable';
function help()
{
echo "\nValid commands are ".join(', ', get_class_methods('Makelos'))."\n";
}
function test($options = array())
{
system('/usr/bin/env php '.dirname(__FILE__).'/test/acts_as_trackable.php');
}
function install()
{
$Installer =& $this->_getInstaller();
$Installer->install();
}
function uninstall()
{
$Installer =& $this->_getInstaller();
$Installer->uninstall();
}
function &_getInstaller()
{
require_once(dirname(__FILE__).DS.'installer'.DS.'acts_as_trackable_installer.php');
$Installer =& new ActsAsTrackableInstaller();
return $Installer;
}
function connectToDatabase($database_settings)
{
$this->_includeDependencies();
Ak::db($database_settings[AK_ENVIRONMENT]);
}
function _includeDependencies()
{
require_once(AK_LIB_DIR.DS.'Ak.php');
require_once(AK_LIB_DIR.DS.'AkObject.php');
require_once(AK_LIB_DIR.DS.'AkInflector.php');
require_once(AK_LIB_DIR.DS.'AkPlugin.php');
require_once(AK_LIB_DIR.DS.'AkPlugin/AkPluginManager.php');
require_once(AK_LIB_DIR.DS.'AkInstaller.php');
require_once(AK_LIB_DIR.DS.'utils'.DS.'generators'.DS.'AkelosGenerator.php');
}
}
$Makelos = new Makelos();
$Makelos->connectToDatabase($database_settings);
$Makelos->$task(@$argv);
?>