cleanup prepend file (psr2 and short array)

master
Jean-Christian Paul Denis 2021-08-26 01:34:34 +02:00
parent 572e45197f
commit d9269c60bf
1 changed files with 45 additions and 42 deletions

View File

@ -10,69 +10,72 @@
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ # -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_RC_PATH')) return; if (!defined('DC_RC_PATH')) {
if (version_compare(str_replace("-r","-p",DC_VERSION),'2.2-alpha','<')){return;} return;
}
if (version_compare(str_replace("-r", "-p", DC_VERSION), '2.2-alpha', '<')) {
return;
}
global $__autoload, $core; global $__autoload, $core;
# Set a URL shortener for quick get request # Set a URL shortener for quick get request
if (!defined('SHORTEN_SERVICE_NAME')) { if (!defined('SHORTEN_SERVICE_NAME')) {
define('SHORTEN_SERVICE_NAME','Is.gd'); define('SHORTEN_SERVICE_NAME', 'Is.gd');
} }
if (!defined('SHORTEN_SERVICE_API')) { if (!defined('SHORTEN_SERVICE_API')) {
define('SHORTEN_SERVICE_API','http://is.gd/api.php?'); define('SHORTEN_SERVICE_API', 'http://is.gd/api.php?');
} }
if (!defined('SHORTEN_SERVICE_BASE')) { if (!defined('SHORTEN_SERVICE_BASE')) {
define('SHORTEN_SERVICE_BASE','http://is.gd/'); define('SHORTEN_SERVICE_BASE', 'http://is.gd/');
} }
if (!defined('SHORTEN_SERVICE_PARAM')) { if (!defined('SHORTEN_SERVICE_PARAM')) {
define('SHORTEN_SERVICE_PARAM','longurl'); define('SHORTEN_SERVICE_PARAM', 'longurl');
} }
if (!defined('SHORTEN_SERVICE_ENCODE')) { if (!defined('SHORTEN_SERVICE_ENCODE')) {
define('SHORTEN_SERVICE_ENCODE',false); define('SHORTEN_SERVICE_ENCODE', false);
} }
# Main class # Main class
$__autoload['kutrl'] = dirname(__FILE__).'/inc/class.kutrl.php'; $d = dirname(__FILE__) . '/inc/';
$__autoload['kutrlService'] = dirname(__FILE__).'/inc/lib.kutrl.srv.php'; $__autoload['kutrl'] = $d . 'class.kutrl.php';
$__autoload['kutrlLog'] = dirname(__FILE__).'/inc/lib.kutrl.log.php'; $__autoload['kutrlService'] = $d . 'lib.kutrl.srv.php';
$__autoload['kutrlLog'] = $d . 'lib.kutrl.log.php';
# Services # Services
$__autoload['bilbolinksKutrlService'] = dirname(__FILE__).'/inc/services/class.bilbolinks.service.php'; $__autoload['bilbolinksKutrlService'] = $d . 'services/class.bilbolinks.service.php';
$core->addBehavior('kutrlService', function() { return array("bilbolinks","bilbolinksKutrlService"); } ); $core->addBehavior('kutrlService', function() { return ["bilbolinks","bilbolinksKutrlService"]; } );
$__autoload['bitlyKutrlService'] = dirname(__FILE__).'/inc/services/class.bitly.service.php'; $__autoload['bitlyKutrlService'] = $d . 'services/class.bitly.service.php';
$core->addBehavior('kutrlService', function() { return array("bitly","bitlyKutrlService"); } ); $core->addBehavior('kutrlService', function() { return ["bitly","bitlyKutrlService"]; } );
$__autoload['customKutrlService'] = dirname(__FILE__).'/inc/services/class.custom.service.php'; $__autoload['customKutrlService'] = $d . 'services/class.custom.service.php';
$core->addBehavior('kutrlService', function() { return array("custom","customKutrlService"); } ); $core->addBehavior('kutrlService', function() { return ["custom","customKutrlService"]; } );
$__autoload['defaultKutrlService'] = dirname(__FILE__).'/inc/services/class.default.service.php'; $__autoload['defaultKutrlService'] = $d . 'services/class.default.service.php';
$core->addBehavior('kutrlService', function() { return array("default","defaultKutrlService"); } ); $core->addBehavior('kutrlService', function() { return ["default","defaultKutrlService"]; } );
$__autoload['googlKutrlService'] = dirname(__FILE__).'/inc/services/class.googl.service.php'; $__autoload['googlKutrlService'] = $d . 'services/class.googl.service.php';
$core->addBehavior('kutrlService', function() { return array("googl","googlKutrlService"); } ); $core->addBehavior('kutrlService', function() { return ["googl","googlKutrlService"]; } );
$__autoload['isgdKutrlService'] = dirname(__FILE__).'/inc/services/class.isgd.service.php'; $__autoload['isgdKutrlService'] = $d . 'services/class.isgd.service.php';
$core->addBehavior('kutrlService', function() { return array("isgd","isgdKutrlService"); } ); $core->addBehavior('kutrlService', function() { return ["isgd","isgdKutrlService"]; } );
$__autoload['localKutrlService'] = dirname(__FILE__).'/inc/services/class.local.service.php'; $__autoload['localKutrlService'] = $d . 'services/class.local.service.php';
$core->addBehavior('kutrlService', function() { return array("local","localKutrlService"); } ); $core->addBehavior('kutrlService', function() { return ["local","localKutrlService"]; } );
$__autoload['shorttoKutrlService'] = dirname(__FILE__).'/inc/services/class.shortto.service.php'; $__autoload['shorttoKutrlService'] = $d . 'services/class.shortto.service.php';
$core->addBehavior('kutrlService', function() { return array("shortto","shorttoKutrlService"); } ); $core->addBehavior('kutrlService', function() { return ["shortto","shorttoKutrlService"]; } );
$__autoload['trimKutrlService'] = dirname(__FILE__).'/inc/services/class.trim.service.php'; $__autoload['trimKutrlService'] = $d . 'services/class.trim.service.php';
$core->addBehavior('kutrlService', function() { return array("trim","trimKutrlService"); } ); $core->addBehavior('kutrlService', function() { return ["trim","trimKutrlService"]; } );
$__autoload['yourlsKutrlService'] = dirname(__FILE__).'/inc/services/class.yourls.service.php'; $__autoload['yourlsKutrlService'] = $d . 'services/class.yourls.service.php';
$core->addBehavior('kutrlService', function() { return array("yourls","yourlsKutrlService"); } ); $core->addBehavior('kutrlService', function() { return ["yourls","yourlsKutrlService"]; } );
$__autoload['suprKutrlService'] = dirname(__FILE__).'/inc/services/class.supr.service.php'; $__autoload['suprKutrlService'] = $d . 'services/class.supr.service.php';
$core->addBehavior('kutrlService', function() { return array("supr","suprKutrlService"); } ); $core->addBehavior('kutrlService', function() { return ["supr","suprKutrlService"]; } );
# Shorten url passed through wiki functions # Shorten url passed through wiki functions
$__autoload['kutrlWiki'] = dirname(__FILE__).'/inc/lib.wiki.kutrl.php'; $__autoload['kutrlWiki'] = $d . 'lib.wiki.kutrl.php';
$core->addBehavior('coreInitWikiPost',array('kutrlWiki','coreInitWiki')); $core->addBehavior('coreInitWikiPost',['kutrlWiki','coreInitWiki']);
$core->addBehavior('coreInitWikiComment',array('kutrlWiki','coreInitWiki')); $core->addBehavior('coreInitWikiComment',['kutrlWiki','coreInitWiki']);
$core->addBehavior('coreInitWikiSimpleComment',array('kutrlWiki','coreInitWiki')); $core->addBehavior('coreInitWikiSimpleComment',['kutrlWiki','coreInitWiki']);
# Public page # Public page
$core->url->register('kutrl','go','^go(/(.*?)|)$',array('urlKutrl','redirectUrl')); $core->url->register('kutrl', 'go', '^go(/(.*?)|)$', ['urlKutrl', 'redirectUrl']);
# Add kUtRL events on plugin activityReport # Add kUtRL events on plugin activityReport
if (defined('ACTIVITY_REPORT')) if (defined('ACTIVITY_REPORT')) {
{ require_once $d . 'lib.kutrl.activityreport.php';
require_once dirname(__FILE__).'/inc/lib.kutrl.activityreport.php';
} }
?>