Skip to content

Instantly share code, notes, and snippets.

View pgasiorowski's full-sized avatar

Piotr Gąsiorowski pgasiorowski

View GitHub Profile
@pgasiorowski
pgasiorowski / MultiUniqueness.php
Created November 7, 2013 10:53
Allows to validate if model is unique across slected fields. Pass additional option "exclude" string or array of fileds to be excluded from the check
/**
* ELS\Model\Validator\MultiUniqueness
*
* Allows to validate if model is unique across selected fields
*/
class MultiUniqueness extends \Phalcon\Mvc\Model\Validator
{
/**
* Executes the validator
@pgasiorowski
pgasiorowski / Google AppEngine and SDK differences
Last active December 31, 2015 22:49
Here are all differences between Google AppEngine PHP environment and my local GAE SDK on Windows 7. Both versions are 1.8.8
Here are all differences between Google AppEngine PHP environment and my local GAE SDK on Windows 7.
Both versions are 1.8.8
-----------------------------------------------------
# $_SERVER["SERVER_SOFTWARE"]
GAE: Google App Engine/1.8.8
SDK: Development/2.0
-----------------------------------------------------
@pgasiorowski
pgasiorowski / sample_content_plugin.php
Created December 21, 2013 12:08
Bug in JForm->load() implementation
# Lets consider a content plugin with the following implementation:
# Basically, its intention is to add/replace elements from a form,
# Joomla 'Global Configuration' form in this case
<?php
public function onContentPrepareForm($form, $data)
{
// The name of the form we want to process
$formName = 'com_config.application';
@pgasiorowski
pgasiorowski / phalcon.c
Created January 11, 2014 15:51
32-bit from ext as of 11 Jan 2014
This file has been truncated, but you can view the full file.
/**
New BSD License
Copyright (c) 2011-2014, Phalcon Framework Team
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
@pgasiorowski
pgasiorowski / phalcon.c
Created January 11, 2014 20:28
32-bit from ext as of 11 Jan 2014 - version 2
This file has been truncated, but you can view the full file.
/**
New BSD License
Copyright (c) 2011-2014, Phalcon Framework Team
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
@pgasiorowski
pgasiorowski / test.html
Created January 12, 2014 13:18
Actual result for /ext/tests/issue-1401.phpt
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Exception: Test</title><link href="//static.phalconphp.com/debug/1.2.0/jquery/jquery-ui.css" type="text/css" rel="stylesheet" /><link href="//static.phalconphp.com/debug/1.2.0/themes/default/style.css" type="text/css" rel="stylesheet" /></head><body><div class="version">Phalcon Framework <a target="_new" href="http://docs.phalconphp.com/en/1.3.0/">1.3.0</a></div><div align="center"><div class="error-main"><h1>Exception: Test</h1><span class="error-file"><a href="">F:\SVN\cphalcon\ext\tests\issue-1401.php</a> (6)</span></div><div class="error-info"><div id="tabs"><ul><li><a href="#error-tabs-1">Backtrace</a></li><li><a href="#error-tabs-2">Request</a></li><li><a href="#error-tabs-3">Server</a></li><li><a href="#error-tabs-4">Included Files</a></li><li><a href="#error-tabs-5">Memory</a></li></ul><div id="error-tabs-1"><table cellspacing="0" align="center" width="100%"><tr><td align="right" valign="top" class="error-number">#0
Microsoft (R) Program Maintenance Utility Version 11.00.50727.1
Copyright (C) Microsoft Corporation. All rights reserved.
Recreating build dirs
phalcon.c
ext\phalcon\phalcon.c(11975) : warning C4018: '>' : signed/unsigned mismatch
ext\phalcon\phalcon.c(14517) : error C2059: syntax error : '}'
ext\phalcon\phalcon.c(14517) : warning C4034: sizeof returns 0
ext\phalcon\phalcon.c(14522) : error C2059: syntax error : '}'
ext\phalcon\phalcon.c(14522) : warning C4034: sizeof returns 0
Creating library Release_TS\php_phalcon.lib and object Release_TS\php_phalcon.exp
phalcon.obj : error LNK2019: unresolved external symbol @phalcon_clean_restore_stack@4 referenced in function _phalcon_verify_permanent_zvals
phalcon.obj : error LNK2019: unresolved external symbol _php_phalcon_init_globals referenced in function _phalcon_verify_permanent_zvals
phalcon.obj : error LNK2019: unresolved external symbol _phalcon_orm_destroy_cache referenced in function _phalcon_verify_permanent_zvals
phalcon.obj : error LNK2019: unresolved external symbol _phalcon_init_interned_strings referenced in function _phalcon_verify_permanent_zvals
phalcon.obj : error LNK2019: unresolved external symbol _phalcon_Phalcon_Acl_init referenced in function _phalcon_verify_permanent_zvals
phalcon.obj : error LNK2019: unresolved external symbol _phalcon_Phalcon_Acl_Adapter_init referenced in function _phalcon_verify_permanent_zvals
phalcon.obj : error LNK2019: unresolved external symbol _phalcon_Phalcon_Acl_AdapterInterface_init
C:\php-sdk\build.phalcon.bat
n
Microsoft (R) Program Maintenance Utility Version 11.00.50727.1
Copyright (C) Microsoft Corporation. All rights reserved.
Recreating build dirs
type ext\pcre\php_pcre.def > Release_TS\php5ts.dll.def
phalcon.c
ext\phalcon\phalcon.c(3407) : error C2143: syntax error : missing ';' before 'type'
@pgasiorowski
pgasiorowski / phalcon.c
Created March 8, 2014 09:51
generated from build/32bits
This file has been truncated, but you can view the full file.
/**
New BSD License
Copyright (c) 2011-2014, Phalcon Framework Team
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright