4 public function switchCh($text, $arrow = 0)
138 return strtr($text, isset($str[$arrow]) ? $str[$arrow] : array_merge($str[0], $str[1]));
142 $list = parse_ini_file(Yii::app()->basePath.
'/config/descriptions.ini',
true);
148 if (!is_array($in)) {
151 foreach ($in as $k=>$v) {
163 $users = Yii::app()->db->createCommand()
167 echo
"<pre>"; var_dump($users); die();
168 foreach ($users as $record) {
169 $usernames[] = $record[
'username'];
175 $users = Yii::app()->db->createCommand()
176 ->select(
'users.username, profiles.firstname')
177 ->from(
'users, profiles')
184 $id = Yii::app()->db->createCommand()
187 ->where(array(
'or',
"username='$str'",
"email='$str'",
"id='$str'"))
197 foreach ($errorMask as $value) {
198 switch ((
string) $value) {
201 'errorType' =>
'Wrong URL'
206 'errorType' =>
'Timeout'
211 'errorType' =>
'HTTP error'
216 'errorType' =>
'Empty content'
221 'errorType' =>
'Wrong MIME type'
226 'errorType' =>
'Connection error'
231 'errorType' =>
'Code page convert error'
236 'errorType' =>
'Bad redirection'
241 'errorType' =>
'Size error'
246 'errorType' =>
'Authorization error'
251 'errorType' =>
'File operation error, write file, create directory and so on'
256 'errorType' =>
'Robots.txt rule not matched'
261 'errorType' =>
'HTML_PARSE_ERROR'
266 'errorType' =>
'BAD_ENCODING'
271 'errorType' =>
'SITE_MAX_ERRORS'
276 'errorType' =>
'SITE_MAX_RESOURCES'
281 'errorType' =>
'MIME_NOT_WRITE'
286 'errorType' =>
'MAX_ALLOW_HTTP_REDIRECTS'
291 'errorType' =>
'MAX_ALLOW_HTML_REDIRECTS'
296 'errorType' =>
'HTML_STRUCTURE'
301 'errorType' =>
'DTD_INVALID'
306 'errorType' =>
'CONTENT_TYPE'
311 'errorType' =>
'FETCH_AMBIGUOUS_REQUEST'
316 'errorType' =>
'FETCH_CONNECTION_ERROR'
321 'errorType' =>
'FETCH_HTTP_ERROR'
326 'errorType' =>
'FETCH_INVALID_URL'
331 'errorType' =>
'FETCH_TOO_MANY_REDIRECTS'
336 'errorType' =>
'FETCH_CONNECTION_TIMEOUT'
341 'errorType' =>
'FETCH_READ_TIMEOUT(28)'
346 'errorType' =>
'FETCH_TIMEOUT'
351 'errorType' =>
'FETCH_UNDEFINED'
356 'errorType' =>
'UNKNOWNERROR(31)'
361 'errorType' =>
'MASK_SITE_MAX_ERRORS'
366 'errorType' =>
'MASK_SITE_MAX_RESOURCES'
371 'errorType' =>
'MASK_SITE_UNSUPPORTED_CONTENT_TYPE'
376 'errorType' =>
'MASK_URL_ENCODING_ERROR'
381 'errorType' =>
'MASK_SCRAPER_ERROR'
386 'errorType' =>
'MASK_MISSED_RAW_CONTENT_ON_DISK'
391 'errorType' =>
'UNKNOWNERROR(38)'
396 'errorType' =>
'UNKNOWNERROR(39)'
401 'errorType' =>
'UNKNOWNERROR(40)'
406 'errorType' =>
'UNKNOWNERROR(41)'
411 'errorType' =>
'UNKNOWNERROR(42)'
416 'errorType' =>
'UNKNOWNERROR(43)'
421 'errorType' =>
'UNKNOWNERROR(44)'
426 'errorType' =>
'UNKNOWNERROR(45)'
431 'errorType' =>
'UNKNOWNERROR(46)'
436 'errorType' =>
'UNKNOWNERROR(47)'
441 'errorType' =>
'UNKNOWNERROR(48)'
446 'errorType' =>
'UNKNOWNERROR(49)'
451 'errorType' =>
'UNKNOWNERROR(50)'
456 'errorType' =>
'UNKNOWNERROR(51)'
461 'errorType' =>
'UNKNOWNERROR(52)'
466 'errorType' =>
'UNKNOWNERROR(53)'
471 'errorType' =>
'UNKNOWNERROR(54)'
476 'errorType' =>
'UNKNOWNERROR(55)'
481 'errorType' =>
'UNKNOWNERROR(56)'
486 'errorType' =>
'UNKNOWNERROR(57)'
491 'errorType' =>
'UNKNOWNERROR(58)'
496 'errorType' =>
'UNKNOWNERROR(59)'
501 'errorType' =>
'UNKNOWNERROR(60)'
506 'errorType' =>
'UNKNOWNERROR(61)'
511 'errorType' =>
'UNKNOWNERROR(62)'
516 'errorType' =>
'UNKNOWNERROR(63)'
521 'errorType' =>
'UNKNOWNERROR(64)'
534 foreach ($tagsMask as $value) {
535 switch ((
string) $value) {
543 'tag' =>
'publication date'
548 'tag' =>
'content_encoded'
563 'tag' =>
'description'
568 'tag' =>
'UPDATED_PARSED'
573 'tag' =>
'creation date'
583 'tag' =>
'guid (rss)'
593 'tag' =>
'media thumbnail'
598 'tag' =>
'enclosure (rss)'
603 'tag' =>
'media (rss)'
608 'tag' =>
'google search'
613 'tag' =>
'google search total'
623 'tag' =>
'parent rss'
628 'tag' =>
'parent rss urlmd5'
633 'tag' =>
'summary detail'
648 'tag' =>
'tags (rss)'
658 'tag' =>
'UNKNOWN_TAG(24)'
663 'tag' =>
'UNKNOWN_TAG(25)'
668 'tag' =>
'UNKNOWN_TAG(26)'
673 'tag' =>
'UNKNOWN_TAG(27)'
678 'tag' =>
'UNKNOWN_TAG(28)'
683 'tag' =>
'UNKNOWN_TAG(29)'
688 'tag' =>
'UNKNOWN_TAG(30)'
693 'tag' =>
'UNKNOWN_TAG(31)'
698 'tag' =>
'UNKNOWN_TAG(32)'