Tuesday, June 30, 2015

Check tax code (fiscal code) when insert a user

Hi all,

i'm new to cakephp and i use the 3 version. I'm lovin' it!!! :-)

I try to check the fiscal code (i'm italian and in my country the fiscal code = tax code is the unique id for all person) because i need to check if the user exist and don't insert duplicate.
I'm going crazy to do that beacuse isn't a function do this.

Help me please!!!

thanks in advantages for all reply.

PS: sorry for my bad english :-)

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: cakephp3 errors..... after edit db info

Yeah I have dedicated servers so not run by GoDaddy let me know.  Since I host many sites I am looking into having php 5.5  and php 5.4 for some our hosting customers.

I see no issues with cakephp 3 and 5.5 ..... so maybe they need to change minimum requirements 

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

XML output

I'm using cake 2.x, how can i use _rootNode for custom xml output?

I would like to delete the <response></response> labels.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Assets via IP working but not with domain

I configured my virtual host like this: http://pastebin.com/Hgu3se5A

Access via IP is working but not with the URL. Than I got problems with the assets. In the core file I set the Configure::write('App.fullBaseUrl', 'www.innolabvenlo.nl');

The /etc/hosts file has the entry of:   ip    innolabvenlo.nl *.innolabvenlo.nl     innolab

The version is Cakephp 2.7

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: cakephp3 errors..... after edit db info


You are not the first one reporting this issue with 5.4.41. I'll try to investigate if this is a bug in the minor version or something odd that godaddy is doing.

On Monday, June 29, 2015 at 1:52:59 AM UTC+2, Eric Haskins wrote:
Hey All

So Im trying to get version 3 running.  Aside from not liking the composer BS Im having a issue with initial install and setup.  I get it running at http://cake3.farsightedmedia.com on the initial setup and works fine as soon as I change the DB credentials 

//'port' => 'nonstandard_port_number',
            'username' => 'my_app',
            'password' => 'secret',
            'database' => 'my_app',
            'encoding' => 'utf8',
            'timezone' => 'UTC',
            'cacheMetadata' => true,

To actual working credentials I am presented with these errors and they dont go away even if I rollback the changes


Fatal error: Call to undefined method Cake\Datasource\ConnectionManager::_config() in /home/farsight/public_html/cake3/vendor/cakephp/cakephp/src/Datasource/ConnectionManager.php on line 80

Fatal error: Call to undefined method Cake\View\StringTemplate::get() in /home/farsight/public_html/cake3/vendor/cakephp/cakephp/src/View/StringTemplate.php on line 176

I have many apps I would like to start porting over to version 3 ........   Ny servers are all CPanel Suphp

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Monday, June 29, 2015

CakePHP 2.6.8 Released

The CakePHP core team is happy to announce the immediate availability of CakePHP
2.6.8. This is a maintenance release for the 2.6 branch.

Bugfixes
--------

