Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major source code optimization #1785

Merged
merged 12 commits into from Jan 10, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Part 7
  • Loading branch information
sjinks committed Jan 10, 2014
commit 6cb6de12c306ad2630d2cd4d52d97955ef69720f
1 change: 0 additions & 1 deletion ext/di.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/

#include "di.h"
#include "phalcon.h"
#include "diinterface.h"
#include "di/exception.h"
#include "di/injectionawareinterface.h"
Expand Down
13 changes: 1 addition & 12 deletions ext/mvc/micro/lazyloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,10 @@
+------------------------------------------------------------------------+
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "php.h"
#include "php_phalcon.h"
#include "phalcon.h"

#include <Zend/zend_operators.h>
#include <Zend/zend_exceptions.h>
#include <Zend/zend_interfaces.h>
#include "mvc/micro/lazyloader.h"

#include "kernel/main.h"
#include "kernel/memory.h"

#include "kernel/exception.h"
#include "kernel/object.h"
#include "kernel/fcall.h"
Expand Down
32 changes: 18 additions & 14 deletions ext/mvc/model/behavior.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,10 @@
+------------------------------------------------------------------------+
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "php.h"
#include "php_phalcon.h"
#include "phalcon.h"

#include <Zend/zend_operators.h>
#include <Zend/zend_exceptions.h>
#include <Zend/zend_interfaces.h>
#include "mvc/model/behavior.h"
#include "mvc/model/behaviorinterface.h"

#include "kernel/main.h"
#include "kernel/memory.h"

#include "kernel/object.h"
#include "kernel/array.h"

Expand All @@ -40,7 +29,22 @@
*
* This is an optional base class for ORM behaviors
*/

zend_class_entry *phalcon_mvc_model_behavior_ce;

PHP_METHOD(Phalcon_Mvc_Model_Behavior, __construct);
PHP_METHOD(Phalcon_Mvc_Model_Behavior, mustTakeAction);
PHP_METHOD(Phalcon_Mvc_Model_Behavior, getOptions);
PHP_METHOD(Phalcon_Mvc_Model_Behavior, notify);
PHP_METHOD(Phalcon_Mvc_Model_Behavior, missingMethod);

static const zend_function_entry phalcon_mvc_model_behavior_method_entry[] = {
PHP_ME(Phalcon_Mvc_Model_Behavior, __construct, arginfo_phalcon_mvc_model_behaviorinterface___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_ME(Phalcon_Mvc_Model_Behavior, mustTakeAction, NULL, ZEND_ACC_PROTECTED)
PHP_ME(Phalcon_Mvc_Model_Behavior, getOptions, NULL, ZEND_ACC_PROTECTED)
PHP_ME(Phalcon_Mvc_Model_Behavior, notify, arginfo_phalcon_mvc_model_behaviorinterface_notify, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Behavior, missingMethod, arginfo_phalcon_mvc_model_behaviorinterface_missingmethod, ZEND_ACC_PUBLIC)
PHP_FE_END
};

/**
* Phalcon\Mvc\Model\Behavior initializer
Expand Down
36 changes: 6 additions & 30 deletions ext/mvc/model/behavior.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,13 @@
+------------------------------------------------------------------------+
*/

extern zend_class_entry *phalcon_mvc_model_behavior_ce;

PHALCON_INIT_CLASS(Phalcon_Mvc_Model_Behavior);

PHP_METHOD(Phalcon_Mvc_Model_Behavior, __construct);
PHP_METHOD(Phalcon_Mvc_Model_Behavior, mustTakeAction);
PHP_METHOD(Phalcon_Mvc_Model_Behavior, getOptions);
PHP_METHOD(Phalcon_Mvc_Model_Behavior, notify);
PHP_METHOD(Phalcon_Mvc_Model_Behavior, missingMethod);
#ifndef PHALCON_MVC_MODEL_BEHAVIOR_H
#define PHALCON_MVC_MODEL_BEHAVIOR_H

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior___construct, 0, 0, 0)
ZEND_ARG_INFO(0, options)
ZEND_END_ARG_INFO()
#include "php_phalcon.h"

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior_notify, 0, 0, 2)
ZEND_ARG_INFO(0, type)
ZEND_ARG_INFO(0, model)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior_missingmethod, 0, 0, 2)
ZEND_ARG_INFO(0, model)
ZEND_ARG_INFO(0, method)
ZEND_ARG_INFO(0, arguments)
ZEND_END_ARG_INFO()
extern zend_class_entry *phalcon_mvc_model_behavior_ce;

