We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Can I build part of phalcon2?

I wanna write some tests and functionality (functionality from 1st branch of framework), 'n I MUST compile all phalcon2, it's too long... Can I do it faster?



98.9k
Accepted
answer
edited Nov '14

First time, compilation takes a long time, but in the second compilation it makes an incremental build only by compiling those files that recently changed, there are also situations that trigger a full compilation like removing an existing method or change the visibility attribute in a class that is a dependency of many classes.



1.8k

First time, compilation takes a long time, but in the second compilation it makes an incremental build only compiling those files that recently changed, there are also situations that trigger a full compilation like removing an existing method or change the visibility attribute in a class that is a dependency of many classes.

Agree with I saw files with md5 hashes. Is the Phalcon' team need some help with developing branch 2.0? If yes - where I can see completed issues and TODO?



98.9k

Most components are already migrated, only a few options in Phalcon\Config are missing and the implementation of Phalcon\Logger\Adapter\FirePhp



1.8k

Most components are already migrated, only a few options in Phalcon\Config are missing and the implementation of Phalcon\Logger\Adapter\FirePhp

as I see Translater\Gettext does not exist. also I've a problem with testing exception:

    file = fopen(options["content"], "rb");
    if file === false {
        throw new Exception("Error opening translation file '" . options["content"] . "'");
    }

how to add @ to fopen?



98.9k

Zephir does not have that @ silent operator, you can use file_exists first to check if the file does exist or is_readable to check permissions.

Most components are already migrated, only a few options in Phalcon\Config are missing and the implementation of Phalcon\Logger\Adapter\FirePhp

as I see Translater\Gettext does not exist. also I've a problem with testing exception:

  file = fopen(options["content"], "rb");
  if file === false {
      throw new Exception("Error opening translation file '" . options["content"] . "'");
  }

how to add @ to fopen?



1.8k

file_exist - toooooo slow

Zephir does not have that @ silent operator, you can use file_exists first to check if the file does exist or is_readable to check permissions.

Most components are already migrated, only a few options in Phalcon\Config are missing and the implementation of Phalcon\Logger\Adapter\FirePhp

as I see Translater\Gettext does not exist. also I've a problem with testing exception:

 file = fopen(options["content"], "rb");
 if file === false {
     throw new Exception("Error opening translation file '" . options["content"] . "'");
 }

how to add @ to fopen?



98.9k

why?

file_exist - toooooo slow



1.8k

for example:

  1. file_exist or is_readable
  2. fopen

    2 operations (also I can create some benchmark to check it for time speed).

why?

file_exist - toooooo slow



98.9k

Actually, PHP implements a stat cache on where the information gathered in the first call is reused in the second call, also Zephir inlines the call to file_exists into a C function which has lower overhead.

https://github.com/phalcon/zephir/blob/master/Library/Optimizers/FunctionCall/FileExistsOptimizer.php#L55

Just wanted to say thanks to Andres. Not only for doing the majority of the development and leading this project, but fielding answers to questions and criticisms.

Thanks for all your hard work.

Actually, PHP implements a stat cache on where the information gathered in the first call is reused in the second call, also Zephir inlines the call to file_exists into a C function which has lower overhead.

https://github.com/phalcon/zephir/blob/master/Library/Optimizers/FunctionCall/FileExistsOptimizer.php#L55