You can expect the following changes in 2.6.8. See the
[changelog](http://cakephp.org/changelogs/2.6.8) for every commit.

* Fix issue with overlapping irregular inflections. When irregular inflections
  overlap we should choose the longest match, not the shortest.
* Fix regression in Inflector::camelize(). The input should not be lowercased
  before camelizing, as this can cause inputs that were previously camelized to
  create incorrect results.
* Fix Validation::multiple() regarding 0 value. Previously 0 could not be
  a valid option.
* FormHelper::radio() now supports complex option definition. This makes it
  easier to define custom attributes on each radio button.
* Element tags had trailing whitespace removed. If you have custom element tags
  with HtmlHelper you might need to update your templates.
* Shells will now never print HTML errors. Previously if you used custom the
  console error handlers you could end up with HTML in your terminal.
* SQL operators in Postgres are now less greedy when fields are quoted.

As always, a huge thanks to all the community members that helped make this
release happen by reporting issues and sending pull requests.

Download a [packaged release on github](https://github.com/cakephp/cakephp/releases>).

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

component to list all controllers and actions

Hi,

I'm coding in CakePHP 3. I'm trying to make a user manager inspired in AdaptCMS with custom roles. I need make a component like this: https://github.com/cakebaker/controller-list-component/blob/master/app/Controller/Component/ControllerListComponent.php

I don't know how list controllers and actions. Any suggestion?

Att,

--
Helton Nogueira UCHOA :: engenheiro.uchoa@gmail.com
Information Technology and Geospatial Specialist - Project Manager
OSGeo Charter Member (www.osgeo.org)
+55 85 8886-3909 (OI - WhatsApp) :: +55 85 9716-7769 (TIM) :: +55 85 3037-8689 (MULTIPLAY)

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: Result of function search is very large

Looks to me as if you could have done the same thing properly (not using session but PRG pattern) and with 3 lines of code
using https://github.com/CakeDC/search

mark



Am Montag, 29. Juni 2015 10:30:50 UTC+2 schrieb Eb ook:
Hello all,

Result of function search is very large, It sometime is wrong.

Can you help me to fix it.

This is source this function.

public function find(){
        $this->layout = 'listimage';
        $this->set('title_for_layout', __('Search Results', true));
        $this->Image->recursive = 0;
        $search = $this->Session->read('Search');
        if(!empty($_POST['data'])){
            $this->Session->write('Search', $this->data);
            $conditions = array();
              if($this->Session->read('Search.Image.region_id')){
                $q = $this->Session->read('Search.Image.region_id');
                $conditions['Image.region_id'] = $q;
            }
              if($this->Session->read('Search.Image.artist_id')){
                $q = $this->Session->read('Search.Image.artist_id');
                $conditions['Image.artist_id'] = $q;
              }
              if($this->Session->read('Search.Image.movement_id')){
                $q = $this->Session->read('Search.Image.movement_id');
                $conditions['Image.movement_id'] = $q;
              }
              if($this->Session->read('Search.Image.museum_id')){
                $q = $this->Session->read('Search.Image.museum_id');
                $conditions['Image.museum_id'] = $q;
              }
              if($this->Session->read('Search.Image.museum_id')){
                $q = $this->Session->read('Search.Image.museum_id');
                $conditions['Image.museum_id'] = $q;
              }
              if($this->Session->read('Search.Theme.Theme.0')){
                $q = $this->Session->read('Search.Theme.Theme.0');
                $this->Image->bindModel(array('hasOne' => array('ImagesTheme')),false);
                $conditions['ImagesTheme.theme_id']= $q;
              }
              if($this->Session->read('Search.Media.Media.0')){
                $q = $this->Session->read('Search.Media.Media.0');
                $this->Image->bindModel(array('hasOne' => array('ImagesMedium')),false);
                $conditions['ImagesMedium.media_id']= $q;
              }
              if($this->Session->read('Search.Image.start_year')){
                if($this->Session->read('Search.Image.end_year')){
                    $q = $this->Session->read('Search.Image.start_year');
                    $p = $this->Session->read('Search.Image.end_year');
                    if($this->Session->read('Search.Image.BC_start'))
                        $conditions['Image.start_year <='] = $q;
                    else
                        $conditions['Image.start_year >='] = $q;
                    if($this->Session->read('Search.Image.BC_end'))
                        $conditions['Image.end_year >='] = $p;
                    else
                        $conditions['Image.end_year <='] = $p;
                }
                else {
                    $q = $this->Session->read('Search.Image.start_year');
                    $conditions['Image.start_year ='] = $q;
                }
              }
              if($this->Session->read('Search.Image.end_year')){
                if($this->Session->read('Search.Image.start_year')){
                    $q = $this->Session->read('Search.Image.end_year');
                    $p = $this->Session->read('Search.Image.start_year');
                    if($this->Session->read('Search.Image.BC_start'))
                        $conditions['Image.start_year <='] = $p;
                    else
                        $conditions['Image.start_year >='] = $p;
                    if($this->Session->read('Search.Image.BC_end'))
                        $conditions['Image.end_year >='] = $q;
                    else
                        $conditions['Image.end_year <='] = $q;
                }
                else {
                    $q = $this->Session->read('Search.Image.end_year');
                    $conditions['Image.end_year ='] = $q;
                }
              }
              $search = $this->Session->read('Search.Image.q');
              $newconditions = array();
            if($search) {
                setlocale(LC_ALL, "en_US.utf8");
                $search = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $search);
                //$search = preg_replace('/[^a-zA-Z0-9]/', '_', $search);
                //$search = '"'.$search.'"';
                if(strpos($search, '"')!==false){
                      $search = str_replace('"','-',$search);
                  }elseif(strpos($search, '+')!==false){
                      $search = str_replace('+','-',$search);
                      $search = '"'.$search.'"';
                  }
                  else $search = $this->Image->searchstring($search);
                $results = $this->Lucene->query($search);
                $image_ids = array();
                foreach($results as $result){
                    $image_ids[] = $result->image_id;
                }
                $newconditions['Image.id'] = $image_ids;
            }
            else if(!empty($conditions)) $newconditions = $conditions;
            //pr($newconditions);
            if(!empty($_POST['page'])) {
                $this->Session->write('page',$_POST['page']);
            }
            $page = $this->Session->read('page');//echo $page;
            $this->paginate = array('conditions'=>$newconditions,'order'=>array('Image.id' => 'DESC'), 'limit' => $page);
            $this->Session->write('SearchResult',$this->paginate());
            $this->set('images', $this->paginate());
            $this->set('page',$page);
        }elseif(!empty($search)){
            $conditions = array();
              if($this->Session->read('Search.Image.region_id')){
                $q = $this->Session->read('Search.Image.region_id');
                $conditions['Image.region_id'] = $q;
            }
              if($this->Session->read('Search.Image.artist_id')){
                $q = $this->Session->read('Search.Image.artist_id');
                $conditions['Image.artist_id'] = $q;
              }
              if($this->Session->read('Search.Image.movement_id')){
                $q = $this->Session->read('Search.Image.movement_id');
                $conditions['Image.movement_id'] = $q;
              }
              if($this->Session->read('Search.Image.museum_id')){
                $q = $this->Session->read('Search.Image.museum_id');
                $conditions['Image.museum_id'] = $q;
              }
              if($this->Session->read('Search.Image.museum_id')){
                $q = $this->Session->read('Search.Image.museum_id');
                $conditions['Image.museum_id'] = $q;
              }
              if($this->Session->read('Search.Theme.Theme.0')){
                $q = $this->Session->read('Search.Theme.Theme.0');
                $this->Image->bindModel(array('hasOne' => array('ImagesTheme')),false);
                $conditions['ImagesTheme.theme_id']= $q;
              }
              if($this->Session->read('Search.Media.Media.0')){
                $q = $this->Session->read('Search.Media.Media.0');
                $this->Image->bindModel(array('hasOne' => array('ImagesMedium')),false);
                $conditions['ImagesMedium.media_id']= $q;
              }
              if($this->Session->read('Search.Image.start_year')){
                if($this->Session->read('Search.Image.end_year')){
                    $q = $this->Session->read('Search.Image.start_year');
                    $p = $this->Session->read('Search.Image.end_year');
                    if($this->Session->read('Search.Image.BC_start'))
                        $conditions['Image.start_year <='] = $q;
                    else
                        $conditions['Image.start_year >='] = $q;
                    if($this->Session->read('Search.Image.BC_end'))
                        $conditions['Image.end_year >='] = $p;
                    else
                        $conditions['Image.end_year <='] = $p;
                }
                else {
                    $q = $this->Session->read('Search.Image.start_year');
                    $conditions['Image.start_year ='] = $q;
                }
              }
              if($this->Session->read('Search.Image.end_year')){
                if($this->Session->read('Search.Image.start_year')){
                    $q = $this->Session->read('Search.Image.end_year');
                    $p = $this->Session->read('Search.Image.start_year');
                    if($this->Session->read('Search.Image.BC_start'))
                        $conditions['Image.start_year <='] = $p;
                    else
                        $conditions['Image.start_year >='] = $p;
                    if($this->Session->read('Search.Image.BC_end'))
                        $conditions['Image.end_year >='] = $q;
                    else
                        $conditions['Image.end_year <='] = $q;
                }
                else {
                    $q = $this->Session->read('Search.Image.end_year');
                    $conditions['Image.end_year ='] = $q;
                }
              }
              $search = $this->Session->read('Search.Image.q');
              $newconditions = array();
            if($search) {
                setlocale(LC_ALL, "en_US.utf8");
                $search = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $search);
                //$search = preg_replace('/[^a-zA-Z0-9]/', '_', $search);
                //$search = '"'.$search.'"';
                if(strpos($search, '"')!==false){
                      $search = str_replace(' ','-',$search);
                  }elseif(strpos($search, '+')!==false){
                      $search = str_replace('+','-',$search);
                      $search = '"'.$search.'"';
                  }
                  else $search = $this->Image->searchstring($search);
                $results = $this->Lucene->query($search);
                $image_ids = array();
                foreach($results as $result){
                    $image_ids[] = $result->image_id;
                }
                $newconditions['Image.id'] = $image_ids;
            }
            else if(!empty($conditions)) $newconditions = $conditions;
            //pr($newconditions);
            if(!empty($_POST['page'])) {
                $this->Session->write('page',$_POST['page']);
            }
            $page = $this->Session->read('page');//echo $page;
            $this->paginate = array('conditions'=>$newconditions,'order'=>array('Image.id' => 'DESC'), 'limit' => $page);
            $this->Session->write('SearchResult',$this->paginate());
            $this->set('images', $this->paginate());
            $this->set('page',$page);
        }
        else{
            $this->Session->write('Search', array());
            $this->redirect('/');
        }
    }

