Reverse Php show errors on class const

Please use this forum to signal bugs.
Merci d'utiliser ce forum pour signaler des bugs.

Reverse Php show errors on class const

Postby jcornil » Sun 18 Aug 2013 10:46

OS : Ubuntu 13.04
Bouml Version : BOUML release 6.4.7

I reversed Zend Framework 2 and got these errors.

Php reverse release 5.0
syntax error in /home/jcornil/Zend/workspaces/DefaultWorkspace/Ilsk/vendor/zendframework/zendframework/library/Zend/Crypt/Password/Apache.php line 23 near BASE64

syntax error in /home/jcornil/Zend/workspaces/DefaultWorkspace/Ilsk/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleEvent.php line 23 near EVENT_LOAD_MODULES



First error...
syntax error in /home/jcornil/Zend/workspaces/DefaultWorkspace/Ilsk/vendor/zendframework/zendframework/library/Zend/Crypt/Password/Apache.php line 23 near BASE64


Line 23 : CONST BASE64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';

source
Code: Select all
<?php
/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/zf2 for the canonical source repository
 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */

namespace Zend\Crypt\Password;

use Traversable;
use Zend\Math\Rand;
use Zend\Stdlib\ArrayUtils;

/**
 * Apache password authentication
 *
 * @see http://httpd.apache.org/docs/2.2/misc/password_encryptions.html
 */
class Apache implements PasswordInterface
{
    CONST BASE64  = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
    CONST ALPHA64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';

    /**
     * @var array
     */
    protected $supportedFormat = array(
        'crypt',
        'sha1',
        'md5',
        'digest',
    );




Second error
syntax error in /home/jcornil/Zend/workspaces/DefaultWorkspace/Ilsk/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleEvent.php line 23 near EVENT_LOAD_MODULES


Line 23 : CONST EVENT_LOAD_MODULES = 'loadModules';

source
Code: Select all
<?php
/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/zf2 for the canonical source repository
 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */

namespace Zend\ModuleManager;

use Zend\EventManager\Event;

/**
 * Custom event for use with module manager
 * Composes Module objects
 */
class ModuleEvent extends Event
{
    /**
     * Module events triggered by eventmanager
     */
    CONST EVENT_LOAD_MODULES        = 'loadModules';
    CONST EVENT_LOAD_MODULE_RESOLVE = 'loadModule.resolve';
    CONST EVENT_LOAD_MODULE         = 'loadModule';
    CONST EVENT_LOAD_MODULES_POST   = 'loadModules.post';

    /**
     * @var mixed
     */
    protected $module;




Both error lines are at the beginning of CONST.
is it a bug? or do I have to set something?
jcornil
 
Posts: 2
Joined: Sun 18 Aug 2013 10:22

Re: Reverse Php show errors on class const

Postby Bruno Pagès » Sun 18 Aug 2013 12:26

Hello,

Your are right, these problems occurs when reversing CONST (in uppercase) rather than const (lowercase), I supposed Php case sensitive, but looking more may be sometimes Php is case sensitive, sometimes not :shock: :?

That's a pity, how is it possible for a language to adopt this kind of inconsistent and incredibly stupid rules ?

Why this is not indicated in the reference manual chapter List of Keywords, contrarily to http://the-echoplex.net/log/php-case-sensitivity, where is the truth ? :roll:

There are 6 CONST in the sources :
./library/Zend/ModuleManager/ModuleEvent.php: CONST EVENT_LOAD_MODULES = 'loadModules';
./library/Zend/ModuleManager/ModuleEvent.php: CONST EVENT_LOAD_MODULE_RESOLVE = 'loadModule.resolve';
./library/Zend/ModuleManager/ModuleEvent.php: CONST EVENT_LOAD_MODULE = 'loadModule';
./library/Zend/ModuleManager/ModuleEvent.php: CONST EVENT_LOAD_MODULES_POST = 'loadModules.post';
./library/Zend/Crypt/Password/Apache.php: CONST BASE64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
./library/Zend/Crypt/Password/Apache.php: CONST ALPHA64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';

I encourage you to replace them by const (in lowercase) before to reverse
ImageAuthor of Bouml
Bruno Pagès
 
Posts: 470
Joined: Mon 20 Feb 2012 08:23
Location: France

Re: Reverse Php show errors on class const

Postby jcornil » Sun 18 Aug 2013 15:49

Thank you for reply and it works great now. ^^b

But, by the blog post ( http://the-echoplex.net/log/php-case-sensitivity ),

Case insensitive (both user defined and PHP defined)

* keywords and constructs (if, else, null, foreach, echo etc.)

So the const keyword is case insensitive. ;)
jcornil
 
Posts: 2
Joined: Sun 18 Aug 2013 10:22

Re: Reverse Php show errors on class const

Postby Bruno Pagès » Sun 18 Aug 2013 16:08

Yes insensitive in the blog, but for me the official entry is the reference manual.

Do we have to consider all is case insensitive by default (when nothing is said about case) in the reference manual ?

Have nice modelling
ImageAuthor of Bouml
Bruno Pagès
 
Posts: 470
Joined: Mon 20 Feb 2012 08:23
Location: France


Return to Bug reports / Rapports de bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron