Minor: Scripts: Add exit; statement at the beginning of each script

pull/3547/head
Yannick Warnier 5 years ago
parent e0c3d4b44e
commit 248b56202d
  1. 1
      tests/scripts/copy_user_id_to_extra_field.php
  2. 2
      tests/scripts/delete_old_tasks.php
  3. 1
      tests/scripts/edit_course_html_files.php
  4. 2
      tests/scripts/fix_collations_utf8.php
  5. 1
      tests/scripts/fix_course_index.php
  6. 2
      tests/scripts/fix_duplicate_settings.php
  7. 3
      tests/scripts/fix_group_items_with_old_db.php
  8. 2
      tests/scripts/fix_lp_calendar.php
  9. 1
      tests/scripts/fix_lp_id_to_iid.php
  10. 1
      tests/scripts/fix_lp_id_to_iid_v2.php
  11. 1
      tests/scripts/fix_lp_items_not_found.php
  12. 1
      tests/scripts/fix_lp_missing_documents.php
  13. 2
      tests/scripts/fix_migrations_1.9.x_1.10.0.php
  14. 1
      tests/scripts/fix_mimetex.php
  15. 2
      tests/scripts/fix_moodle_migration.php
  16. 1
      tests/scripts/fix_restored_learnpaths.php
  17. 3
      tests/scripts/fix_student_publication_id.php
  18. 3
      tests/scripts/fix_user_id.php
  19. 3
      tests/scripts/hide_lp_by_name.php
  20. 6
      tests/scripts/img/list_unused_img.php
  21. 6
      tests/scripts/img/list_used_img.php
  22. 5
      tests/scripts/insert_session_fields.php
  23. 3
      tests/scripts/insert_sessions_categories.php
  24. 3
      tests/scripts/kill_all_queries.php
  25. 1
      tests/scripts/login_as_admin.php
  26. 4
      tests/scripts/move_users.php
  27. 6
      tests/scripts/multi_url_conversion.php
  28. 7
      tests/scripts/packaging/gitlog.php
  29. 4
      tests/scripts/restore_deleted_documents.php
  30. 2
      tests/scripts/settings2csv.php
  31. 4
      tests/scripts/synchronize_user_base_from_ldap.php
  32. 3
      tests/scripts/update_lti_chidren_tools.php
  33. 1
      tests/scripts/update_user_extra_field.php
  34. 4
      tests/scripts/userfields_to_groups.php
  35. 1
      tests/scripts/users_no_course.php

@ -3,6 +3,7 @@
/*
* Copy user.user_id to extra field ScormStudentId
*/
exit;
$extraFieldName = 'ScormStudentId';
use Chamilo\CoreBundle\Entity\ExtraFieldValues;

@ -11,7 +11,7 @@
* @author Percy Santiago <psantiago@icpna.edu.pe>
* @author Yannick Warnier <yannick.warnier@beeznest.com>
*/
exit(); //remove this line to execute from the command line
exit; //remove this line to execute from the command line
if (PHP_SAPI !== 'cli') {
die('This script can only be executed from the command line');
}

@ -11,6 +11,7 @@
* need to move it to an executable folder and change the first require.
* @author Yannick Warnier <yannick.warnier@beeznest.com>
*/
exit;
require __DIR__.'/../../main/inc/global.inc.php';
api_protect_admin_script();

@ -11,7 +11,7 @@
* @author Yannick Warnier <yannick.warnier@beeznest.com>
*/
// To launch, remove the following line
die();
exit;
require __DIR__.'/../../main/inc/global.inc.php';
$sql = "SELECT table_name, table_collation FROM information_schema.tables where TABLE_SCHEMA='".$_configuration['main_database']."'";
$res = Database::query($sql);

@ -11,6 +11,7 @@
* - Check the results in one index.php file
* - Delete this file
*/
exit;
if (PHP_SAPI != 'cli') {
die('This script can only be launched from the command line');
}

@ -4,7 +4,7 @@
* Remove the current_settings duplicates from migration 1.9.x to 1.10.x
*/
//exit;
exit;
require_once __DIR__.'/../../main/inc/global.inc.php';

@ -21,6 +21,7 @@
/**
* Context initialization
*/
exit;
if (PHP_SAPI != 'cli') {
die('This script can only be executed from the command line');
}
@ -173,4 +174,4 @@ function getOldGroupsByCourse() {
}
}
return $courses;
}
}

@ -1,6 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
exit;
require __DIR__ . '/../../main/inc/global.inc.php';
$extraField = new ExtraField('lp_item');

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/**

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/**

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/**

@ -5,6 +5,7 @@
/**
* Set id = iid in c_document for a c_lp
*/
exit;
require_once '../../main/inc/global.inc.php';

@ -1,5 +1,7 @@
<?php
/* For license terms, see /license.txt */
/**
* Fix failed migration 1.9.x to 1.10.0
* Note: You need execute the ./fix_duplicate_settings.php to remove duplicated settings from failed migration

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
exit;

@ -1,5 +1,7 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script is a specific script to finetune a complex migration from a
* Moodle environment, where the usernames and session names need to come

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
exit;

@ -1,7 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
exit;
/* For license terms, see /license.txt */
if (PHP_SAPI != 'cli') {
die('This script can only be launched from the command line');
}