I think the result must not to find string which find per word. (I quess so)

Thanks all.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Result of function search is very large

Hello all,

Result of function search is very large, It sometime is wrong.

Can you help me to fix it.

This is source this function.

public function find(){
        $this->layout = 'listimage';
        $this->set('title_for_layout', __('Search Results', true));
        $this->Image->recursive = 0;
        $search = $this->Session->read('Search');
        if(!empty($_POST['data'])){
            $this->Session->write('Search', $this->data);
            $conditions = array();
              if($this->Session->read('Search.Image.region_id')){
                $q = $this->Session->read('Search.Image.region_id');
                $conditions['Image.region_id'] = $q;
            }
              if($this->Session->read('Search.Image.artist_id')){
                $q = $this->Session->read('Search.Image.artist_id');
                $conditions['Image.artist_id'] = $q;
              }
              if($this->Session->read('Search.Image.movement_id')){
                $q = $this->Session->read('Search.Image.movement_id');
                $conditions['Image.movement_id'] = $q;
              }
              if($this->Session->read('Search.Image.museum_id')){
                $q = $this->Session->read('Search.Image.museum_id');
                $conditions['Image.museum_id'] = $q;
              }
              if($this->Session->read('Search.Image.museum_id')){
                $q = $this->Session->read('Search.Image.museum_id');
                $conditions['Image.museum_id'] = $q;
              }
              if($this->Session->read('Search.Theme.Theme.0')){
                $q = $this->Session->read('Search.Theme.Theme.0');
                $this->Image->bindModel(array('hasOne' => array('ImagesTheme')),false);
                $conditions['ImagesTheme.theme_id']= $q;
              }
              if($this->Session->read('Search.Media.Media.0')){
                $q = $this->Session->read('Search.Media.Media.0');
                $this->Image->bindModel(array('hasOne' => array('ImagesMedium')),false);
                $conditions['ImagesMedium.media_id']= $q;
              }
              if($this->Session->read('Search.Image.start_year')){
                if($this->Session->read('Search.Image.end_year')){
                    $q = $this->Session->read('Search.Image.start_year');
                    $p = $this->Session->read('Search.Image.end_year');
                    if($this->Session->read('Search.Image.BC_start'))
                        $conditions['Image.start_year <='] = $q;
                    else
                        $conditions['Image.start_year >='] = $q;
                    if($this->Session->read('Search.Image.BC_end'))
                        $conditions['Image.end_year >='] = $p;
                    else
                        $conditions['Image.end_year <='] = $p;
                }
                else {
                    $q = $this->Session->read('Search.Image.start_year');
                    $conditions['Image.start_year ='] = $q;
                }
              }
              if($this->Session->read('Search.Image.end_year')){
                if($this->Session->read('Search.Image.start_year')){
                    $q = $this->Session->read('Search.Image.end_year');
                    $p = $this->Session->read('Search.Image.start_year');
                    if($this->Session->read('Search.Image.BC_start'))
                        $conditions['Image.start_year <='] = $p;
                    else
                        $conditions['Image.start_year >='] = $p;
                    if($this->Session->read('Search.Image.BC_end'))
                        $conditions['Image.end_year >='] = $q;
                    else
                        $conditions['Image.end_year <='] = $q;
                }
                else {
                    $q = $this->Session->read('Search.Image.end_year');
                    $conditions['Image.end_year ='] = $q;
                }
              }
              $search = $this->Session->read('Search.Image.q');
              $newconditions = array();
            if($search) {
                setlocale(LC_ALL, "en_US.utf8");
                $search = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $search);
                //$search = preg_replace('/[^a-zA-Z0-9]/', '_', $search);
                //$search = '"'.$search.'"';
                if(strpos($search, '"')!==false){
                      $search = str_replace('"','-',$search);
                  }elseif(strpos($search, '+')!==false){
                      $search = str_replace('+','-',$search);
                      $search = '"'.$search.'"';
                  }
                  else $search = $this->Image->searchstring($search);
                $results = $this->Lucene->query($search);
                $image_ids = array();
                foreach($results as $result){
                    $image_ids[] = $result->image_id;
                }
                $newconditions['Image.id'] = $image_ids;
            }
            else if(!empty($conditions)) $newconditions = $conditions;
            //pr($newconditions);
            if(!empty($_POST['page'])) {
                $this->Session->write('page',$_POST['page']);
            }
            $page = $this->Session->read('page');//echo $page;
            $this->paginate = array('conditions'=>$newconditions,'order'=>array('Image.id' => 'DESC'), 'limit' => $page);
            $this->Session->write('SearchResult',$this->paginate());
            $this->set('images', $this->paginate());
            $this->set('page',$page);
        }elseif(!empty($search)){
            $conditions = array();
              if($this->Session->read('Search.Image.region_id')){
                $q = $this->Session->read('Search.Image.region_id');
                $conditions['Image.region_id'] = $q;
            }
              if($this->Session->read('Search.Image.artist_id')){
                $q = $this->Session->read('Search.Image.artist_id');
                $conditions['Image.artist_id'] = $q;
              }
              if($this->Session->read('Search.Image.movement_id')){
                $q = $this->Session->read('Search.Image.movement_id');
                $conditions['Image.movement_id'] = $q;
              }
              if($this->Session->read('Search.Image.museum_id')){
                $q = $this->Session->read('Search.Image.museum_id');
                $conditions['Image.museum_id'] = $q;
              }
              if($this->Session->read('Search.Image.museum_id')){
                $q = $this->Session->read('Search.Image.museum_id');
                $conditions['Image.museum_id'] = $q;
              }
              if($this->Session->read('Search.Theme.Theme.0')){
                $q = $this->Session->read('Search.Theme.Theme.0');
                $this->Image->bindModel(array('hasOne' => array('ImagesTheme')),false);
                $conditions['ImagesTheme.theme_id']= $q;
              }
              if($this->Session->read('Search.Media.Media.0')){
                $q = $this->Session->read('Search.Media.Media.0');
                $this->Image->bindModel(array('hasOne' => array('ImagesMedium')),false);
                $conditions['ImagesMedium.media_id']= $q;
              }
              if($this->Session->read('Search.Image.start_year')){
                if($this->Session->read('Search.Image.end_year')){
                    $q = $this->Session->read('Search.Image.start_year');
                    $p = $this->Session->read('Search.Image.end_year');
                    if($this->Session->read('Search.Image.BC_start'))
                        $conditions['Image.start_year <='] = $q;
                    else
                        $conditions['Image.start_year >='] = $q;
                    if($this->Session->read('Search.Image.BC_end'))
                        $conditions['Image.end_year >='] = $p;
                    else
                        $conditions['Image.end_year <='] = $p;
                }
                else {
                    $q = $this->Session->read('Search.Image.start_year');
                    $conditions['Image.start_year ='] = $q;
                }
              }
              if($this->Session->read('Search.Image.end_year')){
                if($this->Session->read('Search.Image.start_year')){
                    $q = $this->Session->read('Search.Image.end_year');
                    $p = $this->Session->read('Search.Image.start_year');
                    if($this->Session->read('Search.Image.BC_start'))
                        $conditions['Image.start_year <='] = $p;
                    else
                        $conditions['Image.start_year >='] = $p;
                    if($this->Session->read('Search.Image.BC_end'))
                        $conditions['Image.end_year >='] = $q;
                    else
                        $conditions['Image.end_year <='] = $q;
                }
                else {
                    $q = $this->Session->read('Search.Image.end_year');
                    $conditions['Image.end_year ='] = $q;
                }
              }
              $search = $this->Session->read('Search.Image.q');
              $newconditions = array();
            if($search) {
                setlocale(LC_ALL, "en_US.utf8");
                $search = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $search);
                //$search = preg_replace('/[^a-zA-Z0-9]/', '_', $search);
                //$search = '"'.$search.'"';
                if(strpos($search, '"')!==false){
                      $search = str_replace(' ','-',$search);
                  }elseif(strpos($search, '+')!==false){
                      $search = str_replace('+','-',$search);
                      $search = '"'.$search.'"';
                  }
                  else $search = $this->Image->searchstring($search);
                $results = $this->Lucene->query($search);
                $image_ids = array();
                foreach($results as $result){
                    $image_ids[] = $result->image_id;
                }
                $newconditions['Image.id'] = $image_ids;
            }
            else if(!empty($conditions)) $newconditions = $conditions;
            //pr($newconditions);
            if(!empty($_POST['page'])) {
                $this->Session->write('page',$_POST['page']);
            }
            $page = $this->Session->read('page');//echo $page;
            $this->paginate = array('conditions'=>$newconditions,'order'=>array('Image.id' => 'DESC'), 'limit' => $page);
            $this->Session->write('SearchResult',$this->paginate());
            $this->set('images', $this->paginate());
            $this->set('page',$page);
        }
        else{
            $this->Session->write('Search', array());
            $this->redirect('/');
        }
    }

