как исправить проблему, которая требует_once, я начинаю с MAMP и считаю, что этот конфликт - PullRequest
0 голосов
/ 14 июня 2019

В момент запуска моего проекта с mamp я создал следующую ошибку:

Предупреждение: require_once (/Applications/MAMP/htdocs/saml/lib/_autoload.php): не удалось открытьпоток: нет таких файлов или каталогов в /Applications/MAMP/htdocs/academanabi/Sistema/xolat/web/portal/index.php в строке 41

Неустранимая ошибка: require_once (): не удалось открыть обязательно '/ Applications/MAMP/htdocs/saml/lib/_autoload.php '(include_path ='.: / Applications / MAMP / lib /: / Applications / MAMP / lib / Doctrine: / Applications / MAMP / lib / excellib: / Applications / MAMP /Библиотека / excellib / PHPExcel: / Applications / MAMP / Lib / ActiveRecord: / Applications / MAMP / Библиотека / ActiveRecord / базы данных: / Applications / MAMP / Библиотека / ActiveRecord / базы данных / драйвера / Postgre: / Applications / MAMP / HTDOCS / academanabi /Система / xolat / приложение / портал / модель / бизнес: / Applications / MAMP / HTDOCS / academanabi / Система / xolat / приложение / портал / модель / домен: / Applications / MAMP / HTDOCS / academanabi / Система / xolat / приложение / портал /модели / домен / генерироваться: / Applications / MAMP / HTDOCS / academanabi / Sistema / xolat / приложения / портал / валидаторы: / Applications / MAMP / HTDOCS / academanabi / Sistema / xolat / приложения / портал / услуги: / Applications / MAMP / Библиотека / ZendExt / Трассировка / бизнес: / Applications / MAMP / Библиотека / ZendExt/ трассировки / домен: / Applications / MAMP / Библиотека / ZendExt / трассировки / домен / сгенерированный: / Applications / MAMP / Библиотека / ZendExt / Метаданные / домен: / Applications / MAMP / Библиотека / ZendExt / Метаданные / домен / генерироваться: / Арв /Applications/MAMP/htdocs/academanabi/Sistema/xolat/web/portal/index.php в строке 41

<?php
    /**
     * Fichero de inicio del modulo
     * 
     * @author Yoandry Morejon Borbon
     * @copyright UCID-ERP Cuba
     * @version 1.0-0
     */

    //Direccion de la servidora
    $dir_index = __FILE__;

    //Direccion del fichero de configuracion
    $config_file = substr($dir_index, 0, strrpos($dir_index, 'web')) . 'apps/comun/config.php';

    if (!file_exists($config_file)) //Si no existe el fichero de configuracion
    {
        //Se dispara una excepcion
        throw new Exception('El fichero de configuracion no existe');
    }
    elseif (!is_readable($config_file)) //Si no se puede leer
    {
        //Se dispara una excepcion
        throw new Exception('No se pudo leer el fichero de configuracion. Acceso denegado.');
    }
    else //Si existe el fichero y se puede leer
    {
        //Se inicializa la variable de configuración
        $config = array();

        //Se incluye el fichero

        include_once ($config_file);

        if (!isset($config['include_path']))
            throw new Exception('El framework no esta configurado correctamente.');

        //Se inicializa el include path de php a partir de la variable de configuracion
        set_include_path($config['include_path']);

        require_once($config['SAML']);
        //Se inicia la carga automatica de clases y ficheros
        $loader_file = 'Zend/Loader/Autoloader.php';
        if (!@include_once($loader_file))
            throw new Exception('El framework no esta configurado correctamente.');
        $autoloader = Zend_Loader_Autoloader::getInstance();
        $autoloader->setFallbackAutoloader(true);
        //Se inicia la aplicacion
        $as = new SimpleSAML_Auth_Simple('auth');
        $as->requireAuth();
        $app = new ZendExt_App();
        $_SESSION['login_user']=true;
        $app->init($config,$as);
    }

_Autoload

/**
 * This file implements a autoloader for simpleSAMLphp. This autoloader
 * will search for files under the simpleSAMLphp directory.
 *
 * @author Olav Morken, UNINETT AS.
 * @package simpleSAMLphp
 * @version $Id$
 */


/**
 * Autoload function for simpleSAMLphp.
 *
 * It will autoload all classes stored in the lib-directory.
 *
 * @param $className  The name of the class.
 */
function SimpleSAML_autoload($className) {

    $libDir = dirname(__FILE__) . '/index.php';

    /* Special handling for xmlseclibs.php. */
    if(in_array($className, array('XMLSecurityKey', 'XMLSecurityDSig', 'XMLSecEnc'), TRUE)) {
        require_once($libDir . 'xmlseclibs.php');
        return;
    }

    /* Handlig of modules. */
    if(substr($className, 0, 7) === 'sspmod_') {
        $modNameEnd = strpos($className, '_', 7);
        $module = substr($className, 7, $modNameEnd - 7);
        $moduleClass = substr($className, $modNameEnd + 1);

        if(!SimpleSAML_Module::isModuleEnabled($module)) {
            return;
        }

        $file = SimpleSAML_Module::getModuleDir($module) . '/lib/' . str_replace('_', '/', $moduleClass) . '.php';
    } else {
        $file = $libDir . str_replace('_', '/', $className) . '.php';
    }

    if(file_exists($file)) {
        require_once($file);
    }
}

/* Register autoload function for simpleSAMLphp. */
if(function_exists('spl_autoload_register')) {
    /* Use the spl_autoload_register function if it is available. It should be available
     * for PHP versions >= 5.1.2.
     */
    spl_autoload_register('SimpleSAML_autoload');
} else {

    /* spl_autoload_register is unavailable - let us hope that no one else uses the __autoload function. */

    /**
     * Autoload function for those who don't have spl_autoload_register.
     *
     * @param $className  The name of the requested class.
     */
    function __autoload($className) {
        SimpleSAML_autoload($className);
    }
}

?>

...