@ -1,8 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Temporary fix to set user.user_id to the same as user.id
*/
exit;
if (PHP_SAPI != 'cli') {
die('This script can only be executed from the command line');
}

@ -1,15 +1,16 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Batch to hide all LPs with the $nameToSearch name.
*/
exit;
if (PHP_SAPI != 'cli') {
die('This script can only be executed from the command line');
}
exit;
require_once __DIR__.'/../../main/inc/global.inc.php';

@ -1,4 +1,7 @@
<?php /* For licensing terms, see /license.txt */
<?php
/* For licensing terms, see /license.txt */
/**
* Cron script to list unused images
* @package chamilo.cron
@ -6,6 +9,7 @@
/**
* Includes and declarations
*/
exit;
if (PHP_SAPI!='cli') {
die('Run this script through the command line or comment this line in the code');
}

@ -1,4 +1,7 @@
<?php /* For licensing terms, see /license.txt */
<?php
/* For licensing terms, see /license.txt */
/**
* Cron script to list used, but undefined, language variables
* @package chamilo.cron
@ -6,6 +9,7 @@
/**
* Includes and declarations
*/
exit;
if (PHP_SAPI!='cli') { die('Run this script through the command line or comment this line in the code'); }
require_once __DIR__.'/../../../main/inc/global.inc.php';
$path = api_get_path(SYS_CODE_PATH).'img/';

@ -1,9 +1,12 @@
<?php
/* For licensing terms, see /license.txt */
/*
* This script insert session extra fields
*/
//exit;
exit;
require_once '../../main/inc/global.inc.php';

@ -1,8 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script generates four session categories.
*/
exit;
require_once '../../main/inc/global.inc.php';
api_protect_admin_script();

@ -1,4 +1,7 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script kills all queries to which the Chamilo database user has access
* through processlist.

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
exit;

@ -1,5 +1,7 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Script to move users from one course to another if they haven't taken the
* test in the first course.
@ -10,7 +12,7 @@
/**
* Init
*/
die('Remove the "die()" line to execute this script'.PHP_EOL);
exit;
require __DIR__.'/../../main/inc/global.inc.php';
// Define origin and destination courses' code
$originCourse = 'XYZ2014';

@ -1,12 +1,14 @@
<?php
// For licensing terms, see /license.txt
/* For licensing terms, see /license.txt */
/**
* This script takes a single-URL portal and changes the database so the
* original portal becomes a secondary URL (not the main admin URL).
* This means creating a new URL of ID 1 and moving all previous records
* referencing ID 1 to ID 2.
*/
die();
exit;
require __DIR__.'/../../main/inc/global.inc.php';
$tableAccessUrl = Database::get_main_table(TABLE_MAIN_ACCESS_URL);

@ -1,4 +1,7 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script pre-generates a list of commits to generate a changelog in the
* form (branch, then commits in HTML form, then a final feedback):
@ -17,6 +20,10 @@
* @usage php gitlog.php [-t|some-commit|-max20171001]
* @see https://github.com/ywarnier/git
*/
exit;
if (PHP_SAPI != 'cli') {
die('This script can only be launched from the command line');
}
require 'php-git/src/Git.php';
$repository = __DIR__.'/../..';
$number = 2000; //the number of commits to check (including minor)

@ -1,15 +1,15 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Script to restore some deleted documents
*/
exit;
use Chamilo\CourseBundle\Entity\CDocument;
use Chamilo\CourseBundle\Entity\CItemProperty;
exit;
require __DIR__.'/../../main/inc/global.inc.php';
api_protect_admin_script();

@ -1,5 +1,7 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script generates a CSV file of all settings in the order they appear
* in the platform settings section, in the given language.

@ -1,5 +1,7 @@
<?php
/* For licensing terms, see /license.txt */
/*
User account synchronisation from LDAP
@ -20,7 +22,7 @@ defined in app/config/auth.conf.php.
username field is used to identify and match LDAP and Chamilo accounts together.
($extldap_user_correspondance['username'])
*/
exit;
// Change this to the absolute path to chamilo root folder if you move the script out of tests/scripts
$chamiloRoot = __DIR__.'/../..';

@ -1,15 +1,16 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Update all children tools created by a LTI tool in courses.
*/
exit;
use Chamilo\PluginBundle\Entity\ImsLti\ImsLtiTool;
require __DIR__.'/../../main/inc/global.inc.php';
exit;
// Arguments
$parentLtiToolId = 1;

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/**

@ -1,8 +1,12 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Move user fields "ruc" and "razon_social" to (social) groups (create groups)
* and assign the related users to those groups.
*/
exit;
if (PHP_SAPI != 'cli') {
die('This script can only be launched from the command line');
}

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/**

Loading…
Cancel
Save