I think the result must not to find string which find per word. (I quess so)

Thanks all.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Sunday, June 28, 2015

Re: cakephp3 errors..... after edit db info

<?php
trait Foo {
    
    private static $conf;
    
    public static function config($a) {
        static::$conf = $a;
    }
}

class Bar {
    
    
    use Foo {
        config as protected _config;
    }
    
    public static function config($a) {
        static::_config($a);
    }
}
 
Bar::config(['a']);

Results in this error:   

Fatal error: Call to undefined method Bar::_config() in /home/farsight/public_html/cake3/webroot/index.php on line 19

PHP Version 5.4.41
CPanel Server



On Sunday, June 28, 2015 at 7:52:59 PM UTC-4, Eric Haskins wrote:
Hey All

So Im trying to get version 3 running.  Aside from not liking the composer BS Im having a issue with initial install and setup.  I get it running at http://cake3.farsightedmedia.com on the initial setup and works fine as soon as I change the DB credentials 

//'port' => 'nonstandard_port_number',
            'username' => 'my_app',
            'password' => 'secret',
            'database' => 'my_app',
            'encoding' => 'utf8',
            'timezone' => 'UTC',
            'cacheMetadata' => true,

To actual working credentials I am presented with these errors and they dont go away even if I rollback the changes


Fatal error: Call to undefined method Cake\Datasource\ConnectionManager::_config() in /home/farsight/public_html/cake3/vendor/cakephp/cakephp/src/Datasource/ConnectionManager.php on line 80

