/**
* Test harness for generating the test images for Horde_Image tests
*/
+
define('HORDE_BASE', '/var/www/html/horde');
-require_once HORDE_BASE . '/lib/core.php';
+require_once HORDE_BASE . '/lib/Application.php';
$allTests = array(
'testInitialState' => 'Test initial state. Solid blue square',
. '<td text-align="top">' . Horde::img('im.php?test=' . $name . '&driver=Imagick', '', '', '') . '</td>';
}
echo '</table>';
-?></body></html>
\ No newline at end of file
+?></body></html>
* @package Horde_Memcache
*/
-// Find the base file path of Horde.
-@define('HORDE_BASE', dirname(__FILE__) . '/..');
+// The base file path of horde.
+$horde_base = '/path/to/horde';
-// Do CLI checks and environment setup first.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Make sure no one runs this from the web.
-if (!Horde_Cli::runningFromCLI()) {
- exit("Must be run from the command line\n");
-}
-
-// Load the CLI environment - make sure there's no time limit, init some
-// variables, etc.
-$cli = &Horde_Cli::singleton();
-$cli->init();
-
-// No auth.
-$horde_authentication = 'none';
-require_once HORDE_BASE . '/lib/base.php';
+require_once $horde_base . '/lib/Application.php';
+Horde_Registry::appInit('horde', array('authentication' => 'none', 'cli' => true));
+$cli = Horde_Cli::singleton();
/* Make sure there's no compression. */
@ob_end_clean();
* 2005.
*/
-@define('HORDE_BASE', dirname(__FILE__) . '/../..');
-@define('INCUBATOR_BASE', dirname(__FILE__));
+$horde_base = '/path/to/horde';
-require_once HORDE_BASE . '/lib/core.php';
+require_once $horde_base . '/lib/Application.php';
+Horde_Registry::appInit('horde', array('authentication' => 'none'));
Horde_Autoloader::addClassPath(dirname(__FILE__));
-$registry = Horde_Registry::singleton();
+
$vars = Horde_Variables::getDefaultVariables();
$vars->set('example_bar', 'text with a beginning and an end');
--FILE--
<?php
-define('HORDE_BASE', dirname(dirname(dirname(dirname(__FILE__)))));
-require_once HORDE_BASE . '/lib/core.php';
-
-$registry = Horde_Registry::singleton();
+$horde_base = '/path/to/horde';
+require_once HORDE_BASE . '/lib/Application.php';
+Horde_Registry::appInit('horde', array('authentication' => 'none'));
$prefs = Horde_Prefs::factory('session', 'horde', 'testuser', 'testpw');
$prefs->retrieve('imp');
@define('ZOMBIE_BASE', dirname(__FILE__) . '/..');
-/* We need horde only to get the sql driver config from conf.php. */
-require_once dirname(__FILE__) . '/lib/core.php';
-require_once HORDE_BASE . '/config/conf.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('horde', array('authentication' => 'none'));
/* List of files that are parsed, converted and copied to output
* directory. for all these files default zitem->parameter string
} else {
system("horde-fw-symlinks.php --copy --src ./$directory/framework --dest ./$directory/lib");
}
-
- print "Setting include path\n";
- $filename = $directory . '/lib/core.php';
- $newfilename = $filename . '.new';
- $oldfp = fopen($filename, 'r');
- $newfp = fopen($newfilename, 'w');
- while ($line = fgets($oldfp)) {
- fwrite($newfp, str_replace('// ini_set(\'include_path\'', 'ini_set(\'include_path\'', $line));
- }
- fclose($oldfp);
- fclose($newfp);
- system("mv -f $newfilename $filename");
}
}
*/
// Find the base file path of Horde.
-@define('HORDE_BASE', dirname(__FILE__) . '/..');
+$horde_base = '/path/to/horde';
-// Do CLI checks and environment setup first.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Make sure no one runs this from the web.
-if (!Horde_Cli::runningFromCLI()) {
- exit("Must be run from the command line\n");
-}
-
-// Load the CLI environment - make sure there's no time limit, init some
-// variables, etc.
+require_once $horde_base . '/lib/Application.php';
+Horde_Registry::appInit('horde', array('authentication' => 'none', 'cli' => true));
$cli = Horde_Cli::singleton();
-$cli->init();
-
-// No auth.
-$horde_authentication = 'none';
-require_once HORDE_BASE . '/lib/base.php';
/* Make sure there's no compression. */
@ob_end_clean();
/* Do Horde includes if test for horde backend: */
if ($syncml_backend_driver == 'Horde') {
- /* Syncml does its own session handling. */
- $horde_authentication = 'none';
- $horde_session_control = 'none';
- require_once dirname(__FILE__) . '/../../../lib/core.php';
-
- // Load the CLI environment - make sure there's no time limit, init
- // some variables, etc.
- $cli = Horde_Cli::singleton();
- $cli->init();
-
- require_once HORDE_BASE . '/lib/base.php';
+ require_once dirname(__FILE__) . '/../../../lib/Application.php';
+ Horde_Registry::appInit('horde', array('authentication' => 'none', 'cli' => true, 'session_control' => 'none'));
Horde_String::setDefaultCharset('UTF-8');
Horde_Nls::setCharset('UTF-8');
}
return;
}
- // Define path to Horde.
- @define('HORDE_BASE', $this->_params['horde_base']);
-
- // Load the Horde Framework core, and set up inclusion paths.
- require_once HORDE_BASE . '/lib/core.php';
+ require_once $this->_params['horde_base'] . '/lib/Application.php';
+ Horde_Registry::appInit('horde');
// Create the Registry object.
$this->_registry = Horde_Registry::singleton();
(!empty($_ENV['HORDE_BASE']) && $base = $_ENV['HORDE_BASE'])) &&
is_dir($base) && is_readable($base)) {
$horde_base = $base;
-} elseif (is_file(getcwd() . '/lib/core.php')) {
+} elseif (is_file(getcwd() . '/lib/Application.php')) {
$horde_base = getcwd();
} else {
$horde_base = dirname(dirname(dirname(__FILE__)));
}
+
+require_once $horde_base . '/lib/Application.php';
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-// Do CLI checks and environment setup first.
require_once dirname(__FILE__) . '/horde-base.php';
-require_once $horde_base . '/lib/core.php';
+Horde_Registry::appInit('horde', array('authentication' => 'none', 'cli' => true));
-// Make sure no one runs this from the web.
-if (!Horde_Cli::runningFromCLI()) {
- exit("Must be run from the command line\n");
-}
-
-// Load the CLI environment - make sure there's no time limit, init
-// some variables, etc.
$cli = Horde_Cli::singleton();
-$cli->init();
-
-// Include needed libraries.
-$horde_authentication = 'none';
-require_once HORDE_BASE . '/lib/base.php';
-
$db_lib = 'DB';
$sequence = null;
+
if (isset($_SERVER['argv']) && count($_SERVER['argv']) >= 2) {
array_shift($_SERVER['argv']);
while ($arg = array_shift($_SERVER['argv'])) {
* @package admintools
*/
-/**
- ** Set this to true if you want DB modifications done.
- **/
+/* Set this to true if you want DB modifications done.*/
$live = false;
-// Do CLI checks and environment setup first.
require_once dirname(__FILE__) . '/horde-base.php';
-require_once $horde_base . '/lib/core.php';
-
-// Make sure no one runs this from the web.
-if (!Horde_Cli::runningFromCLI()) {
- exit("Must be run from the command line\n");
-}
-
-// Load the CLI environment - make sure there's no time limit, init
-// some variables, etc.
+Horde_Registry::appInit('horde', array('authentication' => 'none', 'cli' => true, 'nocompress' => true));
$cli = Horde_Cli::singleton();
-$cli->init();
-
-$horde_authentication = 'none';
-$horde_no_compress = true;
-require_once HORDE_BASE . '/lib/base.php';
$scope = $cli->prompt(_("Enter value for pref_scope:"));
$name = $cli->prompt(_("Enter value for pref_name:"));
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-// Do CLI checks and environment setup first.
require_once dirname(__FILE__) . '/horde-base.php';
-require_once $horde_base . '/lib/core.php';
-
-// Make sure no one runs this from the web.
-if (!Horde_Cli::runningFromCLI()) {
- exit("Must be run from the command line\n");
-}
-
-// Load the CLI environment - make sure there's no time limit, init some
-// variables, etc.
-Horde_Cli::init();
-
-// Include needed libraries.
-$horde_authentication = 'none';
-require_once HORDE_BASE . '/lib/base.php';
+Horde_Registry::appInit('horde', array('authentication' => 'none', 'cli' => true));
$dbh = DB::connect($conf['sql']);
if (is_a($dbh, 'PEAR_Error')) {
* @author Jan Schneider <jan@horde.org>
*/
-require_once dirname(__FILE__) . '/lib/core.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
$input = $session_control = null;
$nocompress = false;
* DEFAULT: 525600 = 1 year */
$expire_time = 525600;
-/* Load core first because we need access to Horde_Util::. */
-require_once dirname(__FILE__) . '/../lib/core.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
if (!($path = Horde_Util::getFormData('cache'))) {
exit;
* @author Michael Slusarz <slusarz@horde.org>
*/
-require_once dirname(__FILE__) . '/../../lib/core.php';
-
-$registry = Horde_Registry::singleton(Horde_Registry::SESSION_READONLY);
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+Horde_Registry::appInit('horde', array('session_control' => 'readonly'));
if (!($module = Horde_Util::getFormData('module')) ||
!file_exists($registry->get('fileroot', $module))) {
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../../lib/core.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
header('Content-type: image/gif');
header('Expires: Wed, 21 Aug 1969 11:11:11 GMT');
* @package Horde
*/
-/* Load core first because we need access to Horde_Util::. */
-require_once dirname(__FILE__) . '/../lib/core.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
if (!($path = Horde_Util::getFormData('imple'))) {
exit;
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../../lib/core.php';
-
-$registry = Horde_Registry::singleton();
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+Horde_Registry::appInit('horde');
/* Which application. */
$app = Horde_Util::getFormData('app');
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/core.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
// Get text, uppercase, add start/stop characters.
$text = '*' . Horde_String::upper(Horde_Util::getFormData('barcode', 'test'), true) . '*';
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-$horde_authentication = 'none';
-require_once dirname(__FILE__) . '/../lib/core.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('horde', array('authentication' => 'none'));
-$registry = Horde_Registry::singleton();
$apps = $registry->listApps(array('notoolbar', 'active', 'admin', 'inactive', 'hidden'), true);
ksort($apps);