Example #1
0
 public function filter($action = "index", array $args = array())
 {
     $this->action = $action ? $action : "index";
     $this->args = $args ? $args : array();
     $this->extension = pathinfo($this->args[count($this->args) - 1], PATHINFO_EXTENSION);
     $this->url = URL::create($this->slug, $this->defaultToIndex && $this->action == 'index' ? null : $this->action, $this->args);
     $this->fullURL = URL::create($this->slug, $this->defaultToIndex && $this->action == 'index' ? null : $this->action, $this->args, $this->get->toArray());
     if ($this->extension) {
         $this->args[count($this->args) - 1] = str_replace(".{$this->extension}", '', $this->args[count($this->args) - 1]);
     } else {
         $this->extension = "html";
     }
     if (!method_exists($this, $this->action)) {
         if ($this->defaultToIndex && method_exists($this, 'index')) {
             $this->action = to_camel_case($this->action);
             array_unshift($this->args, $this->action);
             $this->action = 'index';
             $this->filter($this->action, $this->args);
             return;
         }
         throw new NotFoundException("Undefined method - {$this->name}/{$this->action}");
     }
     if ($this->beforeFilter() === false) {
         return;
     }
     call_user_method_array($this->action, $this, $this->args);
     $this->afterFilter();
     if ($this->autoRender) {
         $this->render();
     }
 }
 /**
  * get the singleton object of this class or create new
  * 
  * @param string $name name of the controller
  * @return object reference to the controller object
  */
 public static function getInstance($name)
 {
     if (!is_object(self::$objects[$name])) {
         $class = to_camel_case($name, TRUE);
         self::$objects[$name] = new $class();
     }
     return self::$objects[$name];
 }
Example #3
0
 private function get_ORM_fk_name(reDBForeignKey $fk)
 {
     // [ column => referenced_colum ]
     $cols = array_keys($fk->getColumnReferences());
     foreach ($cols as $i => $col) {
         if (substr($col, -3) == '_id') {
             $cols[$i] = substr($col, 0, -3);
         }
     }
     $fk_name = implode('_', $cols);
     $fk_name = preg_replace('/[^a-zA-Z0-9_]/', '_', $fk_name);
     return to_camel_case($fk_name, true);
 }
Example #4
0
function method_name($amqp_class, $amqp_method)
{
    return $amqp_class . to_camel_case($amqp_method);
}
     echo G::json_encode($process->getAll());
     break;
 case 'save':
     require_once 'classes/model/AdditionalTables.php';
     require_once 'classes/model/Fields.php';
     try {
         $data = $_POST;
         $data['columns'] = G::json_decode($_POST['columns']);
         //decofing data columns
         // Reserved Words
         $aReservedWords = array('ALTER', 'CLOSE', 'COMMIT', 'CREATE', 'DECLARE', 'DELETE', 'DROP', 'FETCH', 'FUNCTION', 'GRANT', 'INDEX', 'INSERT', 'OPEN', 'REVOKE', 'ROLLBACK', 'SELECT', 'SYNONYM', 'TABLE', 'UPDATE', 'VIEW', 'APP_UID', 'ROW');
         $oAdditionalTables = new AdditionalTables();
         $oFields = new Fields();
         // verify if exists.
         $aNameTable = $oAdditionalTables->loadByName($data['REP_TAB_NAME']);
         $repTabClassName = to_camel_case($data['REP_TAB_NAME']);
         $repTabData = array('ADD_TAB_UID' => $data['REP_TAB_UID'], 'ADD_TAB_NAME' => $data['REP_TAB_NAME'], 'ADD_TAB_CLASS_NAME' => $repTabClassName, 'ADD_TAB_DESCRIPTION' => $data['REP_TAB_DSC'], 'ADD_TAB_PLG_UID' => '', 'DBS_UID' => $data['REP_TAB_CONNECTION'], 'PRO_UID' => $data['PRO_UID'], 'ADD_TAB_TYPE' => $data['REP_TAB_TYPE'], 'ADD_TAB_GRID' => $data['REP_TAB_GRID']);
         $columns = $data['columns'];
         if ($data['REP_TAB_UID'] == '') {
             //new report table
             //setting default columns
             $defaultColumns = array();
             $application = new stdClass();
             //APPLICATION KEY
             $application->uid = '';
             $application->field_dyn = '';
             $application->field_uid = '';
             $application->field_name = 'APP_UID';
             $application->field_label = 'APP_UID';
             $application->field_type = 'VARCHAR';
             $application->field_size = 32;
Example #6
0
 if (isset($result->data->pricingInfo->fr)) {
     $content .= "<br>" . html_entity_decode($result->data->pricingInfo->fr);
 }
 if (isset($result->data->imageThumb)) {
     $thumb = $result->data->imageThumb;
 } else {
     $thumb = '';
 }
 if (isset($result->data->tags->fr)) {
     $cibulTags = explode(",", $result->data->tags->fr);
 } else {
     $cibulTags = explode(",", $result->data->tags->en);
 }
 if (!empty($cibulTags) && sizeof($cibulTags)) {
     foreach ($cibulTags as $tag) {
         $freeTag[] = to_camel_case($tag);
         $temp_tag = yakcatPathN($tag, 1);
         if (preg_match("/THEATRE/i", $temp_tag)) {
             $cat[] = "CULTURE#THEATRE";
             $catName[] = "Théatre";
         } else {
             if (preg_match("/CONCERT/i", $temp_tag)) {
                 $cat[] = "CULTURE#MUSIQUE";
                 $catName[] = "Musique";
             } else {
                 if (preg_match("/OPERA/i", $temp_tag)) {
                     $cat[] = "CULTURE#MUSIQUE";
                     $catName[] = "Musique";
                     $freeTag[] = "Classique";
                     $freeTag[] = "Opéra";
                 }
Example #7
0
 function test_main()
 {
     $this->on_start_test_main();
     $error_handler = set_error_handler("error_handler");
     error_reporting(E_ALL);
     $this->TESTS_COMPLETED = 0;
     $this->TESTS_ERROR = 0;
     $this->TESTS_FAILED = 0;
     $this->TESTS_SKIPPED = 0;
     $this->TESTS_TOTAL = 0;
     $handle = opendir($this->directory);
     while (($file = readdir($handle)) !== false) {
         if (strlen($file) > 5 && substr($file, -3) == 'php' && $file != 'index.php') {
             include_once $this->directory . '/' . $file;
             $class = substr($file, 0, strlen($file) - 4);
             $class = to_camel_case($class, true);
             if (class_exists($class)) {
                 if (is_subclass_of($class, 'Test')) {
                     $this->run_test($class);
                 }
             }
         }
     }
     closedir($handle);
     set_error_handler("error_handler");
     $this->on_end_test_main();
 }