Note that there are some explanatory texts on larger screens.

plurals
  1. POSet default value for static method in bootstrap
    primarykey
    data
    text
    <p>this paragraph is part of 'Zend Framework In Action' book.</p> <pre><code>SearchIndexer::setIndexDirectory(ROOT_DIR . '/var/search_index'); Places_Db_Table_Row_Observable::attachObserver('SearchIndexer'); </code></pre> <p><strong>As you can see, it’s simply a case of setting the directory to store the search index files and attaching the class to the list of observers in Places_Db_Table_Row_Observable using the name of the class.</strong></p> <p>Now I have a problem! I put this code in bootstrap file in runapp method, but it can't recognize the directory that I set in bootstrap!</p> <p>It shows me this error </p> <pre><code>An error occurred exception 'Zend_Search_Exception' with message 'No index directory specified' in E:\xampp\php\PEAR\Zend\Search\Lucene.php:497 </code></pre> <p>=======================================================</p> <p><strong>other type of my question :</strong></p> <p>I have this code in bootstrap file (runApp method):</p> <pre><code>SearchIndexer::setIndexDirectory(ROOT_DIR.'/var/search_index'); Places_Db_Table_Row_Observable::attachObserver('SearchIndexer'); </code></pre> <p>I set search directory path in SearchIndexer class, but there is a prob!</p> <p>When I use of below code in controller action, it can't recognize the directory that I set in bootstrap!</p> <p>controller code :</p> <pre><code>$index = Places_Search_Lucene::open(SearchIndexer::getIndexDirectory()); </code></pre> <p>this is seachIndexer code :</p> <pre><code>public static function setIndexDirectory($directory){ if(!is_dir($directory)) { throw new Exception('Directory for SearchIndexer is invalid ('. $directory .')'); } self::$_indexDirectory = $directory; } public static function getIndexDirectory(){ return self::$_indexDirectory; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload