Comments for "System_Folders"

» Submit Your Comment
Comments are only accepted during the "Proposal" phase. This proposal is currently in the "Finished" phase.
» Comments
  • Scott Mattocks  [2006-02-01 15:35 UTC]

    I think it would be a good idea to create some sort of config file (XML maybe) that holds the known paths. This way it can be easily updated by the user and allows more paths to be added without touching the PHP code.
  • Stefano F. Rausch  [2006-02-02 20:19 UTC]

    This is a nice idea.

    However, having tried out your proposal on a German XP box, the following issues have to be addressed, keeping in mind that I run PHP 5.1.2 with E_STRICT:

    M:\SDev>pear install System_Folders-0.1.0.tgz
    install ok: channel://pear.php.net/System_Folders-0.1.0

    M:\SDev>php ../php/pear/docs/system_folders/examples/example.php
    PHP Warning: require_once(Folders.php): failed to open stream: No such file or directory in M:\PHP\PEAR\docs\system_folders\examples\e
    xample.php on line 6
    PHP Fatal error: require_once(): Failed opening required 'Folders.php' (include_path='.;M:\PHP;M:\PHP\PEAR;M:\PHP\PEAR\tests;M:\SDev;M
    :\SDev\WinBinder') in M:\PHP\PEAR\docs\system_folders\examples\example.php on line 6

    M:\SDev>php ../php/pear/docs/system_folders/examples/example.php
    PHP Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in M:\PHP\PEAR\System\Folders.php on line 56
    PHP Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in M:\PHP\PEAR\OS\Guess.php on line 102
    PHP Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in M:\PHP\PEAR\OS\Guess.php on line 103
    PHP Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in M:\PHP\PEAR\OS\Guess.php on line 104
    PHP Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in M:\PHP\PEAR\OS\Guess.php on line 105
    PHP Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in M:\PHP\PEAR\OS\Guess.php on line 106
    array(8) {
    ["Home"]=>
    NULL
    ["Documents"]=>
    NULL
    ["Shared documents"]=>
    NULL
    ["Temp"]=>
    string(16) "C:\WINDOWS\Temp\"
    ["Desktop"]=>
    NULL
    ["AppData"]=>
    NULL
    ["Programs"]=>
    string(13) "C:\Programme\"
    ["Windows"]=>
    string(11) "C:\WINDOWS\"
    }

    After having corrected the import of 'Folders.php' to 'System/Folders.php', the example gives the above stated information.

    Cursory code review:

    - require_once is a language construct and not a function

    - please try to be more PCS compliant, e.g. EOL at the file's end, file doc block not complete etc.