Visualizzazione dei risultati da 1 a 3 su 3

Discussione: Strano errore...

  1. #1
    Utente di HTML.it L'avatar di pheeko
    Registrato dal
    Feb 2003
    Messaggi
    99

    Strano errore...

    Ho un primo file che è l seguente:

    <?php
    require('Smarty.class.php');

    include_once 'includes/controller.php';
    $mycontroller = new controller;


    ?>
    che include il secondo:

    <?php


    class controller {

    public $vista;
    public $modello;

    function controller() {
    $this->vista = new Smarty;
    $this->vista->template_dir = '/usr/local/apache2/htdocs/smarty/templates';
    $this->vista->compile_dir = '/usr/local/apache2/htdocs/smarty/templates_c';
    $this->vista->config_dir = '/usr/local/apache2/htdocs/smarty/configs';
    $this->vista->cache_dir = '/usr/local/apache2/htdocs/smarty/cache';
    $this->load_all_blocks();
    $this->vista->display('index.tpl');
    }

    private function RemoveExtension($strName)
    { $ext = strrchr($strName,'.');
    $strName = substr($strName, 0, -strlen($ext));
    return $strName;}
    private function factory($type) {
    $classname = $type;
    $operation=$_GET['operazione'];
    $modules=$_GET['modules'];
    return new $classname($modules,$operation);
    }

    private function load_all_blocks() {
    if($handle=@opendir('./modules')){
    while(false!==($file=readdir($handle))) {
    $type=$this->RemoveExtension($file);
    if($file!==".." & $file!==".") {
    include_once "./modules/$type.blocks";
    $classname = $this->factory($type);
    if (method_exists($classname,'operation')) {
    $this->vista->assign($type.'operation',$classname->operation());
    }
    if(method_exists($classname,"output")) {
    $this->vista->assign($type,$classname->output());
    }
    }}}}
    }


    ?>
    facendo presente che i vari path sono corretti il risultato è il seguente:

    Warning: controller::load_all_blocks(./modules/.blocks) [function.load-all-blocks]: failed to open stream: No such file or directory in /usr/local/apache2/htdocs/includes/controller.php on line 35

    Warning: controller::load_all_blocks() [function.include]: Failed opening './modules/.blocks' for inclusion (include_path='.:/usr/share/php:/usr/share/php/Smarty-2.6.11/libs') in /usr/local/apache2/htdocs/includes/controller.php on line 35

    Fatal error: Class '' not found in /usr/local/apache2/htdocs/includes/controller.php on line 27

    Dove sbaglio?
    MORITURI TE SALUTANT

  2. #2
    Utente di HTML.it L'avatar di pheeko
    Registrato dal
    Feb 2003
    Messaggi
    99
    nessuno???
    MORITURI TE SALUTANT

  3. #3
    Utente di HTML.it L'avatar di pheeko
    Registrato dal
    Feb 2003
    Messaggi
    99
    up
    MORITURI TE SALUTANT

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.