This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./buildconf --force | |
./configure --enable-debug --enable-mbstring --with-gd --with-gmp --with-openssl --with-pdo-mysql --with-config-file-path=/etc --enable-phalcon --with-curl --with-mcrypt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Phalcon\Mvc; | |
/** | |
* Phalcon\Mvc\Dispatcher | |
* | |
* Dispatching is the process of taking the request object, extracting the module name, | |
* controller name, action name, and optional parameters contained in it, and then | |
* instantiating a controller and calling an action of that controller. | |
* | |
*<code> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Function Attrs: nounwind ssp uwtable | |
define i32 @x(%struct._zval_struct* %z) #0 { | |
%1 = alloca %struct._zval_struct*, align 8 | |
store %struct._zval_struct* %z, %struct._zval_struct** %1, align 8 | |
%2 = load %struct._zval_struct** %1, align 8 | |
%3 = getelementptr inbounds %struct._zval_struct* %2, i32 0, i32 2 | |
%4 = load i8* %3, align 1 | |
%5 = zext i8 %4 to i32 | |
%6 = icmp eq i32 %5, 1 | |
br i1 %6, label %7, label %12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
set_exception_handler(function($e) use ($di) { | |
file_put_contents(APP_PATH . '/app/logs/error-log' . uniqid("", true) . '.txt' , | |
$e->getMessage() . PHP_EOL . | |
print_r($e->getTrace(), true) . PHP_EOL . | |
print_r($_POST, true) . PHP_EOL . | |
print_r($_GET, true) . PHP_EOL . | |
print_r($_SERVER, true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Phalcon\Events\Event, | |
Phalcon\Mvc\User\Plugin, | |
Phalcon\Mvc\Dispatcher, | |
Phalcon\Acl; | |
/** | |
* Security | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<memory-grow> | |
if some-condition { | |
<here-we-need-the-memory-grow> | |
} | |
<restore-stack> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyDialect extends \Phalcon\Db\Dialect\Mysql | |
{ | |
/** | |
* Gets the column name in MySQL | |
* | |
* @param Phalcon\Db\ColumnInterface $column | |
* @return string | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check best compilation flags for GCC | |
export CC="gcc" | |
export CFLAGS="-march=native -mtune=native -O2 -fno-delete-null-pointer-checks -finline-functions -fomit-frame-pointer -fno-builtin-memcmp" | |
echo "int main() {}" > t.c | |
gcc $CFLAGS t.c -o t 2> t.t | |
if [ $? != 0 ]; then | |
chmod +x gcccpuopt | |
BFLAGS=`./gcccpuopt` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$volt = new Phalcon\Mvc\View\Engine\Volt\Compiler(); | |
file_put_contents('x.php', $volt->compileString('{%- macro error_messages(message, field, type) %} | |
<div> | |
<span class="error-type">{{ type }}</span> | |
<span class="error-field">{{ field }}</span> | |
<span class="error-message">{{ message }}</span> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PHP_ARG_ENABLE(test, whether to enable test, [ --enable-test Enable test framework]) | |
if test "$PHP_TEST" = "yes"; then | |
AC_DEFINE(HAVE_TEST, 1, [Whether you have Test]) | |
test_sources="test.c kernel/main.c kernel/memory.c kernel/exception.c kernel/hash.c kernel/debug.c kernel/backtrace.c kernel/object.c kernel/array.c kernel/string.c kernel/fcall.c kernel/alternative/fcall.c kernel/operators.c arithmetic.c flow.c nativearray.c assign.c fibonnaci.c" | |
PHP_NEW_EXTENSION(test, $test_sources, $ext_shared) | |
fi |
NewerOlder