static const zend_function_entry phalcon_mvc_model_behavior_method_entry[] = {
PHP_ME(Phalcon_Mvc_Model_Behavior, __construct, arginfo_phalcon_mvc_model_behavior___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_ME(Phalcon_Mvc_Model_Behavior, mustTakeAction, NULL, ZEND_ACC_PROTECTED)
PHP_ME(Phalcon_Mvc_Model_Behavior, getOptions, NULL, ZEND_ACC_PROTECTED)
PHP_ME(Phalcon_Mvc_Model_Behavior, notify, arginfo_phalcon_mvc_model_behavior_notify, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Behavior, missingMethod, arginfo_phalcon_mvc_model_behavior_missingmethod, ZEND_ACC_PUBLIC)
PHP_FE_END
};
PHALCON_INIT_CLASS(Phalcon_Mvc_Model_Behavior);

#endif /* PHALCON_MVC_MODEL_BEHAVIOR_H */
23 changes: 11 additions & 12 deletions ext/mvc/model/behavior/softdelete.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,13 @@
+------------------------------------------------------------------------+
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "php.h"
#include "php_phalcon.h"
#include "phalcon.h"

#include <Zend/zend_operators.h>
#include <Zend/zend_exceptions.h>
#include <Zend/zend_interfaces.h>
#include "mvc/model/behavior/softdelete.h"
#include "mvc/model/behavior.h"
#include "mvc/model/behaviorinterface.h"
#include "mvc/model/exception.h"

#include "kernel/main.h"
#include "kernel/memory.h"

#include "kernel/operators.h"
#include "kernel/fcall.h"
#include "kernel/array.h"
Expand All @@ -44,7 +36,14 @@
* Instead of permanently delete a record it marks the record as
* deleted changing the value of a flag column
*/
zend_class_entry *phalcon_mvc_model_behavior_softdelete_ce;

PHP_METHOD(Phalcon_Mvc_Model_Behavior_SoftDelete, notify);

static const zend_function_entry phalcon_mvc_model_behavior_softdelete_method_entry[] = {
PHP_ME(Phalcon_Mvc_Model_Behavior_SoftDelete, notify, arginfo_phalcon_mvc_model_behaviorinterface_notify, ZEND_ACC_PUBLIC)
PHP_FE_END
};

/**
* Phalcon\Mvc\Model\Behavior\SoftDelete initializer
Expand Down
18 changes: 6 additions & 12 deletions ext/mvc/model/behavior/softdelete.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,13 @@
+------------------------------------------------------------------------+
*/

extern zend_class_entry *phalcon_mvc_model_behavior_softdelete_ce;

PHALCON_INIT_CLASS(Phalcon_Mvc_Model_Behavior_SoftDelete);
#ifndef PHALCON_MVC_MODEL_BEHAVIOR_SOFTDELETE_H
#define PHALCON_MVC_MODEL_BEHAVIOR_SOFTDELETE_H

PHP_METHOD(Phalcon_Mvc_Model_Behavior_SoftDelete, notify);
#include "php_phalcon.h"

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior_softdelete_notify, 0, 0, 2)
ZEND_ARG_INFO(0, type)
ZEND_ARG_INFO(0, model)
ZEND_END_ARG_INFO()
extern zend_class_entry *phalcon_mvc_model_behavior_softdelete_ce;

static const zend_function_entry phalcon_mvc_model_behavior_softdelete_method_entry[] = {
PHP_ME(Phalcon_Mvc_Model_Behavior_SoftDelete, notify, arginfo_phalcon_mvc_model_behavior_softdelete_notify, ZEND_ACC_PUBLIC)
PHP_FE_END
};
PHALCON_INIT_CLASS(Phalcon_Mvc_Model_Behavior_SoftDelete);

#endif /* PHALCON_MVC_MODEL_BEHAVIOR_SOFTDELETE_H */
24 changes: 11 additions & 13 deletions ext/mvc/model/behavior/timestampable.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,13 @@
+------------------------------------------------------------------------+
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "php.h"
#include "php_phalcon.h"
#include "phalcon.h"

#include <Zend/zend_operators.h>
#include <Zend/zend_exceptions.h>
#include <Zend/zend_interfaces.h>
#include "mvc/model/behavior/timestampable.h"
#include "mvc/model/behavior.h"
#include "mvc/model/behaviorinterface.h"
#include "mvc/model/exception.h"

#include "kernel/main.h"
#include "kernel/memory.h"

#include "kernel/fcall.h"
#include "kernel/operators.h"
#include "kernel/array.h"
Expand All @@ -45,7 +37,14 @@
* Allows to automatically update a model’s attribute saving the
* datetime when a record is created or updated
*/
zend_class_entry *phalcon_mvc_model_behavior_timestampable_ce;

PHP_METHOD(Phalcon_Mvc_Model_Behavior_Timestampable, notify);

static const zend_function_entry phalcon_mvc_model_behavior_timestampable_method_entry[] = {
PHP_ME(Phalcon_Mvc_Model_Behavior_Timestampable, notify, arginfo_phalcon_mvc_model_behaviorinterface_notify, ZEND_ACC_PUBLIC)
PHP_FE_END
};

