Skip to content

Commit

Permalink
Move composer vendor directory
Browse files Browse the repository at this point in the history
  • Loading branch information
usox committed Aug 18, 2020
1 parent 3c7b30b commit 995fc5d
Show file tree
Hide file tree
Showing 21 changed files with 25 additions and 28 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
/config/ampache.cfg.php
/config/registration_agreement.php
/lib/components/
/lib/vendor/
/log/
/logs/
/modules/plugins/ampache-*
Expand Down
6 changes: 2 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"license": "AGPL-3.0",
"config":
{
"vendor-dir": "lib/vendor",
"component-dir": "public/lib/components",
"platform": {
"ext-curl": "1.0",
Expand Down Expand Up @@ -331,13 +330,12 @@
"merge-extra": false
},
"sort-packages": true,
"installer-types": ["component", "library"],
"installer-types": ["component"],
"installer-paths": {
"public/lib/components/noty/": ["needim/noty"],
"public/lib/components/jquery-file-upload/": ["blueimp/jquery-file-upload"],
"public/lib/components/happyworm-jplayer/": ["happyworm/jplayer"],
"public/lib/components/{$name}/": ["type:component"],
"lib/vendor/{$vendor}/{$name}": ["type:library"]
"public/lib/components/{$name}/": ["type:component"]
}
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/batch.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function get_media_files($media_ids)
function send_zip($name, $media_files)
{
/* Require needed library */
if (!@include_once(AmpConfig::get('prefix') . '/lib/vendor/maennchen/zipstream-php/src/ZipStream.php')) {
if (!@include_once(__DIR__ . '/../vendor/maennchen/zipstream-php/src/ZipStream.php')) {
throw new Exception('Missing ZipStream dependency');
}

Expand Down
10 changes: 5 additions & 5 deletions lib/class/graph.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ class Graph
{
public function __construct()
{
if (!AmpConfig::get('statistical_graphs') || !is_dir(AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/')) {
if (!AmpConfig::get('statistical_graphs') || !is_dir(__DIR__ . '/../../vendor/szymach/c-pchart/src/Chart/')) {
debug_event('graph', 'Access denied, statistical graph disabled.', 1);

return false;
}
require_once AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/Data.php';
require_once AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/Draw.php';
require_once AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/Image.php';
require_once __DIR__ . '/../../vendor/szymach/c-pchart/src/Chart/Data.php';
require_once __DIR__ . '/../../vendor/szymach/c-pchart/src/Chart/Draw.php';
require_once __DIR__ . '/../../vendor/szymach/c-pchart/src/Chart/Image.php';

return true;
}
Expand Down Expand Up @@ -479,7 +479,7 @@ protected function render_graph($title, CpChart\Chart\Data $MyData, $zoom, $widt
/* Add a border to the picture */
$myPicture->drawRectangle(0, 0, $width - 1, $height - 1, array("R" => 0, "G" => 0, "B" => 0));

$font_path = AmpConfig::get('prefix') . "/lib/vendor/szymach/c-pchart/src/Resources/fonts";
$font_path = __DIR__ . "/../../vendor/szymach/c-pchart/src/Resources/fonts";
/* Write the chart title */
$myPicture->setFontProperties(array("FontName" => $font_path . "/Forgotte.ttf", "FontSize" => 11));
$myPicture->drawText(150, 35, $title, array("FontSize" => 20, "Align" => TEXT_ALIGN_BOTTOMMIDDLE));
Expand Down
2 changes: 1 addition & 1 deletion lib/debug.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ function return_bytes($val)
*/
function check_dependencies_folder()
{
return file_exists(AmpConfig::get('prefix') . '/lib/vendor');
return file_exists(__DIR__ . '/../vendor');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/init-tiny.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

// Register autoloaders
spl_autoload_register(array('Core', 'autoload'), true, true);
$composer_autoload = $prefix . '/lib/vendor/autoload.php';
$composer_autoload = __DIR__ . '/../vendor/autoload.php';
if (file_exists($composer_autoload)) {
require_once $composer_autoload;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/catalog/soundcloud/soundcloud.catalog.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function __construct($catalog_id = null)
}
}

if (!@include_once(AmpConfig::get('prefix') . '/lib/vendor/mptre/php-soundcloud/Services/Soundcloud.php')) {
if (!@include_once(__DIR__ . '/../../../vendor/mptre/php-soundcloud/Services/Soundcloud.php')) {
throw new Exception('Missing php-soundcloud dependency');
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/localplay/xbmc/xbmc.controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class AmpacheXbmc extends localplay_controller
public function __construct()
{
/* Do a Require Once On the needed Libraries */
if (!@include_once(AmpConfig::get('prefix') . '/lib/vendor/krixon/xbmc-php-rpc/rpc/HTTPClient.php')) {
if (!@include_once(__DIR__ . '/../../../vendor/krixon/xbmc-php-rpc/rpc/HTTPClient.php')) {
throw new Exception('Missing xbmc-php-rpc dependency');
}
} // Constructor
Expand Down
2 changes: 1 addition & 1 deletion modules/plugins/StreamBandwidth/StreamBandwidth.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function stream_control($media_ids)
return true;
}
// if using free software only you can't use this plugin
if (!AmpConfig::get('statistical_graphs') || !is_dir(AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/')) {
if (!AmpConfig::get('statistical_graphs') || !is_dir(__DIR__ . '/../../../vendor/szymach/c-pchart/src/Chart/')) {
debug_event('streambandwidth.plugin', 'Access denied, statistical graph disabled.', 1);

return true;
Expand Down
2 changes: 1 addition & 1 deletion modules/plugins/StreamHits/StreamHits.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function stream_control($media_ids)
return true;
}
// if using free software only you can't use this plugin
if (!AmpConfig::get('statistical_graphs') || !is_dir(AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/')) {
if (!AmpConfig::get('statistical_graphs') || !is_dir(__DIR__ . '/../../../vendor/szymach/c-pchart/src/Chart/')) {
debug_event('streamhits.plugin', 'Access denied, statistical graph disabled.', 1);

return true;
Expand Down
2 changes: 1 addition & 1 deletion modules/plugins/StreamTime/StreamTime.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function stream_control($media_ids)
return true;
}
// if using free software only you can't use this plugin
if (!AmpConfig::get('statistical_graphs') || !is_dir(AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/')) {
if (!AmpConfig::get('statistical_graphs') || !is_dir(__DIR__ . '/../../../vendor/szymach/c-pchart/src/Chart/')) {
debug_event('streamtime.plugin', 'Access denied, statistical graph disabled.', 1);

return true;
Expand Down
2 changes: 1 addition & 1 deletion public/templates/show_album.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
} ?>
<?php if (($owner_id > 0 && $owner_id == (int) Core::get_global('user')->id) || Access::check('interface', 50)) {
$saveorder = T_('Save Track Order'); ?>
<?php if (AmpConfig::get('statistical_graphs') && is_dir(AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/')) { ?>
<?php if (AmpConfig::get('statistical_graphs') && is_dir(__DIR__ . '/../../vendor/szymach/c-pchart/src/Chart/')) { ?>
<li>
<a href="<?php echo AmpConfig::get('web_path'); ?>/stats.php?action=graph&object_type=album&object_id=<?php echo $album->id; ?>"><?php echo UI::get_icon('statistics', T_('Graphs')); ?></a>
<a href="<?php echo AmpConfig::get('web_path'); ?>/stats.php?action=graph&object_type=album&object_id=<?php echo $album->id; ?>"><?php echo T_('Graphs'); ?></a>
Expand Down
2 changes: 1 addition & 1 deletion public/templates/show_artist.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
<?php
} ?>
<?php if (($owner_id > 0 && $owner_id == $GLOBALS['user']->id) || Access::check('interface', 50)) { ?>
<?php if (AmpConfig::get('statistical_graphs') && is_dir(AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/')) { ?>
<?php if (AmpConfig::get('statistical_graphs') && is_dir(__DIR__ . '/../../vendor/szymach/c-pchart/src/Chart/')) { ?>
<li>
<a href="<?php echo AmpConfig::get('web_path'); ?>/stats.php?action=graph&object_type=artist&object_id=<?php echo $artist->id; ?>"><?php echo UI::get_icon('statistics', T_('Graphs')); ?></a>
<a href="<?php echo AmpConfig::get('web_path'); ?>/stats.php?action=graph&object_type=artist&object_id=<?php echo $artist->id; ?>"><?php echo T_('Graphs'); ?></a>
Expand Down
2 changes: 1 addition & 1 deletion public/templates/show_podcast.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<?php
} ?>
<?php if (Access::check('interface', 50)) { ?>
<?php if (AmpConfig::get('statistical_graphs') && is_dir(AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/')) { ?>
<?php if (AmpConfig::get('statistical_graphs') && is_dir(__DIR__ . '/../../vendor/szymach/c-pchart/src/Chart/')) { ?>
<li>
<a href="<?php echo AmpConfig::get('web_path'); ?>/stats.php?action=graph&object_type=podcast&object_id=<?php echo $podcast->id; ?>"><?php echo UI::get_icon('statistics', T_('Graphs')); ?></a>
<a href="<?php echo AmpConfig::get('web_path'); ?>/stats.php?action=graph&object_type=podcast&object_id=<?php echo $podcast->id; ?>"><?php echo T_('Graphs'); ?></a>
Expand Down
2 changes: 1 addition & 1 deletion public/templates/show_podcast_episode.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<?php
} ?>
<?php if (Access::check('interface', 50)) { ?>
<?php if (AmpConfig::get('statistical_graphs') && is_dir(AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/')) { ?>
<?php if (AmpConfig::get('statistical_graphs') && is_dir(__DIR__ . '/../../vendor/szymach/c-pchart/src/Chart/')) { ?>
<a href="<?php echo AmpConfig::get('web_path'); ?>/stats.php?action=graph&object_type=podcast_episode&object_id=<?php echo $episode->id; ?>"><?php echo UI::get_icon('statistics', T_('Graphs')); ?></a>
<?php
} ?>
Expand Down
2 changes: 1 addition & 1 deletion public/templates/show_song.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
} ?>
<?php if (($song->user_upload > 0 && $song->user_upload == $GLOBALS['user']->id) || Access::check('interface', 50)) {
?>
<?php if (AmpConfig::get('statistical_graphs') && is_dir(AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/')) {
<?php if (AmpConfig::get('statistical_graphs') && is_dir(__DIR__ . '/../../vendor/szymach/c-pchart/src/Chart/')) {
?>
<a href="<?php echo AmpConfig::get('web_path'); ?>/stats.php?action=graph&object_type=song&object_id=<?php echo $song->id; ?>"><?php echo UI::get_icon('statistics', T_('Graphs')); ?></a>
<?php
Expand Down
2 changes: 1 addition & 1 deletion public/templates/show_stats.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<?php UI::show_box_bottom(); ?>

<?php
if (AmpConfig::get('statistical_graphs') && is_dir(AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/')) {
if (AmpConfig::get('statistical_graphs') && is_dir(__DIR__ . '/../../vendor/szymach/c-pchart/src/Chart/')) {
Graph::display_from_request();
}
?>
2 changes: 1 addition & 1 deletion public/templates/show_user.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<?php if (Access::check('interface', 50)) { ?>
<dt class="<?php echo $rowparity; ?>"><?php echo T_('Activity'); ?></dt>
<dd class="<?php echo $rowparity; ?>"><?php echo $client->f_usage; ?></dd>
<?php if (AmpConfig::get('statistical_graphs') && is_dir(AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/')) {
<?php if (AmpConfig::get('statistical_graphs') && is_dir(__DIR__ . '/../../vendor/szymach/c-pchart/src/Chart/')) {
?>
<a href="<?php echo AmpConfig::get('web_path'); ?>/stats.php?action=graph&user_id=<?php echo $client->id; ?>"><?php echo UI::get_icon('statistics', T_('Graphs')); ?></a>
<?php
Expand Down
2 changes: 1 addition & 1 deletion public/templates/show_video.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<?php
} ?>
<?php if (Access::check('interface', 50)) { ?>
<?php if (AmpConfig::get('statistical_graphs') && is_dir(AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/')) { ?>
<?php if (AmpConfig::get('statistical_graphs') && is_dir(__DIR__ . '/../../vendor/szymach/c-pchart/src/Chart/')) { ?>
<a href="<?php echo AmpConfig::get('web_path'); ?>/stats.php?action=graph&object_type=video&object_id=<?php echo $video->id; ?>"><?php echo UI::get_icon('statistics', T_('Graphs')); ?></a>
<?php
} ?>
Expand Down
2 changes: 1 addition & 1 deletion src/Application/StatisticGraphApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function run(): void
exit;
}

if (!AmpConfig::get('statistical_graphs') || !is_dir(AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/')) {
if (!AmpConfig::get('statistical_graphs') || !is_dir(__DIR__ . '/../../vendor/szymach/c-pchart/src/Chart/')) {
debug_event('graph', 'Access denied, statistical graph disabled.', 1);
exit;
}
Expand Down

0 comments on commit 995fc5d

Please sign in to comment.