Fatal error: Call to undefined method Cake\View\StringTemplate::get() in /home/farsight/public_html/cake3/vendor/cakephp/cakephp/src/View/StringTemplate.php on line 176

I have many apps I would like to start porting over to version 3 ........   Ny servers are all CPanel Suphp

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

cakephp3 errors..... after edit db info

Hey All

So Im trying to get version 3 running.  Aside from not liking the composer BS Im having a issue with initial install and setup.  I get it running at http://cake3.farsightedmedia.com on the initial setup and works fine as soon as I change the DB credentials 

//'port' => 'nonstandard_port_number',
            'username' => 'my_app',
            'password' => 'secret',
            'database' => 'my_app',
            'encoding' => 'utf8',
            'timezone' => 'UTC',
            'cacheMetadata' => true,

To actual working credentials I am presented with these errors and they dont go away even if I rollback the changes


Fatal error: Call to undefined method Cake\Datasource\ConnectionManager::_config() in /home/farsight/public_html/cake3/vendor/cakephp/cakephp/src/Datasource/ConnectionManager.php on line 80

Fatal error: Call to undefined method Cake\View\StringTemplate::get() in /home/farsight/public_html/cake3/vendor/cakephp/cakephp/src/View/StringTemplate.php on line 176

I have many apps I would like to start porting over to version 3 ........   Ny servers are all CPanel Suphp

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