/**
* Phalcon\Mvc\Model\Behavior\Timestampable initializer
Expand Down Expand Up @@ -158,4 +157,3 @@ PHP_METHOD(Phalcon_Mvc_Model_Behavior_Timestampable, notify){

PHALCON_MM_RESTORE();
}

18 changes: 6 additions & 12 deletions ext/mvc/model/behavior/timestampable.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,13 @@
+------------------------------------------------------------------------+
*/

extern zend_class_entry *phalcon_mvc_model_behavior_timestampable_ce;

PHALCON_INIT_CLASS(Phalcon_Mvc_Model_Behavior_Timestampable);
#ifndef PHALCON_MVC_MODEL_BEHAVIOR_TIMESTAMPABLE_H
#define PHALCON_MVC_MODEL_BEHAVIOR_TIMESTAMPABLE_H

PHP_METHOD(Phalcon_Mvc_Model_Behavior_Timestampable, notify);
#include "php_phalcon.h"

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior_timestampable_notify, 0, 0, 2)
ZEND_ARG_INFO(0, type)
ZEND_ARG_INFO(0, model)
ZEND_END_ARG_INFO()
extern zend_class_entry *phalcon_mvc_model_behavior_timestampable_ce;

static const zend_function_entry phalcon_mvc_model_behavior_timestampable_method_entry[] = {
PHP_ME(Phalcon_Mvc_Model_Behavior_Timestampable, notify, arginfo_phalcon_mvc_model_behavior_timestampable_notify, ZEND_ACC_PUBLIC)
PHP_FE_END
};
PHALCON_INIT_CLASS(Phalcon_Mvc_Model_Behavior_Timestampable);

#endif /* PHALCON_MVC_MODEL_BEHAVIOR_TIMESTAMPABLE_H */
17 changes: 9 additions & 8 deletions ext/mvc/model/behaviorinterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@
+------------------------------------------------------------------------+
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "mvc/model/behaviorinterface.h"
#include "kernel/main.h"

#include "php.h"
#include "php_phalcon.h"
#include "phalcon.h"
zend_class_entry *phalcon_mvc_model_behaviorinterface_ce;

#include "kernel/main.h"
static const zend_function_entry phalcon_mvc_model_behaviorinterface_method_entry[] = {
PHP_ABSTRACT_ME(Phalcon_Mvc_Model_BehaviorInterface, __construct, arginfo_phalcon_mvc_model_behaviorinterface___construct)
PHP_ABSTRACT_ME(Phalcon_Mvc_Model_BehaviorInterface, notify, arginfo_phalcon_mvc_model_behaviorinterface_notify)
PHP_ABSTRACT_ME(Phalcon_Mvc_Model_BehaviorInterface, missingMethod, arginfo_phalcon_mvc_model_behaviorinterface_missingmethod)
PHP_FE_END
};

/**
* Phalcon\Mvc\Model\BehaviorInterface initializer
Expand Down Expand Up @@ -60,4 +62,3 @@ PHALCON_DOC_METHOD(Phalcon_Mvc_Model_BehaviorInterface, notify);
* @param array $arguments
*/
PHALCON_DOC_METHOD(Phalcon_Mvc_Model_BehaviorInterface, missingMethod);

13 changes: 6 additions & 7 deletions ext/mvc/model/behaviorinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
+------------------------------------------------------------------------+
*/

#ifndef PHALCON_MVC_MODEL_BEHAVIORINTERFACE_H
#define PHALCON_MVC_MODEL_BEHAVIORINTERFACE_H

#include "php_phalcon.h"

extern zend_class_entry *phalcon_mvc_model_behaviorinterface_ce;

PHALCON_INIT_CLASS(Phalcon_Mvc_Model_BehaviorInterface);
Expand All @@ -36,10 +41,4 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behaviorinterface_missingmethod
ZEND_ARG_INFO(0, arguments)
ZEND_END_ARG_INFO()

static const zend_function_entry phalcon_mvc_model_behaviorinterface_method_entry[] = {
PHP_ABSTRACT_ME(Phalcon_Mvc_Model_BehaviorInterface, __construct, arginfo_phalcon_mvc_model_behaviorinterface___construct)
PHP_ABSTRACT_ME(Phalcon_Mvc_Model_BehaviorInterface, notify, arginfo_phalcon_mvc_model_behaviorinterface_notify)
PHP_ABSTRACT_ME(Phalcon_Mvc_Model_BehaviorInterface, missingMethod, arginfo_phalcon_mvc_model_behaviorinterface_missingmethod)
PHP_FE_END
};

#endif /* PHALCON_MVC_MODEL_BEHAVIORINTERFACE_H */
Loading