From 1960be0dfa2a14dbbe149780480e91fcbfd08933 Mon Sep 17 00:00:00 2001 From: nate Date: Sat, 1 Mar 2008 05:23:32 +0000 Subject: [PATCH] Deprecating vendor() and removing all instances from the core, fixes #4016 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6497 3807eeeb-6ff5-0310-8944-8be069107fe0 --- app/webroot/test.php | 2 +- cake/basics.php | 5 ++--- cake/console/libs/templates/skel/webroot/test.php | 2 +- cake/tests/lib/cake_test_case.php | 2 +- cake/tests/lib/test_manager.php | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/webroot/test.php b/app/webroot/test.php index 6710d20cf..3716313c3 100644 --- a/app/webroot/test.php +++ b/app/webroot/test.php @@ -99,7 +99,7 @@ if (isset($_GET['output']) && $_GET['output'] == 'html') { define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_TEXT); } -if (!vendor('simpletest' . DS . 'reporter')) { +if (!App::import('Vendor', 'simpletest' . DS . 'reporter')) { CakePHPTestHeader(); include CAKE . 'tests' . DS . 'lib' . DS . 'simpletest.php'; CakePHPTestSuiteFooter(); diff --git a/cake/basics.php b/cake/basics.php index 499c052a2..fb3a503fd 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -144,11 +144,10 @@ if (!function_exists('clone')) { } } /** - * Require given files in the VENDORS directory. Takes optional number of parameters. - * - * @param string $name Filename without the .php part. + * @deprecated */ function vendor() { + trigger_error('(vendor) Deprecated, see App::import(\'Vendor\', \'...\');', E_USER_WARNING); $args = func_get_args(); $c = func_num_args(); diff --git a/cake/console/libs/templates/skel/webroot/test.php b/cake/console/libs/templates/skel/webroot/test.php index 4ac8ab56c..514ec070a 100644 --- a/cake/console/libs/templates/skel/webroot/test.php +++ b/cake/console/libs/templates/skel/webroot/test.php @@ -99,7 +99,7 @@ if (isset($_GET['output']) && $_GET['output'] == 'html') { define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_TEXT); } -if (!vendor('simpletest' . DS . 'reporter')) { +if (!App::import('Vendor', 'simpletest' . DS . 'reporter')) { CakePHPTestHeader(); include CAKE . 'tests' . DS . 'lib' . DS . 'simpletest.php'; CakePHPTestSuiteFooter(); diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index 1f3cf9f0a..b86f76185 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -28,7 +28,7 @@ */ require_once CAKE . 'tests' . DS . 'lib' . DS . 'cake_test_model.php'; require_once CAKE . 'tests' . DS . 'lib' . DS . 'cake_test_fixture.php'; -vendor('simpletest'.DS.'unit_tester'); +!App::import('Vendor', 'simpletest' . DS . 'unit_tester'); /** * Short description for class. * diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index 699af482f..48ab5d8f4 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -49,7 +49,7 @@ class TestManager { } function _installSimpleTest() { - vendor('simpletest'.DS.'unit_tester', 'simpletest'.DS.'mock_objects', 'simpletest'.DS.'web_tester'); + App::import('Vendor', array('simpletest'.DS.'unit_tester', 'simpletest'.DS.'mock_objects', 'simpletest'.DS.'web_tester')); require_once(LIB_TESTS . 'cake_web_test_case.php'); require_once(LIB_TESTS . 'cake_test_case.php'); }