php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21848 error with class and file system
Submitted: 2003-01-23 16:30 UTC Modified: 2003-01-24 01:33 UTC
From: epplestun at alaplaya dot com Assigned:
Status: Not a bug Package: *Directory/Filesystem functions
PHP Version: 4.2.0 OS: Linux Red Hat 8.0
Private report: No CVE-ID: None
 [2003-01-23 16:30 UTC] epplestun at alaplaya dot com
the script:

class php_eddi_dev
{
    var $gui;
    var $modulos;   //cargador de las interfaces de los m?dulos.
    var $interface; //cargador de interfaz principal.
    
    // {{{ delete_event()
    
    /**
     * Constructor de la clase, genera el array gui global, la variable global interface que contendra la interface XML y carga la liberia PHP-GTK.
     *
     * @return void
     */
    function php_eddi_dev()
    {
        dl(stristr(PHP_OS, "WIN") ?  "php_gtk.dll" : "php_gtk.so");
        $this->gui       = array();
        $this->modulos   = array();
        $this->interface = &new GladeXML("php-eddi-dev.glade");
    }
    
    // }}}
    // {{{ salir()

    /**
     * Se encarga de cerrar la aplicacion GTK.
     *
     * @return void
     */
    function salir()
    {
        Gtk::main_quit();
    }

    // }}}
    // {{{ cargador_de_modulos()
    
    /**
     * Se encarga de cargar los modulos adicionales del PHP-EDDI-DEV.
     *
     * @return void TODO
     */
    function cargador_de_modulos()
    {
        $handle = opendir("modulos/");
        while ($directorio = readdir($handle)) {
            if ($directorio != "." AND $directorio != "..")
            {
                if(!is_dir($directorio))
                {
                    echo filetype($directorio) . "\n";
                }
            }
        }
        
    }
    
    // }}}
    // {{{ main()

    /**
     * Se encarga de configurar y de lanzar la aplicaci?n.
     *
     * @return void
     */
    function main()
    {
        $this->gui['Gtk_Window'] = $this->interface->get_widget('ide');
        $this->gui['Gtk_Window']->connect('destroy',array(&$this,'salir'));
        $this->gui['Gtk_Window']->set_usize(600,400);
        /**
         * Asignamos a la variable global color un color.
         */
        $this->gui['color']  = new GdkColor('#898989');
        /**
         * Creamos un estilo nuevo que se le aplicara a $this->gui['Gtk_Fixed'].
         */
        $this->gui['estilo'] = new GtkStyle();
        $this->gui['estilo']->bg[GTK_STATE_NORMAL] = $this->gui['color'];
        /**
         * Recogemos el widget de glade y le aplicamos el estilo.
         */
        $this->gui['Gtk_Fixed'] = $this->interface->get_widget('entorno_desarrollo');
        $this->gui['Gtk_Fixed']->set_style($this->gui['estilo']);
        gtk::main();
    }
    
    // }}}
}

$programa = &new php_eddi_dev;
//$programa->main();
$programa->cargador_de_modulos();

--------------------------------------------------------------

Running PHP 4.1.2
Zend Engine v1.1.1, Copyright (c) 1998-2001 Zend Technologies
[PHP Modules]
xml
wddx
standard
sockets
session
posix
pcre
mysql
ftp
dbx

[Zend Modules]
Not Implemented

The problem is:

When I call to the function cargador_de_modulos() supposedly  to show to me the directories of path that goes to the function opendir() to him but gives a warning me.

<b>Warning</b>:  lstat failed for prueba (errno=2 - No existe el fichero o el directorio) in <b>/root/php-eddi-dev/tests/php-eddi-dev/php-eddi-dev.php</b> on line <b>80</b><br>/root/php-eddi-dev/tests/php-eddi-dev/php-eddi-dev.php(80) : Warning - lstat failed for prueba (errno=2 - No existe el fichero o el directorio)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-23 16:32 UTC] epplestun at alaplaya dot com
excuse me but the version of PHP is php-4.1.2 and with php-4.3.0 to.
 [2003-01-23 17:06 UTC] eppelestun at alamierda dot com
You are very ridiculus
 [2003-01-23 17:10 UTC] gregory at myphpbugs dot com
please learn english guy,...
and your problem is so basic... please, learn english but begin with learning php!!
 [2003-01-23 18:40 UTC] epplestun at alaplaya dot com
Excuse me, me english is very poor but I want to contribute to PHP, I think this is not a programing problem. If the probem is so basic can you tell me what is the problem if you are a PHP guru??

And me intention was to warn of the possible error.
 [2003-01-23 20:23 UTC] epplestun at alaplaya dot com
excuse me i found the error :)

if(!is_dir("modulos/".$directorio))
 [2003-01-24 01:33 UTC] derick@php.net
not a bug, but a user error -> bogus
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Aug 20 14:01:47 2019 UTC