CakePHP 3.0.8 released

The CakePHP core team is happy to announce the immediate availability of CakePHP 3.0.8. This is a maintenance release for the 3.0 branch.

Bugfixes
--------

You can expect the following changes in 3.0.8. See the [changelog](http://cakephp.org/changelogs/3.0.8) for every commit.

* `EntityTrait::toArray()` now handles mixed arrays better. Previously if the first element was an entity, it assumed that all elements were entities.
* Pagination now preserves query string arguments with `0` as their value.
* `Validation::multiple()` now correctly handles '0'.
* Previously it was impossible to use dot notation on two different calls to matching/contain when part of the string was shared (for example Articles.SpecialTags.Tags and Articles.SpecialTags.Authors).
* `TableRegistry::get()` now correctly merges pre-configured options.
* Table names in `UPDATE` queries are correctly quoted now.
* Fixtures now correctly reflect composite primary keys when generated.
* Both `[]` and `''` are now treated the same when saving belongsToMany associations. This fixes silent failures when '' was used.
* Numeric fields are cast to their string values when creating form security tokens. This resolves issues where integer values would cause validation failures.
* CsrfComponent now correctly sets the cookie expiry date.
* The list of available shell commands is now correct if there is an app Shell with the same name as a core one.
* Multicheckboxes generated with complex input types are now checked/disabled correctly.
* When updating belongsToMany links, association conditions are used. This fixes issues with polymorphic joint tables.
* Pagination with SQLServer 2008 now works better.
* AuthComponent no longer causes infinite redirects when an ajax request fails and `/` requires authentication. This was a regression in 3.0.7.


Improvements
------------

As part of the 3.0 patch releases we are experimenting with implementing smaller net new features. We want try delivering new features incrementally. In 3.0.8 the following new features were added:

* The fallback domain for translations can be disabled with
  `I18n::useFallback(false)`.
* PaginatorComponents' `sortWhitelist` option now allows `false` to disable
  sorting entirely.
* Components now have a `response` property set during initialization.
* `cake i18n extract` now generates missing directories.

As always, a huge thanks to all the community members that helped make this release happen by reporting issues and sending pull requests.

Download a [packaged release on github](https://github.com/cakephp/cakephp/releases>).


--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Friday, June 26, 2015

Re: Load model in bootstrap

thanks 

its working for me too

App::uses('ClassRegistry', 'Utility');
$Setting = ClassRegistry::init('Configuration'); 

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

JOB POST: CakePHP Developer Needed (Full time in LA area)

Company:                Stage 32 (Stage32.com

Job Description:    CakePHP 3 Web Developer

 

Established in 2011, Stage 32 is the world's largest social network and eduational hub for film, television and theater creatives. Forbes Magazine has called Stage 32 "LinkedIn meets Lynda for the entertainment industry." Stage 32 provides education, networking, opportunity and access to decision makers in the industry, with thousands of projects completed through networking on the platform.

 

Stage 32 is currently in need of a Senior level CakePHP 3 back end web developer for our established social network over 500,000+ members.

 

Skills required:

  • High level of proficiency with CakePHP 3 framework and object-oriented PHP development in general
  • High level of proficiency with MySQL (schema design, querying, etc.)
  • Proficiency with Git version control, preferably experience using Git on past projects
  • Proficiency with RESTful application design

 

Platforms and systems we use:

  • CakePHP 3
  • MySQL/MariaDB
  • Git version control
  • ZenDesk, Slack, GitHub
  • LEMP stack servers (Linux, Nginx, MySQL, PHP) - no sysadmin skills required


Salary

Reports directly to CTO, Salary Depending On Experience

 

Location

Stage 32 is located in Manhattan Beach, CA at the MBS Media Campus (formerly Raleigh Studios), 1600 Rosecrans Ave., 4th Floor, Manhattan Beach, CA 90266.

 Please send your resume and any pertinent work samples to:  

Derrick Ontiveros, CTO, Derrick@stage32.com

 

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.