query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
verify in logs that impression event of this decision was dispatched
public function verifyLogsImpressionsEventsDispatched(): void { // 💡️ Be sure that your FLAG_KEYS array above includes A/B Test eg "product_version" $logger = new DefaultLogger(Logger::DEBUG); $localOptimizelyClient = new Optimizely(datafile: null, logger: $logger, sdkKey: SDK_KEY); $localUserContext = $localOptimizelyClient->createUserContext($this->userId); // review the DEBUG output, ensuring you see an impression log for each experiment type in your FLAG_KEYS // "Dispatching impression event to URL https://logx.optimizely.com/v1/events with params..." // ⚠️ Your Rollout type flags should not have impression events $localUserContext->decideForKeys(FLAG_KEYS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function verifyLogsImpressionsEventsDispatched(): void\n {\n // 💡️ Create a new flag with an A/B Test eg \"product_version\"\n $featureFlagKey = 'product_version';\n $logger = new DefaultLogger(Logger::DEBUG);\n $localOptimizelyClient = new Optimizely(datafile: null, logger: $logger, sdkKey: SDK_KEY);\n $localUserContext = $localOptimizelyClient->createUserContext($this->userId);\n\n // review the DEBUG output, ensuring you see an impression log\n // \"Dispatching impression event to URL https://logx.optimizely.com/v1/events with params...\"\n $localUserContext->decide($featureFlagKey);\n }", "public function verifyResultsPageInYourProjectShowsImpressionEvent(): void\n {\n print \"Go to your project's results page and verify decisions events are showing (5 min delay)\";\n }", "public function verifyResultsPageInYourProjectShowsImpressionEvent(): void\n {\n print \"Go to your project's results page and verify decisions events are showing (5 min delay)\";\n }", "public function verifyDecisionListenerWasCalled(): void\n {\n // Check that this was called during the...\n $onDecision = function ($type, $userId, $attributes, $decisionInfo) {\n print \">>> [$this->outputTag] OnDecision:\n type: $type,\n userId: $userId,\n attributes: \" . print_r($attributes, true) . \"\n decisionInfo: \" . print_r($decisionInfo, true) . \"\\r\\n\";\n };\n $this->optimizelyClient->notificationCenter->addNotificationListener(\n NotificationType::DECISION,\n $onDecision\n );\n\n // ...decide.\n $this->userContext->decide(FLAG_KEY);\n }", "public function verifyDecisionListenerWasCalled(): void\n {\n // Check that this was called during the...\n $onDecision = function ($type, $userId, $attributes, $decisionInfo) {\n print \">>> [$this->outputTag] OnDecision:\n type: $type,\n userId: $userId,\n attributes: \" . print_r($attributes, true) . \"\n decisionInfo: \" . print_r($decisionInfo, true) . \"\\r\\n\";\n };\n $this->optimizelyClient->notificationCenter->addNotificationListener(\n NotificationType::DECISION,\n $onDecision\n );\n\n // ...decide.\n $this->userContext->decide(FLAG_KEY);\n }", "protected function logActivity(FieldObservation $fieldObservation)\n {\n activity()->performedOn($fieldObservation)\n ->causedBy(auth()->user())\n ->log('approved');\n }", "function formlift_track_impression( $formID ) {\n\tglobal $FormLiftUser;\n\n// if ( is_user_logged_in() && current_user_can( 'manage_options' ) )\n// return;\n\n\tif ( ! $FormLiftUser->hasImpression( $formID ) ) {\n\t\t$FormLiftUser->addImpression( $formID );\n\t\tformlift_add_impression( $formID );\n\n\t\t$imps = formlift_get_form_impressions( date( 'Y-m-d H:i:s', strtotime( '-7 days' ) ), current_time( 'mysql' ), $formID );\n\t\t$subs = formlift_get_form_submissions( date( 'Y-m-d H:i:s', strtotime( '-7 days' ) ), current_time( 'mysql' ), $formID );\n\n\t\tformlift_update_form_stats( $formID, $imps, $subs );\n\t}\n}", "public function requestAnalysis() {\n $this->getTransaction()->tagAsAnalysisSent($this);\n }", "public function log_view() {\n \\filter_embedquestion\\event\\question_viewed::create(['context' => $this->embedlocation->context,\n 'objectid' => $this->current_question()->id])->trigger();\n }", "public function checkForFollowUpNotClicked()\n {\n $now = Carbon::now();\n $logs = $this->getNotClickedMessagesToFollow();\n foreach($logs as $log) {\n MailLog::info(sprintf('Trigger sending follow-up not clicked email for automation `%s`, subscriber: %s, event ID: %s', $this->automation->name, $log->subscriber_id, $this->id));\n $this->fire(collect([$log->subscriber]));\n // a more verbal way is: fire(Subscriber::where('id', $log->subscriber_id)\n }\n }", "public function take_action()\n {\n }", "public function take_action()\n {\n }", "public function checkForFollowUpClicked()\n {\n $now = Carbon::now();\n $logs = $this->getClickedMessagesToFollow();\n\n foreach($logs as $log) {\n if ($now->gte($log->created_at->copy()->modify($this->getDelayInterval()))) {\n MailLog::info(sprintf('Trigger sending follow-up clicked email for automation `%s`, subscriber: %s, event ID: %s, message ID: %s', $this->automation->name, $log->subscriber_id, $this->id, $log->message_id));\n $this->fire(collect([$log->subscriber]));\n // a more verbal way is: fire(Subscriber::where('id', $log->subscriber_id)\n }\n }\n }", "function track_clicks_allowed_by_user(){\n if (!$this->get_config('track_visits_of_loggedin_users',true) && serendipity_userLoggedIn()){\n return false;\n }\n return true;\n }", "public static function maybe_track_usage() {\n\n\t\t/** checking optin state */\n\t\tif ( 'yes' == self::get_optIn_state() ) {\n\t\t\t$data = self::collect_data();\n\n\t\t\t//posting data to api\n\t\t\tXL_API::post_tracking_data( $data );\n\t\t}\n\t}", "public function canManageTracking();", "public function should_track_identity()\n {\n }", "function recordAnalytics() {\n\t\t//Is your user agent any of my business? Not really, but don't worry about it.\n\t\texecuteQuery(\"\n\t\t\tINSERT INTO dwm2r_activitymonitor\n\t\t\t(IPAddress,UserAgent,Flags,Seed,CreatedDTS)\n\t\t\tVALUES (\n\t\t\t\t'\".$_SERVER['REMOTE_ADDR'].\"',\n\t\t\t\t'\".$_SERVER['HTTP_USER_AGENT'].\"',\n\t\t\t\t'\".trim($_REQUEST[\"Flags\"]).\"',\n\t\t\t\t'\".$this->modder->flags[\"Seed\"].\"',\n\t\t\t\tNOW()\n\t\t\t)\n\t\t\");\n\t}", "public function requestVerification()\n {\n Event::dispatch(new VerificationRequest($this));\n }", "private function add_to_log($action) {\n if ($action) {\n $event = \\mod_simplecertificate\\event\\course_module_viewed::create(\n array(\n 'objectid' => $this->get_course_module()->instance,\n 'context' => $this->get_context(),\n 'other' => array('certificatecode' => $this->get_issue()->code)));\n $event->add_record_snapshot('course', $this->get_course());\n }\n\n if (!empty($event)) {\n $event->trigger();\n }\n }", "protected function assertPayload(): void\n {\n }", "protected function assertPayload(): void\n {\n }", "protected function assertPayload(): void\n {\n }", "public function simulateEnabledMatchSpecificConditionsSucceeds() {}", "public function testOn()\n\t{\n\t\t$this->assertTrue(Catapult\\Log::isOn());\n\t}", "public function simulateEnabledMatchSpecificConditionsSucceeds() {}", "public function testComAdobeGraniteLoggingImplLogAnalyserImpl()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.logging.impl.LogAnalyserImpl';\n\n $crawler = $client->request('POST', $path);\n }", "public function verifyDecisionProperties(): void\n {\n $decision = $this->userContext->decide(FLAG_KEY);\n\n $this->printDecision($decision, \"Check that the following decision properties are expected for user $this->userId\");\n }", "public function doApology()\n {\n\n // Check for a token authority.\n // Check for a list authority.\n $this->getApologies();\n\n // Calculate the expiry of the authority.\n\n // Check if the authority has expired. Is in the past.\n\n if ($this->agent_input == null) {\n $array = ['No apology found.'];\n $k = array_rand($array);\n $v = $array[$k];\n\n $response = \"APOLOGY | \" . $v;\n\n $this->message = $response; // mewsage?\n } else {\n $this->message = $this->agent_input;\n }\n }", "public function logPixelPaymentInfo($observer){\n //Logging event\n Mage::getModel('core/session')->setPixelPaymentInfo(true);\n }" ]
[ "0.7668425", "0.6778277", "0.6778277", "0.6554328", "0.6554328", "0.6009658", "0.55407953", "0.55402875", "0.5365371", "0.5317638", "0.5304101", "0.5304101", "0.5301933", "0.5125348", "0.5078407", "0.5042903", "0.50420034", "0.5029171", "0.5015953", "0.5008906", "0.49963698", "0.49963698", "0.49963698", "0.49820292", "0.49819008", "0.49811763", "0.4979281", "0.49742955", "0.49498454", "0.4948319" ]
0.7510679
1
verify on Results page that impression even was created
public function verifyResultsPageInYourProjectShowsImpressionEvent(): void { print "Go to your project's results page and verify decisions events are showing (5 min delay)"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function verifyLogsImpressionsEventsDispatched(): void\n {\n // 💡️ Create a new flag with an A/B Test eg \"product_version\"\n $featureFlagKey = 'product_version';\n $logger = new DefaultLogger(Logger::DEBUG);\n $localOptimizelyClient = new Optimizely(datafile: null, logger: $logger, sdkKey: SDK_KEY);\n $localUserContext = $localOptimizelyClient->createUserContext($this->userId);\n\n // review the DEBUG output, ensuring you see an impression log\n // \"Dispatching impression event to URL https://logx.optimizely.com/v1/events with params...\"\n $localUserContext->decide($featureFlagKey);\n }", "function formlift_track_impression( $formID ) {\n\tglobal $FormLiftUser;\n\n// if ( is_user_logged_in() && current_user_can( 'manage_options' ) )\n// return;\n\n\tif ( ! $FormLiftUser->hasImpression( $formID ) ) {\n\t\t$FormLiftUser->addImpression( $formID );\n\t\tformlift_add_impression( $formID );\n\n\t\t$imps = formlift_get_form_impressions( date( 'Y-m-d H:i:s', strtotime( '-7 days' ) ), current_time( 'mysql' ), $formID );\n\t\t$subs = formlift_get_form_submissions( date( 'Y-m-d H:i:s', strtotime( '-7 days' ) ), current_time( 'mysql' ), $formID );\n\n\t\tformlift_update_form_stats( $formID, $imps, $subs );\n\t}\n}", "public function verifyLogsImpressionsEventsDispatched(): void\n {\n // 💡️ Be sure that your FLAG_KEYS array above includes A/B Test eg \"product_version\"\n $logger = new DefaultLogger(Logger::DEBUG);\n $localOptimizelyClient = new Optimizely(datafile: null, logger: $logger, sdkKey: SDK_KEY);\n $localUserContext = $localOptimizelyClient->createUserContext($this->userId);\n\n // review the DEBUG output, ensuring you see an impression log for each experiment type in your FLAG_KEYS\n // \"Dispatching impression event to URL https://logx.optimizely.com/v1/events with params...\"\n // ⚠️ Your Rollout type flags should not have impression events\n $localUserContext->decideForKeys(FLAG_KEYS);\n }", "function nnr_stats_record_impresssion_v1() {\n\n\t$data_id = $_POST['data_id'];\n\t$table_name = $_POST['table_name'];\n\n\t// Return false if no data is given\n\n\tif ( !isset($data_id) ) {\n\t\tnnr_stats_return_data_v1('Impression was NOT able to be recored because no Data ID given.');\n\t}\n\n\t// Return false if crawler\n\n\tif ( nnr_stats_is_bot_v1() ) {\n\t\tnnr_stats_return_data_v1('Impression was NOT able to be recored because a crawler was detected.');\n\t}\n\n\t// Return if user is admin or higher\n\n\tif ( current_user_can('edit_published_posts') ) {\n\t\tnnr_stats_return_data_v1('Impression was NOT able to be recored because current user is an admin.');\n\t}\n\n\tglobal $wpdb;\n\t$table_name = $wpdb->prefix . $table_name;\n\t$today = date('Y-m-d');\n\n\t// Check if entry already exsits\n\n\t$impressions = $wpdb->query($wpdb->prepare('SELECT * FROM ' . $table_name . ' WHERE `date` = %s AND `data_id` = %d', $today, $data_id));\n\n\t// Entry aleady exists, just add 1\n\n\tif ( isset($impressions) && $impressions != 0 ) {\n\n\t\t$result = $wpdb->query($wpdb->prepare('UPDATE ' . $table_name . ' SET\n\t\t\t`impressions` = `impressions` + 1\n\t\t\tWHERE `date` = %s AND `data_id` = %d', $today, $data_id\n\t\t));\n\n\t}\n\n\t// Entry does not exist, create a new one and set impressions to 1\n\n\telse {\n\n\t\t$result = $wpdb->query($wpdb->prepare('INSERT INTO ' . $table_name . ' (\n\t\t\t`date`,\n\t\t\t`data_id`,\n\t\t\t`impressions`,\n\t\t\t`conversions`\n\t\t\t) VALUES (%s, %d, 1, 0)',\n\t\t\t$today,\n\t\t\t$data_id\n\t\t));\n\n\t}\n\n\tif ( $result ) {\n\t\tnnr_stats_return_data_v1('Impression was able to be recored.');\n\t} else {\n\t\tnnr_stats_return_data_v1('Impression was NOT able to be recored.');\n\t}\n}", "public function Impress() {\n if ($this->native_session_id) {\n $result = mysql_query(\"UPDATE http_session SET last_impression = NOW() WHERE id = \" . $this->native_session_id);\n //var_dump($result);\n if (!$result) {\n die('4 - Invalid query: ' . mysql_error());\n }\n }\n\n }", "public function testComDayCqWcmFoundationImplPageImpressionsTracker()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.wcm.foundation.impl.PageImpressionsTracker';\n\n $crawler = $client->request('POST', $path);\n }", "function test_treatments_report_true()\n {\n $this->seed();\n\n $user = User::where('email', '=', '[email protected]')->first();\n \n $token = JWTAuth::fromUser($user);\n $treatments = Treatment::factory()\n ->count(3)\n ->for($user)\n ->create(['public' => 1]);\n $treatment = Treatment::first();\n $response = $this->json('POST', '/api/report/'.$treatment->id.'?token='.$token);\n $response->assertOk()->assertJsonFragment(['isReported'=>true]);\n }", "public function cohorte_imprimer_impressions() {\n\t\t\t$Cohortes = $this->Components->load( 'WebrsaCohortesDossierspcgs66Impressions' );\n\t\t\t$Cohortes->impressions(\n\t\t\t\tarray(\n\t\t\t\t\t'modelName' => 'Dossierpcg66',\n\t\t\t\t\t'modelRechercheName' => 'WebrsaCohorteDossierpcg66Imprimer',\n\t\t\t\t\t'configurableQueryFieldsKey' => 'Dossierspcgs66.cohorte_imprimer'\n\t\t\t\t)\n\t\t\t);\n\t\t}", "public function hasResults();", "public function isHasResults();", "public function getSocialImpression()\n\t{\n\t\tif (isset($this->uniqueImpression)) {\n\n\t\t\treturn $this->uniqueImpression;\n\t\t}\n\n\t\treturn 0;\n\t}", "public function getUniqueImpression()\n\t{\n\t\tif (isset($this->uniqueImpression)) {\n\n\t\t\treturn $this->uniqueImpression;\n\t\t}\n\n\t\treturn 0;\n\t}", "public function test_resultsAreValidFormat() {\n $types = ['track'];\n\n foreach ($types as $tk => $type) {\n $searchInstance = new SpotifySearch('a', $type, SingletonTokenContainer::get());\n $results = $searchInstance->getNextPage()->get();\n\n foreach ($results as $ik => $item) {\n $this->assertNotEmpty($item->href);\n $this->assertNotEmpty($item->name);\n if ($type != 'track') {\n $this->assertNotEmpty($item->images);\n } else {\n $this->assertNotEmpty($item->album);\n }\n }\n }\n\n }", "public function has_results()\r\n {\r\n \t$tbl_stats = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);\r\n\t\t$sql = 'SELECT count(exe_id) AS number FROM '.$tbl_stats\r\n\t\t\t\t.\" WHERE exe_cours_id = '\".$this->get_course_code().\"'\"\r\n\t\t\t\t.' AND exe_exo_id = '.$this->get_ref_id();\r\n \t$result = api_sql_query($sql, __FILE__, __LINE__);\r\n\t\t$number=mysql_fetch_row($result);\r\n\t\treturn ($number[0] != 0);\r\n }", "public function setUniqueImpression($value)\n\t{\n\t\t$this->uniqueImpression = $value;\t\n\t}", "public function gagnerExperience()\n {\n $this->_experience++;\n }", "function test_treatments_report_blocked_true()\n {\n $this->seed();\n\n $user = User::where('email', '=', '[email protected]')->first();\n \n $token = JWTAuth::fromUser($user);\n $treatments = Treatment::factory()\n ->count(3)\n ->for($user)\n ->create(['public' => 1]);\n $treatment = Treatment::first();\n $response = $this->json('POST', '/api/report/'.$treatment->id.'?token='.$token);\n $user = User::where('email', '=', '[email protected]')->first();\n \n $token = JWTAuth::fromUser($user);\n $response = $this->json('POST', '/api/report/'.$treatment->id.'?token='.$token);\n $response->assertOk()->assertJsonFragment(['isReported'=>true]);\n }", "public function AnomalyPageTest()\n {\n // Test user login\n $user = $this->testAccounts[\"anthro-analyst\"];\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new loginPage)\n ->loginUser($user['email'], $user['password'])\n ->pause(3000)\n ->assertSee('Welcome');\n\n $browser->visit(new specimenPage)\n ->pause(5000)\n ->maximize()\n ->pause(2000)\n\n ->click('@leftSideBar-menu')\n ->pause(2000)\n ->click('@project-report-button')\n ->driver->switchTo()->window(collect($browser->driver->getWindowHandles())->last());\n $browser\n ->pause(3000)\n\n ->click('@anomaly_as')\n ->pause(10000)\n ->assertSee('Accession Number')\n ->assertSee('Bone')\n ->assertSee('Provenance 1')\n ->assertSee('Provenance 2')\n ->assertSee('Side')\n ->assertSee('Anomaly')\n\n ->pause(3000)\n\n\n ->logoutUser();\n });\n }", "public function update_impressions(){\n if( ! $this->is_valid_nonce( 'mpp_ajax_nonce' ) ){\n die();\n }\n if( ! isset( $_POST['popup_id'] ) || ! $this->plugin->is_published_popup( $_POST['popup_id'] ) ){\n die();\n }\n $result = array();\n $result['success'] = false;\n $popup_id = $_POST['popup_id'];\n $restore = isset( $_POST['restore'] ) ? $_POST['restore'] : false;\n\n if( $restore == 'true' || $restore === true ){\n $impressions = 0;\n update_post_meta( $popup_id, 'mpp_impressions', 0 );\n } else{\n $impressions = (int) get_post_meta( $popup_id, 'mpp_impressions', true );\n update_post_meta( $popup_id, 'mpp_impressions', ++$impressions );\n }\n $result['success'] = true;\n $result['impressions'] = $impressions;\n wp_send_json( $result );\n }", "function qa_check_page_clicks()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\tglobal $qa_page_error_html;\n\n\tif (qa_is_http_post()) {\n\t\tforeach ($_POST as $field => $value) {\n\t\t\tif (strpos($field, 'vote_') === 0) { // voting...\n\t\t\t\t@list($dummy, $postid, $vote, $anchor) = explode('_', $field);\n\n\t\t\t\tif (isset($postid) && isset($vote)) {\n\t\t\t\t\tif (!qa_check_form_security_code('vote', qa_post_text('code')))\n\t\t\t\t\t\t$qa_page_error_html = qa_lang_html('misc/form_security_again');\n\n\t\t\t\t\telse {\n\t\t\t\t\t\trequire_once QA_INCLUDE_DIR . 'app/votes.php';\n\t\t\t\t\t\trequire_once QA_INCLUDE_DIR . 'db/selects.php';\n\n\t\t\t\t\t\t$userid = qa_get_logged_in_userid();\n\n\t\t\t\t\t\t$post = qa_db_select_with_pending(qa_db_full_post_selectspec($userid, $postid));\n\t\t\t\t\t\t$qa_page_error_html = qa_vote_error_html($post, $vote, $userid, qa_request());\n\n\t\t\t\t\t\tif (!$qa_page_error_html) {\n\t\t\t\t\t\t\tqa_vote_set($post, $userid, qa_get_logged_in_handle(), qa_cookie_get(), $vote);\n\t\t\t\t\t\t\tqa_redirect(qa_request(), $_GET, null, null, $anchor);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} elseif (strpos($field, 'favorite_') === 0) { // favorites...\n\t\t\t\t@list($dummy, $entitytype, $entityid, $favorite) = explode('_', $field);\n\n\t\t\t\tif (isset($entitytype) && isset($entityid) && isset($favorite)) {\n\t\t\t\t\tif (!qa_check_form_security_code('favorite-' . $entitytype . '-' . $entityid, qa_post_text('code')))\n\t\t\t\t\t\t$qa_page_error_html = qa_lang_html('misc/form_security_again');\n\n\t\t\t\t\telse {\n\t\t\t\t\t\trequire_once QA_INCLUDE_DIR . 'app/favorites.php';\n\n\t\t\t\t\t\tqa_user_favorite_set(qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), $entitytype, $entityid, $favorite);\n\t\t\t\t\t\tqa_redirect(qa_request(), $_GET);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} elseif (strpos($field, 'notice_') === 0) { // notices...\n\t\t\t\t@list($dummy, $noticeid) = explode('_', $field);\n\n\t\t\t\tif (isset($noticeid)) {\n\t\t\t\t\tif (!qa_check_form_security_code('notice-' . $noticeid, qa_post_text('code')))\n\t\t\t\t\t\t$qa_page_error_html = qa_lang_html('misc/form_security_again');\n\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ($noticeid == 'visitor')\n\t\t\t\t\t\t\tsetcookie('qa_noticed', 1, time() + 86400 * 3650, '/', QA_COOKIE_DOMAIN, (bool)ini_get('session.cookie_secure'), true);\n\n\t\t\t\t\t\telseif ($noticeid == 'welcome') {\n\t\t\t\t\t\t\trequire_once QA_INCLUDE_DIR . 'db/users.php';\n\t\t\t\t\t\t\tqa_db_user_set_flag(qa_get_logged_in_userid(), QA_USER_FLAGS_WELCOME_NOTICE, false);\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trequire_once QA_INCLUDE_DIR . 'db/notices.php';\n\t\t\t\t\t\t\tqa_db_usernotice_delete(qa_get_logged_in_userid(), $noticeid);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tqa_redirect(qa_request(), $_GET);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "public function testProfilePrototypeCountReviews()\n {\n\n }", "public function testAccessibilityAnalysisResource()\n {\n $mockAdminApi = new MockAdminApi();\n $mockAdminApi->asset(self::$UNIQUE_TEST_ID, ['accessibility_analysis' => true]);\n $lastRequest = $mockAdminApi->getMockHandler()->getLastRequest();\n\n self::assertRequestQueryStringSubset($lastRequest, ['accessibility_analysis' => '1']);\n }", "public function testIsResultsCountEnabledException()\n {\n $objectManagerMock = $this->getMockBuilder(\\Magento\\Framework\\ObjectManagerInterface::class)\n ->disableOriginalConstructor()\n ->getMock();\n $objectManagerMock->expects($this->once())\n ->method('create')\n ->willReturn(null);\n\n $objectManagerHelper = new ObjectManagerHelper($this);\n /* @var $model \\Magento\\AdvancedSearch\\Model\\SuggestedQueries */\n $model = $objectManagerHelper->getObject(\n \\Magento\\AdvancedSearch\\Model\\SuggestedQueries::class,\n [\n 'engineResolver' => $this->engineResolverMock,\n 'objectManager' => $objectManagerMock,\n 'data' => ['my_engine' => 'search_engine']\n ]\n );\n $model->isResultsCountEnabled();\n }", "public function isUsedInAssessments(){\n return ($this->assessments == 1);\n }", "function testFindAppearsOn() {\n\t\t$result = $this->Album->find('appearsOn', array('limit' => 1, 'order' => 'release_date ASC'));\n\n\t\t$this->assertNotEmpty($result);\n\t\t$this->assertEquals($result[0]['Album']['title'], 'Knifetank (The Albumhole)');\n\t}", "public function testListPastWebinarPollResults()\n {\n }", "public function mockupRiskScreening()\n {\n $f = Questionaire::with('questions.choices.subchoices')\n ->find(env('APP_RISK_ID'));\n\n $participants = Participant::all();\n $i = 0;\n $c = count($participants);\n foreach ($participants as $p) {\n $this->createAnswers($f, $p);\n\n // Points doesn't really matter alot in risk form\n $this->createResults($f, $p, 999); \n\n echo \"risk results & answers \".($i+1).\"/\".$c.\" created\\r\";\n\n $i++;\n }\n }", "public function testReportsReputationHistoryGet()\n {\n }", "public function getNewsfeedImpression()\n\t{\n\t\tif (isset($this->newsfeed_impression)) {\n\n\t\t\treturn $this->newsfeed_impression;\n\t\t}\n\n\t\treturn 0;\n\t}", "public function testQuestionViewExistingID() {\n $response = $this->get('question/' . $this->question->id);\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $this->assertEquals('general.permission', $response->content->view);\n }" ]
[ "0.6249699", "0.6068109", "0.60492015", "0.5945385", "0.56744397", "0.56206983", "0.52456534", "0.52308804", "0.51702756", "0.5156005", "0.502122", "0.49999642", "0.4976467", "0.497505", "0.49684155", "0.496407", "0.49478167", "0.49362057", "0.4935828", "0.49255764", "0.49190938", "0.48856357", "0.4885617", "0.4871198", "0.48535925", "0.4847144", "0.4838113", "0.4826293", "0.48240122", "0.48207742" ]
0.70249856
1
verify that decision listener contains correct information
public function verifyDecisionListenerWasCalled(): void { // Check that this was called during the... $onDecision = function ($type, $userId, $attributes, $decisionInfo) { print ">>> [$this->outputTag] OnDecision: type: $type, userId: $userId, attributes: " . print_r($attributes, true) . " decisionInfo: " . print_r($decisionInfo, true) . "\r\n"; }; $this->optimizelyClient->notificationCenter->addNotificationListener( NotificationType::DECISION, $onDecision ); // ...decide. $this->userContext->decide(FLAG_KEY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function verifyDecisionProperties(): void\n {\n $decision = $this->userContext->decide(FLAG_KEY);\n\n $this->printDecision($decision, \"Check that the following decision properties are expected for user $this->userId\");\n }", "public function verifyDecisionProperties(): void\n {\n $decision = $this->userContext->decideForKeys(FLAG_KEYS);\n\n $this->printDecisions($decision, \"Check that the following decisions' properties are expected\");\n }", "public function performChecks(){\n\t\t\n\t}", "abstract public function check();", "public function verify()\n {\n $this->setVerifiedFlag()->save();\n\n // :TODO: Fire an event here\n }", "public function testCheckReturnsTrueIfOneEmployerIsAllowed()\n {\n $target = new CheckJobCreatePermissionListener();\n $e = $this->getTestEvent();\n\n $this->assertTrue($target->checkCreatePermission($e));\n }", "public function testCheckReturnsFalseIfNoEmployerIsAllowed()\n {\n $target = new CheckJobCreatePermissionListener();\n $e = $this->getTestEvent(false);\n\n $this->assertFalse($target->checkCreatePermission($e));\n }", "public function testHasConstraintInfo()\n {\n // false\n $this->fixture = new ValidationReport(\n array( // results\n new ValidationResult(\n $this->nodeFactory->createNamedNode('http://focusNode/'),\n $this->nodeFactory->createNamedNode('http://resultPath/'),\n new Severity('sh:Info'),\n $this->nodeFactory->createNamedNode('sh:MinMaxCountConstraintComponent'),\n $this->nodeFactory->createNamedNode('http://value')\n )\n )\n );\n\n $this->assertTrue($this->fixture->hasConstraintInfo());\n }", "public function _check()\n {\n }", "public function check() {}", "abstract function check();", "protected function isTargetCorrect() {}", "public function createApplicableChecker();", "abstract protected function afterSuccessValidation();", "abstract public function check_hint();", "public function needsVerificationMessage ();", "public function check();", "public function check();", "public function check();", "public function check();", "public function check();", "function verify()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tif(!empty($_POST))\n\t\t{\n\t\t\t# Approve or reject a school\n\t\t\t$result = $this->_job->verify($_POST);\n\t\t\t\n\t\t\t$actionPart = current(explode(\"_\", $_POST['action']));\n\t\t\t$actions = array('save'=>'saved', 'archive'=>'archived');\n\t\t\t$actionWord = !empty($actions[$actionPart])? $actions[$actionPart]: 'made';\n\t\t\t$this->native_session->set('msg', ($result['boolean']? \"The job has been \".$actionWord: (!empty($result['msg'])? $result['msg']: \"ERROR: The job could not be \".$actionWord) ));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# Get list type\n\t\t\t$data['list_type'] = current(explode(\"_\", $data['action']));\n\t\t\t$data['area'] = 'verify_job';\n\t\t\t$this->load->view('addons/basic_addons', $data);\n\t\t}\n\t}", "public function testCheckReturnsTrueIfNoOrganizationOrOwner()\n {\n $target = new CheckJobCreatePermissionListener();\n\n $org = $this->getMockBuilder('\\Organizations\\Entity\\OrganizationReference')\n ->disableOriginalConstructor()\n ->getMock();\n\n $org->expects($this->exactly(2))\n ->method('hasAssociation')\n ->will($this->onConsecutiveCalls(false, true));\n\n $org->expects($this->once())\n ->method('isOwner')\n ->willReturn(true);\n\n $role = new User();\n $role->setOrganization($org);\n\n $e = new AssertionEvent();\n $e->setRole($role);\n\n $this->assertTrue($target->checkCreatePermission($e));\n $this->assertTrue($target->checkCreatePermission($e));\n }", "public function simulateEnabledMatchSpecificConditionsSucceeds() {}", "public function simulateEnabledMatchSpecificConditionsSucceeds() {}", "public function testWinnerVerifiedStatus()\n\t{\n\t\t$data = new OLPBlackbox_Data();\n\t\t$data->phone_home = '123451234';\n\t\t$data->phone_work = '123451234';\n\t\t$data->paydates = array(time(), strtotime('+1 week'));\n\n\t\t$init = array('target_name' => 'ca', 'name' => 'ca');\n\t\t$state_data = new OLPBlackbox_TargetStateData($init);\n\n\t\t$rule = $this->getMock('OLPBlackbox_Enterprise_Impact_Rule_WinnerVerifiedStatus',\n\t\t\t\t\t\tarray('logEvent')\n\t\t);\n\t\t$rule->expects($this->at(0))\n\t\t\t->method('logEvent')\n\t\t\t->with($this->equalTo('VERIFY_SAME_WH'),\n\t\t\t\t\t$this->equalTo('VERIFY'),\n\t\t\t\t\t$this->equalTo($state_data->name));\n\n\t\t$rule->isValid($data, $state_data);\n\t}", "protected function AssessLvlAnswers()\n {\n $lvlDecreased = $this->TryToDecreaseLevel();\n \n if ($lvlDecreased == FALSE)\n {\n $lvlIncreased = $this->TryToIncreaseLevel();\n \n if ($lvlIncreased == FALSE)\n {\n $isDone = $this->IsDone();\n \n if ($isDone == TRUE)\n {\n $this->RecordLvlQAs();\n }\n }\n }\n }", "public function check()\n {\n }", "public function check()\n {\n }", "abstract function is_trial_utilized();" ]
[ "0.65480614", "0.62806135", "0.5491631", "0.5322595", "0.523217", "0.5229661", "0.52165985", "0.51994663", "0.5197485", "0.51791364", "0.51481986", "0.51348776", "0.5130494", "0.51180595", "0.5099238", "0.50958705", "0.50893104", "0.50893104", "0.50893104", "0.50893104", "0.50893104", "0.5085035", "0.5081939", "0.5077097", "0.50764585", "0.50666285", "0.50530505", "0.5036405", "0.5036405", "0.50284857" ]
0.7961968
1
verify that invalid flag key is handled correctly
public function verifyAnInvalidFlagKeyIsHandledCorrectly(): void { $logger = new DefaultLogger(Logger::ERROR); $localOptimizelyClient = new Optimizely(datafile: null, logger: $logger, sdkKey: SDK_KEY); $userId = 'user-' . mt_rand(10, 99); $localUserContext = $localOptimizelyClient->createUserContext($userId); // ensure you see an error -- Optimizely.ERROR: FeatureFlag Key "a_key_not_in_the_project" is not in datafile. $localUserContext->decide("a_key_not_in_the_project"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testIsValidKeyWithInvalidKey() \n {\n $result = $this->fileCache->isValidKey('');\n $expected = FALSE;\n\n $this->assertEquals($expected, $result);\n }", "function check_element_validity($key,$opt){\n\n if (preg_match(STARTCHARRGX, $key) === 1 ) { //check first character\n preg_match(STARTCHARRGX,$key,$matches);\n if ($matches[0] == \"_\") {\n return false;\n }\n return true;\n }\n if ( preg_match(INVALIDCHARSRGX, $key) === 1) { //check other chars validity\n return true;\n }\n return false;\n }", "private static function setInvalidFlag($flag) {\n self::$_elements[self::$_inputElement]['inValid'] = $flag;\n }", "private function validate( $flag )\n { \n return in_array( $flag, $this->valid_flags );\n }", "protected function is_valid_key($key)\n {\n }", "public function testCacheKeyInvalidTypeBoolean(): void\n {\n $value = '99 bottles of beer on the wall';\n $key = true;\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->set($key, $value);\n }", "public function testIsValidKeyNotFound()\n {\n $this->assertFalse($this->helper->isValid('blabla', 12.93));\n }", "public function testIsValidKeyWithValidKey() \n {\n $key = 'key1';\n $result = $this->fileCache->isValidKey($key);\n $expected = TRUE;\n\n $this->assertEquals($expected, $result);\n }", "public function testInvalidConfig()\n {\n $config = array(\n 'invalidArg' => TRUE,\n );\n\n $result = self::processFilter($config, self::$request);\n }", "function validate_key($key)\n{\n if ($key == 'PhEUT5R251')\n return true;\n else\n return false;\n}", "public function setInvalid();", "protected static function validKey($key) {\n return is_string($key) && !is_numeric($key) && strpos($key, ':') === FALSE;\n }", "public function isValid(string $key) : bool;", "public function hasError($key) : bool;", "private function isValidKey($key) {\n\n\t\t// Check key length\n\t\t$len = strlen($key);\n\n\t\tif ($len < 1) {\n\t\t\tthrow new FlintstoneException('No key has been set');\n\t\t}\n\n\t\tif ($len > 50) {\n\t\t\tthrow new FlintstoneException('Maximum key length is 50 characters');\n\t\t}\n\n\t\t// Check valid characters in key\n\t\tif (!preg_match(\"/^[A-Za-z0-9_\\-]+$/\", $key)) {\n\t\t\tthrow new FlintstoneException('Invalid characters in key');\n\t\t}\n\n\t\treturn true;\n\t}", "function is_valid_meta_key( $key ) {\n\t\t// skip attachment metadata since we'll regenerate it from scratch\n\t\t// skip _edit_lock as not relevant for import\n\t\tif ( in_array( $key, array( '_wp_attached_file', '_wp_attachment_metadata', '_edit_lock' ) ) )\n\t\t\treturn false;\n\t\treturn $key;\n\t}", "function check($key) {\n\t\tswitch ($key) {\n\t\t\tcase 'name':\n\t\t\tcase 'email':\n\t\t\tcase 'type_demande':\n\t\t\t\t// field(s) is(are) compulsory\n\t\t\t\treturn $this->checkEmpty($key);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// any other field is fine as it is\n\t\t\t\treturn true;\n\t\t}\n\t\treturn true;\n\t}", "public function isInvalid(): bool;", "public static function validatePasskey( $key ) {\n\t\t$pk = self::getPasskey( $key );\n\n\t\tif ( ( $pk == 'false' ) || ( $pk === false ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\tif ( empty( $pk->active ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( empty( $pk->type_def['valid'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $pk->trials <= 0 ) {\n\t\t\treturn false;\n\t\t}\n\t\t*/\n\n\t\treturn true;\n\t}", "public function valid() { return isset($this->keys[$this->pos]);\n }", "public function isValidKey($key) {\n\t\treturn is_int($key);\n\t}", "function replace_invalid_keys($key,$opt){\n\n if(is_string($key)){\n $key = preg_replace(INVALIDCHARSRGX, $opt->substitute_string, $key);\n $key = preg_replace(STARTCHARRGX, $opt->substitute_string, $key);\n }\n return $key;\n }", "private function validateReviewerKey(){\n\t\treturn true;\n\t}", "public function valid()\n {\n return $this->key === 0;\n }", "protected function validateOrThrow() {}", "public function testGetKeyUriWithLabelContainsInvalidCharatcer() {\n // throw the label contains invalid characters exception message\n GoogleAuthenticator::getKeyUri('hotp', 'illegal:char1:char2:char3:char4', 'secret');\n }", "public function testTextInvalidKeySuccess() {\n $config = [\n 'success' => 'A',\n 'data' => 'example'\n ];\n $errors = $this->getValidator()->validate($config);\n\n $this->assertNotEmpty($errors);\n $this->assertCount(1, $errors);\n $this->assertEquals('VALIDATION.INVALID_SUCCESS_IDENTIFIER', $errors[0]['__CODE'] );\n }", "public static function validate_key( $key ) {\n \treturn self::$instance->validate( $key );\n }", "function invalid_form_element($key) {\n $errors = Session::getErrors();\n if ($errors != null) {\n if (array_key_exists($key, $errors)) {\n echo 'invalid';\n }\n }\n}", "public function testInvalidArg ()\n {\n $this->tran->loadDictionary(1.23);\n $this->tran->loadDictionary(array('yo' => 'for sure'));\n $this->tran->loadDictionary(true);\n\n $this->tran->translate(34);\n $this->tran->translate(array('yo' => 'for sure'));\n }" ]
[ "0.67659914", "0.640581", "0.6379434", "0.63693994", "0.6341779", "0.6326382", "0.6140762", "0.6140514", "0.6055783", "0.59930325", "0.5917794", "0.59130347", "0.5889435", "0.5886992", "0.5781108", "0.57391214", "0.5704403", "0.5701161", "0.5697768", "0.5682411", "0.56671363", "0.5649084", "0.56431437", "0.56374943", "0.5621247", "0.5619933", "0.55993617", "0.55993307", "0.55873287", "0.5576087" ]
0.7583321
1
Save assigned categories to an entry
public function save_category_posts($entry_id, $meta, $data) { $categories = array(); // Channel:Form/Safecracker if (isset($data['categories'])) { $categories = $data['categories']; } // Normal Entry Save elseif (isset($data['revision_post']['category'])) { $categories = $data['revision_post']['category']; } $publisher_save_status = ee()->input->post('publisher_save_status'); // Insert new categories. $this->_save_category_posts($entry_id, $publisher_save_status, $categories); // If option is enabled, and saving as open, delete drafts and save new draft rows too. if( $publisher_save_status == PUBLISHER_STATUS_OPEN && ee()->publisher_setting->sync_drafts() ){ $this->_save_category_posts($entry_id, 'draft', $categories); } // Get open records, and re-insert them into category_posts, otherwise // we get draft category assignments added to the core table. if( $publisher_save_status == PUBLISHER_STATUS_DRAFT && ($categories = $this->get_category_posts($entry_id, PUBLISHER_STATUS_OPEN)) ){ // First delete all category assignments for this entry. ee()->db->where('entry_id', $entry_id) ->delete('category_posts'); foreach ($categories as $category) { $data = array( 'cat_id' => $category, 'entry_id' => $entry_id ); $qry = ee()->db->where($data)->get('category_posts'); if ($qry->num_rows() == 0) { ee()->db->insert('category_posts', $data); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "public function actionCategorySave()\n {\n $this->_assertCanManageCategories();\n\n $category_id = $this->_input->filterSingle('faq_id', XenForo_Input::UINT);\n $saveAction = new XenForo_Phrase('iversia_faq_category_added');\n\n $dw = XenForo_DataWriter::create('Iversia_FAQ_DataWriter_Category');\n if ($category_id) {\n $dw->setExistingData($category_id);\n $saveAction = new XenForo_Phrase('iversia_faq_category_edited');\n }\n $dw->bulkSet(\n array(\n 'title' => $this->_input->filterSingle('title', XenForo_Input::STRING),\n 'display_order' => $this->_input->filterSingle('display_order', XenForo_Input::UINT),\n )\n );\n $dw->save();\n\n return $this->responseRedirect(\n XenForo_ControllerResponse_Redirect::SUCCESS,\n XenForo_Link::buildPublicLink('faq'),\n $saveAction\n );\n }", "public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpdb->insert_id;\n\t\t} else\n\t\t\t$wpdb->update(FAQBUILDDBCATEGORY,$this->toArray(true),array(\"category_id\"=>$this->category_id),$types,array(\"%d\"));\n\t}", "function multi_entry_category_update()\n\t{\n\t\tif ( ! $this->cp->allowed_group('can_access_content'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\n\t\tif ($this->input->get_post('entry_ids') === FALSE OR $this->input->get_post('type') === FALSE)\n\t\t{\n\t\t\treturn $this->dsp->no_access_message($this->lang->line('unauthorized_to_edit'));\n\t\t}\n\n\t\tif ($this->input->get_post('category') === FALSE OR ! is_array($_POST['category']) OR count($_POST['category']) == 0)\n\t\t{\n\t\t\treturn $this->output->show_user_error('submission', $this->lang->line('no_categories_selected'));\n\t\t}\n\n\t\t/** ---------------------------------\n\t\t/**\t Fetch categories\n\t\t/** ---------------------------------*/\n\n\t\t// We do this first so we can destroy the category index from\n\t\t// the $_POST array since we use a separate table to store categories in\n\t\t\n\t\t$this->api->instantiate('channel_categories');\n\n\t\tforeach ($_POST['category'] as $cat_id)\n\t\t{\n\t\t\t$this->api_channel_categories->cat_parents[] = $cat_id;\n\t\t}\n\n\t\tif ($this->api_channel_categories->assign_cat_parent == TRUE)\n\t\t{\n\t\t\t$this->api_channel_categories->fetch_category_parents($_POST['category']);\n\t\t}\n\n\t\t$this->api_channel_categories->cat_parents = array_unique($this->api_channel_categories->cat_parents);\n\n\t\tsort($this->api_channel_categories->cat_parents);\n\n\t\tunset($_POST['category']);\n\n\t\t$ids = array();\n\n\t\tforeach (explode('|', $_POST['entry_ids']) as $entry_id)\n\t\t{\n\t\t\t$ids[] = $this->db->escape_str($entry_id);\n\t\t}\n\n\t\tunset($_POST['entry_ids']);\n\n\t\t$entries_string = implode(\"','\", $ids);\n\n\t\t/** -----------------------------\n\t\t/**\t Get Category Group IDs\n\t\t/** -----------------------------*/\n\t\t$query = $this->db->query(\"SELECT DISTINCT exp_channels.cat_group FROM exp_channels, exp_channel_titles\n\t\t\t\t\t\t\t WHERE exp_channel_titles.channel_id = exp_channels.channel_id\n\t\t\t\t\t\t\t AND exp_channel_titles.entry_id IN ('\".$entries_string.\"')\");\n\n\t\t$valid = 'n';\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$valid = 'y';\n\t\t\t$last = explode('|', $query->row('cat_group') );\n\n\t\t\tforeach($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$valid_cats = array_intersect($last, explode('|', $row['cat_group']));\n\n\t\t\t\tif (count($valid_cats) == 0)\n\t\t\t\t{\n\t\t\t\t\t$valid = 'n';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($valid == 'n')\n\t\t{\n\t\t\treturn $this->dsp->show_user_error($this->lang->line('no_category_group_match'));\n\t\t}\n\n\t\t/** -----------------------------\n\t\t/**\t Remove Valid Cats, Then Add...\n\t\t/** -----------------------------*/\n\n\t\t$valid_cat_ids = array();\n\t\t$query = $this->db->query(\"SELECT cat_id FROM exp_categories\n\t\t\t\t\t\t\t WHERE group_id IN ('\".implode(\"','\", $valid_cats).\"')\n\t\t\t\t\t\t\t AND cat_id IN ('\".implode(\"','\", $this->api_channel_categories->cat_parents).\"')\");\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$this->db->query(\"DELETE FROM exp_category_posts WHERE cat_id = \".$row['cat_id'].\" AND entry_id IN ('\".$entries_string.\"')\");\n\t\t\t\t$valid_cat_ids[] = $row['cat_id'];\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->input->get_post('type') == 'add')\n\t\t{\n\t\t\t$insert_cats = array_intersect($this->api_channel_categories->cat_parents, $valid_cat_ids);\n\t\t\t// How brutish...\n\t\t\tforeach($ids as $id)\n\t\t\t{\n\t\t\t\tforeach($insert_cats as $val)\n\t\t\t\t{\n\t\t\t\t\t$this->db->query($this->db->insert_string('exp_category_posts', array('entry_id' => $id, 'cat_id' => $val)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t/** ---------------------------------\n\t\t/**\t Clear caches if needed\n\t\t/** ---------------------------------*/\n\n\t\tif ($this->config->item('new_posts_clear_caches') == 'y')\n\t\t{\n\t\t\t$this->functions->clear_caching('all');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->functions->clear_caching('sql');\n\t\t}\n\t\t\n\t\t$this->session->set_flashdata('message_success', $this->lang->line('multi_entries_updated'));\n\t\t$this->functions->redirect(BASE.AMP.'C=content_edit');\n\t}", "public function multi_entry_category_update()\n {\n // Does the user have permission?\n if ( !ee()->publisher_helper->allowed_group('can_access_content'))\n {\n show_error(lang('unauthorized_access'));\n }\n\n $entries = ee()->input->post('entry_ids', TRUE);\n $cat_ids = ee()->input->post('category', TRUE);\n $type = ee()->input->post('type', TRUE);\n $entry_ids = array();\n\n if ( !$entries || !$type)\n {\n show_error(lang('unauthorized_to_edit'));\n }\n\n if ( !$cat_ids || !is_array($cat_ids) || empty($cat_ids))\n {\n return ee()->output->show_user_error('submission', lang('no_categories_selected'));\n }\n\n // For the entries affected, sync publisher_category_posts to category_posts\n\n foreach (explode('|', trim($entries)) as $entry_id)\n {\n $entry_ids[] = $entry_id;\n }\n\n // default states\n $default_language_id = ee()->publisher_model->default_language_id;;\n $default_view_status = ee()->publisher_setting->default_view_status();\n $states = array();\n\n foreach($entry_ids as $entry_id)\n {\n // we'll always have a state for the default language and status\n $states = array(array(\n 'publisher_lang_id' => $default_language_id,\n 'publisher_status' => $default_view_status\n ));\n\n if ($type == 'add')\n {\n // Adding categories\n // ----------------------------------------------------------------\n\n // We want to add categories to all the open and draft versions\n // of an entry without changing existing category selections\n\n // for each entry, look up existing distinct states\n $query = ee()->db->distinct()\n ->select('publisher_lang_id, publisher_status')\n ->where('entry_id', $entry_id)\n ->get('publisher_titles');\n\n if ($query->num_rows() > 0)\n {\n $result = $query->result_array();\n\n foreach($result as $row)\n {\n if (FALSE === ($row['publisher_lang_id'] == $default_language_id && $row['publisher_status'] == $default_view_status))\n {\n $states[] = array(\n 'publisher_lang_id' => $row['publisher_lang_id'],\n 'publisher_status' => $row['publisher_status']\n );\n }\n }\n }\n\n // build an an array of records to insert into publisher_category_posts\n $data = array();\n\n foreach($states as $state)\n {\n // add the new categories\n foreach($cat_ids as $cat_id)\n {\n $data[] = array(\n 'entry_id' => $entry_id,\n 'cat_id' => $cat_id,\n 'publisher_lang_id' => $state['publisher_lang_id'],\n 'publisher_status' => $state['publisher_status']\n );\n }\n }\n\n // delete any relationships with the newly added categories that already exist\n // for this entry so that we don't end up with duplicate rows\n ee()->db->where('entry_id', $entry_id)\n ->where_in('cat_id', $cat_ids)\n ->delete('publisher_category_posts');\n\n // (re)insert the categories with the appropriate states\n ee()->db->insert_batch('publisher_category_posts', $data);\n }\n\n elseif($type == 'remove')\n {\n // Removing categories\n // ----------------------------------------------------------------\n\n // we're simply removing the selected categories from all versions of the entry\n ee()->db->where('entry_id', $entry_id)\n ->where_in('cat_id', $cat_ids)\n ->delete('publisher_category_posts');\n }\n }\n }", "public function save() {\n if (self::getCategoryById($this->id) == null) {\n // should create\n $sql = \"INSERT INTO category (name) VALUES ('%s') RETURNING id;\";\n $auth_user = User::getUserById(1);\n $sql = sprintf($sql, pg_escape_string($this->name));\n $results = self::$connection->execute($sql);\n $this->id = $results[0][\"id\"];\n } else {\n // should update\n $sql = \"UPDATE category SET name='%s' WHERE id=%d\";\n $sql = sprintf($sql, pg_escape_string($this->name), addslashes($this->id));\n self::$connection->execute($sql);\n }\n }", "public function category(){\n\n Excel::import(new ComponentsImport,'/imports/categories.csv');\n $cats = array_values(array_unique(Cache::get('category')));\n for($i=0;$i<count($cats);$i++){\n $sub = new Category();\n $sub->name = $cats[$i];\n $sub->save();\n }\n }", "private function _save_category_posts($entry_id, $publisher_save_status, $categories = array())\n {\n ee()->db->where('publisher_status', $publisher_save_status)\n ->where('publisher_lang_id', ee()->publisher_lib->lang_id)\n ->where('entry_id', $entry_id)\n ->delete('publisher_category_posts');\n\n /*\n TODO? - On save, see if the entry has a row for the requested status/lang_id in publisher_titles\n then we don't update the categories for that entry.\n\n if no rows exist, then get the categories for the default language, then insert them for the\n requested status/lang_id so it has records, thus sharing the same cats as the default lang.\n requires new loop over each language with the same insert array.\n */\n\n if ( !empty($categories))\n {\n foreach ($categories as $cat_id)\n {\n $data = array(\n 'cat_id' => $cat_id,\n 'entry_id' => $entry_id,\n 'publisher_status' => $publisher_save_status,\n 'publisher_lang_id' => ee()->publisher_lib->lang_id\n );\n\n ee()->db->insert('publisher_category_posts', $data);\n }\n }\n }", "public function save(){\n\t\t$sql = new Sql();\n\n\t\t$results = $sql->select(\"CALL sp_categories_save(:idcategory, :descategory)\", array(\n\t\t\t\":idcategory\"=>$this->getidcategory(),\n\t\t\t\":descategory\"=>$this->getdescategory()\n\t\t));\n\n\t\t$this->setData($results[0]);\n\n\n\t\tCategory::updateFile();\n\n\t}", "public function save($categories) {\n if (!empty($categories)) {\n $query = \"INSERT INTO \" . self::$TABLE . \"(\n id, \n name, \n link) VALUES\";\n \n if (is_array($categories)) {\n //make a bulk insert\n $rowsValues = \"\";\n foreach ($categories as $category) {\n if ($category->isValid()) {\n //check if the category already exists\n $existentCat = $this->getByName($category->getName());\n if (empty($existentCat)) {\n $rowsValues .= self::populateRowValuesFromObject($category) . \", \";\n }\n }\n }\n if (!empty($rowsValues)) {\n $rowsValues = substr($rowsValues, 0, strlen($rowsValues) - 2);\n $query .= $rowsValues . \";\";\n parent::executeQuery($query);\n }\n } else {\n //make a single row insert\n if ($categories->isValid()) {\n //check if the category already exists\n $existentCat = $this->getByName($categories->getName());\n if (empty($existentCat)) {\n $query .= self::populateRowValuesFromObject($categories) . \";\";\n parent::executeQuery($query);\n $categories->setId($this->lastInsertID());\n return $categories;\n }\n return $existentCat;\n }\n }\n }\n //category already exists.\n return null;\n }", "function saveCat()\n {\n //update stuff\n }", "public function save() {\n\t\t$date = date('Y-m-d H:i:s');\n\t\t$this->setLast_modified($date);\n\t\t\n\t\tif (!is_null($this->getId())) {\n\t\t\t$sql = 'update cart_categories set ';\n\t\t} else {\n\t\t\t$sql = 'insert into cart_categories set ';\n\t\t\t$this->setDate_added($date);\n\t\t}\n\t\tif (!is_null($this->getImage())) {\n\t\t\t$sql .= '`categories_image`=\"' . e($this->getImage()->getId()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getParent_id())) {\n\t\t\t$sql .= '`parent_id`=\"' . e($this->getParent_id()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getSort_order())) {\n\t\t\t$sql .= '`sort_order`=\"' . e($this->getSort_order()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getDate_added())) {\n\t\t\t$sql .= '`date_added`=\"' . e($this->getDate_added()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getLast_modified())) {\n\t\t\t$sql .= '`last_modified`=\"' . e($this->getLast_modified()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getStatus())) {\n\t\t\t$sql .= '`categories_status`=\"' . e($this->getStatus()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getId())) {\n\t\t\t$sql .= 'categories_id=\"' . e($this->getId()) . '\" where categories_id=\"' . e($this->getId()) . '\"';\n\t\t} else {\n\t\t\t$sql = trim($sql, ', ');\n\t\t}\n\t\tDatabase::singleton()->query($sql);\n\t\t$catId = Database::singleton()->lastInsertedID();\n\t\t$new = false;\n\t\tif (is_null($this->getId())) {\n\t\t\t$this->setId($catId);\n\t\t\t$new = true;\n\t\t\t$sql = 'insert into cart_categories_description set ';\n\t\t} else {\n\t\t\t$sql = 'update cart_categories_description set ';\n\t\t}\n\t\t$sql .= '`language_id`=\"' . 1 . '\", ';\n\t\t$sql .= '`categories_name`=\"' . e($this->getName()) . '\", ';\n\t\t$sql .= '`categories_description`=\"' . e($this->getDescription()) . '\"';\n\t\t\n\t\tif ($new) {\n\t\t\t$sql .= ', `categories_id`=\"' . e($this->getId()) . '\"';\n\t\t} else {\n\t\t\t$sql .= ' where `categories_id`=\"' . e($this->getId()) . '\"';\n\t\t}\n\t\tDatabase::singleton()->query($sql);\n\t\t\n\t\tself::__construct($this->getId());\n\t}", "public function save_category_info($data) {\n $this->db->insert('tbl_category', $data);\n }", "public function save()\n {\n $error = true;\n\n // Save the not language specific part\n $pre_save_category = new self($this->category_id, $this->clang_id);\n\n if (0 === $this->category_id || $pre_save_category !== $this) {\n $query = rex::getTablePrefix() .'d2u_linkbox_categories SET '\n .\"name = '\". addslashes($this->name) .\"' \";\n\n if (0 === $this->category_id) {\n $query = 'INSERT INTO '. $query;\n } else {\n $query = 'UPDATE '. $query .' WHERE category_id = '. $this->category_id;\n }\n $result = rex_sql::factory();\n $result->setQuery($query);\n if (0 === $this->category_id) {\n $this->category_id = (int) $result->getLastId();\n $error = !$result->hasError();\n }\n }\n\n return $error;\n }", "function storeSecondaryCategories( $secondary_categories )\r\n\t{\r\n\t // delete all existing ones\r\n\t $db = $this->getDBO();\r\n\t $db->setQuery( \"DELETE FROM #__calendar_eventcategories WHERE `event_id` = '$this->event_id';\");\r\n\t $db->query();\r\n\t \r\n\t // save new ones\r\n\t JTable::addIncludePath( JPATH_ADMINISTRATOR . '/components/com_publications/tables' );\r\n\t foreach( $secondary_categories as $secondary_category)\r\n\t {\r\n\t $table = JTable::getInstance( 'EventCategories', 'CalendarTable' );\r\n\t $table->event_id = $this->event_id;\r\n\t $table->category_id = $secondary_category;\r\n\t $table->store();\r\n\t }\r\n\t}", "public function store() {\n if ($id = Input::get('id')) {\n $category = Category::find($id);\n } else {\n $category = new Category();\n }\n\n $inputs = Input::only(['type', 'parent_id', 'name', 'description',\n 'slug', 'keywords', 'order', 'status', 'template']);\n $rules = [\n 'type' => 'in:subject,application,product',\n 'name' => 'required|min:1',\n 'order' => 'required|numeric',\n ];\n\n $validator = Validator::make($inputs, $rules);\n $validator->sometimes('slug', 'unique:categories,slug', function() use($inputs, $category) {\n return !empty($inputs['slug']) && ($category->slug != $inputs['slug']);\n });\n //todo: 循环继承的问题解决思路\n //在数据库存一个layer的字段,标明改分类的层级,p_id=0的为1层\n //递归n次得到p_id=0则为n层\n //最后对比大小禁止循环继承\n if ($validator->fails()) {\n $messages = $validator->messages()->toArray();\n return $this->msg($messages, 1);\n }\n\n $category->fill($inputs);\n $category->save();\n\n return $this->msg('success', 0);\n }", "function saveCategories($product_id)\n {\n //var_dump(Category::$cats); exit;\n if(is_null($this->categories) || sizeof($this->categories) < 1){\n return;\n }\n \n foreach ($this->categories as $ids) {\n if(empty($ids)){\n continue;\n }\n \tif(isset(Category::$cats[$ids]) && is_object(Category::$cats[$ids])){\n\t $names[] = array('name'=>Category::$cats[$ids]->name);\n\t $cids[] = array('name'=>Category::$cats[$ids]->cid);\n\t $i = 0;\n\t $parent_id = $ids;\n\t \n\t while(($parent_id = Category::$cats[$parent_id]->parent_id) != 0){\n\t \n\t $names[] = array('name'=>Category::$cats[$parent_id]->name);\n\t $cids[] = array('name'=>Category::$cats[$parent_id]->cid);\n\t $i++;\n\t if($i > 7 ){ $i = 0; break; }\n\t }\n\t \t\n\t // \t\n\t \t$this->saveWords(Category::$cats[$ids]->name, $product_id, 2);\n\t \t $this->saveWords(Category::$cats[$ids]->description, $product_id, 1);\n\t\t//\t\t}\n\t\t\t}\n } \n\t\tif(isset($names)){\n \t$this->options['category'] = array('name'=>'category','value'=>$names);\n \t$this->options['category_id'] = array('name'=>'category_id','value'=>$cids);\n\t\t}\n }", "function save_extra_category_fileds( $term_id ) {\n\tif ( isset( $_POST['term_meta'] ) ) {\n\t\t$tag_id\t\t= $term_id;\n\t\t$term_meta\t= get_option( \"category_$tag_id\" );\n\t\t$cat_keys\t= array_keys( $_POST['term_meta'] );\n\t\tforeach ( $cat_keys as $key ) {\n\t\t\tif ( isset( $_POST['term_meta'][$key] ) ) {\n\t\t\t\t$term_meta[$key] = $_POST['term_meta'][$key];\n\t\t\t}\n\t\t}\n\t\t//save the option array\n\t\tupdate_option( \"category_$tag_id\", $term_meta );\n\t}\n}", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"index\"\n ));\n }\n\n $id = $this->request->getPost(\"id\");\n\n $category = ArticleCategories::findFirstByid($id);\n if (!$category) {\n $this->flash->error(\"category does not exist \" . $id);\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"index\"\n ));\n }\n\n $category->id = $this->request->getPost(\"id\");\n $category->name = $this->request->getPost(\"name\");\n $category->description = $this->request->getPost(\"description\");\n \n\n if (!$category->save()) {\n\n foreach ($category->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"edit\",\n \"params\" => array($category->id)\n ));\n }\n\n $this->flash->success(\"category was updated successfully\");\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"index\"\n ));\n\n }", "public function addCathegory($values)\n\t{\n\t\treturn $this->getTable('kategoria')->insert(array(\n\t\t\t'Nazov' => $values->nazov,\n\t\t));\n\t}", "public function saveCategory(Request $request){\n if (Category::where('name', $request->get('category'))->exists()){\n // found\n }\n else{\n $level = $request->get('parent') == ''? 1 : 2;\n if ($level == 1){\n $parent = null;\n }\n else{\n $parent = Category::where('name', $request->get('parent'))->first()->id;\n }\n Category::insert([\n 'name' => $request->get('category'),\n 'level' => $level,\n 'parent_id' => $parent,\n 'created_at' => new \\DateTime(),\n 'updated_at' => new \\DateTime()\n ]);\n }\n return redirect()->route('all-categories');\n }", "public function storeCategory(array $data): void\n {\n }", "public function save_category() {\n\t\t// If no form submission, bail!\n\t\tif ( empty( $_POST ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! isset( $_POST['set_redirection_category'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tcheck_admin_referer( 'rank-math-save-redirections', 'security' );\n\t\tif ( ! Helper::has_cap( 'redirections' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$cmb = cmb2_get_metabox( 'rank-math-redirections' );\n\t\t$values = $cmb->get_sanitized_values( $_POST );\n\n\t\t$values['redirection_category'] = isset( $values['redirection_category'] ) && is_array( $values['redirection_category'] ) ? $values['redirection_category'] : [];\n\t\tunset( $_POST['redirection_category'], $_POST['set_redirection_category'] );\n\n\t\tif ( empty( $values['id'] ) ) {\n\t\t\t$this->save_categories = $values['redirection_category'];\n\t\t\t$this->action( 'rank_math/redirection/saved', 'save_category_after_add' );\n\t\t\treturn true;\n\t\t}\n\n\t\twp_set_object_terms( $values['id'], array_map( 'absint', $values['redirection_category'] ), 'rank_math_redirection_category' );\n\t\treturn true;\n\t}", "function process_categories() {\n\t\t$this->categories = apply_filters( 'wp_import_categories', $this->categories );\n\n\t\tif ( empty( $this->categories ) )\n\t\t\treturn;\n\n\t\tforeach ( $this->categories as $cat ) {\n\t\t\t// if the category already exists leave it alone\n\t\t\t$term_id = term_exists( $cat['category_nicename'], 'category' );\n\t\t\tif ( $term_id ) {\n\t\t\t\tif ( is_array($term_id) ) $term_id = $term_id['term_id'];\n\t\t\t\tif ( isset($cat['term_id']) )\n\t\t\t\t\t$this->processed_terms[intval($cat['term_id'])] = (int) $term_id;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$category_parent = empty( $cat['category_parent'] ) ? 0 : category_exists( $cat['category_parent'] );\n\t\t\t$category_description = isset( $cat['category_description'] ) ? $cat['category_description'] : '';\n\t\t\t$catarr = array(\n\t\t\t\t'category_nicename' => $cat['category_nicename'],\n\t\t\t\t'category_parent' => $category_parent,\n\t\t\t\t'cat_name' => $cat['cat_name'],\n\t\t\t\t'category_description' => $category_description\n\t\t\t);\n\n\t\t\t$id = wp_insert_category( $catarr );\n\t\t\tif ( ! is_wp_error( $id ) ) {\n\t\t\t\tif ( isset($cat['term_id']) )\n\t\t\t\t\t$this->processed_terms[intval($cat['term_id'])] = $id;\n\t\t\t} else {\n\t\t\t\tprintf( 'Failed to import category %s', esc_html($cat['category_nicename']) );\n\t\t\t\tif ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )\n\t\t\t\t\techo ': ' . $id->get_error_message();\n\t\t\t\techo '<br />';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tunset( $this->categories );\n\t}", "function save(){\n\t\t// $insert_query = 'INSERT INTO tb_categories';\n\t\t// $insert_query .= ' SET ';\n\t\t// $insert_query .= ' name = \"'.$this->name.'\"';\n\n\t\t// $this->db->query($insert_query);\n\t\t\tif($this->page_id){\n\t\t\t\t$this->update();\n\t\t\t}else{\n\t\t\t\t$this->page_id = $this->db->insert(\n\t\t\t\t\t'tb_pages',\n\t\t\t\t\tarray(\t\t\t\t\t\n\t\t\t\t\t'title' => $this->title,\n\t\t\t\t\t'content' => $this->content)\n\t\t\t\t);\n\t\t\t}\n\t\t}", "public function updateCategory()\n {\n Category::findOrFail($this->category_id)->update([\n 'category_name' => $this->categoryName,\n 'slug' => Str::slug($this->categoryName),\n 'class' => $this->class,\n\n ]);\n }", "function save_extra_category_fileds( $term_id ) {\n if ( isset( $_POST['Cat_meta'] ) ) {\n $t_id = $term_id;\n $cat_meta = get_option( \"category_$t_id\");\n $cat_keys = array_keys($_POST['Cat_meta']);\n foreach ($cat_keys as $key){\n if (isset($_POST['Cat_meta'][$key])){\n $cat_meta[$key] = $_POST['Cat_meta'][$key];\n }\n }\n //save the option array\n update_option( \"category_$t_id\", $cat_meta );\n }\n}", "function save_extra_category_fileds( $term_id ) {\n if ( isset( $_POST['Cat_meta'] ) ) {\n $t_id = $term_id;\n $cat_meta = get_option( \"category_$t_id\");\n $cat_keys = array_keys($_POST['Cat_meta']);\n foreach ($cat_keys as $key){\n if (isset($_POST['Cat_meta'][$key])){\n $cat_meta[$key] = $_POST['Cat_meta'][$key];\n }\n }\n //save the option array\n update_option( \"category_$t_id\", $cat_meta );\n }\n}", "public function store(CategoryRequest $request)\n { \n $data = $request->all();\n\n $data['slug'] = str_slug($data['name']);\n\n $data['level'] += 1;\n\n $category = Category::insertData($data);\n\n return $category; \n \n }", "public function store(Request $request)\n {\n// $this->validate($request, [\n// 'name'=>'required|max:120|unique:page_categories'\n// ]);\n\n $category = new PageCategory();\n $category->main_page_category_id = $request->input('main_page_category_id') ? :null;\n $category->save();\n\n foreach (\\Loc::getLocales() as $locale){\n\n if($request->input('name.'.$locale->code) == \"\"){\n continue;\n }\n\n $category->setActiveLocale($locale->code);\n $category->name = $request->input('name.'.$locale->code);\n $category->slug = str_slug($request->input('name.'.$locale->code));\n $category->save();\n }\n\n return redirect()->route(\"backend.page.category.edit\", ['page_category' => $category->id])->withSuccess( __('backend.save_success') );\n }" ]
[ "0.7105386", "0.657624", "0.65236574", "0.64653856", "0.6462581", "0.6461511", "0.6438404", "0.62992126", "0.61338675", "0.596923", "0.59471154", "0.59307206", "0.5913978", "0.58563083", "0.5843725", "0.5817443", "0.58066255", "0.57915413", "0.57899785", "0.5787178", "0.5764153", "0.5760341", "0.5742855", "0.5730925", "0.570513", "0.56828326", "0.56747466", "0.56747466", "0.5673752", "0.56436414" ]
0.6716348
1
Handle multi_entry_category_update. There is no hook in EE so we only trigger this if the $_POST is correct. Thanks to Mark Croxton for contributing this.
public function multi_entry_category_update() { // Does the user have permission? if ( !ee()->publisher_helper->allowed_group('can_access_content')) { show_error(lang('unauthorized_access')); } $entries = ee()->input->post('entry_ids', TRUE); $cat_ids = ee()->input->post('category', TRUE); $type = ee()->input->post('type', TRUE); $entry_ids = array(); if ( !$entries || !$type) { show_error(lang('unauthorized_to_edit')); } if ( !$cat_ids || !is_array($cat_ids) || empty($cat_ids)) { return ee()->output->show_user_error('submission', lang('no_categories_selected')); } // For the entries affected, sync publisher_category_posts to category_posts foreach (explode('|', trim($entries)) as $entry_id) { $entry_ids[] = $entry_id; } // default states $default_language_id = ee()->publisher_model->default_language_id;; $default_view_status = ee()->publisher_setting->default_view_status(); $states = array(); foreach($entry_ids as $entry_id) { // we'll always have a state for the default language and status $states = array(array( 'publisher_lang_id' => $default_language_id, 'publisher_status' => $default_view_status )); if ($type == 'add') { // Adding categories // ---------------------------------------------------------------- // We want to add categories to all the open and draft versions // of an entry without changing existing category selections // for each entry, look up existing distinct states $query = ee()->db->distinct() ->select('publisher_lang_id, publisher_status') ->where('entry_id', $entry_id) ->get('publisher_titles'); if ($query->num_rows() > 0) { $result = $query->result_array(); foreach($result as $row) { if (FALSE === ($row['publisher_lang_id'] == $default_language_id && $row['publisher_status'] == $default_view_status)) { $states[] = array( 'publisher_lang_id' => $row['publisher_lang_id'], 'publisher_status' => $row['publisher_status'] ); } } } // build an an array of records to insert into publisher_category_posts $data = array(); foreach($states as $state) { // add the new categories foreach($cat_ids as $cat_id) { $data[] = array( 'entry_id' => $entry_id, 'cat_id' => $cat_id, 'publisher_lang_id' => $state['publisher_lang_id'], 'publisher_status' => $state['publisher_status'] ); } } // delete any relationships with the newly added categories that already exist // for this entry so that we don't end up with duplicate rows ee()->db->where('entry_id', $entry_id) ->where_in('cat_id', $cat_ids) ->delete('publisher_category_posts'); // (re)insert the categories with the appropriate states ee()->db->insert_batch('publisher_category_posts', $data); } elseif($type == 'remove') { // Removing categories // ---------------------------------------------------------------- // we're simply removing the selected categories from all versions of the entry ee()->db->where('entry_id', $entry_id) ->where_in('cat_id', $cat_ids) ->delete('publisher_category_posts'); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function multi_entry_category_update()\n\t{\n\t\tif ( ! $this->cp->allowed_group('can_access_content'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\n\t\tif ($this->input->get_post('entry_ids') === FALSE OR $this->input->get_post('type') === FALSE)\n\t\t{\n\t\t\treturn $this->dsp->no_access_message($this->lang->line('unauthorized_to_edit'));\n\t\t}\n\n\t\tif ($this->input->get_post('category') === FALSE OR ! is_array($_POST['category']) OR count($_POST['category']) == 0)\n\t\t{\n\t\t\treturn $this->output->show_user_error('submission', $this->lang->line('no_categories_selected'));\n\t\t}\n\n\t\t/** ---------------------------------\n\t\t/**\t Fetch categories\n\t\t/** ---------------------------------*/\n\n\t\t// We do this first so we can destroy the category index from\n\t\t// the $_POST array since we use a separate table to store categories in\n\t\t\n\t\t$this->api->instantiate('channel_categories');\n\n\t\tforeach ($_POST['category'] as $cat_id)\n\t\t{\n\t\t\t$this->api_channel_categories->cat_parents[] = $cat_id;\n\t\t}\n\n\t\tif ($this->api_channel_categories->assign_cat_parent == TRUE)\n\t\t{\n\t\t\t$this->api_channel_categories->fetch_category_parents($_POST['category']);\n\t\t}\n\n\t\t$this->api_channel_categories->cat_parents = array_unique($this->api_channel_categories->cat_parents);\n\n\t\tsort($this->api_channel_categories->cat_parents);\n\n\t\tunset($_POST['category']);\n\n\t\t$ids = array();\n\n\t\tforeach (explode('|', $_POST['entry_ids']) as $entry_id)\n\t\t{\n\t\t\t$ids[] = $this->db->escape_str($entry_id);\n\t\t}\n\n\t\tunset($_POST['entry_ids']);\n\n\t\t$entries_string = implode(\"','\", $ids);\n\n\t\t/** -----------------------------\n\t\t/**\t Get Category Group IDs\n\t\t/** -----------------------------*/\n\t\t$query = $this->db->query(\"SELECT DISTINCT exp_channels.cat_group FROM exp_channels, exp_channel_titles\n\t\t\t\t\t\t\t WHERE exp_channel_titles.channel_id = exp_channels.channel_id\n\t\t\t\t\t\t\t AND exp_channel_titles.entry_id IN ('\".$entries_string.\"')\");\n\n\t\t$valid = 'n';\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$valid = 'y';\n\t\t\t$last = explode('|', $query->row('cat_group') );\n\n\t\t\tforeach($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$valid_cats = array_intersect($last, explode('|', $row['cat_group']));\n\n\t\t\t\tif (count($valid_cats) == 0)\n\t\t\t\t{\n\t\t\t\t\t$valid = 'n';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($valid == 'n')\n\t\t{\n\t\t\treturn $this->dsp->show_user_error($this->lang->line('no_category_group_match'));\n\t\t}\n\n\t\t/** -----------------------------\n\t\t/**\t Remove Valid Cats, Then Add...\n\t\t/** -----------------------------*/\n\n\t\t$valid_cat_ids = array();\n\t\t$query = $this->db->query(\"SELECT cat_id FROM exp_categories\n\t\t\t\t\t\t\t WHERE group_id IN ('\".implode(\"','\", $valid_cats).\"')\n\t\t\t\t\t\t\t AND cat_id IN ('\".implode(\"','\", $this->api_channel_categories->cat_parents).\"')\");\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$this->db->query(\"DELETE FROM exp_category_posts WHERE cat_id = \".$row['cat_id'].\" AND entry_id IN ('\".$entries_string.\"')\");\n\t\t\t\t$valid_cat_ids[] = $row['cat_id'];\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->input->get_post('type') == 'add')\n\t\t{\n\t\t\t$insert_cats = array_intersect($this->api_channel_categories->cat_parents, $valid_cat_ids);\n\t\t\t// How brutish...\n\t\t\tforeach($ids as $id)\n\t\t\t{\n\t\t\t\tforeach($insert_cats as $val)\n\t\t\t\t{\n\t\t\t\t\t$this->db->query($this->db->insert_string('exp_category_posts', array('entry_id' => $id, 'cat_id' => $val)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t/** ---------------------------------\n\t\t/**\t Clear caches if needed\n\t\t/** ---------------------------------*/\n\n\t\tif ($this->config->item('new_posts_clear_caches') == 'y')\n\t\t{\n\t\t\t$this->functions->clear_caching('all');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->functions->clear_caching('sql');\n\t\t}\n\t\t\n\t\t$this->session->set_flashdata('message_success', $this->lang->line('multi_entries_updated'));\n\t\t$this->functions->redirect(BASE.AMP.'C=content_edit');\n\t}", "public function postCategoryMultiUpdate(){\n\t\t$selected_items_id = Input::get('id');\n\t\t$selected_item_color_id = Input::get('shift_category_color_id');\n\t\t$messages = new MessageBag();\n\t\t\n\t\tforeach($selected_items_id as $key => $value){\n\t\t\tif(isset($selected_item_color_id[$key])){\n\t\t\t\ttry{\n\t\t\t\t\t$category = ShiftCategory::find($value);\n\t\t\t\t\t$category->shift_category_color_id = $selected_item_color_id[$key];\n\t\t\t\t\t$this->shift->saveCategory($category);\n\t\t\t\t}catch(\\Exception $e){\n\t\t\t\t\t$messages->add('error', $e->getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tif($messages->count())\n\t\t\treturn Redirect::back()->withErrors($messages);\n\t\telse\n\t\t\treturn Redirect::to($this->_adminPrefix. '/shifts/category-list')->with('success', 'Selected categories updated successfully');\t\n\t}", "public function update_gallery_category_post()\n {\n prevent_author();\n\n //validate inputs\n $this->form_validation->set_rules('name', trans(\"category_name\"), 'required|xss_clean|max_length[200]');\n\n if ($this->form_validation->run() === false) {\n $this->session->set_flashdata('errors', validation_errors());\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n redirect($this->agent->referrer());\n } else {\n //category id\n $id = $this->input->post('category_id', true);\n if ($this->gallery_category_model->update_category($id)) {\n $this->session->set_flashdata('success', trans(\"category\") . \" \" . trans(\"msg_suc_updated\"));\n redirect('admin_category/gallery_categories');\n } else {\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n $this->session->set_flashdata('error', trans(\"msg_error\"));\n redirect($this->agent->referrer());\n }\n }\n }", "function wp_update_category($catarr)\n {\n }", "function fm_update_category($name, $catid = NULL, $groupid = 0) {\r\n\tglobal $USER;\r\n\t\r\n\tif ($catid != NULL) {\r\n\t\t$update->id = $catid;\r\n\t\t$update->name = $name;\r\n\t\t$update->timemodified = time();\r\n\t\tif (!update_record('fmanager_categories', $update)) {\r\n\t\t\terror(get_string(\"errnoupdate\",'block_file_manager'));\r\n\t\t}\r\n\t} else {\r\n\t\t$new->name = $name;\r\n\t\tif ($groupid == 0){\r\n\t\t\t$new->owner = $USER->id;\r\n\t\t\t$new->ownertype = OWNERISUSER;\r\n\t\t} else {\r\n\t\t\t$new->owner = $groupid;\r\n\t\t\t$new->ownertype = OWNERISGROUP;\r\n\t\t}\r\n\t\t$new->timemodified = time();\r\n\t\tif (!insert_record('fmanager_categories', $new)) {\r\n\t\t\terror(get_string(\"errnoinsert\",'block_file_manager'));\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "function update_categories(){\n\t\t\tprint_r($this->input->post());\n\t\t}", "public function update_assets_category() {\n\t\n\t\tif($this->input->post('edit_type')=='assets_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t\n\t\t$id = $this->uri->segment(4);\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->update_assets_category_record($data,$id);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_updated');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "function edit_category() {\r\n\r\n\tif(isset($_POST['editcategory'])){\r\n\r\n\t\t$cat_id\t\t\t\t= clean_input($_GET['cat_id']);\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\r\n\r\n\t\t$xyquery = \"UPDATE categories SET \";\r\n\t\t$xyquery .= \"cat_name = '$cat_name',\";\r\n\t\t$xyquery .= \"cat_desc_short = '$cat_desc_short'\";\r\n\t\t$xyquery .= \",cat_desc_long = '$cat_desc_long'\";\r\n\t\t$xyquery .= \",cat_parent_id = '$cat_parent_id'\";\r\n\t\t$xyquery .= \",cat_url = '$cat_url'\";\r\n\t\t$xyquery .= \",cat_mod = '$cat_mod'\";\r\n\t\t$xyquery .= \",cat_mod_by = '$cat_mod_by'\";\r\n\t\t$xyquery .= \",page_template = '$page_template'\";\r\n\t\t$xyquery .= \",cat_meta_title = '$cat_meta_title'\";\r\n\t\t$xyquery .= \",cat_meta_keywords = '$cat_meta_keywords'\";\r\n\t\t$xyquery .= \",cat_meta_description = '$cat_meta_description'\";\r\n\t\t$xyquery .= \",insert_keywords = '$insert_keywords'\";\t\t\t\t\r\n\t\t$xyquery .= \"WHERE cat_id = '$cat_id'\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" been edited!</h4></center>\";\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been modified.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "public function updateCate()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['upcategory'];\n\t\t\t$category_id = $_POST['upcategory_id'];\n\t\t\t$sql = \" update lib_book_species set category = '{$category}' where category in \n\t\t\t\t\t(select category from lib_category where category_id = {$category_id});\n\t\t\t\t\tupdate lib_category set category='\" . $category . \"' where category_id='\" . $category_id . \"';\n\t\t\t\t\t\";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Modify successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function executeAddCategoryUpdate(HTTPRequest $request)\n {\n $this->addCategory($request);\n $this->app->getHttpResponse()->redirect('/admin/updatePost-' . $request->postData('postId'));\n\n }", "public function testUpdateItemSubCategory()\n {\n }", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "public function update($product_category_id)\n\t{\n\t\t$master['status'] = True;\n $data = array();\n $master = array();\n $original_category_name=$this->db->from('tbl_product_category')->where('category_id',$product_category_id)->get()->result();\n $is_unique='';\n if($this->input->post('category')!=$original_category_name[0]->category)\n {\n \t$is_unique = '|is_unique[tbl_product_category.category]';\n }\n\n $this->form_validation->set_rules('category', 'Category', 'trim|required|max_length[64]'.$is_unique);\n $this->form_validation->set_rules('remarks', 'Remarks', 'trim|max_length[254]');\n $this->form_validation->set_error_delimiters('<p class=\"text-danger\">', '</p>');\n\t\tif ($this->form_validation->run() == True) \n\t\t{\n\t\t\t$this->product_category->update($product_category_id);\n\t\t\t$master['status'] = True;\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$master['status'] = false;\n foreach ($_POST as $key => $value) \n {\n if (form_error($key) != '') \n {\n $data['error_string'] = $key;\n $data['input_error'] = form_error($key);\n array_push($master, $data);\n }\n }\n\t\t}\n\t\techo(json_encode($master));\n\t}", "public function save_category_posts($entry_id, $meta, $data)\n {\n $categories = array();\n\n // Channel:Form/Safecracker\n if (isset($data['categories']))\n {\n $categories = $data['categories'];\n }\n // Normal Entry Save\n elseif (isset($data['revision_post']['category']))\n {\n $categories = $data['revision_post']['category'];\n }\n\n $publisher_save_status = ee()->input->post('publisher_save_status');\n\n // Insert new categories.\n $this->_save_category_posts($entry_id, $publisher_save_status, $categories);\n\n // If option is enabled, and saving as open, delete drafts and save new draft rows too.\n if(\n $publisher_save_status == PUBLISHER_STATUS_OPEN &&\n ee()->publisher_setting->sync_drafts()\n ){\n $this->_save_category_posts($entry_id, 'draft', $categories);\n }\n\n // Get open records, and re-insert them into category_posts, otherwise\n // we get draft category assignments added to the core table.\n if(\n $publisher_save_status == PUBLISHER_STATUS_DRAFT &&\n ($categories = $this->get_category_posts($entry_id, PUBLISHER_STATUS_OPEN))\n ){\n // First delete all category assignments for this entry.\n ee()->db->where('entry_id', $entry_id)\n ->delete('category_posts');\n\n foreach ($categories as $category)\n {\n $data = array(\n 'cat_id' => $category,\n 'entry_id' => $entry_id\n );\n\n $qry = ee()->db->where($data)->get('category_posts');\n\n if ($qry->num_rows() == 0)\n {\n ee()->db->insert('category_posts', $data);\n }\n }\n }\n }", "public function update($postArray)\n {\n $params = BaseMtc_membership_category::getParams();\n return $this->updateRow($postArray, $params);\n }", "public function category_update(){ \n\n\n if (!has_role($this->session->userdata('user_id'), 'CATEGORY_UPDATE')) {\n redirect(base_url('page_not_found'));\n }\n\n $data['parent'] = $this->input->post('parent');\n $data['last_modified'] = date(\"Y-m-d H:i:s\");\n $data['name'] = $this->input->post('name');\n \n if(!$this->category_model->is_parent_category($data['parent'])){\n\n $this->session->set_flashdata('category_save_failed', \"Failed to update sub category!!\");\n }else{\n\n \n $category_id = $this->input->post('cat_id');\n\n\n\n\n if($this->category_model->update_category($category_id, $data)){\n\n $this->logger\n ->user($this->session->userdata('user_id')) //Set UserID, who created this Action\n ->user_details($this->user_model->getUserInfoByIpAddress())\n ->type('category_update') //Entry type like, Post, Page, Entry\n ->id($category_id) //Entry ID\n ->token('UPDATE') //Token identify Action\n ->comment($this->session->userdata('name'). ' update a category.')\n ->log(); //Add Database Entry\n\n $this->session->set_flashdata('category_save_success', \"Category information Updated Successfully!!\");\n } else {\n $this->session->set_flashdata('category_save_failed', \"Category update fialied!!\");\n }\n }\n redirect(base_url('categories'));\n }", "public function updatecategory($args)\n {\n if (!SecurityUtil::checkPermission('Dizkus::', \"::\", ACCESS_ADMIN)) {\n return LogUtil::registerPermissionError();\n }\n \n // copy all entries from $args to $obj that are found in the categories table\n // this prevents possible SQL errors if non existing keys are passed to this function\n $ztables = DBUtil::getTables();\n $obj = array();\n foreach ($args as $key => $arg) {\n if (array_key_exists($key, $ztables['dizkus_categories_column'])) {\n $obj[$key] = $arg;\n }\n }\n \n if (isset($obj['cat_id'])) {\n $obj = DBUtil::updateObject($obj, 'dizkus_categories', null, 'cat_id');\n return true;\n }\n \n return false;\n }", "function bvt_sfa_feed_admin_screen() {\n\n // TODO: Break this function down into smaller bits?\n\n global $wpdb;\n\n $submit_flag = \"bvt_sfa_feed_admin_form\";\n\n $categories = bvt_sfa_feed_admin_get_categories();\n\n if (isset($_POST[$submit_flag]) && $_POST[$submit_flag] == 'Y') {\n\n $errors = false;\n\n // Postback; save feed settings...\n\n foreach ($categories as $category) {\n\n if ($_POST['bvt_sfa_catfeed'][$category->cat_ID]) {\n\n // ...only for categories actually submitted\n\n $new_values = $_POST['bvt_sfa_catfeed'][$category->cat_ID];\n\n $sql = $wpdb->prepare(\"\n INSERT INTO \" . BVT_SFA_DB_FEED_TABLE . \" (\n category_id,\n feed_url,\n postrank_url,\n cache_time\n )\n VALUES (\n %d,\n %s,\n %s,\n %d\n )\n ON DUPLICATE KEY UPDATE\n feed_url = %s,\n postrank_url = %s,\n cache_time = %d\",\n $category->cat_ID,\n $new_values['feed_url'],\n $new_values['postrank_url'],\n $new_values['cache_time'],\n $new_values['feed_url'],\n $new_values['postrank_url'],\n $new_values['cache_time']\n );\n }\n\n if ($wpdb->query($sql) === FALSE) {\n\n echo '\n <div class=\"error\">\n <p>\n <strong>Error saving settings!</strong>\n It was not possible to save feed settings for feed ID\n ' . htmlspecialchars($category->cat_ID) . '. Error: ';\n $wpdb->print_error();\n echo '</p></div>';\n\n $errors = true;\n }\n }\n\n // Save static content\n\n update_option(\n \"BVT_SFA_FEED_INTRO_HEADING\",\n $_POST[\"bvt_sfa_feed_intro_heading\"]\n );\n\n update_option(\n \"BVT_SFA_FEED_INTRO_BODY\",\n $_POST[\"bvt_sfa_feed_intro_body\"]\n );\n\n update_option(\n \"BVT_SFA_FEED_INTRO_BODY_HOMEPAGE\",\n $_POST[\"bvt_sfa_feed_intro_body_homepage\"]\n );\n\n // Save advanced settings\n\n update_option(\n \"BVT_SFA_TOPICS_CATEGORY_ID\",\n $_POST[\"bvt_sfa_topics_category_id\"]\n );\n\n update_option(\n \"BVT_SFA_METRICS_ITEMS\",\n str_replace(\" \", \"\", strtolower($_POST[\"bvt_sfa_metrics_items\"]))\n // remove spaces, set to lowercase\n );\n\n if (!$errors) {\n echo '<div class=\"updated\"><p><strong>Success.</strong>\n New settings saved.</p></div>';\n }\n\n // Re-get categories, since the parent category might have changed\n\n $categories = bvt_sfa_feed_admin_get_categories();\n }\n\n // Read config from DB\n\n foreach ($categories as $category) {\n\n $sql = $wpdb->prepare(\"\n SELECT\n category_id,\n feed_url,\n postrank_url,\n last_update,\n cache_time\n FROM\n \" . BVT_SFA_DB_FEED_TABLE . \"\n WHERE\n category_id = %d\",\n $category->cat_ID\n );\n\n // Merge config with list of categories\n\n if ($result = $wpdb->get_row($sql)) {\n\n $category->feed_url = $result->feed_url;\n $category->postrank_url = $result->postrank_url;\n $category->cache_time = $result->cache_time;\n $category->last_update =\n ($result->last_update == \"0000-00-00 00:00:00\") ?\n \"Never\" :\n $result->last_update;\n }\n else {\n\n $category->feed_url = \"\";\n $category->postrank_url = \"\";\n $category->cache_time = BVT_SFA_FEED_CACHE_TIME;\n $category->last_update = \"Never\";\n }\n }\n\n // Output form\n\n ?>\n\n <div class=\"wrap\">\n <form method=\"post\" action=\"\">\n\n <input type=\"hidden\" name=\"<?php echo $submit_flag; ?>\" value=\"Y\" />\n\n <h2>PostRank Feed Seetings</h2>\n\n <h3>Subject feeds</h3>\n\n <table class=\"widefat\">\n <thead>\n <tr>\n <th>Subject title</th>\n <th>Feed URL</th>\n <th>PostRank URL</th>\n <th>Cache time (seconds)</th>\n <th>Last updated</th>\n </tr>\n </thead>\n\n <tbody>\n\n <?php foreach ($categories as $category) { ?>\n\n <tr>\n\n <td><?php echo htmlspecialchars($category->name) ?></td>\n <td>\n <input\n type=\"text\"\n style=\"width: 100%;\"\n value=\"<?php echo htmlspecialchars($category->feed_url) ?>\"\n name=\"bvt_sfa_catfeed[<?php echo $category->cat_ID ?>][feed_url]\"\n id=\"bvt_sfa_catfeed[<?php echo $category->cat_ID ?>][feed_url]\" />\n </td>\n <td>\n <input\n type=\"text\"\n style=\"width: 100%;\"\n value=\"<?php echo htmlspecialchars($category->postrank_url) ?>\"\n name=\"bvt_sfa_catfeed[<?php echo $category->cat_ID ?>][postrank_url]\"\n id=\"bvt_sfa_catfeed[<?php echo $category->cat_ID ?>][postrank_url]\" />\n </td>\n <td>\n <input\n type=\"text\"\n value=\"<?php echo htmlspecialchars($category->cache_time) ?>\"\n name=\"bvt_sfa_catfeed[<?php echo $category->cat_ID ?>][cache_time]\"\n id=\"bvt_sfa_catfeed[<?php echo $category->cat_ID ?>][cache_time]\" />\n </td>\n <td>\n <?php echo htmlspecialchars($category->last_update) ?>\n </td>\n\n </tr>\n\n <?php } ?>\n\n </tbody>\n </table>\n\n\n <h3>Static content</h3>\n\n <p>Please note that HTML is not allowed in these fields.</p>\n\n <table class=\"form-table\">\n <tbody>\n <tr>\n <th scope=\"row\">\n <label for=\"bvt_sfa_feed_intro_heading\">Intro heading</label>\n </th>\n <td>\n <input\n style=\"width: 47.5%;\"\n type=\"text\"\n value=\"<?php echo htmlspecialchars(get_option(\"BVT_SFA_FEED_INTRO_HEADING\")); ?>\"\n name=\"bvt_sfa_feed_intro_heading\"\n id=\"bvt_sfa_feed_intro_heading\" />\n </td>\n </tr>\n <tr>\n <th scope=\"row\">\n <label for=\"bvt_sfa_feed_intro_body_homepage\">\n Intro text (home page)\n </label>\n </th>\n <td>\n <textarea\n style=\"width: 95%; height: 7em;\"\n name=\"bvt_sfa_feed_intro_body_homepage\"\n id=\"bvt_sfa_feed_intro_body_homepage\"><?php\n echo htmlspecialchars(get_option(\"BVT_SFA_FEED_INTRO_BODY_HOMEPAGE\"));\n ?></textarea>\n </td>\n </tr>\n <tr>\n <th scope=\"row\">\n <label for=\"bvt_sfa_feed_intro_body\">\n Intro text (category pages)\n </label>\n <p><em>Note</em>: The text \"<strong>[category]</strong>\" will be\n replaced with the current category name.</p>\n </th>\n <td>\n <textarea\n style=\"width: 95%; height: 7em;\"\n name=\"bvt_sfa_feed_intro_body\"\n id=\"bvt_sfa_feed_intro_body\"><?php\n echo htmlspecialchars(get_option(\"BVT_SFA_FEED_INTRO_BODY\"));\n ?></textarea>\n </td>\n </tr>\n </tbody>\n </table>\n\n <h3>Advanced settings</h3>\n\n <table class=\"form-table\">\n <tbody>\n <tr>\n <th scope=\"row\">\n <label for=\"bvt_sfa_topics_category_id\">\n Parent category for subjects\n </label>\n </th>\n <td>\n <?php\n wp_dropdown_categories(array(\n \"exclude\" => 1, /* 1 is \"Uncategorized\" */\n \"hide_empty\" => false,\n \"hierarchical\" => 1,\n \"name\" => \"bvt_sfa_topics_category_id\",\n \"selected\" => get_option('bvt_sfa_topics_category_id')\n ));\n ?>\n </td>\n </tr>\n <tr>\n <th scope=\"row\">\n <label for=\"bvt_sfa_metrics_items\">\n PostRank metrics to display\n </label>\n </th>\n <td>\n <input\n style=\"width: 47.5%;\"\n type=\"text\"\n value=\"<?php echo htmlspecialchars(get_option(\"BVT_SFA_METRICS_ITEMS\")); ?>\"\n name=\"bvt_sfa_metrics_items\"\n id=\"bvt_sfa_metrics_items\" />\n <p>Comma-separated list of data IDs. Available IDs include:\n delicious, brightkite, reddit_comments, reddit_votes, views,\n identica, google, diigo, clicks, blip, digg, bookmarks,\n twitter, jaiku, tumblr, ff_likes, ff_comments, comments. These are\n <a href=\"http://www.postrank.com/postrank#sources\">described by\n PostRank</a>.</p>\n </td>\n </tr>\n </tbody>\n </table>\n\n <p class=\"submit\">\n <input type=\"submit\" class=\"button-primary\" value=\"<?php _e('Save Changes') ?>\" />\n </p>\n\n </form>\n </div>\n\n <?php\n}", "function pnAddressBook_admin_updatecategories() {\r\n\r\n\t$output = new pnHTML();\r\n\r\n // Security check\r\n if (!pnSecAuthAction(0, 'pnAddressBook::', '::', ACCESS_ADMIN)) {\r\n $output->Text(pnVarPrepHTMLDisplay(_PNADDRESSBOOK_NOAUTH));\r\n $output->Text(pnAddressBook_themetable('end'));\r\n\t\treturn $output->GetOutput();\r\n }\r\n\r\n\tlist($id,$del,$name,$newname) = pnVarCleanFromInput('id','del','name','newname');\r\n\tif(is_array($del)) {\r\n $dels = implode(',',$del);\r\n }\r\n\r\n\t$modID = $modName = array();\r\n\r\n\tif(isset($id)) {\r\n\t\tforeach($id as $k=>$i) {\r\n \t$found = false;\r\n \tif(count($del)) {\r\n \tforeach($del as $d) {\r\n \tif($i == $d) {\r\n \t$found = true;\r\n \tbreak;\r\n \t}\r\n \t}\r\n \t}\r\n \tif(!$found) {\r\n \tarray_push($modID,$i);\r\n \tarray_push($modName,$name[$k]);\r\n }\r\n \t}\r\n\t}\r\n\r\n\t$pntable = pnDBGetTables();\r\n\t$cat_table = $pntable[pnaddressbook_categories];\r\n\t$cat_column = $pntable['pnaddressbook_categories_column'];\r\n\r\n\t$updates = array();\r\n foreach($modID as $k=>$id) {\r\n array_push($updates,\"UPDATE $cat_table\r\n SET $cat_column[name]='\".pnVarPrepForStore($modName[$k]).\"'\r\n WHERE $cat_column[nr]=$id\");\r\n\t}\r\n\r\n\t$error = '';\r\n\r\n\tif(pnModAPIFunc(__PNADDRESSBOOK__,'admin','updateCategories',array('updates'=>$updates))) {\r\n \tif (empty($error)) { $error .= 'UPDATE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\telse { $error .= ' - UPDATE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t}\r\n\r\n\t$delete = \"DELETE FROM $cat_table WHERE $cat_column[nr] IN ($dels)\";\r\n\tif(isset($dels)) {\r\n if(pnModAPIFunc(__PNADDRESSBOOK__,'admin','deleteCategories',array('delete'=>$delete))) {\r\n if (empty($error)) { $error .= 'DELETE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t\telse { $error .= ' - DELETE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n }\r\n }\r\n\r\n\tif( (isset($newname)) && ($newname != '') ) {\r\n if(pnModAPIFunc(__PNADDRESSBOOK__,'admin','addCategories',array('name'=>$newname))) {\r\n if (empty($error)) { $error .= 'INSERT '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t\telse { $error .= ' - INSERT '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t}\r\n }\r\n\r\n\t$args=array('msg'=>$error);\r\n\r\n\tpnRedirect(pnModURL(__PNADDRESSBOOK__, 'admin', 'categories',$args));\r\n\treturn true;\r\n}", "function submit(){\n\t$parent_category = $this->uri->segment(4);\n\tif (!is_numeric($parent_category)){\n\t\t$parent_category = 0;\n\t}\n\n\t$this->form_validation->set_rules('category_name', 'Category Name', 'required');\n\n\tif ($this->form_validation->run() == FALSE){\n\t\t$this->create();\n\t} else {\n\n\t\t$update_id = $this->uri->segment(3);\n\n\t\tif ($update_id > 0){\n\t\t\t//This is an update\n\t\t\t$data = $this->get_data_from_post();\n\t\t\t$data['category_url'] = url_title($data['category_name']);\n\t\t\t$this->update($update_id, $data);\n\t\t\t$value = \"<p style = 'color: green;'>The category was successfully updated.</p>\";\n\t\t\t$parent_category = $update_id;\n\t\t} else {\n\t\t\t//Create new record\n\t\t\t$data = $this->get_data_from_post();\n\t\t\t$data['category_url'] = url_title($data['category_name']);\n\t\t\t$data['parent_category'] = $parent_category;\n\t\t\t$this->insert($data);\n\t\t\t$value = \"<p style = 'color: green;'>The category was successfully created.</p>\";\n\t\t\t$update_id = $this->get_max();\n\n\t\t\t$this->session->set_flashdata('category', $value);\n\t\t\t\n\t\t}\n\t\t//add flashdata\n\t\t$this->session->set_flashdata('category', $value);\t\n\n\t\tredirect ('store_categories/manage/'.$parent_category);\n\t\t\n\t}\n}", "public function updateCategory()\n {\n Category::findOrFail($this->category_id)->update([\n 'category_name' => $this->categoryName,\n 'slug' => Str::slug($this->categoryName),\n 'class' => $this->class,\n\n ]);\n }", "function modifyCategory()\n{\n global $connection;\n global $updateCategorySuccess, $updateCategoryError;\n $updateCategorySuccess = $updateCategoryError = '';\n\n if (isset($_POST['btn_save_category'])) {\n $category_id = $_POST['txt_userid'];\n\n $updateColumncategory = '';\n\n $category_name = htmlentities($_POST['category_name']);\n if (!empty($category_name)) {\n $updateColumncategory .= \"category = '$category_name',\";\n }\n\n $updateColumncategory = rtrim($updateColumncategory, ',');\n\n $query_update = \"UPDATE product_category SET $updateColumncategory WHERE id_category = '$category_id'\";\n $result_update = mysqli_query($connection, $query_update);\n\n if ($result_update) {\n $updateCategorySuccess = '<script language=\"javascript\">\n swal(\"Sukses!\", \"Kategoria u modifikua me sukses!\", \"success\")\n </script>';\n } else {\n $updateCategoryError = '<script language=\"javascript\">\n swal(\"Gabim!\", \"Ka ndodhur një gabim gjatë modifikimit të kategorisë! Provoni përsëri!\", \"error\")\n </script>';\n }\n }\n}", "function multi_categories_edit($type, $query)\n {\n\t\tif ( ! $this->cp->allowed_group('can_access_content'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n \n \tif ($query->num_rows() == 0)\n {\n show_error($this->lang->line('unauthorized_to_edit'));\n }\n\n\t\t$this->load->helper('form');\n \n\t\t/** -----------------------------\n\t\t/** Fetch the cat_group\n\t\t/** -----------------------------*/\n\t\t\n\t\t/* Available from $query:\tentry_id, channel_id, author_id, title, url_title, \n\t\t\t\t\t\t\t\t\tentry_date, dst_enabled, status, allow_comments, \n\t\t\t\t\t\t\t\t\tsticky\n\t\t*/\n\n\t\t$sql = \"SELECT DISTINCT cat_group FROM exp_channels WHERE channel_id IN(\";\n\t\t\n\t\t$channel_ids = array();\n\t\t$entry_ids = array();\n\t\t\n\t\tforeach ($query->result_array() as $row)\n\t\t{\n\t\t\t$channel_ids[] = $row['channel_id'];\n\t\t\t$entry_ids[] = $row['entry_id'];\n\t\t\t\n\t\t\t$sql .= $row['channel_id'].',';\n\t\t}\n\t\t\n\t\t$group_query = $this->db->query(substr($sql, 0, -1).')');\n\t\t\n\t\t$valid = 'n';\n\t\t\n\t\tif ($group_query->num_rows() > 0)\n\t\t{\n\t\t\t$valid = 'y';\n\t\t\t$last = explode('|', $group_query->row('cat_group'));\n\t\t\t\n\t\t\tforeach($group_query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$valid_cats = array_intersect($last, explode('|', $row['cat_group']));\n\t\t\t\t\n\t\t\t\tif (count($valid_cats) == 0)\n\t\t\t\t{\n\t\t\t\t\t$valid = 'n';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($valid == 'n')\n\t\t{\n\t\t\tshow_error($this->lang->line('no_category_group_match'));\n\t\t}\n\t\t\n\t\t$this->api->instantiate('channel_categories');\n\t\t$this->api_channel_categories->category_tree(($cat_group = implode('|', $valid_cats)));\n\t\t//print_r($this->api_channel_categories->categories);\n\t\t$vars['cats'] = array();\n\t\t$vars['message'] = '';\n\t\t\n\t\tif (count($this->api_channel_categories->categories) == 0)\n\t\t{ \n\t\t\t$vars['message'] = $this->lang->line('no_categories');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// @confirm this is how we want to handle passing it to the view\n\t\t\t//$vars['cats'] = $this->api_channel_categories->categories;\n\t\t\t\n\t\t\tforeach ($this->api_channel_categories->categories as $val)\n\t\t\t{\n\t\t\t\t\t$vars['cats'][$val['3']][] = $val;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$vars['edit_categories_link'] = FALSE; //start off as false, meaning user does not have privs\n\n\t\t\n\t\t$link_info = $this->api_channel_categories->fetch_allowed_category_groups($cat_group);\n\t\t\n\t\t// @todo- this kinda sucks, but I'm going to output the whole string for now\n\t\t\n\t\t$links = FALSE;\n\t\tif ($link_info !== FALSE)\n\t\t{\n\t\t\t// @todo needs reworking. If you include the z it throws an error because that triggers an include of cp.publish.\n\t\t\t// Without the z the permissions may not be working as per 1.6. \n\n\t\t\tforeach ($link_info as $val)\n\t\t\t{\n\t\t\t\t$links[] = array('url' => BASE.AMP.'C=admin_content'.AMP.'M=category_editor'.AMP.'group_id='.$val['group_id'],\n\t\t\t\t\t'group_name' => $val['group_name']); \t\n\t\t\t}\n\t\t}\n\n\t\t$vars['edit_categories_link'] = $links;\n\n\t\t$this->cp->set_breadcrumb(BASE.AMP.'C=content_edit', $this->lang->line('edit'));\n\n\t\t$vars['form_hidden'] = array();\n\t\t$vars['form_hidden']['entry_ids'] = implode('|', $entry_ids);\n\t\t$vars['form_hidden']['type'] = $type;\n\n\t\t$vars['type'] = $type;\n\t\n\t\t$this->cp->set_variable('cp_page_title', $this->lang->line('multi_entry_category_editor'));\n\n\t\t$this->javascript->compile();\n\t\t$this->load->view('content/multi_cat_edit', $vars);\n\t}", "function edit_category($tbl_name){\n\t\t//print_r($_POST); die;\n\t\tunset($_POST['submitLog']);\n\t\t$this->db->where('id', $_POST['id']);\n\t\tunset($_POST['id']);\n\t\t$this->db->update($tbl_name,$_POST);\n\t\t// print_r($this->db->last_query());\n\t // die();\n\t}", "function pre_contact_update($post_id, $data) {\n\n // Check if user has permissions to save data.\n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return;\n }\n\n // Check if not an autosave.\n if ( wp_is_post_autosave( $post_id ) ) {\n return;\n }\n\n // Check if not a revision.\n if ( wp_is_post_revision( $post_id ) ) {\n return;\n }\n\n if (!empty($_POST) && $data['post_type'] == 'contact') {\n // get category info first because we can cut processing short if there are no categories to deal with\n $old_cats = wp_get_post_categories($post_id);\n $cats = !empty($_POST['post_category']) ? array_filter($_POST['post_category']) : array();\n if (empty($old_cats) && empty($cats)) return;\n\n // get the rest of the old contact data\n $old_name = get_the_title($post_id);\n $old_email = get_post_meta($post_id, 'email', true);\n\n // and the new\n $email = $first_name = $last_name = '';\n foreach ($_POST['fields'] as $name => $value) {\n $field = get_field_object($name);\n switch ($field['name']) {\n case 'email':\n $email = sanitize_text_field($value);\n break;\n case 'first_name':\n $first_name = sanitize_text_field($value);\n break;\n case 'last_name':\n $last_name = sanitize_text_field($value);\n break;\n }\n }\n $name = get_full_name($first_name, $last_name);\n\n // get the categories to add and delete\n $to_add = array_diff($cats, $old_cats);\n $to_delete = array_diff($old_cats, $cats);\n\n // if categories weren't changed by email or name were changed, we still want to update the lists\n $updated_email = !empty($old_email) && $old_email != $email; // !empty($old_email) tells us if this is a new post or an edit\n $updated_name = !empty($old_email) && $old_name != $name; // !empty($old_email) tells us if this is a new post or an edit\n if (empty($to_add) && !empty($cats) && ($updated_email || $updated_name)) {\n $to_add = $cats;\n }\n\n if (!empty($to_add)) {\n // add this contact to each list\n foreach ($to_add as $cat_id) {\n // if email was changed, we need to remove the old email\n if ($updated_email) {\n delete_contact_from_list($cat_id, $old_email);\n }\n add_contact_to_list($cat_id, $email, $name);\n }\n }\n if (!empty($to_delete)) {\n // remove this contact from each list\n foreach ($to_delete as $cat_id) {\n delete_contact_from_list($cat_id, $old_email);\n }\n }\n }\n}", "protected function _postUpdate()\n\t{\n\t}", "function process_edit_category($parent_id, $title, $alias, $description, $date_add, $date_modify, $enabled, $id){\n\t\t $sql = \" Update category SET\n\t\t\t\t\t `parent_id` = ?, \n\t\t\t\t\t `title` = ?, \n\t\t\t\t\t `alias` = ?, \n\t\t\t\t\t `description` = ?, \n\t\t\t\t\t `date_add` = ?, \n\t\t\t\t\t `date_modify` = ?, \n\t\t\t\t\t `enabled` = ?\n\t\t\t\t WHERE cat_id = ?\";\n\t\t if($this->dbObj->SqlQueryInputResult($sql, array($parent_id, $this->dbObj->fix_quotes_dquotes($title), $alias, $description, $date_add, $date_modify, $enabled, $id)) <> FALSE){\n\t\t\t return true;\n\t\t }\n\t }", "function wlms_book_categories_save()\n{\n global $wpdb;\n $name = \"\";\n \n $name = trim( $_POST['wlms_book_categories_name'] );\n $errors = array();\n\n if (strlen($name) == 0)\n {\n array_push( $errors, \"book_cat\" );\n }\n\n\n if( count($errors) == 0 )\n {\n $nonce = $_REQUEST['_wpnonce'];\n if ( ! wp_verify_nonce( $nonce, 'submit_books_categories' ) ) \n {\n exit; \n }\n\n // books categories save\n $id = 0;\n if(isset ($_POST['wlms_save_book_categories']))\n {\n $wpdb->query( $wpdb->prepare( \n \"\n INSERT INTO {$wpdb->prefix}wlms_book_categories\n ( name, status )\n VALUES ( %s, %d )\n \", \n array(\n $_POST['wlms_book_categories_name'], \n $_POST['wlms_book_cat_status']\n ) \n ) );\n \n $id = $wpdb->insert_id;\n set_message_key('item_saved', 'saved');\n }\n \n \n //update books categories\n if(isset ($_POST['wlms_update_book_categories']))\n {\n $request_id = 0;\n if ( is_numeric( $_GET['update_id'] ) ) {\n $request_id = absint( $_GET['update_id'] );\n $id = $request_id;\n }\n \n $wpdb->query(\n $wpdb->prepare(\n \"UPDATE {$wpdb->prefix}wlms_book_categories SET name = %s, status = %d WHERE id= %d\",\n $_POST['wlms_book_categories_name'], $_POST['wlms_book_cat_status'], $request_id\n )\n );\n \n set_message_key('item_updated', 'updated');\n }\n \n \n wp_redirect( esc_url_raw( add_query_arg( array( 'update_id' => $id ), admin_url( 'admin.php?page=wlms-pages&wlms-tab=wlms-book-categories&manage=add-book-categories' ) ) ) ); exit;\n }\n \n}", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "public function updatePost() {\n // strip_tags to secure input fields from inserting harmful code to database.\n \n $id = $_POST[\"single_post_id_update\"];\n $image = $_FILES[\"image\"];\n $title = strip_tags($_POST[\"title\"]);\n $content = strip_tags($_POST[\"content\"]);\n $id_category = $_POST[\"category_list\"];\n foreach($id_category as $key => $value) {\n $id_category = $value;\n\n }\n\n // If no image has been selected, choose the existing one to upload.\n if (empty($image[\"tmp_name\"])) {\n $new_location = $_POST[\"existing_image\"];\n $update_post = true;\n \n // Else upload new image.\n } else {\n $temporary_location = $image[\"tmp_name\"];\n $new_location = \"../images/uploads/\" . $image[\"name\"];\n $update_post = move_uploaded_file($temporary_location, $new_location);\n }\n\n \n // Insert variables to correct rows in table.\n if($update_post) {\n // Define the value of the array. Point out the exact number to insert to database.\n $update_post_statement = $this->pdo->prepare(\n \"UPDATE posts\n SET title = :title, content = :content, image = :image, id_category = :id_category\n WHERE id = :id\");\n\n $update_post_statement->execute(\n [\n \":title\" => $title,\n \":content\" => $content,\n \"id\" => $id,\n \":image\" => $new_location,\n \":id_category\" => $id_category\n ]\n );\n\n $update_post = $update_post_statement;\n return $update_post;\n }\n }" ]
[ "0.8170923", "0.6424623", "0.6291664", "0.62079436", "0.61742085", "0.6161012", "0.6133668", "0.61207837", "0.60949314", "0.6066736", "0.605513", "0.6037569", "0.5997986", "0.59850764", "0.5982726", "0.5980113", "0.5979108", "0.59551746", "0.5931074", "0.5929418", "0.589933", "0.587068", "0.58281106", "0.5819787", "0.57966655", "0.5788094", "0.57847106", "0.575252", "0.5748429", "0.57286704" ]
0.7950188
1
Grab specific category group, and optionally return only the group ID
public function get_group($group_id = FALSE, $return_id = FALSE) { // If no category group was specified, get the first one found. // This is used in the CP Category management landing page. if (is_numeric($group_id)) { $qry = ee()->db->where('group_id', $group_id) ->get('category_groups'); } else { $qry = ee()->db->limit(1)->get('category_groups'); } return $qry->num_rows() ? ($return_id ? $qry->row('group_id') : $qry->row()) : FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_category_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'));\n\t\t\n\t\t// start hook\n\t\t$vars = $this->_hook('get_category_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_category_group($vars['group_id'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_category_group_end', $data);\n\n\t\t$this->response($data);\n\t}", "public function get_group_category( $group_category = '', $list_id = '' ) {\n $groups = $this->get_group_categories( $list_id );\n if ( empty( $groups ) || empty( $group_category ) ) {\n return false;\n }\n foreach ( $groups as $group ) {\n if ( $group_category == $group->id || $group_category == $group->title ) {\n return $group;\n }\n }\n return false;\n }", "public function get_group( $group_id = '', $group_category = '', $list_id = '' ) {\n $groups = $this->get_groups( $group_category, $list_id );\n foreach ( $groups as $group ) {\n if ( $group->id == $group_id ) {\n return $group;\n }\n if ( $group->name == $group_id ) {\n return $group;\n }\n }\n return false;\n }", "function get_categories_by_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'));\n\n\t\t// start hook\n\t\t$vars = $this->_hook('get_categories_by_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_category_by_group($vars['group_id'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_categories_by_group_end', $data);\n\n\t\t$this->response($data);\n\t}", "function get_group_by_id($group_id) {\n $sql = \"SELECT a.*, portal_nm \n FROM com_group a \n INNER JOIN com_portal b ON a.portal_id = b.portal_id\n WHERE group_id = ?\";\n $query = $this->db->query($sql, $group_id);\n if ($query->num_rows() > 0) {\n $result = $query->row_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }", "function get_member_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'), array(\n\t\t\t'select' => array()\n\t\t));\n\t\t\n\t\t// prepare variables for sql\n\t\t$vars = $this->_prepare_sql($vars);\n\n\t\t// start hook\n\t\t$vars = $this->_hook('get_member_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_member_group($vars['group_id'], $vars['select'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_member_group_end', $data);\n\n\t\t$this->response($data);\n\t}", "function get_group( $id ) {\r\n global $wpdb;\r\n return $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$wpdb->prefix}wpc_client_groups WHERE group_id = %d\", $id ), \"ARRAY_A\");\r\n }", "function MyMod_Data_Group_Def_Get($group,$single=FALSE,$echo=True)\n {\n if ($this->MyMod_Data_Group_Singular($single))\n {\n if (!empty($this->ItemDataSGroups[ $group ]))\n {\n return $this->ItemDataSGroups[ $group ];\n }\n }\n else\n {\n if (!empty($this->ItemDataGroups[ $group ]))\n {\n return $this->ItemDataGroups[ $group ];\n }\n }\n\n if ($echo)\n {\n echo $this->ModuleName.\" Warning: Group $group undefined\";\n $this->AddMsg(\"Warning: Group $group undefined\");\n exit();\n }\n\n return array();\n }", "public function get_campaigns_by_group( $group = '', $group_category = '', $args = [] ) {\n $campaigns = [];\n $group = $this->get_group( $group, $group_category );\n if ( ! $group || ! isset( $group->id ) ) {\n return $campaigns;\n }\n $all_campaigns = $this->get_campaigns( $args );\n foreach ( $all_campaigns as $campaign ) {\n $in_group = false;\n $conditions = $campaign->recipients->segment_opts->conditions;\n foreach ( $conditions as $condition ) {\n if ( is_array( $condition->value ) && in_array( $group->id, $condition->value ) ) {\n $in_group = true;\n }\n }\n if ( $in_group ) {\n // Remove the _link element\n if ( isset( $campaign->{'_links'} ) ) {\n unset( $campaign->{'_links'} );\n }\n $campaigns[] = $campaign;\n }\n }\n return $campaigns;\n }", "private function _get_group_detail($tag_group_id){\n $param['tag_group_id'] = $tag_group_id;\n $param['delete_flg'] = $this->config->item('not_deleted','common_config');\n $record = $this->Logic_tag->get_group_detail($param);\n if(!empty($record[0])){\n return $record[0];\n }else{\n return false;\n }\n }", "public function getById($group_id)\n {\n return $this->getQuery()->eq('id', $group_id)->findOne();\n }", "public function group($group)\n {\n if (is_numeric($group)) {\n return $this->groupModel->find((int) $group);\n }\n\n return $this->groupModel->where('name', $group)->first();\n }", "function getGroup() {\n\n\tglobal $db;\n\treturn $db->getGroup ( $GLOBALS [\"targetId\"] );\n\n}", "public function get_by_group($formatted = FALSE)\n {\n $groups = $this->get_groups();\n $categories = $this->get_all();\n $grouped = array();\n\n foreach ($groups as $group_id => $group)\n {\n $grouped[$group_id] = array(\n 'value' => $group_id,\n 'label' => $group->group_name\n );\n\n foreach ($categories as $index => $category)\n {\n if ($category->group_id == $group_id)\n {\n $grouped[$group_id]['categories'][] = array(\n 'value' => $category->cat_id,\n 'label' => $category->cat_name\n );\n }\n }\n }\n\n if ( !$formatted)\n {\n return $grouped;\n }\n\n // Leave a blank option other wise the on change event won't work\n $out = '<option value=\"\"></option>';\n\n foreach ($grouped as $group_index => $group)\n {\n $out .= '<optgroup label=\"'. $group['label'] .'\">';\n\n if ( !isset($group['categories'])) continue;\n\n foreach ($group['categories'] as $category_index => $category)\n {\n $url = ee()->publisher_helper_cp->mod_link('categories', array('group_id' => $group['value'] .'#category-'. $category['value']));\n\n $out .= '<option value=\"'. $url .'\">'. $category['label'] .'</option>';\n }\n\n $out .= '</optgroup>';\n }\n\n return $out;\n }", "function find_group($db, $group_id)\n{\n $records = exec_sql_query(\n $db,\n \"SELECT * FROM groups WHERE id = :group_id;\",\n array(':group_id' => $group_id)\n )->fetchAll();\n if ($records) {\n // groups are unique, there should only be 1 record\n return $records[0];\n }\n return NULL;\n}", "public function getGroup()\n {\n //Note: group parts are not \"named\" so it's all or nothing\n return $this->_get('_group');\n }", "function get_group($id)\n\t{\n\t\treturn get_instance()->kbcore->groups->get($id);\n\t}", "public static function get($group);", "public function getGroup();", "public function getGroup();", "public function getGroup();", "public function getGroup()\n {\n $this->getParam('group');\n }", "public function group($group);", "function acf_get_field_group($id = 0)\n{\n}", "public function findOneByIdJoinedCategoryGroup($categoryGroupId)\n {\n $query = $this->getEntityManager()\n ->createQuery(\n 'SELECT c, cg FROM category c \n JOIN c.categoryGroup cg\n WHERE c.id= :id'\n )\n ->setParameter('id', $categoryGroupId);\n\n return $query->getSingleResult();\n }", "public function findGroupId($group) {\r\n\t\t\r\n\t\t$group = strtolower(preg_replace('/[^\\w\\-]/','', $group));\r\n\t\t\r\n\t\tGLOBAL $wgYammerCacheDir;\r\n\t\t\r\n\t\t# Authentication tests\r\n\t\tif(!$this->isOAuthAuthenticated()) {\r\n\t\t\treturn $this->performAuth();\r\n\t\t}\r\n\t\tif(empty($wgYammerCacheDir)) {\r\n\t\t\treturn $this->createErrorResponse('Please specify <code>$wgYammerCacheDir</code> in your LocalSettings.php. Then <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a>.');\r\n\t\t}\r\n\t\tif(!is_dir($wgYammerCacheDir)) {\r\n\t\t\treturn $this->createErrorResponse('Please make sure that <code>$wgYammerCacheDir</code> as defined in your LocalSettings.php exists and is a directory. Then <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a>.');\r\n\t\t}\r\n\t\t\r\n\t\t# Try and see if the id is available in cache\r\n\t\t$file = $wgYammerCacheDir . DIRECTORY_SEPARATOR . 'group-'.strtolower($group). '.txt';\r\n\t\tif(is_file($file)) {\r\n\t\t\treturn file_get_contents($file);\r\n\t\t}\r\n\t\t\r\n\t\t# Cache miss, we are going to process the groups list until the group is found\r\n\t\t\r\n\t\t$letter = strtolower(substr($group, 0, 1));\r\n\t\t$page = 0;\r\n\t\t\r\n\t\twhile(true) {\r\n\t\t\t$url = sprintf(self::YAMMER_URI_GROUPS_BY_LETTER, $letter, $page);\r\n\t\t\t$body = $this->signedRequest($url);\r\n\t\t\t\r\n\t\t\t# Make sure there are groups in the response\r\n\t\t\tif(false === stripos($body, '<id>')) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t# Try and parse the groups. \r\n\t\t\tif(!preg_match_all('#<response>(.*?)</response>#ims', $body, $m)) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t# Process each group\r\n\t\t\tforeach($m[1] as $responseBody) {\r\n\t\t\t\t# Fetch group name and group id\r\n\t\t\t\t$name = preg_match('#<name>(.*?)</name>#i', $responseBody, $m) ? $m[1] : '';\r\n\t\t\t\t$id = preg_match('#<id>(.*?)</id>#i', $responseBody, $m) ? $m[1] : '';\r\n\t\t\t\t\r\n\t\t\t\t# Skip this response if either name or id is empty\r\n\t\t\t\tif(empty($name) || empty($id)) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t# Create a cache file with the group id\r\n\t\t\t\t$file = $wgYammerCacheDir . DIRECTORY_SEPARATOR . 'group-'.strtolower($name).'.txt';\r\n\t\t\t\tif(!is_file($file)) {\r\n\t\t\t\t\t$f = fopen($file, 'w');\r\n\t\t\t\t\tfwrite($f, $id);\r\n\t\t\t\t\tfclose($f);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t# We found the correct group\r\n\t\t\t\tif($name == strtolower($group)) {\r\n\t\t\t\t\treturn $id;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t# Increase page number\r\n\t\t\t$page++;\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->createErrorResponse('Group with name \"'.$group.'\" was not found');\r\n\t}", "function MyMod_Data_Group_Actual_Get()\n {\n $this->PostInitItems();\n\n if (!empty($this->CurrentDataGroup))\n {\n $group=$this->CurrentDataGroup;\n }\n else\n {\n $group=$this->GetCGIVarValue($this->GroupDataCGIVar());\n }\n\n $groups=$this->MyMod_Data_Group_Defs_Get();\n if (!preg_grep('/^'.$group.'$/',array_keys($groups)))\n {\n $group=\"\";\n }\n\n if (\n empty($group)\n ||\n !$this->MyMod_Item_Group_Allowed($groups[ $group ])\n )\n {\n //No group found (or group found was not allowed)\n //Localize first allowed data group\n foreach ($groups as $rgroup => $groupdef)\n {\n if ($this->MyMod_Item_Group_Allowed($groups[ $rgroup ]))\n {\n $group=$rgroup;\n break;\n }\n }\n }\n\n return $group;\n }", "function group_id($group_id=null)\n {\n if (isset($group_id)) {\n $this->group_id = intval($group_id);\n }\n return $this->group_id;\n }", "protected function GetGroup() {\r\n\t\t\treturn $this->group;\r\n\t\t}", "public function getGroup($group, &$name = NULL, &$description = NULL): int {\n\t\t$this->getAttributes();\n\t\tif(!is_numeric($group))\n\t\t\t$group = $this->cachedAttributeGroupNames2ID[ strtolower($group) ] ?? -1;\n\t\t$g = $this->cachedAttributeGroups[$group] ?? NULL;\n\t\t$name = $g[\"name\"] ?? NULL;\n\t\t$description = $g[\"description\"] ?? NULL;\n\t\treturn $group;\n\t}" ]
[ "0.76983947", "0.7062646", "0.70292354", "0.695643", "0.66145825", "0.65348166", "0.64825004", "0.64241004", "0.63876474", "0.63750595", "0.63022715", "0.6279023", "0.62195444", "0.6212036", "0.6205768", "0.6111761", "0.6104808", "0.60837454", "0.6052708", "0.6052708", "0.6052708", "0.6049206", "0.6043613", "0.6020259", "0.60096455", "0.6005619", "0.5993001", "0.59900826", "0.59864295", "0.5985097" ]
0.7079017
1
Grab all category groups for the current site
public function get_groups() { $qry = ee()->db->where('site_id', ee()->publisher_lib->site_id) ->order_by('group_name', 'asc') ->get('category_groups'); $groups = array(); if ($qry->num_rows()) { foreach ($qry->result() as $group) { $groups[$group->group_id] = $group; } } return $groups; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_categories_by_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'));\n\n\t\t// start hook\n\t\t$vars = $this->_hook('get_categories_by_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_category_by_group($vars['group_id'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_categories_by_group_end', $data);\n\n\t\t$this->response($data);\n\t}", "public function getGroups();", "public function getGroups();", "public function getGroups() {}", "public function getGroups() {\n\t\t$groups = array(\n\t\t\t'get_posts' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use WP_Query instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'get_posts',\n\t\t\t\t\t'wp_get_recent_posts',\n\t\t\t\t\t'get_children',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_get_post_terms' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use get_the_terms() instead. Use wp_list_pluck() to get the IDs.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_get_post_terms',\n\t\t\t\t\t'wp_get_object_terms',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_get_post_categories' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use the equivalent get_the_* version instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_get_post_categories',\n\t\t\t\t\t'wp_get_post_tags',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_old_slug_redirect' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use wpcom_vip_old_slug_redirect() instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_old_slug_redirect',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'get_term_by' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => \"%s() is an uncached function; use wpcom_vip_get_term_by() instead.\",\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'get_term_by',\n\t\t\t\t\t'get_cat_ID',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$wpcom_vip_fns = array(\n\t\t\t'get_category_by_slug',\n\t\t\t'get_term_link',\n\t\t\t'get_page_by_title',\n\t\t\t'get_page_by_path',\n\t\t\t'url_to_postid',\n\t\t);\n\t\tforeach ( $wpcom_vip_fns as $function ) {\n\t\t\t$groups[ $function ] = array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => \"%s() is an uncached function; use wpcom_vip_$function() instead.\",\n\t\t\t\t'functions' => array(\n\t\t\t\t\t$function\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\treturn $groups;\n\t}", "public function getAllGroups();", "function get_category_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'));\n\t\t\n\t\t// start hook\n\t\t$vars = $this->_hook('get_category_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_category_group($vars['group_id'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_category_group_end', $data);\n\n\t\t$this->response($data);\n\t}", "private function _get_groups() {\n\n\t\t$request = new Gitlab();\n\t\t$gitlab = $request->init_request();\n\n\t\t$groups = [];\n\t\t$page_index = 1;\n\n\t\tdo {\n\n\t\t\t$response = $gitlab->get( \"groups?per_page=100&page=$page_index\" );\n\t\t\t$response_arr = json_decode( $response->body, true );\n\n\t\t\t$groups = array_merge( $groups, $response_arr );\n\n\t\t\t$page_index = get_next_page( $response );\n\n\t\t} while ( ! empty( $page_index ) );\n\n\t\treturn $groups;\n\n\t}", "public function getCategorys()\r\n {\r\n $groupData = $this->getGroupById();\r\n $html = null;\r\n if ($groupData) {\r\n foreach (explode(',', $groupData['categorys']) as $categoryId) {\r\n if ($categoryId) {\r\n $itemCategorys = $this->itemCollectionFactory->create()\r\n ->addFieldToFilter('category_id', array('eq' => $categoryId))\r\n ->addFieldToFilter('status', array('eq' => 1))\r\n ->addFieldToFilter('menu_type', array('eq' => 1));\r\n if ($itemCategorys->getData()) {\r\n foreach ($itemCategorys as $item) {\r\n $html .= $this->getMegamenuHtml($item);\r\n continue;\r\n }\r\n } else {\r\n $category = $this->getCategoryById($categoryId);\r\n if ($category) {\r\n $parentClass = ($this->hasSubcategory($category->getId())) ? 'parent' : null;\r\n $html .= '<li class=\"' . $this->checkCurrentCategory($category->getId()) . ' ui-menu-item level0 ' . $this->getMenuTypeGroup($groupData['menu_type']) . ' ' . $parentClass . ' \">';\r\n $html .= '<a href=\"' . $category->getUrl() . '\" class=\"level-top\"><span>' . $category->getName() . '</span></a>';\r\n if ($this->hasSubcategory($category->getId())) {\r\n $html .= '<div class=\"open-children-toggle\"></div>';\r\n }\r\n //get html of category\r\n $html .= $this->getHtmlCategory($category,\r\n $this->getMenuTypeGroup($groupData['menu_type']));\r\n $html .= '</li>';\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return $html;\r\n }", "private function getCategories($groupID = null)\n {\n $this->db->select('*', '`bf_categories`')\n ->where('`visible` = 1' . \n ($groupID ? ' AND `category_group_id` = \\'' . intval($groupID) . '\\'' : ''))\n ->order('name', 'asc')\n ->execute();\n \n // Collect categories\n $categoryCollection = array();\n while($category = $this->db->next())\n {\n // Get image\n $image = $this->parent->db->getRow('bf_images', $category->image_id);\n \n // No image?\n if(!$image)\n {\n // Default image\n $imageURL = \n $this->parent->config->get('com.b2bfront.site.default-image', true);\n }\n else\n {\n $imageURL = Tools::getImageThumbnail($image->url);\n }\n \n $categoryCollection[] = array(\n 'name' => $category->name,\n 'id' => $category->id,\n 'url' => $imageURL\n );\n }\n \n return $categoryCollection;\n }", "public function groups();", "public function groups();", "function getCategories(){\n\t\tif ($this->isAdmin() || $this->isSupervisor())\n\t\t\treturn CategoryQuery::create()->find();\n\n\t\t$sql = \"SELECT \".CategoryPeer::TABLE_NAME.\".* FROM \".UserGroupPeer::TABLE_NAME .\" ,\".\n\t\t\t\t\t\tGroupCategoryPeer::TABLE_NAME .\", \".CategoryPeer::TABLE_NAME .\n\t\t\t\t\t\t\" where \".UserGroupPeer::USERID .\" = '\".$this->getId().\"' and \".\n\t\t\t\t\t\tUserGroupPeer::GROUPID .\" = \".GroupCategoryPeer::GROUPID .\" and \".\n\t\t\t\t\t\tGroupCategoryPeer::CATEGORYID .\" = \".CategoryPeer::ID .\" and \".\n\t\t\t\t\t\tCategoryPeer::ACTIVE .\" = 1\";\n\n\t\t$con = Propel::getConnection(UserPeer::DATABASE_NAME);\n\t\t$stmt = $con->prepare($sql);\n\t\t$stmt->execute();\n\t\treturn CategoryPeer::populateObjects($stmt);\n\t}", "protected function getGroupList() {}", "protected function getGroupList() {}", "public function getCategories();", "public function getCategories();", "public function getGroups()\n\t{\t\t\n\t\t$groups = $this->tax_class->getTerms();\n\t\tforeach ($groups as &$group) \n\t\t{\n\t\t\t$key = md5($group->meta['location_address']);\n\t\t\t$cache = $this->getCache($key);\n\t\t\tif($cache)\n\t\t\t{\n\t\t\t\t$group->meta['location'] = $cache;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$group->meta['location'] = $this->getLatLngByAddress($group->meta['location_address']);\n\t\t\t}\n\t\t\t$this->setCache($key, $group->meta['location']);\n\t\t}\n\t\treturn $groups;\n\t}", "public function getCategoriesGroup() {\n\t\t$imageTypes = $this->getImagesTypes();\n\t\t$categories = $this->getCollection()\n\t\t\t\t->addFieldToFilter('status',1);\n\t\t$arrayOptions = array();\n\t\t$i = 1;\n\t\tforeach($imageTypes as $key => $imageType)\n\t\t{\n\t\t\tif($key == 'uncategorized')\n\t\t\t{\n\t\t\t\t$arrayOptions[0] = 'Uncategorized';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$arrayValue = array();\n\t\t\tforeach($categories as $category)\n\t\t\t{\n\t\t\t\tif($category->getImageTypes() == $key)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$arrayValue[] = array('value'=>$category->getId(),'label'=>$category->getTitle());\n\t\t\t\t}\n\t\t\t}\n\t\t\t$arrayOptions[$i]['value'] = $arrayValue;\n\t\t\t$arrayOptions[$i]['label'] = $imageType;\n\t\t\t$i++;\n\t\t}\n\t\treturn $arrayOptions;\n\t}", "function ajax_get_all_groups() {\r\n global $wpdb;\r\n\r\n $groups = $this->get_groups();\r\n\r\n if ( is_array( $groups ) && 0 < count( $groups ) ) {\r\n\r\n $i = 0;\r\n $n = ceil( count( $groups ) / 5 );\r\n\r\n $html = '';\r\n $html .= '<ul class=\"clients_list\">';\r\n\r\n\r\n\r\n foreach ( $groups as $group ) {\r\n if ( $i%$n == 0 && 0 != $i )\r\n $html .= '</ul><ul class=\"clients_list\">';\r\n\r\n $html .= '<li><label>';\r\n $html .= '<input type=\"checkbox\" name=\"groups_id[]\" value=\"' . $group['group_id'] . '\" /> ';\r\n $html .= $group['group_id'] . ' - ' . $group['group_name'];\r\n $html .= '</label></li>';\r\n\r\n $i++;\r\n }\r\n\r\n $html .= '</ul>';\r\n } else {\r\n $html = 'false';\r\n }\r\n\r\n die( $html );\r\n\r\n }", "protected function getGroups()\n\t{\n\t\t// Initialize variables.\n\t\t$groups = array();\n\n\t\t// Get the client and client_id.\n\t\t$client = (string) $this->element['client'];\n\t\t$clientId = ($client == 'administrator') ? 1 : 0;\n\n\t\t// Get the database object and a new query object.\n\t\t$db\t\t= JFactory::getDBO();\n\t\t$query\t= $db->getQuery(true);\n\n\t\t// Build the query.\n\t\t$query->select('id, title, template');\n\t\t$query->from('#__template_styles');\n\t\t$query->where('client_id = '.(int) $clientId);\n\t\t$query->order('template');\n\t\t$query->order('title');\n\n\t\t// Set the query and load the styles.\n\t\t$db->setQuery($query);\n\t\t$styles = $db->loadObjectList();\n\n\t\t// Build the grouped list array.\n\t\tforeach($styles as $style) {\n\n\t\t\t// Initialize the group if necessary.\n\t\t\tif (!isset($groups[$style->template])) {\n\t\t\t\t$groups[$style->template] = array();\n\t\t\t}\n\n\t\t\t$groups[$style->template][] = JHtml::_('select.option', $style->id, $style->title);\n\t\t}\n\n\t\t// Merge any additional groups in the XML definition.\n\t\t$groups = array_merge(parent::getGroups(), $groups);\n\n\t\treturn $groups;\n\t}", "public function groups()\n {\n return $this->groupModel\n ->orderBy('name', 'asc')\n ->findAll();\n }", "public static function groupList()\n {\n $category = Category::all();\n $array = [];\n foreach ($category->where('category_id', 0) as $parent){\n\n $array[$parent->title] = array();\n\n foreach($parent->children as $attribute) {\n $array[$parent->title][$attribute->id] = $attribute->title;\n }\n }\n\n return $array;\n }", "public function getGroups(): array;", "public function categories()\n {\n $group_id = ee()->input->get('group_id') ? ee()->input->get('group_id') : ee()->publisher_category->get_first_group();\n\n $vars = ee()->publisher_helper_cp->get_category_vars($group_id);\n\n $vars = ee()->publisher_helper_cp->prep_category_vars($vars);\n\n // Load the file manager for the category image.\n ee()->publisher_helper_cp->load_file_manager();\n\n // Bail if there are no category groups defined.\n if (empty($vars['category_groups']))\n {\n show_error('No category groups found, please <a href=\"'. BASE.AMP .'D=cp&C=admin_content&M=edit_category_group\">create one</a>.');\n }\n\n return ee()->load->view('category/index', $vars, TRUE);\n }", "public function getGroupsList(){\n return $this->_get(1);\n }", "function get_groups() {\r\n global $wpdb;\r\n $groups = $wpdb->get_results( \"SELECT wcg.*, count(wcgc.client_id) as clients_count FROM {$wpdb->prefix}wpc_client_groups wcg LEFT JOIN {$wpdb->prefix}wpc_client_group_clients wcgc ON wcgc.group_id = wcg.group_id GROUP BY wcg.group_id\", \"ARRAY_A\");\r\n return $groups;\r\n }", "public function getGroupsList(){\n return $this->_get(3);\n }", "public function getGroupList()\n\t{\n\t\t$db = FabrikWorker::getDbo(true);\n\t\t$query = $db->getQuery(true);\n\t\t$query->select('DISTINCT(group_id)')->from('#__{package}_formgroup');\n\t\t$db->setQuery($query);\n\t\t$usedgroups = $db->loadResultArray();\n\t\tJArrayHelper::toInteger($usedgroups);\n\t\t$query = $db->getQuery(true);\n\t\t$query->select('id AS value, name AS text')->from('#__{package}_groups');\n\t\tif (!empty($usedgroups)) {\n\t\t\t$query->where('id NOT IN('.implode(\",\", $usedgroups) .')');\n\t\t}\n\t\t$query->where('published <> -2');\n\t\t$query->order(FabrikString::safeColName('text'));\n\t\t$db->setQuery($query);\n\t\t$groups = $db->loadObjectList();\n\t\t$list = JHTML::_('select.genericlist', $groups, 'jform[groups]', \"class=\\\"inputbox\\\" size=\\\"10\\\" style=\\\"width:100%;\\\" \", 'value', 'text', null, $this->id . '-from');\n\t\treturn array($groups, $list);\n\t}", "private function groupByCategory(){\n \n $searchResults = null;\n $items = $this->items; \n \n foreach($items as $item){\n foreach($item->categories as $category_tmp){ \n $searchResults[$category_tmp][] = $item;\n } \n }\n \n return $searchResults;\n }" ]
[ "0.7119901", "0.6809501", "0.6809501", "0.67347866", "0.67156607", "0.666446", "0.66382635", "0.65982777", "0.6537011", "0.6509248", "0.64859027", "0.64859027", "0.634545", "0.6305408", "0.6305408", "0.6297586", "0.6297586", "0.62926996", "0.625669", "0.6234821", "0.62307227", "0.62213004", "0.6218487", "0.62173283", "0.6210872", "0.6205342", "0.61964315", "0.61915076", "0.6187328", "0.61787295" ]
0.71832263
0
MCP ONLY Get all the translations for a category, and optionally return only a specific lang_id.
public function get_translations($cat_id = FALSE, $group_id = FALSE, $status = PUBLISHER_STATUS_OPEN, $lang_id = FALSE) { if ( !$cat_id) { show_error('$cat_id is required. publisher_category.php->get_translations()'); } if ( !$group_id) { show_error('$group_id is required. publisher_category.php->get_translations()'); } $categories = array(); $translations = array(); $where = array( 'publisher_status' => $status, 'cat_id' => $cat_id, 'site_id' => ee()->publisher_lib->site_id ); $qry = ee()->db->from('publisher_categories') ->where($where) ->get(); foreach ($qry->result() as $row) { $categories[$row->publisher_lang_id] = $row; } if ($lang_id) { $translations[$lang_id] = isset($categories[$lang_id]) ? $categories[$lang_id] : $categories[ee()->publisher_lib->default_lang_id]; } else { $fields = $this->get_custom_fields($group_id); $field_select_default = array(); foreach ($fields as $name => $field) { if (preg_match('/field_id_(\d+)/', $name, $matches)) { $field_select_default[] = 'cfd.'. $name; } } foreach ($this->get_enabled_languages() as $lid => $language) { // If we have existing category data if (isset($categories[$lid])) { $translations[$lid] = $categories[$lid]; } // If the language ID in the loop is what our current default lang is elseif ($lid == ee()->publisher_lib->default_lang_id) { $default_qry = ee()->db->select('c.*, '. implode(',', $field_select_default)) ->from('categories AS c') ->join('category_field_data AS cfd', 'cfd.cat_id = c.cat_id', 'left') ->where('c.cat_id', $cat_id) ->where('c.site_id', ee()->publisher_lib->site_id) ->get(); $default_category = (object) array(); // Kind of silly, but NULL values in the DB don't work when accessing // the property value, e.g. $category->$field_name will throw an error. foreach ($default_qry->row() as $field => $value) { $default_category->$field = $value === NULL ? '' : $value; } $translations[$lid] = $default_category; } // The category has not been translated yet, so create the vars // with an empty translation value so the view doesn't bomb. else { $categories[$lid] = new stdClass(); // Make sure our object has the same properties, but blank, // as a translated entry. foreach ($fields as $file_name => $field_data) { $categories[$lid]->$file_name = ''; } $categories[$lid]->cat_id = $cat_id; $categories[$lid]->publisher_lang_id = $lid; $translations[$lid] = $categories[$lid]; } $translations[$lid]->text_direction = $this->get_language($lid, 'direction'); } } return $translations; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllTranslationByLanguage();", "public function getLanguages($category_id = NULL, $language_name = NULL)\n {\n global $conn;\n if (!isset($conn))\n {\n $this->connect();\n }\n\n if (is_null($language_name) && is_null($category_id))\n {\n $query = 'SELECT field_name, experience, experience_level, icon, language_categories.category_name\n FROM languages\n RIGHT JOIN language_categories\n ON languages.category = language_categories.id';\n $sth = $conn->prepare($query, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n if ($sth->execute())\n {\n return $sth->fetchAll();\n }\n else\n {\n return 'Oops, no languages found.';\n }\n }\n else if (is_null($language_name) && !is_null($category_id))\n {\n $query = 'SELECT field_name, experience, experience_level, icon, language_categories.category_name\n FROM languages\n RIGHT JOIN language_categories\n ON languages.category = language_categories.id\n WHERE languages.category = :language_category';\n $sth = $conn->prepare($query, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n if ($sth->execute(array(':language_category' => $category_id)))\n {\n return $sth->fetchAll();\n }\n else\n {\n return 'Oops, no languages in this category.';\n }\n }\n else if (!is_null($language_name) && is_null($category_id))\n {\n $query = 'SELECT field_name, experience_level, icon, language_categories.category_name\n FROM languages\n RIGHT JOIN skills_categories\n ON languages.category = language_categories.id\n WHERE languages.field_name = :language_name';\n $sth = $conn->prepare($query, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n if ($sth->execute(array(':language_name' => $language_name)))\n {\n return $sth->fetch();\n }\n else\n {\n return 'Oops, there\\'s no language with that name';\n }\n }\n else\n {\n return 'There\\'s an error with your code. We don\\'t expect you to pass both $category_id and $language_name';\n }\n }", "public function getTranslations( ?string $category = null ) : array;", "public function getMultilingual();", "public function getLanguageCategories()\n {\n global $conn;\n if (!isset($conn))\n {\n $this->connect();\n }\n\n $query = 'SELECT id, category_name\n FROM language_categories';\n $sth = $conn->prepare($query, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n if ($sth->execute())\n {\n return $sth->fetchAll();\n }\n else\n {\n return 'Oops, no language categories found in the database.';\n }\n }", "public static function getAll($aCat, $aLang = 'MA') {\n $lRet = array();\n \n $lSql = 'SELECT a.`content_id`, a.`parent_id`, b.`content`, b.`tokens`, b.`format`, b.`status`, c.`category`, a.`language`, a.`maxver` as ver ';\n $lSql.= 'FROM (SELECT `content_id`, `parent_id`, max(`version`) AS maxver, `language` ';\n $lSql.= 'FROM `al_cms_ref_lang` WHERE `language`='.esc($aLang).' GROUP BY `parent_id`,`language`) as a ';\n //$lSql.= 'INNER JOIN `al_cms_ref_lang` b ON (a.`parent_id`=b.`parent_id` AND a.`maxver`=b.`version` AND a.`language`=b.`language`) ';\n $lSql.= 'INNER JOIN (SELECT * FROM `al_cms_content` WHERE `mand`='.intval(MID).') as b ON (a.`content_id`=b.`content_id`) ';\n $lSql.= 'INNER JOIN `al_cms_ref_category` as c ON (a.`content_id`=c.`content_id`) ';\n if(!empty($aCat)) {\n $lCat = explode('_', $aCat);\n $lCat = $lCat[0];\n $lSql.= 'WHERE c.`category`='.esc($lCat).' ';\n }\n $lSql.= 'ORDER BY b.`parent_id`, b.`content` ASC';\n $lQry = new CCor_Qry($lSql);\n foreach ($lQry as $lRow) {\n $lCid = intval($lRow['content_id']);\n $lArr = array(\n \t'content_id' => $lCid,\n \t'parent_id' => intval($lRow['parent_id']),\n \t'content' => strip_tags($lRow['content']),\n \t'tokens' => $lRow['tokens'],\n 'format' => $lRow['format'],\n \t'status' => $lRow['status'],\n \t'language' => $lRow['language'],\n \t'version' => $lRow['ver'],\n \t'categories' => $lRow['category']\n );\n\n $lArr['metadata'] = self::getMetadata($lCid);\n $lArr['jobs'] = self::getJobs($lCid);\n \n if($lArr['language'] == 'MA'){\n $lRet[] = $lArr;\n }\n }\n \n return $lRet;\n }", "public function get($cat_id = FALSE, $status = PUBLISHER_STATUS_OPEN, $translations = FALSE)\n {\n if ( !$cat_id)\n {\n show_error('$cat_id is required. publisher_category.php->get()');\n }\n\n if ($translations)\n {\n // TODO: turns out I never used this... Doesn't exist.\n return $this->get_category_translations($cat_id);\n }\n else\n {\n $qry = ee()->db->select('c.*, uc.*, c.cat_id as cat_id')\n ->from('publisher_categories AS uc')\n ->join('categories AS c', 'c.cat_id = uc.cat_id')\n ->where('c.cat_id', $cat_id)\n ->where('c.site_id', ee()->publisher_lib->site_id)\n ->get();\n\n return $qry->row() ?: FALSE;\n }\n }", "protected abstract function getTranslations();", "public function getTranslationsForLanguage($language);", "public function translations($language = '') {\n if ($language == '') {\n $language = app()->getLocale();\n }\n return $this->hasMany(AdditionalFieldTranslation::class)\n ->whereIn('language', array($language, Config::get('app.fallback_locale')));\n }", "protected function loadMessages($category, $language)\r\n {\r\n if ($this->cachingDuration > 0 && $this->cacheID !== false && ($cache = Yii::app()->getComponent($this->cacheID)) !== null) {\r\n $key = self::CACHE_KEY_PREFIX . '.messages.' . $category . '.' . $language;\r\n if (($data = $cache->get($key)) !== false)\r\n return unserialize($data);\r\n }\r\n\r\n $messages = $this->loadMessagesFromDb($category, $language);\r\n\r\n if (isset($cache))\r\n $cache->set($key, serialize($messages), $this->cachingDuration);\r\n\r\n return $messages;\r\n }", "protected function loadMessages($category,$language)\n\t{\n\t\tif($this->cachingDuration>0 && $this->cacheID!==false && ($cache=Yii::app()->getComponent($this->cacheID))!==null)\n\t\t{\n\t\t\t$key=self::CACHE_KEY_PREFIX.'.messages.'.$category.'.'.$language;\n\t\t\tif(($data=$cache->get($key))!==false)\n\t\t\t\treturn unserialize($data);\n\t\t}\n\n\t\t$messages=$this->loadMessagesFromDb($category,$language);\n\n\t\tif(isset($cache))\n\t\t\t$cache->set($key,serialize($messages),$this->cachingDuration);\n\n\t\treturn $messages;\n\t}", "public function loadLanguage($lang, $category)\n\t{\n\t\t//see if we have the language saved in the db\n\t\t$messages = $this->getConfigValue('messages');\n\t\t\n\t\tif(empty($messages)) //no language is saved, so revert to the file one\n\t\t{\n\t\t\t$messages = SyC::loadFileLanguage($lang,$category);\n\t\t}\n\t\t\n\t\t//make sure we have an array for this variable\n\t\tif(!is_array($messages)) $messages=array();\n\t\t\n\t\treturn $messages;\n\t}", "protected function loadMessages($category, $language)\n {\n return resolve([]);\n }", "protected function loadMessagesFromDb($category,$language)\n\t{\n\t\t$sql=<<<EOD\nSELECT t1.message AS message, t2.translation AS translation\nFROM {$this->sourceMessageTable} t1, {$this->translatedMessageTable} t2\nWHERE t1.id=t2.id AND t1.category=:category AND t2.language=:language\nEOD;\n\t\t$command=$this->getDbConnection()->createCommand($sql);\n\t\t$command->bindValue(':category',$category);\n\t\t$command->bindValue(':language',$language);\n\t\t$messages=array();\n\t\tforeach($command->queryAll() as $row)\n\t\t\t$messages[$row['message']]=$row['translation'];\n\n\t\treturn $messages;\n\t}", "public static function getBasicInfo($category_id=0, $language_id = 0)\n\t{\n\t\t$db = DataAccess::getInstance();\n\t\tif (!$category_id){\n\t\t\t//TODO: get this text from the DB somewhere...\n\t\t\treturn array('category_name' => \"Main\");\n\t\t}\n\t\tif (!$language_id){\n\t\t\t$language_id = $db->getLanguage();\n\t\t}\n\t\tif (isset(self::$_getInfoCache[$category_id][$language_id])){\n\t\t\treturn self::$_getInfoCache[$category_id][$language_id];\n\t\t}\n\t\t\n\t\t$sql = \"SELECT `category_name`,`category_cache`,`cache_expire`,`description` FROM \".geoTables::categories_languages_table.\" WHERE `category_id` = ? and language_id = ? LIMIT 1\";\n\t\t$result = $db->Execute($sql, array($category_id, $language_id));\n\t\tif (!$result || $result->RecordCount() == 0)\n\t\t{\n\t\t\ttrigger_error('ERROR CATEGORY SQL: Cat not found for id: '.$category_id.', Sql: '.$sql.' Error Msg: '.$db->ErrorMsg());\n\t\t\treturn false;\n\t\t}\n\t\t$show = $result->FetchRow();\n\t\t$show['category_name'] = geoString::fromDB($show['category_name']);\n\t\t$show['description'] = geoString::fromDB($show['description']);\n\t\t//save it, so we don't query the db a bunch\n\t\tself::$_getInfoCache[$category_id][$language_id] = $show;\n\t\treturn $show;\n\t}", "public static function get_language_translation( $lang_id ) {\n\n\t\tstatic $translation;\n\n\t\t// from cache (used for multilingual)\n\t\tif ( ! is_null( $translation ) && isset( $translation[ $lang_id ] ) ) {\n\t\t\treturn $translation[ $lang_id ];\n\t\t}\n\n\t\t$languages = publisher_translation()->get_languages();\n\n\t\tif ( ! isset( $languages[ $lang_id ] ) ) {\n\t\t\treturn $translation[ $lang_id ] = array(\n\t\t\t\t'status' => 'error',\n\t\t\t\t'msg' => __( 'Translation for selected language not found!', 'publisher' ),\n\t\t\t);\n\t\t}\n\n\t\t// translation data from core\n\t\tif ( $languages[ $lang_id ]['type'] === 'core' && class_exists( 'BetterFramework_Oculus' ) ) {\n\n\t\t\t$core_translation = BetterFramework_Oculus::request( 'get-translation', array(\n\t\t\t\t'group' => 'translation',\n\t\t\t\t'json_assoc' => true,\n\t\t\t\t'data' => array(\n\t\t\t\t\t'code' => $lang_id\n\t\t\t\t)\n\t\t\t) );\n\n\t\t\tif ( is_wp_error( $core_translation ) ) {\n\t\t\t\treturn $translation[ $lang_id ] = array(\n\t\t\t\t\t'status' => 'Error',\n\t\t\t\t\t'error_code' => $core_translation->get_error_code(),\n\t\t\t\t\t'error_message' => $core_translation->get_error_message(),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( ! empty( $core_translation['success'] ) && ! empty( $core_translation['translation']['translation'] ) ) {\n\t\t\t\treturn $translation[ $lang_id ] = array(\n\t\t\t\t\t'status' => 'success',\n\t\t\t\t\t'translation' => json_decode( $core_translation['translation']['translation'], true ),\n\t\t\t\t);\n\t\t\t}\n\n\t\t}\n\n\t\t// url is not found for online\n\t\tif ( ! isset( $languages[ $lang_id ]['url'] ) ) {\n\t\t\treturn $translation[ $lang_id ] = array(\n\t\t\t\t'status' => 'error',\n\t\t\t\t'msg' => __( 'Translation for selected language not found!', 'publisher' ),\n\t\t\t);\n\t\t}\n\n\n\t\t/**\n\t\t * Filter translation file url\n\t\t *\n\t\t * @since 1.0.0\n\t\t */\n\t\t$translation_url = apply_filters( 'publisher-theme-core/translation/change-translation/file-url', $languages[ $lang_id ]['url'] );\n\n\t\t// Read translation json file\n\t\t$translation_options_data = wp_remote_get( $translation_url );\n\t\tif ( is_wp_error( $translation_options_data ) ) {\n\t\t\treturn $translation[ $lang_id ] = array(\n\t\t\t\t'status' => 'Error',\n\t\t\t\t'error_code' => $translation_options_data->get_error_code(),\n\t\t\t\t'error_message' => $translation_options_data->get_error_message(),\n\t\t\t);\n\t\t}\n\n\t\t// request is not 200\n\t\t$http_code = wp_remote_retrieve_response_code( $translation_options_data );\n\t\tif ( $http_code !== 200 ) {\n\t\t\treturn $translation[ $lang_id ] = array(\n\t\t\t\t'status' => 'error',\n\t\t\t\t'error_code' => 'http-code-error',\n\t\t\t\t'error_message' => sprintf( __( 'Http request code was %s', 'publisher' ), $http_code ),\n\t\t\t);\n\t\t}\n\n\t\t// file body is not valid\n\t\t$translation_options_data = wp_remote_retrieve_body( $translation_options_data );\n\t\tif ( ! $translation_options_data ) {\n\t\t\treturn $translation[ $lang_id ] = array(\n\t\t\t\t'status' => 'error',\n\t\t\t\t'msg' => __( 'Translation file for selected language not found!', 'publisher' ),\n\t\t\t);\n\t\t}\n\n\t\treturn $translation[ $lang_id ] = array(\n\t\t\t'status' => 'success',\n\t\t\t'translation' => json_decode( $translation_options_data, true ),\n\t\t);\n\n\t}", "public function getTranslationCategories()\n {\n try {\n $model = $this->getTranslationModel();\n if ($model instanceof ActiveRecord) {\n $list = $model::find()->groupBy('category')->all();\n return ArrayHelper::getColumn($list, 'category');\n }\n } catch (\\Exception $ex) {\n Yii::error($ex->getMessage(), 'translations');\n }\n return [];\n }", "protected function loadMessagesFromDb($category, $language)\r\n {\r\n $sql = \"SELECT message, translation_\" . $language . \" AS translation\r\n FROM {{translate_message}}\r\n WHERE category=:category\";\r\n $command = Yii::app()->db->createCommand($sql);\r\n $command->bindValue(':category', $category);\r\n $messages = array();\r\n foreach ($command->queryAll() as $row)\r\n $messages[$row['message']] = $row['translation'];\r\n\r\n return $messages;\r\n }", "function getAll()\r\n\t\t{\r\n\t\t\treturn $this->lang;\r\n\t\t}", "public function get_current($by_group = FALSE)\n {\n if ( !ee()->publisher_setting->enabled())\n {\n return array();\n }\n\n // @todo - cache\n if(FALSE)\n {\n\n }\n else if (isset(ee()->session->cache['publisher']['all_categories']))\n {\n if ($by_group)\n {\n return ee()->session->cache['publisher']['all_categories'][$by_group];\n }\n else\n {\n return ee()->session->cache['publisher']['all_categories'];\n }\n }\n else\n {\n // Grab the custom fields. We don't need field_id_N in our templates\n $fields = $this->get_custom_fields();\n\n $field_select_default = array();\n $field_select_custom = array();\n\n foreach ($fields as $name => $field)\n {\n if (preg_match('/field_id_(\\d+)/', $name, $matches))\n {\n $field_select_default[] = 'cfd.'. $name .' AS \\''. $field->field_name.'\\'';\n $field_select_custom[] = $name .' AS \\''. $field->field_name.'\\'';\n }\n }\n\n $qry = ee()->db->select('c.*, '. implode(',', $field_select_default))\n ->from('categories AS c')\n ->join('category_field_data AS cfd', 'cfd.cat_id = c.cat_id', 'left')\n ->where('c.site_id', ee()->publisher_lib->site_id)\n ->get();\n\n ee()->session->cache['publisher']['all_categories'] = array();\n ee()->session->cache['publisher']['translated_categories'] = array();\n\n foreach ($qry->result_array() as $category)\n {\n ee()->session->cache['publisher']['all_categories'][$category['group_id']][$category['cat_id']] = $category;\n }\n\n $where = array(\n 'publisher_lang_id' => ee()->publisher_lib->lang_id,\n 'publisher_status' => ee()->publisher_lib->status,\n 'site_id' => ee()->publisher_lib->site_id\n );\n\n $qry = ee()->db->select('*, '. implode(',', $field_select_custom))\n ->from('publisher_categories')\n ->where($where)\n ->get();\n\n foreach ($qry->result_array() as $category)\n {\n ee()->session->cache['publisher']['translated_categories'][$category['group_id']][$category['cat_id']] = $category;\n }\n\n foreach (ee()->session->cache['publisher']['all_categories'] as $group_id => $group)\n {\n foreach ($group as $cat_id => $category)\n {\n if (isset(ee()->session->cache['publisher']['translated_categories'][$group_id][$cat_id]))\n {\n foreach (ee()->session->cache['publisher']['translated_categories'][$group_id][$cat_id] as $field_name => $field_value)\n {\n if ($field_value != '')\n {\n ee()->session->cache['publisher']['all_categories'][$group_id][$cat_id][$field_name] = $field_value;\n }\n }\n }\n }\n }\n\n foreach (ee()->session->cache['publisher']['all_categories'] as $group_id => $group)\n {\n foreach ($group as $cat_id => $category)\n {\n foreach ($category as $field => $value)\n {\n ee()->session->cache['publisher']['all_categories'][$group_id][$cat_id][str_replace('cat_', 'category_', $field)] = $value;\n }\n }\n }\n\n if ($by_group)\n {\n return ee()->session->cache['publisher']['all_categories'][$by_group];\n }\n else\n {\n return ee()->session->cache['publisher']['all_categories'];\n }\n }\n }", "public function getTranslations( $language )\n\t{\n\t\t$sql = <<<TRANSLATIONS\nSELECT\n\t*\nFROM\n\t`i18n_messages` m\nLEFT JOIN\n\ti18n_translations t ON m.id=t.id_message AND lang =?\nORDER BY\n\tt.translation ASC, m.message ASC\nTRANSLATIONS;\n\n\treturn $this->GetArray( $sql, array( $language, 'tag' => 'Get all translations for current language' ) );\n\t}", "public function getCategories($language = null) {\n global $db, $langval;\n if ($language === null) $language = $langval;\n $arCategories = $db->fetch_table(\"SELECT el.*, s.T1, s.V1, s.V2 FROM `kat` el\n LEFT JOIN `string_kat` s ON s.S_TABLE='kat' AND s.FK=el.ID_KAT\n AND s.BF_LANG=if(el.BF_LANG_KAT & \".$language.\", \".$language.\", 1 << floor(log(el.BF_LANG_KAT+0.5)/log(2)))\n WHERE ROOT=1 AND B_VIS=1 AND KAT_TABLE='\".$this->tableName.\"'\n ORDER BY el.ORDER_FIELD\");\n return $arCategories;\n }", "protected function loadMessages($category, $language)\n {\n $messages = $this->_loadFromDb($category, $language);\n return $messages;\n }", "public function getById($id){\n\t\t$url = WEBSERVICE. \"languages/getById/\" . $id;\n\t\t$this->HTTPRequest->setUrl($url);\n\t\t$this->HTTPRequest->setMethod(\"GET\");\n\t\t$arrayResponse = $this->HTTPRequest->sendHTTPRequest();\n\t\treturn $this->arrayToLanguage($arrayResponse, true);\n\t}", "public function getCategoriesAndParents() {\n\t\t$cats = array();\n\t\tif ($this->categories) {\n\t\t\t$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['camaliga']);\n\t\t\t$catMode = intval($configuration[\"categoryMode\"]);\n\t\t\t$lang = intval($GLOBALS['TSFE']->config['config']['sys_language_uid']);\n\t\t\t// Step 1: select all categories of the current language\n\t\t\t$categoriesUtility = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('\\quizpalme\\Camaliga\\Utility\\AllCategories');\n\t\t\t$all_cats = $categoriesUtility->getCategoriesarrayComplete();\n\t\t\t// Step 2: aktuelle orig_uid herausfinden\n\t\t\t$orig_uid = intval($this->getUid());\t// ist immer die original uid (nicht vom übersetzten Element!)\n\t\t\tif ($lang > 0 && $catMode == 0) {\n\t\t\t\t$res4 = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t\t'uid',\n\t\t\t\t\t\t'tx_camaliga_domain_model_content',\n\t\t\t\t\t\t'deleted=0 AND hidden=0 AND sys_language_uid=' . $lang . ' AND t3_origuid=' . $orig_uid);\n\t\t\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($res4) > 0) {\n\t\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res4))\n\t\t\t\t\t\tif ($row['uid']) {\n\t\t\t\t\t\t\t$orig_uid = intval($row['uid']);\t// uid of the translated element\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res4);\n\t\t\t}\n\t\t\t// Step 3: get the mm-categories of the current element (from the original or translated element)\n\t\t\t$res4 = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t'uid_local',\n\t\t\t\t'sys_category_record_mm',\n\t\t\t\t\"tablenames='tx_camaliga_domain_model_content' AND uid_foreign=\" . $orig_uid);\n\t\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($res4) > 0) {\n\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res4)){\n\t\t\t\t\t$uid = $row['uid_local'];\n\t\t\t\t\tif (!isset($all_cats[$uid]['parent'])) continue;\n\t\t\t\t\t$parent = (int) $all_cats[$uid]['parent'];\n\t\t\t\t\t//if (!$all_cats[$parent]['title'])\tcontinue;\n\t\t\t\t\tif (!isset($cats[$parent])) {\n\t\t\t\t\t\t$cats[$parent] = array();\n\t\t\t\t\t\t$cats[$parent]['childs'] = array();\n\t\t\t\t\t\t$cats[$parent]['title'] = $all_cats[$parent]['title'];\n\t\t\t\t\t}\n\t\t\t\t\tif ($all_cats[$uid]['title'])\n\t\t\t\t\t\t$cats[$parent]['childs'][$uid] = $all_cats[$uid]['title'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res4);\n\t\t}\n\t\treturn $cats;\n\t}", "protected function _loadFromDb($category, $language)\n {\n $criteria = new \\EMongoCriteria();\n $criteria\n ->addCond('category', '==', $category)\n ->addCond('language', '==', $language);\n $itemList = Item::model()->findAll($criteria);\n\n $messages = array();\n foreach ($itemList as $item) {\n $messages[$item->message] = $item->translation;\n }\n\n return $messages;\n }", "public function getAll(){\n\t\t$url = WEBSERVICE. \"languages/getAll\";\n\t\t$this->HTTPRequest->setUrl($url);\n\t\t$this->HTTPRequest->setMethod(\"GET\");\n\t\t$arrayResponse = $this->HTTPRequest->sendHTTPRequest();\n\t\treturn $this->arrayToLanguage($arrayResponse, false);\n\t}", "function product_categories($lang = 'en_us')\n\t{\n\t\t$lang = str_replace('_', '-', $lang);\n\t\t\n\t\t$content = '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\t\t\t<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n\t\t\t\t<soap:Header>\n\t\t\t\t\t<ServiceAuthHeader xmlns=\"http://tempuri.org/\">\n\t\t\t\t\t\t<UserName>' . $this->username . '</UserName>\n\t\t\t\t\t\t<Password>' . $this->password . '</Password>\n\t\t\t\t\t</ServiceAuthHeader>\n\t\t\t\t</soap:Header>\n\t\t\t\t<soap:Body>\n\t\t\t\t\t<product_categories xmlns=\"http://tempuri.org/\">\n\t\t\t\t\t\t<lang>'.$lang.'</lang>\n\t\t\t\t\t</product_categories>\n\t\t\t\t</soap:Body>\n\t\t\t</soap:Envelope>';\n\t\t\n\t\t$headers = array( \n\t\t\t'POST /redactedapiservice.asmx HTTP/1.1',\n\t\t\t'Host: 000.00.000.185',\n\t\t\t'Content-Type: text/xml; charset=utf-8',\n\t\t\t'Content-Length: ' . strlen($content),\n\t\t\t'SOAPAction: \"http://tempuri.org/product_categories\"',\n\t\t);\n\t\t\n\t\treturn $this->_init_curl($content, $this->url, $headers);\n\t\n\t}", "function GetLocalizedTextsByLanguageId($languageId)\n\t{\n\t\t$result = $this->sendRequest(\"GetLocalizedTextsByLanguageId\", array(\"LanguageId\"=>$languageId));\t\n\t\treturn $this->getResultFromResponse($result);\n\t}" ]
[ "0.687502", "0.6645714", "0.65657455", "0.6527444", "0.63609296", "0.60629493", "0.6013262", "0.5933166", "0.5875027", "0.57991856", "0.57625335", "0.575892", "0.57574594", "0.5754433", "0.5742737", "0.57411486", "0.57222575", "0.5719788", "0.5713194", "0.57118034", "0.5704997", "0.5698633", "0.56455743", "0.5633233", "0.559215", "0.55880773", "0.555467", "0.55439407", "0.5531204", "0.5525005" ]
0.71551293
0
Get first category group
public function get_first_group() { return ee()->db->select('MIN(group_id) AS group_id') ->get('category_groups') ->row('group_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getFirstCategory() {\r\n\t\treturn $this->newsItem->getFirstCategory()->getTitle();\r\n\t}", "private function _getFirstCategoryLevel()\n\t{\n\t\tif (!$this->_firstCategoryLevel) {\n\t\t\t$this->_firstCategoryLevel = intval($this->getVar('category_first_level', 1));\n\t\t}\n\t\treturn $this->_firstCategoryLevel;\n\t}", "function get_first_category_ID() {\n\t$category = get_the_category(); \n\t$category_parent_id = $category[0]->category_parent;\n\t\n\tif ( $category_parent_id != 0 ) {\n\t\t$category_parent = get_term( $category_parent_id, 'category' );\n\t\t$css_slug = $category_parent->slug;\n\t} else {\n\t\t$css_slug = $category[0]->slug;\n\t}\n\n\treturn $css_slug;\n}", "function get_first_category_link($post_id) {\n $category = get_the_category($post_id);\n if ($category[0]) {\n return get_category_link($category[0]->term_id);\n }\n}", "public function getCategory1()\n {\n if (array_key_exists(\"category1\", $this->_propDict)) {\n return $this->_propDict[\"category1\"];\n } else {\n return null;\n }\n }", "function get_category_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'));\n\t\t\n\t\t// start hook\n\t\t$vars = $this->_hook('get_category_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_category_group($vars['group_id'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_category_group_end', $data);\n\n\t\t$this->response($data);\n\t}", "function get_first_category_name($post_id) {\n $category = get_the_category($post_id);\n if ($category[0]) {\n return $category[0]->cat_name;\n }\n}", "public function get_cat_one()\n {\n $select = $this->db->get('category_one');\n $cat_one = $select->result();\n return $cat_one;\n }", "function get_first_row(){\n global $db;\n $query = \n ' SELECT cat_categoryID\n FROM categories\n LIMIT 1';\n $statement = $db->prepare($query);\n $statement->execute();\n $categories = $statement->fetchAll();\n $statement->closeCursor();\n foreach($categories as $category){ \n return $category['cat_categoryID'];\n }\n}", "public function getGroup() {\n \tif(count($this->groups))\n \t return $this->groups[0]->getName();\n \telse\n \t return null;\n }", "function getGroup() {\n \n return null;\n \n }", "public function getDefaultGroup()\n {\n return $this->defaultGroup;\n }", "function achieve_get_main_category()\r\n{\r\n global $sql;\r\n\r\n $main_cat = array();\r\n $result = $sql[\"dbc\"]->query(\"SELECT ID, Name FROM achievement_category WHERE ParentID=-1 and ID<>1 ORDER BY `GroupID` ASC\");\r\n while ($main_cat[] = $sql[\"dbc\"]->fetch_assoc($result));\r\n return $main_cat;\r\n}", "public function getCategory() {\r\n return $this->catList->find('id', $this->categoryId)[0];\r\n }", "public function getDefaultGroup(): string;", "private function isFirstLevel($category)\n {\n return $category->getData('level') == 2 ? true : false;\n }", "private function getSingleGroup()\n {\n if (!$this->result) {\n throw new \\Exception('This adapter must have a result set on it before being accessed');\n }\n $grouping = $this->result->getGrouping();\n $groups = reset($grouping);\n $group = reset($groups);\n\n return $group;\n }", "public function getDefaultPricingGroup()\n {\n if ($this->pricingGroups[0]->isDefault()) return $this->pricingGroups[0]; // normally because of self::setPricingGroupsBubbleDefaultToTop\n\n foreach ($this->pricingGroups as $pricingGroup) {\n if ($pricingGroup->isDefault()) return $pricingGroup;\n }\n\n return null;\n }", "public function get_default_category() {\n return $this->defaultcategory;\n }", "public function getPostFirstCategory($post)\r\n {\r\n /** @var \\Mageplaza\\Blog\\Model\\ResourceModel\\Category\\Collection $collection */\r\n $collection = $this->getCategoryCollection($post->getCategoryIds());\r\n\r\n return $collection->getFirstItem();\r\n }", "function getCategory() {\n // Load categories.\n $categories = userpoints_get_categories();\n return isset($categories[$this->getTid()]) ? $categories[$this->getTid()] : $categories[userpoints_get_default_tid()];\n }", "public function getGroupObject() {\n return $this->groups[0];\n }", "public function get_category()\n {\n return $this->primary_category();\n }", "public function category() {\n\t\treturn $this->get_category();\n\t}", "public function getGroup();", "public function getGroup();", "public function getGroup();", "function getCategory() {\n\t\treturn $this->node->firstChild->toString();\n\t}", "public function getFirstPage($group = 'default') {\n $this->ensureGroup($group);\n\n // @todo determine based on a 'surroundCount' value\n return 1;\n }", "private function retrieve_primary_category() {\n\t\t$primary_category = null;\n\n\t\tif ( ! empty( $this->args->ID ) ) {\n\t\t\t$wpseo_primary_category = new WPSEO_Primary_Term( 'category', $this->args->ID );\n\n\t\t\t$term_id = $wpseo_primary_category->get_primary_term();\n\t\t\t$term = get_term( $term_id );\n\n\t\t\tif ( ! is_wp_error( $term ) && ! empty( $term ) ) {\n\t\t\t\t$primary_category = $term->name;\n\t\t\t}\n\t\t}\n\n\t\treturn $primary_category;\n\t}" ]
[ "0.6992908", "0.65998644", "0.6392275", "0.6311134", "0.62993157", "0.6292467", "0.6182475", "0.6125688", "0.60287684", "0.60007143", "0.5900196", "0.58980006", "0.5866777", "0.5863748", "0.5858644", "0.58394516", "0.58335835", "0.58314127", "0.58232695", "0.57744443", "0.5766075", "0.5764646", "0.57635784", "0.5685904", "0.5682851", "0.5682851", "0.5682851", "0.5668625", "0.5626301", "0.56163114" ]
0.8117068
0
Grab all the custom fields for a category
public function get_custom_fields($group_id = FALSE) { // Default fields $fields = array( // Return the Image field first so we can float it in the view. 'cat_image' => (object) array( 'field_name' => 'cat_image', 'field_label' => 'Image' ), 'cat_name' => (object) array( 'field_name' => 'cat_name', 'field_label' => 'Name' ), 'cat_description' => (object) array( 'field_name' => 'cat_description', 'field_label' => 'Description' ), 'cat_url_title' => (object) array( 'field_name' => 'cat_url_title', 'field_label' => 'URL Title' ), ); // Grab the columns from the table $columns = $this->get_table_columns($this->data_table); // Grab the custom field data $field_data = array(); if ($group_id) { ee()->db->where('group_id', $group_id); } $qry = ee()->db->get('category_fields'); foreach ($qry->result() as $row) { $field_data[$row->field_id] = $row; } foreach ($columns as $column_name) { if (substr($column_name, 0, 9) == 'field_id_') { $id = preg_replace('/field_id_(\d+)/', "$1", $column_name); if (array_key_exists($id, $field_data)) { $fields[$column_name] = $field_data[$id]; } } } return $fields; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllCustomFields()\n\t{\n\t\t$fields = $this->CustomFields->indexBy('field_name');\n\n\t\t$cache_key = \"ChannelFieldGroups/{$this->getId()}/\";\n\t\tif (($field_groups = ee()->session->cache(__CLASS__, $cache_key, FALSE)) == FALSE)\n\t\t{\n\t\t\t$field_groups = $this->FieldGroups;\n\t\t}\n\n\t\tforeach ($field_groups as $field_group)\n\t\t{\n\t\t\tforeach($field_group->ChannelFields as $field)\n\t\t\t{\n\t\t\t\t$fields[$field->field_name] = $field;\n\t\t\t}\n\t\t}\n\n\t\tee()->session->set_cache(__CLASS__, $cache_key, $field_groups);\n\n\t\treturn new Collection($fields);\n\t}", "public function fields()\n {\n $fullResult = $this->client->call(\n 'crm.dealcategory.fields'\n );\n return $fullResult;\n }", "public function getCustomFields()\n\t{\n\t\t$all_customs = array();\n\t\t$results = $this->grApiInstance->getCustomFields();\n\t\tif ( !empty($results))\n\t\t{\n\t\t\tforeach ($results as $ac)\n\t\t\t{\n\t\t\t\tif (isset($ac->name) && isset($ac->customFieldId)) {\n\t\t\t\t\t$all_customs[$ac->name] = $ac->customFieldId;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $all_customs;\n\t}", "function getCategoryFields() {\n\t\t\n\t\t$model = $this->getModel();\n\t\t$category_id = JRequest::getVar('id');\n\t\t$form = $model->getFieldForm($category_id, 'category');\n\t\t\n\t\tif (!$form) {\n\t\t\techo \"There was an error creating the form\";\n\t\t\texit();\n\t\t}\n\t\t\n\t\techo '<div class=\"fltlft\" style=\"width:250px;\">';\n\t\techo '<fieldset class=\"adminform\" >';\n\t\techo '<legend>New Category</legend>';\n\t\techo '<div class=\"adminformlist\">';\n\t\tforeach ($form->getFieldset() as $field) {\n\t\t\tJHtml::_('wbty.renderField', $field);\n\t\t}\n\t\techo \"</div></fieldset></div>\";\n\t\t\n\t\texit();\n\t}", "public function get_fields() {\n\t\treturn apply_filters( 'wpcd_get_custom_fields', $this->custom_fields );\n\t}", "public function custom_fields_for_feed_setting() {\n\t\t\n\t\t$fields = array();\n\t\t\n\t\t/* If iContact API credentials are invalid, return the fields array. */\n\t\tif ( ! $this->initialize_api() ) {\n\t\t\treturn $fields;\n\t\t}\n\t\t\n\t\t/* Get available iContact fields. */\n\t\t$icontact_fields = $this->api->get_custom_fields();\n\t\t\n\t\t/* If no iContact fields exist, return the fields array. */\n\t\tif ( empty( $icontact_fields ) || is_wp_error( $icontact_fields ) || ! is_array( $icontact_fields ) ) {\n\t\t\treturn $fields;\n\t\t}\n\t\t\t\n\t\t/* Add iContact fields to the fields array. */\n\t\tforeach ( $icontact_fields as $field ) {\n\t\t\t\n\t\t\t$fields[] = array(\n\t\t\t\t'label' => $field['publicName'],\n\t\t\t\t'value' => $field['customFieldId']\n\t\t\t);\n\t\t\t\n\t\t}\n\n\t\t/* Add new custom fields to the fields array. */\n\t\tif ( ! empty( $this->_new_custom_fields ) ) {\n\t\t\t\n\t\t\tforeach ( $this->_new_custom_fields as $new_field ) {\n\t\t\t\t\n\t\t\t\t$found_custom_field = false;\n\t\t\t\tforeach ( $fields as $field ) {\n\t\t\t\t\t\n\t\t\t\t\tif ( $field['value'] == $new_field['value'] )\n\t\t\t\t\t\t$found_custom_field = true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( ! $found_custom_field )\n\t\t\t\t\t$fields[] = array(\n\t\t\t\t\t\t'label' => $new_field['label'],\n\t\t\t\t\t\t'value' => $new_field['value']\t\n\t\t\t\t\t);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif ( empty( $fields ) ) {\n\t\t\treturn $fields;\n\t\t}\n\t\t\t\t\t\t\n\t\t/* Add \"Add Custom Field\" to array. */\n\t\t$fields[] = array(\n\t\t\t'label' => esc_html__( 'Add Custom Field', 'gravityformsicontact' ),\n\t\t\t'value' => 'gf_custom'\t\n\t\t);\n\t\t\n\t\treturn $fields;\n\t\t\n\t}", "public function getFormCustomFields(){\n\t}", "public function getCustomFields() {\n }", "public function getCustomFields() {\n }", "public function getCustomFields()\n {\n return $this->customFields;\n }", "public function getCustomFields()\n {\n return $this->customFields;\n }", "public function getAllCustomFields() : array\n {\n return $this->getAll();\n }", "public function get_custom_fields() {\n\t\treturn apply_filters( 'dev_get_custom_fields', $this->options );\n\t}", "private static function _get_custom_fields($content_type)\n\t{\n\t\t$data = get_option( CCTM::db_key );\n\t\tif (isset($data[$content_type]['custom_fields']))\n\t\t{\n\t\t\treturn $data[$content_type]['custom_fields'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t}", "public function getCustomFields() {\n return Doctrine::getTable('ArticleCustomFieldValue')->getCustomFields($this);\n }", "private function addCustomFields() {\n if (function_exists('get_fields')) {\n foreach (self::getPostTypes() as $post_type) {\n register_rest_field($post_type, 'fields', [\n 'get_callback' => function ($post) {\n if (is_object($post)) {\n return get_fields($post->id);\n } elseif (is_array($post) && array_key_exists('id', $post)) {\n return get_fields($post['id']);\n }\n },\n ]);\n }\n }\n }", "public function getCategoryFormElements($category) {\n //TYPE\n //DEFAULT ELEMENTS\n //Category ELEMENTS\n \n }", "public static function custom_fields()\r\n {/*{{{*/\r\n $f = array();\r\n\t $file = self::custom_fields_file();\r\n\t if(!file_exists($file)) \r\n return false;\r\n\r\n\t $data = getXML($file);\r\n\t $items = $data->item;\r\n\t if(count($items) <= 0) \r\n\t return false;\r\n\t foreach($items as $item) \r\n\t {\r\n\t\t $cf = array();\r\n\t\t $cf['key'] = (string)$item->desc;\r\n\t\t $cf['label'] = (string)$item->label;\r\n\t\t $cf['type'] = (string)$item->type;\r\n\t\t $cf['value'] = (string)$item->value;\r\n\t\t if($cf['type'] == 'dropdown') \r\n\t\t {\r\n\t\t $cf['options'] = array();\r\n\t\t\t foreach ($item->option as $option) \r\n\t\t\t\t $cf['options'][] = (string)$option;\r\n\t\t }\r\n\t\t $f[] = $cf;\r\n\t }\r\n return $f;\r\n }", "public function getCustomFields($page=null, $per_page=null){\n\t\treturn CustomField::all($page, $per_page);\n\t\t\n }", "public function saveCustomFields($fields, $category) {\n // usuwanie dotychczasowych powiazan\n if($this->getPrimaryKey()) {\n $q = Doctrine_Query::create()\n ->delete('ArticleCustomFieldValue acfv')\n ->where('acfv.article_id = ?', $this->getPrimaryKey());\n\n $q->execute();\n }\n\n // pobranie dozwolonych pol na podstawie kategorii\n $q = Doctrine::getTable('ArticleCustomFields2ArtCategories')\n ->createQuery('cf2ac')\n ->leftJoin('cf2ac.ArticleCustomField acf')\n// ->where('artcategory_id = ?', $category);\n ->andWhereIn('artcategory_id', array_keys(Doctrine::getTable('ArtCategories')->find($category)->getAncestorsArrayByIds(true)));\n\n $validFields = $q->execute();\n\n foreach($validFields as $validField) {\n\n foreach($fields as $field => $value) {\n\n if($field == $validField->ArticleCustomField->getName()) {\n $this->setCustomField($field, $value);\n }\n }\n }\n }", "public function getCustomFields()\n {\n return $this->_customFields ?: array();\n }", "function getForumCategoryFields() {\n return array(\n 'nom',\n 'image',\n 'niveau',\n 'ordre'\n );\n}", "function details_field_collection()\r\n{\r\n\tglobal $wpdb,$post,$htmlvar_name;\r\n\tremove_all_actions('posts_where');\r\n\tremove_all_actions('posts_orderby');\r\n\t$cus_post_type = get_post_type();\r\n\t$args = \r\n\tarray( 'post_type' => 'custom_fields',\r\n\t'posts_per_page' => -1\t,\r\n\t'post_status' => array('publish'),\r\n\t'meta_query' => array(\r\n\t 'relation' => 'AND',\r\n\t\tarray(\r\n\t\t\t'key' => 'post_type_'.$cus_post_type.'',\r\n\t\t\t'value' => $cus_post_type,\r\n\t\t\t'compare' => '=',\r\n\t\t\t'type'=> 'text'\r\n\t\t),\r\n\t\tarray(\r\n\t\t\t'key' => 'show_on_page',\r\n\t\t\t'value' => array('user_side','both_side'),\r\n\t\t\t'compare' => 'IN'\r\n\t\t),\r\n\t\tarray(\r\n\t\t\t'key' => 'is_active',\r\n\t\t\t'value' => '1',\r\n\t\t\t'compare' => '='\r\n\t\t),\r\n\t\tarray(\r\n\t\t\t'key' => 'show_on_detail',\r\n\t\t\t'value' => '1',\r\n\t\t\t'compare' => '='\r\n\t\t)\r\n\t),\r\n\t\t'meta_key' => 'sort_order',\r\n\t\t'orderby' => 'meta_value_num',\r\n\t\t'meta_value_num'=>'sort_order',\r\n\t\t'order' => 'ASC'\r\n\t);\r\n\t$post_meta_info = null;\r\n\tadd_filter('posts_join', 'custom_field_posts_where_filter');\r\n\t$post_meta_info = new WP_Query($args);\r\n\tremove_filter('posts_join', 'custom_field_posts_where_filter');\r\n\treturn $post_meta_info;\r\n}", "public function getCMSFields() {\n\t\t$shopConfig = ShopConfig::current_shop_config();\n\t\t$fields = parent::getCMSFields();\n\n\t\t$categories = ProductCategory::getAllCategories();\n\t\tif($categories){\n\t\t\t// Product fields\n\t\t\t$fields->addFieldsToTab('Root.Main', array(\n\t\t\t\tTextField::create('SKU', 'SKU Code'),\n\t\t\t\tPriceField::create('Price', 'Standard Price'),\n\t\t\t\tPriceField::create('SpecialPrice', 'Special Price')->setRightTitle('If price set to 0.00 the product will not be on special')\n\t\t\t), 'Content');\n\n\t\t\t// Replace URL Segment field\n\t\t\t/*\n\t\t\t$urlsegment = SiteTreeURLSegmentField::create(\"URLSegment\", 'URLSegment');\n\t\t\t$baseLink = Controller::join_links(Director::absoluteURL(), 'product/');\n\t\t\t$url = (strlen($baseLink) > 36) ? \"...\" . substr($baseLink, -32) : $baseLink;\n\t\t\t$urlsegment->setURLPrefix($url);\n\t\t\t$fields->replaceField('URLSegment', $urlsegment);\n\t\t\t*/\n\n\t\t\t// Categories Fields\n\t\t\tarsort($categories);\n\t\t\t$fields->addFieldsToTab(\n\t\t\t\t'Root.Main',\n\t\t\t\tarray(\n\t\t\t\t\tDropDownField::create('MainCategoryID', 'Select main category', $categories)->setEmptyString('Select a category'),\n\t\t\t\t\tListboxField::create('ProductCategories', 'Categories')->setMultiple(true)->setSource($categories)->setAttribute('data-placeholder', 'Add categories')\n\t\t\t\t),\n\t\t\t\t'Content'\n\t\t\t);\n\n\t\t\t// Short Description\n\t\t\t$fields->addFieldToTab('Root.Main', TextareaField::create('ShortDescription', 'Short Description'), 'Content');\n\n\t\t\t// Product images\n\t\t\t$prodimgconf = GridFieldConfig_RelationEditor::create(10)->addComponent(new GridFieldSortableRows('SortOrder'));\n\t\t\t$fields->addFieldToTab('Root.Images', new GridField('Images', 'Images', $this->Images(), $prodimgconf));\n\n\t\t\t//Product variations\n\t\t\t$attributes = $shopConfig->Attributes();//$this->Attributes();\n\t\t\tif ($attributes && $attributes->exists()) {\n\t\t\t\t$variationFieldList = array();\n\t\t\t\tforeach ($attributes as $attribute) {\n\t\t\t\t\t$variationFieldList['AttributeValue_'.$attribute->ID] = $attribute->Title;\n\t\t\t\t}\n\t\t\t\t$variationFieldList = array_merge($variationFieldList, singleton('Variation')->summaryFields());\n\n\t\t\t\t$config = GridFieldConfig_HasManyRelationEditor::create();\n\t\t\t\t$dataColumns = $config->getComponentByType('GridFieldDataColumns');\n\t\t\t\t$dataColumns->setDisplayFields($variationFieldList);\n\n\t\t\t\tif($this->OnSpecial() && $shopConfig->config()->HideVariationsOnSpecial){\n\t\t\t\t\t$listField = new LiteralField('','<h3>Variations can only be added when a product is not on special.</h3>');\n\t\t\t\t} else {\n\t\t\t\t\t$listField = new GridField(\n\t\t\t\t\t\t'Variations',\n\t\t\t\t\t\t'Variations',\n\t\t\t\t\t\t$this->Variations(),\n\t\t\t\t\t\t$config\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t$fields->addFieldToTab('Root.Variations', $listField);\n\t\t\t}\n\n\t\t\t// Stock level\n\t\t\tif($shopConfig->StockCheck){\n\t\t\t\tif(!$this->Variations()){\n\t\t\t\t\t$fields->addFieldToTab('Root.Main', TextField::create('Stock', 'Stock level'), 'MainCategoryID');\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\t$fields->addFieldToTab('Root.Main', new LiteralField('CategoryWarning',\n\t\t\t\t'<p class=\"message warning\">Please create a category before creating products.</p>'\n\t\t\t), 'Title');\n\t\t}\n\n\t\t//Ability to edit fields added to CMS here\n\t\t$this->extend('updateProductCMSFields', $fields);\n\n\t\tif ($warning = ShopConfig::base_currency_warning()) {\n\t\t\t$fields->addFieldToTab('Root.Main', new LiteralField('BaseCurrencyWarning',\n\t\t\t\t'<p class=\"message warning\">'.$warning.'</p>'\n\t\t\t), 'Title');\n\t\t}\n\n\t\treturn $fields;\n\t}", "function ywccp_get_all_custom_fields(){\r\n\t\t\r\n\t\t$fields = array();\r\n\t\t// get billing\r\n\t\t$fields['billing'] = ywccp_get_custom_fields('billing');\r\n\t\t// get shipping\r\n\t\t$fields['shipping'] = ywccp_get_custom_fields('shipping');\r\n\t\t// get additional\r\n\t\t$fields['additional'] = ywccp_get_custom_fields('additional');\r\n\t\t\r\n\t\treturn $fields;\r\n\t}", "function create_custom_fields() {\n // Get all components to be listed\n $this->get_components();\n // Add components meta box\n if ( function_exists( 'add_meta_box' ) ) {\n foreach ( $this->postTypes as $postType ) {\n add_meta_box( 'wpnext', 'WPNext Builder', array( &$this, 'display_custom_fields' ), $postType, 'normal', 'high' );\n }\n }\n }", "function _arc_meta_category_meta($event, $step, $data, $rs)\n{\n // category types).\n if ($rs['type']!='article') {\n return $data;\n }\n\n // Get the existing meta data for this category.\n $meta = _arc_meta('category', $rs['name'], true);\n\n $form = hInput('arc_meta_id', $meta['id']);\n $form .= '<div class=\"txp-form-field edit-category-arc_meta_title\">';\n $form .= '<div class=\"txp-form-field-label\">' . tag(gtxt('arc_meta_title'), 'label', ' for=\"arc_meta_title\"') . '</div>';\n $form .= '<div class=\"txp-form-field-value\">' . fInput('text', 'arc_meta_title', $meta['title'], '', '', '', '32', '', 'arc_meta_title') . '</div>';\n $form .= '</div>';\n $form .= '<div class=\"txp-form-field edit-category-arc_meta_image\">';\n $form .= '<div class=\"txp-form-field-label\">' . tag(gtxt('arc_meta_image'), 'label', ' for=\"arc_meta_image\"') . '</div>';\n $form .= '<div class=\"txp-form-field-value\">' . fInput('number', 'arc_meta_image', $meta['image'], '', '', '', '32', '', 'arc_meta_image') . '</div>';\n $form .= '</div>';\n $form .= '<div class=\"txp-form-field edit-category-arc_meta_robots\">';\n $form .= '<div class=\"txp-form-field-label\">' . tag(gtxt('arc_meta_robots'), 'label', ' for=\"arc_meta_description\"') . '</div>';\n $form .= '<div class=\"txp-form-field-value\">' . selectInput('arc_meta_robots', _arc_meta_robots(), $meta['robots'], 'arc_meta_robots') . '</div>';\n $form .= '</div>';\n\n return $data . $form;\n}", "function listing_fields_collection()\r\n{\r\n\tglobal $wpdb,$post;\r\n\tremove_all_actions('posts_where');\r\n\t$cus_post_type = get_post_type();\r\n\t$args = \r\n\tarray( 'post_type' => 'custom_fields',\r\n\t'posts_per_page' => -1\t,\r\n\t'post_status' => array('publish'),\r\n\t'meta_query' => array(\r\n\t 'relation' => 'AND',\r\n\t\tarray(\r\n\t\t\t'key' => 'post_type_'.$cus_post_type.'',\r\n\t\t\t'value' => $cus_post_type,\r\n\t\t\t'compare' => '=',\r\n\t\t\t'type'=> 'text'\r\n\t\t),\r\n\t\tarray(\r\n\t\t\t'key' => 'show_on_page',\r\n\t\t\t'value' => array('user_side','both_side'),\r\n\t\t\t'compare' => 'IN'\r\n\t\t),\r\n\t\tarray(\r\n\t\t\t'key' => 'is_active',\r\n\t\t\t'value' => '1',\r\n\t\t\t'compare' => '='\r\n\t\t),\r\n\t\tarray(\r\n\t\t\t'key' => 'show_on_listing',\r\n\t\t\t'value' => '1',\r\n\t\t\t'compare' => '='\r\n\t\t)\r\n\t),\r\n\t\t'meta_key' => 'sort_order',\r\n\t\t'orderby' => 'meta_value',\r\n\t\t'order' => 'ASC'\r\n\t);\r\n\t$post_query = null;\r\n\tadd_filter('posts_join', 'custom_field_posts_where_filter');\r\n\t$post_query = new WP_Query($args);\r\n\tremove_filter('posts_join', 'custom_field_posts_where_filter');\r\n\treturn $post_query;\r\n}", "public static function get_custom_fields() {\n\n\t\t$custom_fields = [];\n\t\t$fields = self::get_meta_keys_alt();\n\n\t\tforeach ( $fields as $field ) {\n\t\t\t$custom_fields[$field] = ucfirst( str_replace( '_', ' ', $field ) );\n\t\t}\n\n\t\treturn $custom_fields;\n\n\t}", "public function extraFields()\n {\n return ['categoria'];\n }" ]
[ "0.68171626", "0.66885823", "0.6568583", "0.6500657", "0.64871895", "0.6476785", "0.643758", "0.6403181", "0.6403181", "0.6352187", "0.6352187", "0.63201135", "0.6286337", "0.62459534", "0.6243046", "0.6232388", "0.6188691", "0.61799073", "0.6174262", "0.6167261", "0.6121792", "0.6102491", "0.60585433", "0.6041173", "0.6032209", "0.6001477", "0.59697014", "0.5962762", "0.59622896", "0.5941475" ]
0.70938337
0
See if a draft exists for a requested category
public function has_draft($cat_id, $language_id = FALSE) { // Get by current language or a requested one? $language_id = $language_id ?: ee()->publisher_lib->lang_id; $where = array( 'cat_id' => $cat_id, 'publisher_status' => PUBLISHER_STATUS_DRAFT, 'publisher_lang_id' => $language_id ); $qry = ee()->db->select('edit_date')->get_where($this->data_table, $where); // If we have a draft, see if its newer than the open version. if ($qry->num_rows()) { $draft_date = $qry->row('edit_date'); $where = array( 'cat_id' => $cat_id, 'publisher_status' => PUBLISHER_STATUS_OPEN, 'publisher_lang_id' => $language_id ); $qry = ee()->db->select('edit_date')->get_where($this->data_table, $where); $open_date = $qry->row('edit_date') ?: 0; if ($draft_date > $open_date) { return TRUE; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function user_can_create_draft($user_id, $blog_id = 1, $category_id = 'None')\n {\n }", "public function cate_exists() {\n\t\t$category_name = trim($this->input->post ( 'category_name' ));\n\n\n\t\t$edit_id = $this->input->post ( 'edit_id' );\n\t\t$where = array ( 'category_name' => trim ( $category_name ));\n\n\t\tif ($edit_id != \"\") {\n\t\t\t$where = array_merge ( $where, array ( \"category_id !=\" => $edit_id ) );\n\t\t} \n\n\t\t$result = $this->Mydb->get_record ( 'category_id', $this->table, $where );\n\t\tif (! empty ( $result )) {\n\t\t\t$this->form_validation->set_message ( 'cate_exists', get_label('cate_exists') );\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function hasCategory(): bool;", "public static function isDrafted()\n\t{\n\t\t$app = Factory::getApplication();\n\t\t$template = $app->getTemplate(true);\n\t\t$templateId = 0;\n\n\t\tif ($app->isClient('site'))\n\t\t{\n\t\t\t$templateId = $template->id;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($app->input->get('option') === 'com_ajax' && $app->input->get('helix') === 'ultimate')\n\t\t\t{\n\t\t\t\t$templateId = $app->input->get('id', 0, 'INT');\n\t\t\t}\n\t\t}\n\n\t\t$draftKeyOptions = [\n\t\t\t'option' => 'com_ajax',\n\t\t\t'helix' => 'ultimate',\n\t\t\t'status' => 'draft',\n\t\t\t'id' => $templateId\n\t\t];\n\n\t\t$key = self::generateKey($draftKeyOptions);\n\t\t$cache = new HelixCache($key);\n\n\t\treturn $cache->contains();\n\t}", "public function isCategory($category): bool;", "public function isDraft();", "public function isDraft();", "public function isDraft();", "public function isNewCategory(): bool {\n return !$this->category->exists;\n }", "public function draftsExists($page_id) {\n\t\t// Build the MindTouch API URL to check a draft's existence.\n\t\t$url = $this->draftsUrl($page_id);\n\n\t\t// Get output from API.\n\t\t$output = $this->get($url);\n\n\t\t// Parse the output.\n\t\t$output = $this->parseOutput($output);\n\n\t\tif ((string) $output['state'] === 'active' \n\t\t\t|| (string) $output['state'] === 'unpublished'\n\t\t) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function hasDrafts(): bool\n {\n return $this->drafts()->count() > 0;\n }", "function categoryAssociationExists($monographId, $categoryId) {\n\t\t$result = $this->retrieve(\n\t\t\t'SELECT COUNT(*) FROM submission_categories WHERE submission_id = ? AND category_id = ?',\n\t\t\tarray((int) $monographId, (int) $categoryId)\n\t\t);\n\t\t$returner = isset($result->fields[0]) && $result->fields[0] == 1 ? true : false;\n\n\t\t$result->Close();\n\t\treturn $returner;\n\t}", "function has_category($category = '', $post = \\null)\n {\n }", "function categoryExists($cat) { // Return true if the given category exists\n\t$cat = dbEscape($cat);\n\treturn(dbResultExists(\"SELECT * FROM categories WHERE name='$cat'\"));\n}", "public function isDraft()\n {\n return $this->publish_status == Status::DRAFT;\n }", "public function cat_match($category){\n\n\t\t\t$sql = mysql_query(\"SELECT * FROM `categories` WHERE `cat` = '$category'\");\n\n\t\t\t$count_query = mysql_num_rows($sql);\n\n\t\t\t\tif ($count_query == 0) {\n\t\t\t\t\t# code...\n\t\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t\t} else {\n\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\t}", "function dialogue_contains_draft_files($draftid) {\n global $USER;\n\n $usercontext = \\context_user::instance($USER->id);\n $fs = get_file_storage();\n\n $draftfiles = $fs->get_area_files($usercontext->id, 'user', 'draft', $draftid, 'id');\n\n return (count($draftfiles) > 1) ? true : false;\n}", "function feed_category_term_access($feed_category_term) {\r\n global $user;\r\n \r\n if (isset($feed_category_term->uid) && $feed_category_term->uid == $user->uid) {\r\n return TRUE;\r\n }\r\n if (isset($feed_category_term->fcid) && $feed_category = feed_category_load($feed_category_term->fcid)) {\r\n return $feed_category->uid == $user->uid;\r\n }\r\n return FALSE;\r\n}", "public function isDraft()\n {\n return $this->isInStatus($this::DRAFT);\n }", "private function hasDraft(&$Model, $id) {\r\n\t\treturn $Model->DraftModel->find('count', array(\r\n\t\t\t\t'conditions' => array($Model->primaryKey => $id)));\r\n\t}", "public function isDraft()\n {\n return ($this->getData('draft')) ? true : false;\n }", "public function hasCreatedFromDraftId()\n {\n return $this->CreatedFromDraftId !== null;\n }", "function post_exists($title, $content = '', $date = '', $type = '', $status = '')\n {\n }", "public static function exists($id,$future,$draft) {\n global $manager;\n\n $id = intval($id);\n\n $sql = 'SELECT count(*) AS result FROM '.sql_table('item').' WHERE inumber='.$id;\n if (!$future) {\n $bid = getBlogIDFromItemID($id);\n if (!$bid) return 0;\n $b =& $manager->getBlog($bid);\n $sql .= ' AND itime<='.mysqldate($b->getCorrectTime());\n }\n if (!$draft) {\n $sql .= ' AND idraft=0';\n }\n $sql .= ' LIMIT 1';\n\n return (intval(quickQuery($sql)) > 0);\n }", "public function hasCategory()\n {\n return $this->category !== null;\n }", "public function canBeShowInCategory($categoryId)\n {\n return $this->_getResource()->canBeShowInCategory($this, $categoryId);\n }", "public function hasCategory($categoryId) {\n\t\t$quizCategories = $this->quizCategoriesTable->find('quizId', $this->id);\n\n\t\tforeach ($quizCategories as $quizCategory) {\n\t\t\tif ($quizCategory->categoryId == $categoryId) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}", "public function category_exists() {\n\t\t$users_name = trim($this->input->post ( 'category_name' ));\n\n\t\t$where = array ('category_name' => trim ( $users_name ));\n\t\t\n\t\t$result = $this->Mydb->get_record ( 'category_id', $this->table, $where );\n\t\tif (! empty ( $result )) {\n\t\t\t$this->form_validation->set_message ( 'cate_exists', get_label('username_exists') );\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function getDraftAttribute(): bool\n {\n return $this->status_id === CampaignStatus::STATUS_DRAFT;\n }", "public function checkCategoryExist($ssCategory)\n {\n try\n {\n return Doctrine_Query::create()\n ->select(\"MU.*\")\n ->from(\"Model_Category MU\")\n ->where(\"MU.category_name =?\",$ssCategory)\n ->fetchArray();\n }\n catch( Exception $e )\n {\n echo $e->getMessage();\n return false;\n }\n }" ]
[ "0.6410271", "0.6308579", "0.62689185", "0.62643653", "0.61226237", "0.61004084", "0.61004084", "0.61004084", "0.60864604", "0.6063833", "0.59904146", "0.5868327", "0.5829884", "0.5709518", "0.57029325", "0.55906355", "0.5565072", "0.5559128", "0.55590665", "0.55541635", "0.5552491", "0.55474836", "0.5543759", "0.5538997", "0.55215085", "0.5505266", "0.5501607", "0.55015355", "0.54740196", "0.54720336" ]
0.66792125
0
Search by a translated url_title, and return the default language version of it.
public function get_default_url_title($url_title, $return = 'url_title') { // First see if its a Cat URL Indicator translation if ($seg = $this->_get_default_cat_url_indicator($url_title)) { return $seg; } $cache_key = 'get_default_url_title/cat'. $url_title .'/'. $return; // Make sure this query run as few times as possible if ( !isset(ee()->session->cache['publisher'][$cache_key])) { $qry = ee()->db->select('cat_id') ->where('cat_url_title', $url_title) ->where('publisher_lang_id', ee()->publisher_lib->lang_id) ->where('publisher_status', ee()->publisher_lib->status) ->get('publisher_categories'); if ($qry->num_rows() == 1) { $cat_id = $qry->row('cat_id'); if ($return == 'cat_id') { ee()->session->cache['publisher'][$cache_key] = $cat_id; } else { $qry = ee()->db->select('cat_url_title') ->where('cat_id', $cat_id) ->get('categories'); $url_title = $qry->num_rows() ? $qry->row('cat_url_title') : $url_title; ee()->session->cache['publisher'][$cache_key] = $url_title; } } } if (isset(ee()->session->cache['publisher'][$cache_key])) { return ee()->session->cache['publisher'][$cache_key]; } return ($return === FALSE) ? FALSE : $url_title; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLanguageFromUrl(string $url);", "abstract public function get_language_url($language = null, $url = null);", "function loadContentEnglish($where, $default='') {\n // Sanitize it for security reasons\n $content = filter_input(INPUT_GET, $where, FILTER_SANITIZE_STRING);\n $default = filter_var($default, FILTER_SANITIZE_STRING);\n // If there wasn't anything on the url, then use the default\n $content = (empty($content)) ? $default : $content;\n // If you found have content, then get it and pass it back\n if ($content) {\n\t// sanitize the data to prevent hacking.\n\t$html = include 'content/en/'.$content.'.php';\n\treturn $html;\n }\n}", "private function _get_default_cat_url_indicator($url_title)\n {\n foreach (ee()->publisher_model->languages as $lang_id => $language)\n {\n if ($language['cat_url_indicator'] == $url_title)\n {\n return ee()->publisher_model->languages[ee()->publisher_lib->default_lang_id]['cat_url_indicator'];\n }\n }\n\n return FALSE;\n }", "function search( ) {\n\t\t$language_id = $this->session->userdata('language_id');\n\t\t// breadcrumb urls\n\t\t$language_list = get_msg('list_lang_label');\n\t\t$this->data['action_title'] = array( \n\t\t\tarray( 'url' => '/index/', 'label' => get_msg('list_lang_str_label'), 'mod_name' => 'language_strings','special_mod_name' => 'Languages', 'special_mod_url' => $language_list),\n\t\t\tarray( 'label' => get_msg( 'lang_str_search' ))\n\t\t\t\n\t\t);\n\t\t\n\t\t// condition with search term\n\t\tif($this->input->post('submit') != NULL ){\n\t\t\t$conds = array( 'searchterm' => $this->searchterm_handler( $this->input->post( 'searchterm' )) );\n\t\t\tif($this->input->post('searchterm') != \"\") {\n\t\t\t\t$conds['searchterm'] = $this->input->post('searchterm');\n\t\t\t\t$this->data['searchterm'] = $this->input->post('searchterm');\n\t\t\t\t$this->session->set_userdata(array(\"searchterm\" => $this->input->post('searchterm')));\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$this->session->set_userdata(array(\"searchterm\" => NULL));\n\t\t\t}\n\t\t}else{\n\t\t\t//read from session value\n\t\t\tif($this->session->userdata('searchterm') != NULL){\n\t\t\t\t$conds['searchterm'] = $this->session->userdata('searchterm');\n\t\t\t\t$this->data['searchterm'] = $this->session->userdata('searchterm');\n\t\t\t}\n\t\t}\n\n\t\t$conds['language_id'] = $language_id;\n\t\t// print_r($conds);die;\n\t\t// pagination\n\t\t$this->data['rows_count'] = $this->Language_string->count_all_by( $conds );\n\n\t\t// search data\n\t\t$this->data['langstrings'] = $this->Language_string->get_all_by( $conds, $this->pag['per_page'], $this->uri->segment( 4 ) );\n\t\t$this->data['language_id'] = $language_id;\n\t\t\n\t\t// load add list\n\t\tparent::string_search($language_id);\n\t}", "public function get_language_from_url( $url = '' ) {\n\t\tif ( empty( $url ) ) {\n\t\t\t$url = pll_get_requested_url();\n\t\t}\n\n\t\t$host = wp_parse_url( $url, PHP_URL_HOST );\n\t\treturn ( $lang = array_search( $host, $this->get_hosts() ) ) ? $lang : '';\n\t}", "public static function getLangByUrl($url = null)\n {\n if (is_null($url)) {\n return null;\n } else {\n $lang = self::find()->where(['url' => $url, 'status' => self::LANGUAGE_STATUS_ACTIVE])->one();\n if (is_null($lang)) {\n return null;\n } else {\n return $lang;\n }\n }\n }", "protected function getTitleFromUrl($url, $default = '')\n {\n if (!empty($default)) {\n return $default;\n }\n\n preg_match('/<title>(.+)<\\/title>/', @file_get_contents($url), $matches);\n\n if (empty($matches)) {\n return $url;\n }\n\n return mb_convert_encoding($matches[1], 'UTF-8', 'UTF-8');\n }", "public function get_translated_url_title($url_title, $lang_id_from = NULL, $lang_id_to = NULL)\n {\n $lang_id_from = $lang_id_from ?: ee()->publisher_lib->prev_lang_id;\n $lang_id_to = $lang_id_to ?: ee()->publisher_lib->lang_id;\n\n // If we're in the middle of a language switch, I don't care what was passed to this method.\n if (ee()->publisher_lib->switching)\n {\n $lang_id_from = ee()->publisher_lib->prev_lang_id;\n }\n\n $key = $lang_id_from.':'.$lang_id_to;\n\n if ( !isset($this->cache['translated_cat_url_title'][$url_title][$key]))\n {\n // Is it a Cat URL Title indicator?\n if ($seg = $this->_get_translated_cat_url_indicator($url_title, $lang_id_from, $lang_id_to))\n {\n $this->cache['translated_cat_url_title'][$seg][$key] = $seg;\n\n return $seg;\n }\n\n $qry = ee()->db->select('cat_id')\n ->where('cat_url_title', $url_title)\n ->where('publisher_lang_id', $lang_id_from)\n ->where('publisher_status', ee()->publisher_lib->status)\n ->get('publisher_categories');\n\n if ($qry->num_rows() == 1)\n {\n $cat_id = $qry->row('cat_id');\n\n $qry = ee()->db->select('cat_url_title')\n ->where('cat_id', $cat_id)\n ->where('publisher_lang_id', $lang_id_to)\n ->where('publisher_status', ee()->publisher_lib->status)\n ->get('publisher_categories');\n\n $url_title = $qry->num_rows() ? $qry->row('cat_url_title') : $url_title;\n\n $this->cache['translated_cat_url_title'][$url_title][$key] = $url_title;\n\n return $url_title;\n }\n }\n\n $this->cache['translated_cat_url_title'][$url_title][$key] = $url_title;\n\n return $url_title;\n }", "public static function find_default()\n\t{\n\t\t// All supported languages\n\t\t$langs = (array) Kohana::$config->load('lang');\n\n\t\t// Look for language cookie first\n\t\tif ($lang = Cookie::get(Lang::$cookie))\n\t\t{\n\t\t\t// Valid language found in cookie\n\t\t\tif (isset($langs[$lang]))\n\t\t\t\treturn $lang;\n\n\t\t\t// Delete cookie with invalid language\n\t\t\tCookie::delete(Lang::$cookie);\n\t\t}\n\n\t\t// Parse HTTP Accept-Language headers\n\t\tforeach (Request::accept_lang() as $lang => $quality)\n\t\t{\n\t\t\t// Return the first language found (the language with the highest quality)\n\t\t\tif (isset($langs[$lang]))\n\t\t\t\treturn $lang;\n\t\t}\n\n\t\t// Return the hard-coded default language as final fallback\n\t\treturn Lang::$default;\n\t}", "public function getLanguageSearch(): ?string {\n\t\treturn (string)$this->_getConfig('language.search');\n\t}", "function subtitle($url)\n{\n // include the countries array\n $countries = include \"../app/includes/countries_array.php\";\n\n // if search results were found\n if(!empty($url['search'])) return \"results found\";\n\n // if country page is open\n if(!empty($url['country']) && isset($countries[$url['country']])) return \"caps from {$countries[$url['country']]}\";\n\n // if collection page is open\n return \"caps collected\";\n}", "public function getTitle($languageCode);", "abstract public function get_app_language();", "function searchByTitle($title){\n $name = $title['search'];\n return db()->QUERY(\"SELECT * FROM posts WHERE title LIKE '%$name%' ORDER BY title\");\n }", "function get_title() {\n\t\tglobal $Thesaurus;\n\t\tif (isset($_GET['p'])) {\n\t\t\techo ucwords($_GET['p']);\n\t\t} else if (isset($_GET['cat'])) {\n\t\t\techo ucwords($Thesaurus[$_GET['cat']]['T']);\n\t\t} else {\n\t\t\techo 'Home';\n\t\t}\n\t}", "public static function search() {\r\n $result = lC_Default::find($_GET['q']);\r\n\r\n echo $result;\r\n }", "function __($word) {\n global $cfg;\n if (isset($_GET['lang'])) {\n include(\"langs/\".$_GET['lang'].\".php\");\n } else include(\"langs/\".$cfg[\"default_language\"].\".php\"); \n\n return isset($translations[$word]) ? $translations[$word] : $word;\n}", "function prefered_language ($available_languages,$http_accept_language=\"auto\") { \n // if $http_accept_language was left out, read it from the HTTP-Header \n if ($http_accept_language == \"auto\") $http_accept_language = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : ''; \n\n // standard for HTTP_ACCEPT_LANGUAGE is defined under \n // http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4 \n // pattern to find is therefore something like this: \n // 1#( language-range [ \";\" \"q\" \"=\" qvalue ] ) \n // where: \n // language-range = ( ( 1*8ALPHA *( \"-\" 1*8ALPHA ) ) | \"*\" ) \n // qvalue = ( \"0\" [ \".\" 0*3DIGIT ] ) \n // | ( \"1\" [ \".\" 0*3(\"0\") ] ) \n preg_match_all(\"/([[:alpha:]]{1,8})(-([[:alpha:]|-]{1,8}))?\" . \n \"(\\s*;\\s*q\\s*=\\s*(1\\.0{0,3}|0\\.\\d{0,3}))?\\s*(,|$)/i\", \n $http_accept_language, $hits, PREG_SET_ORDER); \n\n // default language (in case of no hits) is the first in the array \n $bestlang = $available_languages[0]; \n $bestqval = 0; \n\n foreach ($hits as $arr) { \n // read data from the array of this hit \n $langprefix = strtolower ($arr[1]); \n if (!empty($arr[3])) { \n $langrange = strtolower ($arr[3]); \n $language = $langprefix . \"-\" . $langrange; \n } \n else $language = $langprefix; \n $qvalue = 1.0; \n if (!empty($arr[5])) $qvalue = floatval($arr[5]); \n \n // find q-maximal language \n if (in_array($language,$available_languages) && ($qvalue > $bestqval)) { \n $bestlang = $language; \n $bestqval = $qvalue; \n } \n // if no direct hit, try the prefix only but decrease q-value by 10% (as http_negotiate_language does) \n else if (in_array($langprefix,$available_languages) && (($qvalue*0.9) > $bestqval)) { \n $bestlang = $langprefix; \n $bestqval = $qvalue*0.9; \n } \n } \n return $bestlang; \n}", "public function getByTitle()\n {\n }", "function lixgetlang() {\n $lang = 'rus';\n \n if ($_GET[lang] != 'rus' && $_GET[lang] != 'eng' && $_GET[lang] != 'deu') {\n if (lixlpixel_detect_lang() != 'ru') { $lang = 'eng'; }\n else { $lang = 'rus'; }\n } else {\n $lang = $_GET[lang];\n }\n \n return $lang;\n}", "function gettitle() {\n\n\t\tglobal $pagetiltle;\n\n\t\tif (isset($pagetiltle)) {\n\n\t\t\techo $pagetiltle;\n\t\t} else {\n\n\t\t\techo lang('DEFAULT');\n\t\t}\n\t}", "public function languageWhere() {}", "public function languageWhere() {}", "function edan_search_set_title( $title )\n {\n $options = new esw_options_handler();\n $cache = new esw_cache_handler();\n\n /**\n * if in the loop and the title is cached (or if object group is retrieved successfully)\n * modify the page title on display.\n */\n if(in_the_loop() && edan_search_name_from_url() == $options->get_path() && $options->get_title() != '')\n {\n if(get_query_var('edanUrl'))\n {\n $object = $cache->get()['object'];\n\n if($object)\n {\n if(property_exists($object, 'content') && property_exists($object->{'content'}, 'descriptiveNonRepeating'))\n {\n if(property_exists($object->{'content'}->{'descriptiveNonRepeating'}, 'title'))\n {\n $title = $object->{'content'}->{'descriptiveNonRepeating'}->{'title'}->{'content'};\n }\n }\n elseif(property_exists($object, 'title'))\n {\n if(property_exists($object->{'title'}, 'content'))\n {\n $title = $this->object->{'title'}->{'content'};\n }\n else\n {\n $title = $this->object->{'title'};\n }\n }\n }\n }\n else\n {\n $title = $options->get_title();\n }\n }\n\n return $title;\n }", "function get_lang($name) {\n global $lang;\n return $lang->get_phrase($name);\n}", "function preferred_language ($available_languages, $http_accept_language=\"auto\") {\n if ($http_accept_language == \"auto\") $http_accept_language = $_SERVER['HTTP_ACCEPT_LANGUAGE'];\n // standard for HTTP_ACCEPT_LANGUAGE is defined under\n // http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4\n // pattern to find is therefore something like this:\n // 1#( language-range [ \";\" \"q\" \"=\" qvalue ] )\n // where:\n // language-range = ( ( 1*8ALPHA *( \"-\" 1*8ALPHA ) ) | \"*\" )\n // qvalue = ( \"0\" [ \".\" 0*3DIGIT ] )\n // | ( \"1\" [ \".\" 0*3(\"0\") ] )\n preg_match_all(\"/([[:alpha:]]{1,8})(-([[:alpha:]|-]{1,8}))?\" .\n \"(\\s*;\\s*q\\s*=\\s*(1\\.0{0,3}|0\\.\\d{0,3}))?\\s*(,|$)/i\",\n $http_accept_language, $hits, PREG_SET_ORDER);\n\n // default language (in case of no hits) is the first in the array\n $bestlang = $available_languages[0];\n $bestqval = 0;\n\n foreach ($hits as $arr) {\n // read data from the array of this hit\n $langprefix = strtolower ($arr[1]);\n if (!empty($arr[3])) {\n $langrange = strtolower ($arr[3]);\n $language = $langprefix . \"-\" . $langrange;\n }\n else $language = $langprefix;\n $qvalue = 1.0;\n if (!empty($arr[5])) $qvalue = floatval($arr[5]);\n\n // find q-maximal language\n if (in_array($language,$available_languages) && ($qvalue > $bestqval)) {\n $bestlang = $language;\n $bestqval = $qvalue;\n }\n // if no direct hit, try the prefix only but decrease q-value by 10% (as http_negotiate_language does)\n else if (in_array($langprefix,$available_languages) && (($qvalue*0.9) > $bestqval)) {\n $bestlang = $langprefix;\n $bestqval = $qvalue*0.9;\n }\n }\n return $bestlang;\n}", "public function matchLanguage()\n\t{\n\t\t$pattern = '/^(?P<primarytag>[a-zA-Z]{2,8})'.\n '(?:-(?P<subtag>[a-zA-Z]{2,8}))?(?:(?:;q=)'.\n '(?P<quantifier>\\d\\.\\d))?$/';\n\t\t\n\t\tforeach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $lang) \n\t\t{\n\t\t\t$splits = array();\n\n\t\t\tif (preg_match($pattern, $lang, $splits)) \n\t\t\t{\n\t\t\t\t$language = $splits['primarytag'];\n\t\t\t\tif(isset($this->languages[$language]))\n\t\t\t\t\treturn $language;\n\t\t\t} \n\t\t\telse \n\t\t\t\treturn 'en';\n\t\t}\n\t\t\n\t\treturn 'en';\n\t}", "public function getTitle($route = NULL) {\n if ($route === NULL) {\n $route = $this->routeMatch->getRouteName();\n }\n $facet = $this->request->get('facets_query');\n\n $title = $this->getTitleFromRoute($route);\n $search = $this->request->query->all();\n\n if ($route === 'search.view') {\n if (!empty($search)) {\n return t('@title results', ['@title' => $title]);\n }\n else {\n return $title;\n }\n }\n // Applying the term being viewed to Judiciary Sentencing guidelines page title.\n elseif ($route === 'view.judicial_decisions_search.sentence_guide_search_page') {\n $current_path = $this->currentPath->getPath();\n // Match the last number in the URL string with the type filter applied.\n if (preg_match_all('/.*\\/type\\/.*-(\\d+)/', $current_path, $matches)) {\n $tid = $matches[1][0];\n if (is_numeric($tid)) {\n $decision_type = Term::load($tid);\n $term_name = $decision_type->getName();\n $title = 'Sentencing guidelines - ' . $term_name;\n }\n }\n else {\n $title = 'Sentencing guidelines';\n }\n return $title;\n }\n else {\n if (!empty($facet) || !empty($search)) {\n return t('@title - search results', ['@title' => $title]);\n }\n else {\n return $title;\n }\n }\n }", "function fetch_title($_url=\"\"){ \n if($_url&&$this-> fetch($_url)){\n $html = str_get_html($this-> html);\n return $html->find('title',0)->plaintext;\n }\n return false;\n }" ]
[ "0.61352044", "0.60453653", "0.5912318", "0.5887892", "0.58520335", "0.57546294", "0.5693313", "0.56768495", "0.5669532", "0.56693906", "0.563123", "0.55944204", "0.54889673", "0.54722184", "0.5399911", "0.5374761", "0.53701484", "0.5348924", "0.5316287", "0.53082323", "0.5284016", "0.52739686", "0.527141", "0.527141", "0.52642745", "0.52623177", "0.5261023", "0.52607495", "0.52536106", "0.5247487" ]
0.6164824
0
Search for the default Cat URL Indicator segment based on the currently translated segment.
private function _get_default_cat_url_indicator($url_title) { foreach (ee()->publisher_model->languages as $lang_id => $language) { if ($language['cat_url_indicator'] == $url_title) { return ee()->publisher_model->languages[ee()->publisher_lib->default_lang_id]['cat_url_indicator']; } } return FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDefaultURLSegment()\n {\n return $this->generateURLSegment(\n _t(\n 'SilverStripe\\CMS\\Controllers\\CMSMain.NEWPAGE',\n 'New {pagetype}',\n [\n 'pagetype' => $this->i18n_singular_name()\n ]\n )\n );\n }", "public static function Segment($key = null, $default = false)\n\t{\n\t\tstatic $result = null;\n\n\t\tif (is_null($result) === true)\n\t\t{\n\t\t\tif (count($result = explode('/', substr(self::Value($_SERVER, 'PHP_SELF'), strlen(self::Value($_SERVER, 'SCRIPT_NAME'))))) > 0)\n\t\t\t{\n\t\t\t\t$result = array_values(array_filter($result, 'strlen'));\n\t\t\t}\n\t\t}\n\n\t\treturn (isset($key) === true) ? self::Value($result, (is_int($key) === true) ? $key : (array_search($key, $result) + 1), $default) : $result;\n\t}", "function LookForExistingURLSegment($URLSegment)\n {\n return Company::get()->filter(array('URLSegment' => $URLSegment, 'ID:not' => $this->ID))->first();\n }", "public function get_cat_url_indicator()\n {\n if(isset(ee()->publisher_model->current_language['cat_url_indicator']) &&\n ee()->publisher_model->current_language['cat_url_indicator'] != '')\n {\n return ee()->publisher_model->current_language['cat_url_indicator'];\n }\n\n return ee()->config->item('reserved_category_word');\n }", "private function get_category_breaking_segment($segments)\n {\n\n // var_dump($segments);\n }", "protected function _default_segments()\n\t{\n\t\t// Check for default controller\n\t\tif (empty($this->default_controller))\n\t\t{\n\t\t\t// Return empty array\n\t\t\treturn array();\n\t\t}\n\n\t\t// Break out default controller\n\t\t$default = explode('/', $this->default_controller);\n\t\tif ( ! isset($default[1]))\n\t\t{\n\t\t\t// Add default method\n\t\t\t$default[] = 'index';\n\t\t}\n\n\t\treturn $default;\n\t}", "private function _get_translated_cat_url_indicator($str, $lang_id_from = NULL, $lang_id_to = NULL)\n {\n $from_language = ee()->publisher_model->languages[$lang_id_from];\n $to_language = ee()->publisher_model->languages[$lang_id_to];\n\n if ($from_language['cat_url_indicator'] == $str)\n {\n return $to_language['cat_url_indicator'];\n }\n\n return FALSE;\n }", "public function getUrlSegment()\n {\n // Create URL segment if we don't have one.\n if(!$this->url_segment){\n $this->url_segment = str_slug($this->getFullName().' '.$this->id);\n $this->save();\n }\n\n return $this->url_segment;\n }", "function uriSegment($segment = '')\n {\n $request_uri = trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/');\n $explode = explode('/', str_replace('index.php/', '', $request_uri));\n\n if(empty($segment)) return '';\n\n if(!empty($explode[($segment-1)]))\n return $explode[($segment-1)];\n else \n return '';\n }", "static function get_url_segment() {\r\n\t\tself::$url_path;\r\n\t}", "public function getContentSegment($segment = 'content');", "function ver_categoria ( $uri ) {\n\tglobal $categorias;\n\t//ver si figura la variable cat en el url, en ese caso es categoria\n\t$cat = isset($_REQUEST['cat']) ? $_REQUEST['cat'] : 'none';\n\n\t$parseUrl = explode('/', $uri);\n\t$RequestURI = $parseUrl[1];\n\n\tfor ($i=0; $i < count($categorias); $i++) { \n\t\tif ( $categorias[$i]['slug'] == $RequestURI ) {\n\t\t$cat = $RequestURI;\n\t\tbreak;\n\t\t}\n\t}\n\n\treturn $cat;\n\n}", "public function get_default_url_title($url_title, $return = 'url_title')\n {\n // First see if its a Cat URL Indicator translation\n if ($seg = $this->_get_default_cat_url_indicator($url_title))\n {\n return $seg;\n }\n\n $cache_key = 'get_default_url_title/cat'. $url_title .'/'. $return;\n\n // Make sure this query run as few times as possible\n if ( !isset(ee()->session->cache['publisher'][$cache_key]))\n {\n $qry = ee()->db->select('cat_id')\n ->where('cat_url_title', $url_title)\n ->where('publisher_lang_id', ee()->publisher_lib->lang_id)\n ->where('publisher_status', ee()->publisher_lib->status)\n ->get('publisher_categories');\n\n if ($qry->num_rows() == 1)\n {\n $cat_id = $qry->row('cat_id');\n\n if ($return == 'cat_id')\n {\n ee()->session->cache['publisher'][$cache_key] = $cat_id;\n }\n else\n {\n $qry = ee()->db->select('cat_url_title')\n ->where('cat_id', $cat_id)\n ->get('categories');\n\n $url_title = $qry->num_rows() ? $qry->row('cat_url_title') : $url_title;\n\n ee()->session->cache['publisher'][$cache_key] = $url_title;\n }\n }\n }\n\n if (isset(ee()->session->cache['publisher'][$cache_key]))\n {\n return ee()->session->cache['publisher'][$cache_key];\n }\n\n return ($return === FALSE) ? FALSE : $url_title;\n }", "public function segment($num_segment=NULL){\n\t\t$base_url = $this->site_url();\n\t\t$actual_link = $this->protocol() . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\t\t$set_parse = str_replace($base_url, $this->protocol() . 'g.g/', $actual_link);\n\t\t$parse_url = parse_url($set_parse, PHP_URL_PATH);\n\t\t$arrPath = explode('/', $parse_url);\n\t\t/*\tmembuat urutan ulang index array. urutan pertama menjadi 1 */\n\n\t\tif($num_segment == NULL){\n\n\t\t\t/* menampilkan semua data array */\n\t\t\treturn $arrPath;\n\t\t} else {\n\n\t\t\t/* chcek jika input data melebihi jumlah array path */\n\t\t\tif(count($arrPath) >= $num_segment){\n\t\t\t\tif(isset($arrPath[$num_segment])){\n\t\t\t\t\treturn $arrPath[$num_segment];\n\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t}", "private function __getCategoryIdFromUrl() {\n return $this->uri->segment( 3, 0 );\n }", "function urlSegment($int=''){\n $input = get('url');\n $input = explode('/', $input);\n $int--;\n return $input[$int];\n }", "public function findDefault();", "function get_segment_name() {\n\tif ( isset( $_SERVER['HTTP_X_WPENGINE_SEGMENT'] ) ) {\n\t\treturn sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_WPENGINE_SEGMENT'] ) );\n\t}\n}", "private function get_default_filter_search() {\n \n //get instance config\n $instance_config = $this->get_settings_config_data();\n \n //if there is saved filters\n if(isset($instance_config) && isset($instance_config->data))\n $search = $this->get_default_search($instance_config->data);//get default\n \n //if a default for instance is found return it\n if($search != null) return $search;\n \n //get global config data for dd_content blocks\n $global_config_data = dd_content_get_admin_config();\n \n //tty to get a default from global\n $search = $this->get_default_search($global_config_data);\n \n //if a default is found return it\n if($search != null) return $search;\n\n //no default is found - return null\n return null;\n \n }", "function _esf_tc_helper_get_solr_default_page_path() {\n $solr_page = apachesolr_search_page_load(apachesolr_search_default_search_page());\n return $solr_page['search_path'];\n}", "public static function getFirstSegment(string $uri = null, bool $no_index_path = false, string $index_page_default = NULL){\n $segments = self::segments($uri, $no_index_path, $index_page_default);\n if($segments){\n return array_values($segments)[0];\n }\n return null;\n }", "private function findTranslationId($segment)\n {\n return array_search($segment, (array) $this->trans());\n }", "function matchFirstCategory( $menuname, $categories ) {\n # First load and parse the template page \n $content = loadTemplate( $menuname );\n \n # Navigation list\n $breadcrumb = '';\n preg_match_all( \"`<li>\\s*?(.*?)\\s*</li>`\", $content, $matches, PREG_PATTERN_ORDER );\n \n # Look for the first matching category or a default string\n foreach ( $matches[1] as $nav ) {\n $pos = strpos( $nav, DELIM ); // End of category\n if ( $pos !== false ) {\n $cat = trim( substr($nav, 0, $pos) );\n $crumb = trim( substr($nav, $pos + 1) );\n // Is there a match for any of our page's categories? \n if ( $cat == 'default' ) {\n $breadcrumb = $crumb;\n }\n else if ( in_array( $cat, $categories ) ) {\n $breadcrumb = $crumb;\n break;\n }\n }\n }\n \n return normalizeParameters( $breadcrumb, DELIM, 3 );\n}", "protected function getMappingSegment($className, $segment)\n\t{\n\t\treturn explode('@', $this->mappings[$className])[$segment];\n\t}", "function rest_get_url_prefix()\n {\n }", "private function match($categoryNodes, $segment)\n {\n foreach ($categoryNodes as $categoryNode) {\n if ($segment == $categoryNode->id . ':' . $categoryNode->alias) {\n return $categoryNode;\n }\n }\n return null;\n }", "public function getUrlSegment ()\n {\n $parts = preg_split(\n '/([A-Z]{1}+[a-z]+)|([A-Z])/',\n $this->getClassName(),\n -1,\n PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY\n );\n\n return strtolower(implode('-', $parts));\n }", "public static function translate($input = null, $casing = null, $scan_bundles = false)\r\n\t{\r\n\r\n\t\t// Defaults\r\n\t\tif (strlen($scan_bundles) == 0 || $scan_bundles === false)\r\n\t\t\t$scan_bundles = Config::get('breadcrumb::breadcrumb.scan_bundles');\r\n\r\n\t\tif (strlen($casing) == 0 || is_null($casing))\r\n\t\t\t$casing = Config::get('breadcrumb::breadcrumb.default_casing');\r\n\r\n\t\t// Check if an input was given or not and process it if it is necessary\r\n\t\tif (is_array($input))\r\n\t\t{\r\n\t\t\tstatic::$segments_raw = $input;\r\n\t\t}\r\n\t\telseif ($input != null)\r\n\t\t{\r\n\t\t\tstatic::$segments_raw = static::split_uri($input);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tstatic::$segments_raw = static::split_uri(URI::current());\r\n\t\t}\r\n\r\n\t\t// Translation\r\n\t\tif (is_array(static::$segments_raw) && !empty(static::$segments_raw))\r\n\t\t{\r\n\t\t\t// Clean previous versions\r\n\t\t\tstatic::$segments_translated = null;\r\n\r\n\t\t\tforeach (static::$segments_raw AS $value)\r\n\t\t\t{\r\n\t\t\t\t$key = 'breadcrumb::breadcrumb.' . $value;\r\n\t\t\t\t$tmp = null;\r\n\r\n\t\t\t\t// If the scanning is turned on, and if we find a match\r\n\t\t\t\t// for the current controller's name in the bundles list\r\n\t\t\t\t// then we use it's language settings instead of this\r\n\t\t\t\t// bundle's translations.\r\n\t\t\t\t$controller_name = strtolower(URI::segment(1));\r\n\r\n\t\t\t\t// Case insensitive search, just in case... o.O\r\n\t\t\t\tforeach(\\Bundle::names() AS $bundle_name)\r\n\t\t\t\t{\r\n\r\n\t\t\t\t\t// This isn't the greates way of executing a search,\r\n\t\t\t\t\t// but couldn't find a better way to do it at the \r\n\t\t\t\t\t// time this was made....\r\n\t\t\t\t\tif(strtolower($controller_name) == strtolower($bundle_name) && $scan_bundles === true && Lang::has($bundle_name . '::breadcrumb.' . $value))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$tmp = Lang::line($bundle_name . '::breadcrumb.' . $value)->get();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If it doesn't find a match, then it basically continues\r\n\t\t\t\t// with the translation search in this bundle or falls back.\r\n\t\t\t\tif(is_null($tmp))\r\n\t\t\t\t{\r\n\t\t\t\t\tif (Lang::has($key))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$tmp = Lang::line($key)->get();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$tmp = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\t// Formats\r\n\t\t\t\tswitch ($casing)\r\n\t\t\t\t{\r\n\t\t\t\t\tcase 'lower':\r\n\t\t\t\t\t\t$tmp = Str::lower($tmp);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'upper':\r\n\t\t\t\t\t\t$tmp = Str::upper($tmp);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'title':\r\n\t\t\t\t\t\t$tmp = Str::title($tmp);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t$tmp = Str::lower($tmp);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstatic::$segments_translated[] = $tmp;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new BreadcrumbException('No array provided to work with!');\r\n\t\t}\r\n\t}", "function culturefeed_search_get_active_search_page() {\n if ($type = culturefeed_get_searchable_type_by_path()) {\n return culturefeed_get_search_page($type);\n }\n}", "protected function getCurrentSegment(string $seg): string\n {\n if ($seg[0] === '{') {\n return str_replace(['}', '{'], '', $seg);\n }\n\n return $seg;\n }" ]
[ "0.53501505", "0.5228517", "0.5163586", "0.5127393", "0.5069319", "0.4969884", "0.49285695", "0.48433638", "0.4810713", "0.48093724", "0.4749071", "0.46752492", "0.46630478", "0.4662474", "0.46541166", "0.46516436", "0.46339652", "0.462695", "0.46196583", "0.45948422", "0.45757005", "0.45567474", "0.4552777", "0.45457143", "0.45272014", "0.4518733", "0.45163655", "0.45094442", "0.44768858", "0.44693908" ]
0.5442984
0
Retorna o hash de $str de acordo com o algortimo definido na configura??o
public function _hash($str) { switch ($this->config['algoritmo_criptografia']) { case 'sha1': return ($str == '') ? '' : sha1($str); break; case 'crypt': return crypt($str); break; case 'base64': return base64_encode($str); break; case 'plain': return $str; break; case 'md5': default: return md5($str); break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function hash($str)\n\t{\n\t\treturn hash($this->config['hash_method'], $str);\n\t}", "public function hash($str)\n\t{\n\t\treturn hash($this->_config['hash_method'], $str);\n\t}", "function getHash($str)\n{\n\treturn hash('sha256', $str);\n}", "public function hash($str)\n\t{\n\t\t// on some servers hash() can be disabled :( then password are not encrypted \n\t\tif (empty($this->config['hash_method']))\n\t\t\treturn $this->config['salt_prefix'].$str.$this->config['salt_suffix']; \n\t\telse\n\t\t\treturn hash($this->config['hash_method'], $this->config['salt_prefix'].$str.$this->config['salt_suffix']); \n\t}", "public function hash($str) {\n\n return hash($this->hash_method, $str);\n }", "private function hash($str)\n {\n return ($this->hashType == 'sha1') ? $this->sha1($str) : md5($str);\n }", "private static function getHash($string)\n\t{\n\t\treturn base64_encode(extension_loaded('hash') ?\n\t\thash_hmac('sha1', $string, self::$__secretKey, true) : pack('H*', sha1(\n\t\t(str_pad(self::$__secretKey, 64, chr(0x00)) ^ (str_repeat(chr(0x5c), 64))) .\n\t\tpack('H*', sha1((str_pad(self::$__secretKey, 64, chr(0x00)) ^\n\t\t(str_repeat(chr(0x36), 64))) . $string)))));\n\t}", "private static function key($str) {\n\t\treturn md5($str);\n\t}", "public static function GetPasswordHash($str)\n {\n global $PASSWORD_HASH_INFO;\n if (empty($PASSWORD_HASH_INFO)) {\n $type = 'sha256';\n $user_salt = '';\n $random_salt_length = 8;\n } else {\n $type = $PASSWORD_HASH_INFO['type'];\n $user_salt = $PASSWORD_HASH_INFO['user_salt'];\n $random_salt_length = $PASSWORD_HASH_INFO['random_salt_length'];\n }\n $random_salt = ($random_salt_length)? substr(md5(uniqid(rand())), 0, $random_salt_length) : '';\n return $random_salt . hash($type, $random_salt . $str . $user_salt);\n }", "public function hash ($string){\n\t\treturn hash('sha512', $string . config_item('encryption_key'));\n\t\t}", "public function hash($str)\n {\n return ($this->_hashType == 'sha1') ? $this->sha1($str) : md5($str);\n }", "protected function _getHash($string) {\n\n\t\t\treturn sha1($string);\n\t\t}", "public static function hash($string) {\n $hash = hash_init(Config::get('HASH'));\n hash_update($hash, $string);\n hash_update($hash, Config::get('SALT'));\n\n return hash_final($hash);\n }", "public function hash($string){\n return hash('sha512', $string . config_item('encryption_key'));\n }", "public function hash( $string ) {\n\n return hash( 'sha512', $string.config_item( 'encryption_key' ) );\n }", "function get_hash($string) {\r\n return hash('sha1', $string);\r\n}", "static function hash_string($input, $config = []) {\n\t\t$defaults = [\n\t\t\t'use_salt' => true,\n\t\t\t'encryption' => PASSWORD_BCRYPT\n\t\t];\n\t\t$config = array_merge($defaults, $config);\n\n\t\t//Create random bytes\n\t\t$salt_byte = random_bytes(15);\n\t\t//Make the bytes into a readable string (to save to the database)\n\t\t$salt_string = $config['use_salt'] ? bin2hex($salt_byte) : \"\";\n\t\t//Put the salt-string after the password for the hashing for both creation and login\n\t\t$string_hashed = password_hash($input . $salt_string, $config['encryption']);\n\n\t\treturn ['hash' => $string_hashed, 'salt' => $salt_string];\n\t}", "public function hashPass($str)\n {\n // Phalcon's hashing system\n //return $this->_security->hash($str);\n\n // Using PHP5.5's built in system\n return password_hash($str, PASSWORD_DEFAULT, ['cost' => \\Phalcon\\DI::getDefault()->getShared('config')->auth->hash_workload]);\n }", "public static function hashCode($_str) {\n\t\treturn str_pad(\n\t\t\tbase_convert(sprintf('%u',crc32($_str)),10,36),7,'0',\n\t\t\t\tSTR_PAD_LEFT\n\t\t);\n\t}", "public static function hash($str, $type = 'sha1')\n {\n if ($type == 'sha1') {\n return sha1($str);\n } else {\n return md5($str);\n }\n }", "private static function hash($str) {\n $hash = 0;\n\n for ($i = 0, $l = strlen($str); $i < $l; $i++) {\n $hash += ord($str[$i]);\n $hash += $hash << 10;\n $hash ^= $hash >> 6;\n }\n\n $hash += $hash << 3;\n $hash ^= $hash >> 6;\n $hash += $hash << 16;\n\n return $hash;\n }", "function getHash($str, $hashSize) {\n // Sum the ascii of every char of the string\n // and return the modulus of $hashsize\n $str_arr = str_split($str);\n $sum = 0;\n foreach ($str_arr as $char) {\n $sum += ord($char);\n }\n return $sum % $hashSize;\n}", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "function _hash($string) {\n\t\t\t// Use sha1() if possible, php versions >= 4.3.0 and 5\n\t\t\tif(function_exists('sha1')) {\n\t\t\t\t$hash = sha1($string);\n\t\t\t} else {\n\t\t\t\t// Fall back to md5(), php versions 3, 4, 5\n\t\t\t\t$hash = md5($string);\n\t\t\t}\n\t\t\t$out ='';\n\t\t\t// Convert hexadecimal hash value to binary string\n\t\t\tfor($c=0;$c<strlen($hash);$c+=2) {\n\t\t\t\t$out .= $this->_hex2chr($hash[$c] . $hash[$c+1]);\n\t\t\t}\n\t\t\treturn $out;\n\t\t}", "public function getHash() {}", "private function hash($string)\n {\n if (!function_exists('hash')) {\n return sha1($string);\n }\n return hash('sha256', $string);\n }", "function _salt($str)\n\t{\n\t\treturn sha1($this->CI->config->item('encryption_key').$str);\n\t}" ]
[ "0.71996737", "0.7061308", "0.6919904", "0.67925525", "0.6655747", "0.65481097", "0.6514853", "0.64912003", "0.6231753", "0.62079966", "0.6176047", "0.61236596", "0.6118815", "0.60848767", "0.6081343", "0.6071801", "0.6018405", "0.59719974", "0.59462076", "0.59116787", "0.590701", "0.5872514", "0.58669555", "0.58669555", "0.58669555", "0.58669555", "0.5840456", "0.5819923", "0.5801209", "0.5776424" ]
0.7244635
0
Informa se as restri??es definidas possuem alguma dos prefixos
public function restricoes_possuem_rotas_prefixadas() { $routes = Configure::read('Routing.prefixes'); foreach ($this->restricoes as $restriction) { if (in_array($restriction, $routes)) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPrefixes();", "public function getPrefix() {}", "abstract public function getPrefix(): string;", "public function getPrefix();", "public function getPrefix();", "function rest_get_url_prefix()\n {\n }", "function getPrefixes() {\n return array(\"from\" => \"froms\", \"subject\" => \"subjects\", \"text\" => \"texts\");\n}", "function _prefix($prefix = 'admin') {\n\t\tif (isset($this->params['prefix']) && $this->params['prefix'] == $prefix) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function getPrefixes();", "public function getPrefix(): string\n {\n }", "public function getWildcardPrefixes() {}", "abstract public function getRoutePrefix();", "public function prefixDecl(){\n try {\n // Sparql11query.g:36:3: ( PREFIX PNAME_NS iriRef ) \n // Sparql11query.g:37:3: PREFIX PNAME_NS iriRef \n {\n $this->match($this->input,$this->getToken('PREFIX'),self::$FOLLOW_PREFIX_in_prefixDecl120); \n $this->match($this->input,$this->getToken('PNAME_NS'),self::$FOLLOW_PNAME_NS_in_prefixDecl122); \n $this->pushFollow(self::$FOLLOW_iriRef_in_prefixDecl124);\n $this->iriRef();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "abstract protected function getDefaultPrefix(): string;", "function mPREFIX(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$PREFIX;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:101:3: ( 'prefix' ) \n // Tokenizer11.g:102:3: 'prefix' \n {\n $this->matchString(\"prefix\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function eh_rota_prefixada() {\n $routes = Configure::read('Routing.prefixes');\n if (count($routes)) {\n $a = $this->controller->action;\n foreach ($routes as $route) {\n $strpos = strpos($a, $route . '_');\n if ($strpos === 0) {\n return true;\n }\n }\n }\n return false;\n }", "public function setPrefix( $prefix );", "public function setPrefix() {\n\t}", "public function Get_All_Prefix()\n {\n $this->DB->Change_DB($this->PERSON_DB);\n $sql = \"SELECT `code`,`name` FROM `prefix` ORDER BY `name_full`\";\n $result = $this->DB->Query($sql);\n $this->DB->Change_DB($this->DEFAULT_DB);\n if($result)\n {\n $prefix = array();\n for($i=0;$i<count($result);$i++)\n {\n $temp['id'] = $result[$i]['code'];\n $temp['prefix'] = $result[$i]['name'];\n array_push($prefix,$temp);\n }\n return $prefix;\n }\n else\n {\n return false;\n }\n\n }", "function startsWith($prefix) {\n $node = $this->find($prefix);\n return $node != null; // 前缀存在即可\n }", "public function setPrefix($prefix);", "public function test_updatePrefix()\n\t{\n\t}", "public function getSourcePrefixes();", "public function preparePrefixes()\n {\n $this->prefixes['route'] = explode('/', config('app-generator.prefixes.route', ''));\n $this->prefixes['path'] = explode('/', config('app-generator.prefixes.path', ''));\n\n if ($prefix = $this->getOption('prefix')) {\n $multiplePrefixes = explode(',', $prefix);\n\n $this->prefixes['route'] = array_merge($this->prefixes['route'], $multiplePrefixes);\n $this->prefixes['path'] = array_merge($this->prefixes['path'], $multiplePrefixes);\n }\n\n $this->prefixes['route'] = array_filter($this->prefixes['route']);\n $this->prefixes['path'] = array_filter($this->prefixes['path']);\n\n $routePrefix = '';\n foreach ($this->prefixes['route'] as $singlePrefix) {\n $routePrefix .= Str::camel($singlePrefix) . '.';\n }\n $this->prefixes['route'] = !empty($routePrefix) ? substr($routePrefix, 0, -1) : $routePrefix;\n\n $namespacePrefix = $pathPrefix = '';\n foreach ($this->prefixes['path'] as $singlePrefix) {\n $namespacePrefix .= Str::title($singlePrefix) . '\\\\';\n $pathPrefix .= Str::title($singlePrefix) . '/';\n }\n\n $this->prefixes['namespace'] = !empty($namespacePrefix) ? substr($namespacePrefix, 0, -1) : $namespacePrefix;\n $this->prefixes['path'] = !empty($pathPrefix) ? substr($pathPrefix, 0, -1) : $pathPrefix;\n }", "Public Function getPrefix() { Return $this->prefix; }", "public function test_insertPrefix()\n\t{\n\t}", "public function prefixKey($prefix);", "public function testPrefix(): void\n {\n $routes = Router::createRouteBuilder('/');\n\n $routes->prefix('admin', function (RouteBuilder $routes): void {\n $this->assertSame('/admin', $routes->path());\n $this->assertEquals(['prefix' => 'Admin'], $routes->params());\n });\n\n $routes->prefix('admin', ['_namePrefix' => 'admin:'], function (RouteBuilder $routes): void {\n $this->assertSame('admin:', $routes->namePrefix());\n $this->assertEquals(['prefix' => 'Admin'], $routes->params());\n });\n }", "protected function getPrefix(): string\n\t{\n\t\treturn $this->arParams['PREFIX'] !== '' ? $this->arParams['PREFIX'] : $this->getDefaultPrefix();\n\t}", "public function listAll($prefix = '');" ]
[ "0.70628846", "0.7056692", "0.69820374", "0.69389015", "0.69389015", "0.69381607", "0.6771489", "0.67323786", "0.67189294", "0.66852945", "0.664125", "0.65949154", "0.65881336", "0.6540308", "0.65234166", "0.6521488", "0.6470314", "0.64640635", "0.6428032", "0.64152956", "0.6335758", "0.6306298", "0.6241235", "0.6220953", "0.6209349", "0.618987", "0.61509037", "0.6147616", "0.61474717", "0.6110114" ]
0.7110509
0
Set the service layer instance for the given type
public static function setServiceLayer($type, $service, $mode = '') { $type = $type . $mode; self::$services[$type] = $service; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setService(){\n if($this->getRecord()->getRecordType() === \"yt\"){\n $this->service = new YoutubeService();\n }\n if($this->getRecord()->getRecordType() === \"gm\"){\n $this->service = new GoogleMapService();\n }\n }", "public function setClass($class)\n {\n $this->service = new $class();\n }", "public function set($typeId, $class);", "public function set(string $serviceId, $instance): void\n {\n $this->services[$serviceId] = $instance;\n }", "public function set(string $serviceName, $object);", "public static function setInstance( IContainer $container );", "public function set(string $type)\n\t{\n\t\ttry {\n\t\t\tif (!in_array($type, $this->AllowsShapesTypes, true)) {\n\t\t\t\tthrow new \\Exception(\"Don't exist shape (\" . $type . ')');\n\t\t\t}\n\t\t} catch (\\Exception $e) {\n\t\t\t$type = 'default';\n\t\t\tResponseHandler::fail($e->getMessage());\n\t\t} finally {\n\t\t\t$this->type = $type;\n\t\t}\n\t}", "public static function set(string $name, $instance): void\n {\n static::$services[$name] = $instance;\n }", "public function set_type($type) {\n $this->update([\n 'type' => $type\n ]);\n\n $this->type = $type;\n\n // finish configuring this OrderExchange\n $this->sync();\n }", "public function __set($name, $value) {\n $this->services[$name] = $value;\n }", "public function setType($type) :ISEntity\n {\n array_walk($this->types, function($name, $index) use ($type) {\n if($type === $name){\n $this->type = $index;\n }\n });\n if(is_null($this->type)) {\n if(isset($this->types[$type])) {\n $this->type = $type;\n }\n }\n return $this;\n }", "function setType($type) {\n $this->type = $type;\n }", "public function setService($service) {\r\n\t\t$this->service = $service;\r\n\t}", "public function setControllerFactory($type, $callable)\n {\n $this->controllerFactories[$type] = $callable;\n }", "public function setType($type){ }", "public static function setInstance($container){\n //Method inherited from \\Illuminate\\Container\\Container \n \\Illuminate\\Foundation\\Application::setInstance($container);\n }", "public function setService($instance)\n {\n parent::setService($instance);\n foreach ($this->_entry as $entry) {\n $entry->setService($instance);\n }\n return $this;\n }", "function setType($type) {\n\t\t$this->_type = $type;\n\t}", "function setType($type) {\n\t\t$this->_type = $type;\n\t}", "public function setServiceType(array $serviceType)\n {\n $this->serviceType = $serviceType;\n return $this;\n }", "public function setType($type) {}", "public function register(string $type, string $classPath)\n {\n $this->classPool[$type] = $classPath;\n }", "abstract public function setDAO($type);", "function set_ms_layer_type(&$ms_layer, $db_layer){\n\t\tswitch ($db_layer->geom_type){\n\t\t\t// point\n\t\t\tcase \"point\":\n\t\t\tcase \"multipoint\":\n\t\t\t\t$ms_layer->set(\"type\", MS_LAYER_POINT);\n\t\t\t\tbreak;\n\t\t\t// line\t\n\t\t\tcase \"line\":\n\t\t\tcase \"linestring\":\n\t\t\tcase \"multilinestring\":\n\t\t\t\t$ms_layer->set(\"type\", MS_LAYER_LINE);\n\t\t\t\tbreak;\n\t\t\t// polygon\n\t\t\tcase \"polygon\":\n\t\t\tcase \"multipolygon\":\n\t\t\t\t$ms_layer->set(\"type\", MS_LAYER_POLYGON);\n\t\t\t\tbreak;\n\t\t\t// default\n\t\t\tdefault:\n\t\t\t\t$ms_layer->set(\"type\", MS_LAYER_POLYGON);\n\t\t}\n\t}", "public function setType(?string $type): void\n {\n }", "public function setObject($obj)\n {\n $this->service = $obj;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType(?string $type): void;" ]
[ "0.6481874", "0.6216244", "0.6152679", "0.57389146", "0.56784296", "0.56774443", "0.56186455", "0.56133044", "0.5586003", "0.55498165", "0.5509799", "0.5507854", "0.550776", "0.54718435", "0.54533345", "0.5452731", "0.5450716", "0.5442827", "0.5442827", "0.5437661", "0.54244", "0.5405654", "0.540455", "0.5401247", "0.5396193", "0.53950584", "0.53938115", "0.53938115", "0.53938115", "0.5376925" ]
0.68155515
0
Construct new TypeSpec from binary data.
public function __construct(DataStream $data) { $this->type = $data->readShort(); switch ($this->type) { case self::CUSTOM: $this->customTypename = $data->readString(); break; case self::COLLECTION_LIST: case self::COLLECTION_SET: $this->valueType = new TypeSpec($data); break; case self::COLLECTION_MAP: $this->keyType = new TypeSpec($data); $this->valueType = new TypeSpec($data); break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create_from_binary_data($data);", "public static function createFromBuffer($raw_binary_data, $name = null)\n {\n // TODO: Convert to \"is_buffer\" or \"is_binary\" once available (PHP 6)\n if (!is_string($raw_binary_data)) {\n throw new InvalidArgumentException('Expected a raw binary string');\n }\n\n // Create a temporary file name if none was given\n $name = $name ?: static::DEFAULT_NAME;\n\n // Set a default MIME-type. \"octet-stream\" is generic and RFC safe\n $mime_type = 'application/octet-stream';\n\n // Try and auto-detect the MIME-type\n try {\n $mime_type = static::detectMimeTypeFromBuffer($raw_binary_data);\n } catch (RuntimeException $e) {\n // Must have the fileinfo extension loaded to automatically detect the MIME type\n }\n\n // Only convert binary to hex if its not plain text\n if (strpos($mime_type, 'text') !== 0 || static::isBase64String($raw_binary_data)) {\n $raw_binary_data = bin2hex($raw_binary_data);\n }\n\n // Wrap our binary data in a SplFileObject compatible data stream\n $stream_wrapped = 'data://'. $mime_type .','. rawurlencode($raw_binary_data);\n\n $object = new static($stream_wrapped, 'r');\n $object->setName($name);\n $object->setMimeType($mime_type);\n\n return $object;\n }", "public function convertToObject(\\SetaPDF_Core_Type_Raw $data) {}", "public function decode($binary, array $tagMap = []): AbstractType;", "abstract protected function initDataTypes();", "public function initFromBinary($data): InterventionImage\n {\n return $this->initFromVips(VipsImage::newFromBuffer($data));\n }", "public static function fromDER(string $data): self\n {\n return self::fromASN1(UnspecifiedType::fromDER($data)->asSequence());\n }", "public static function fromDER(string $data): self\n {\n return self::fromASN1(UnspecifiedType::fromDER($data)->asSequence());\n }", "public function __construct($spec);", "public static function data($data, $type = null)\n {\n $type === null && $type = MongoBinData::BYTE_ARRAY;\n\n return new MongoBinData($data, $type);\n }", "public static function createSelf()\n {\n $dataTypeFactory = new self();\n\n $dataTypeFactory->addFactoryTypeHandler('bit', new BitTypeFactory());\n // Integer type mappers.\n $dataTypeFactory->addFactoryTypeHandler('tinyint', new TinyIntTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('smallint', new SmallIntTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('mediumint', new MediumIntTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('int', new IntTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('bigint', new BigIntTypeFactory());\n // Numeric-point type mappers.\n $dataTypeFactory->addFactoryTypeHandler('double', new DoubleTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('float', new FloatTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('decimal', new DecimalTypeFactory());\n // Date and time mappers.\n $dataTypeFactory->addFactoryTypeHandler('date', new DateTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('time', new TimeTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('timestamp', new TimestampTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('datetime', new DateTimeTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('year', new YearTypeFactory());\n // Char type mappers.\n $dataTypeFactory->addFactoryTypeHandler('char', new CharTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('varchar', new VarCharTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('binary', new BinaryTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('varbinary', new VarBinaryTypeFactory());\n // Blob type mappers.\n $dataTypeFactory->addFactoryTypeHandler('tinyblob', new TinyBlobTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('blob', new BlobTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('mediumblob', new MediumBlobTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('longblob', new LongBlobTypeFactory());\n // Text type mappers.\n $dataTypeFactory->addFactoryTypeHandler('tinytext', new TinyTextTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('text', new TextTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('mediumtext', new MediumTextTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('longtext', new LongTextTypeFactory());\n // Option type mappers.\n $dataTypeFactory->addFactoryTypeHandler('enum', new EnumTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('set', new SetTypeFactory());\n // Other type mappers.\n $dataTypeFactory->addFactoryTypeHandler('json', new JsonTypeFactory());\n\n return $dataTypeFactory;\n }", "public static function fromString($data)\n {\n return new static(Reader::fromString($data));\n }", "public static function fromData(array $data);", "protected function _parseStructure($data)\n {\n $ob = new Horde_Mime_Part();\n\n $ob->setType(strtolower($data->type) . '/' . strtolower($data->subType));\n\n // Optional for multipart-parts, required for all others\n if (isset($data->parameters)) {\n $params = array();\n foreach ($data->parameters as $key => $value) {\n $params[strtolower($key)] = $value;\n }\n\n $params = Horde_Mime::decodeParam('content-type', $params, 'UTF-8');\n foreach ($params['params'] as $key => $value) {\n $ob->setContentTypeParameter($key, $value);\n }\n }\n\n // Optional entries. 'location' and 'language' not supported\n if (isset($data->disposition)) {\n $ob->setDisposition($data->disposition);\n if (isset($data->dparameters)) {\n $dparams = array();\n foreach ($data->dparameters as $key => $value) {\n $dparams[strtolower($key)] = $value;\n }\n\n $dparams = Horde_Mime::decodeParam('content-disposition', $dparams, 'UTF-8');\n foreach ($dparams['params'] as $key => $value) {\n $ob->setDispositionParameter($key, $value);\n }\n }\n }\n\n if ($ob->getPrimaryType() == 'multipart') {\n // multipart/* specific entries\n foreach ($data->subParts as $val) {\n $ob->addPart($this->_parseStructure($val));\n }\n } else {\n // Required options\n if (isset($data->partID)) {\n $ob->setContentId($data->partID);\n }\n\n $ob->setTransferEncoding(strtolower($data->encoding));\n $ob->setBytes($data->bytes);\n\n if ($ob->getType() == 'message/rfc822') {\n $ob->addPart($this->_parseStructure(reset($data->subParts)));\n }\n }\n\n return $ob;\n }", "protected function createType($data)\n {\n $type = new AddressType();\n foreach ($data as $attribute => $value) {\n $type->{$attribute} = $value;\n }\n $type->save();\n\n return $type;\n }", "public function FromBytes($stream)\r\n\t{\r\n\t\t//file_put_contents(\"/tmp/stream-dump.txt\", $stream);\r\n\t\t$used = 0;\r\n\t\twhile ($used < strlen($stream))\r\n\t\t{\r\n\t\t\t$f = new ProtoBuf_Field();\r\n\t\t\t$used += $parsed = $f->FromBytes($stream, $used);\r\n\t\t\tif ($parsed > 0)\r\n\t\t\t\t$this->fields[] = $f;\r\n\t\t\telse\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}", "public static function create($data)\n {\n $name = $data['name'];\n $language = $data['language'];\n $columnOption = $data['columnOption'];\n $specificColumns = $data['specificColumns'];\n return new TableType(self::generateId($name), $name, $language, $columnOption, $specificColumns);\n }", "public function fromArray(array $data)\n {\n parent::fromArray($data);\n $this->parseDynamicProperties($data);\n }", "final public function createdDataTypeInstanceHasCorrectProperties(): void\n {\n $dataType = new DataTypeMock();\n $this->assertEquals(PHP_INT_SIZE << 3, $dataType->getSystemMaxBits());\n $this->assertNull($dataType->getValue());\n $this->assertEquals('object', $dataType->getPrimitiveType());\n }", "public function fromArray(array $data) : DataContainerInterface;", "public static function createFromArray($name, array $data = [])\n {\n $type = parent::createFromArray($name, $data);\n \\assert($type instanceof self);\n\n return $type;\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"Spec\",$param) and $param[\"Spec\"] !== null) {\n $this->Spec = $param[\"Spec\"];\n }\n\n if (array_key_exists(\"SpecName\",$param) and $param[\"SpecName\"] !== null) {\n $this->SpecName = $param[\"SpecName\"];\n }\n\n if (array_key_exists(\"StorageType\",$param) and $param[\"StorageType\"] !== null) {\n $this->StorageType = $param[\"StorageType\"];\n }\n\n if (array_key_exists(\"DiskType\",$param) and $param[\"DiskType\"] !== null) {\n $this->DiskType = $param[\"DiskType\"];\n }\n\n if (array_key_exists(\"RootSize\",$param) and $param[\"RootSize\"] !== null) {\n $this->RootSize = $param[\"RootSize\"];\n }\n\n if (array_key_exists(\"MemSize\",$param) and $param[\"MemSize\"] !== null) {\n $this->MemSize = $param[\"MemSize\"];\n }\n\n if (array_key_exists(\"Cpu\",$param) and $param[\"Cpu\"] !== null) {\n $this->Cpu = $param[\"Cpu\"];\n }\n\n if (array_key_exists(\"DiskSize\",$param) and $param[\"DiskSize\"] !== null) {\n $this->DiskSize = $param[\"DiskSize\"];\n }\n\n if (array_key_exists(\"InstanceType\",$param) and $param[\"InstanceType\"] !== null) {\n $this->InstanceType = $param[\"InstanceType\"];\n }\n }", "public function decode(string $data): Package\n {\n $cmd = '';\n $ext = [];\n $map = (array)unserialize($data, ['allowed_classes' => false]);\n\n // Find message route\n if (isset($map['cmd'])) {\n $cmd = (string)$map['cmd'];\n unset($map['cmd']);\n }\n\n if (isset($map['data'])) {\n $body = $map['data'];\n $ext = $map['ext'] ?? [];\n } else {\n $body = $map;\n }\n\n return Package::new($cmd, $body, $ext);\n }", "public static function unpack($data, $parentBemSelector = '', $workingDirectory = './')\n {\n if (isset($data['bem-type'], $data['definition'], $data['inner'], $data['name']) === false) {\n return null;\n }\n\n $bemSelector = static::nameEntity($data['name'], $data['bem-type'], $parentBemSelector);\n $instance = static::retrieveInstance($bemSelector);\n\n $mergeInstructions = true;\n\n if ($instance === null) {\n $mergeInstructions = false;\n\n switch ($data['bem-type']) {\n case 'element':\n $instance = new BemElement([\n 'name' => $data['name'],\n 'definition' => $data['definition'],\n 'inner' => $data['inner'],\n 'parentBemSelector' => $parentBemSelector,\n ]);\n break;\n case 'modifier':\n $instance = new BemModifier([\n 'name' => $data['name'],\n 'definition' => $data['definition'],\n 'inner' => $data['inner'],\n 'parentBemSelector' => $parentBemSelector,\n ]);\n break;\n case 'block':\n default:\n $instance = new BemBlock([\n 'name' => $data['name'],\n 'definition' => $data['definition'],\n 'inner' => $data['inner'],\n ]);\n break;\n }\n\n $instance->bemSelector = $bemSelector;\n }\n\n $instance->workingDirectory = $workingDirectory;\n $instance->unpackAdditionalAttributes($data, $mergeInstructions);\n\n static::$globalIdentityMap[$bemSelector] = $instance;\n\n return $instance;\n }", "public static function fromXML($xml)\n {\n $nuspec = new SimpleXMLElement($xml);\n\n if ($nuspec === null || empty($nuspec->metadata)) {\n return null;\n }\n\n $spec = new NuspecFile;\n\n $spec->id = (string)$nuspec->metadata->id;\n $spec->version = (string)$nuspec->metadata->version;\n $spec->title = (string)$nuspec->metadata->title;\n $spec->authors = (string)$nuspec->metadata->authors;\n $spec->owners = (string)$nuspec->metadata->owners;\n $spec->licenseUrl = (string)$nuspec->metadata->licenseUrl;\n $spec->projectUrl = (string)$nuspec->metadata->projectUrl;\n $spec->iconUrl = (string)$nuspec->metadata->iconUrl;\n $spec->requireLicenseAcceptance = (string)$nuspec->metadata->requireLicenseAcceptance;\n $spec->developmentDependency = (string)$nuspec->metadata->developmentDependency;\n $spec->description = (string)$nuspec->metadata->description;\n $spec->summary = (string)$nuspec->metadata->summary;\n $spec->releaseNotes = (string)$nuspec->metadata->releaseNotes;\n $spec->copyright = (string)$nuspec->metadata->copyright;\n $spec->tags = (string)$nuspec->metadata->tags;\n// $spec->minClientVersion = $nuspec->metadata->minClientVersion;\n $spec->language = $nuspec->metadata->language;\n\n // dependencies processor\n $dependenciesElement = $nuspec->metadata->dependencies;\n\n if ($dependenciesElement) {\n $dependencies = [];\n\n // process v1 types\n $v1Dependencies = is_array($dependenciesElement->dependency)\n ? $dependenciesElement->dependency\n : [$dependenciesElement->dependency];\n\n foreach ($v1Dependencies as $dep) {\n if (!isset($dep['id'])) continue;\n array_push($dependencies, [\n 'id' => (string)$dep['id'],\n 'targetFramework' => null,\n 'version' => isset($dep['version'])\n ? (string)$dep['version']\n : null\n ]);\n }\n\n $v2DepGroups = is_array($dependenciesElement->group)\n ? $dependenciesElement->group\n : [$dependenciesElement->group];\n\n foreach ($v2DepGroups as $depGroup) {\n $targetFramework = isset($dep['targetFramework'])\n ? (string)$dep['targetFramework']\n : null;\n\n $v2Dependencies = is_array($depGroup->dependency)\n ? $depGroup->dependency\n : [$depGroup->dependency];\n\n foreach ($v2Dependencies as $dep) {\n if (!isset($dep['id'])) continue;\n array_push($dependencies, [\n 'id' => (string)$dep['id'],\n 'targetFramework' => $targetFramework,\n 'version' => isset($dep['version'])\n ? (string)$dep['version']\n : null\n ]);\n }\n }\n\n $dependenciesString = implode('|', array_map(function ($dependency) {\n return \"{$dependency['id']}:{$dependency['version']}:{$dependency['targetFramework']}\";\n }, $dependencies));\n\n $spec->dependencies = $dependenciesString;\n }\n\n return empty($spec->id) || empty($spec->version) ? null : $spec;\n }", "public function buildClass($data)\n {\n $classDescriptor = new ClassDescriptor();\n\n $classDescriptor->setFullyQualifiedStructuralElementName($data->getName());\n $classDescriptor->setName($data->getShortName());\n\n $this->buildDocBlock($data, $classDescriptor);\n\n $classDescriptor->setParentClass($data->getParentClass());\n\n $classDescriptor->setLocation('', $data->getLinenumber());\n $classDescriptor->setAbstract($data->isAbstract());\n $classDescriptor->setFinal($data->isFinal());\n\n foreach ($data->getInterfaces() as $interfaceClassName) {\n $classDescriptor->getInterfaces()->set($interfaceClassName, $interfaceClassName);\n }\n foreach ($data->getConstants() as $constant) {\n $this->buildConstant($constant, $classDescriptor);\n }\n foreach ($data->getProperties() as $property) {\n $this->buildProperty($property, $classDescriptor);\n }\n foreach ($data->getMethods() as $method) {\n $this->buildMethod($method, $classDescriptor);\n }\n\n $fqcn = $classDescriptor->getFullyQualifiedStructuralElementName();\n $namespace = substr($fqcn, 0, strrpos($fqcn, '\\\\'));\n\n $classDescriptor->setNamespace($namespace);\n\n return $classDescriptor;\n }", "public static function decodeSingle($parsedType, $data, $dataBin, $offset)\n {\n if (is_string($parsedType)) {\n $parsedType = self::parseType($parsedType);\n }\n\n $size = null;\n $num = null;\n $ret = null;\n $i = null;\n\n if ($parsedType->name === 'address') {\n return self::decodeSingle($parsedType->rawType, $data, $dataBin, $offset); //.toArrayLike(Buffer, 'be', 20).toString('hex')\n } else if ($parsedType->name === 'bool') {\n return (string)self::decodeSingle($parsedType->rawType, $data, $dataBin, $offset) . toString() === '1';\n } else if ($parsedType->name === 'string') {\n $bytes = self::decodeSingle($parsedType->rawType, $data, $dataBin, $offset);\n return $bytes; //new Buffer(bytes, 'utf8').toString()\n } else if ($parsedType->isArray) {\n // this part handles fixed-length arrays ([2]) and variable length ([]) arrays\n // NOTE: we catch here all calls to arrays, that simplifies the rest\n $ret = [];\n $size = $parsedType->size;\n\n if ($parsedType->size === 'dynamic') {\n $offset = (int)self::decodeSingle('uint256', $data, $dataBin, $offset);\n $size = self::decodeSingle('uint256', $data, $dataBin, $offset);\n $offset = $offset + 32;\n }\n for ($i = 0; $i < $size; $i++) {\n $decoded = self::decodeSingle($parsedType->subArray, $data, $dataBin, $offset);\n $ret[] = $decoded;\n $offset += $parsedType->subArray->memoryUsage;\n }\n return $ret;\n } else if ($parsedType->name === 'bytes') {\n $offset = (int)self::decodeSingle('uint256', $data, $dataBin, $offset);\n $size = (int)self::decodeSingle('uint256', $data, $dataBin, $offset);\n return bin2hex(substr($dataBin, $offset + 32, ($offset + 32 + $size) - ($offset + 32)));\n } else if (strpos($parsedType->name, 'bytes') === 0) {\n return bin2hex(substr($dataBin, $offset, ($offset + $parsedType->size) - $offset));\n } else if (strpos($parsedType->name, 'uint') === 0) {\n $num = bin2hex(substr($dataBin, $offset, $offset + 32 - $offset));\n\n if (strlen(bin2hex($num)) / 2 > $parsedType->size) {\n throw new Exception('Decoded int exceeds width: ' . $parsedType->size . ' vs ' . strlen(bin2hex($num)) / 2);\n }\n\n// if (num.bitLength() > parsedType.size) {\n// throw new Error('Decoded int exceeds width: ' + parsedType.size + ' vs ' + num.bitLength())\n// }\n return $num;\n } else if (strpos($parsedType->name, 'int') === 0) {\n $num = bin2hex(substr($dataBin, $offset, $offset + 32 - $offset));\n\n// new BN(data.slice(offset, offset + 32), 16, 'be').fromTwos(256)\n\n if (strlen(bin2hex($num)) / 2 > $parsedType->size) {\n throw new Exception('Decoded int exceeds width: ' . $parsedType->size . ' vs ' . strlen(bin2hex($num)) / 2);\n }\n\n return $num;\n } else if (strpos($parsedType->name, 'ufixed') === 0) {\n $size = pow(2, $parsedType->size[1]);\n $num = self::decodeSingle('uint256', $data, $dataBin, $offset);\n if (!($num % $size === 0)) {\n throw new Exception('Decimals not supported yet');\n }\n return $num / $size;\n } else if (strpos($parsedType->name, 'fixed') === 0) {\n $size = pow(2, $parsedType->size[1]);\n $num = self::decodeSingle('int256', $data, $dataBin, $offset);\n if (!($num % $size === 0)) {\n throw new Exception('Decimals not supported yet');\n }\n return $num / $size;\n }\n throw new Exception('Unsupported or invalid type: ' . $parsedType->name);\n }", "public static function fromBase64($data)\n {\n return Base64Serializer::deserialize($data, get_class());\n }", "public function deserialize($data);", "public function unpack(string $data): Package\n {\n [$head, $body] = $this->unpackData($data);\n\n return $this->getPacker((string)$head['type'])->decode($body);\n }" ]
[ "0.63814074", "0.5564252", "0.5224507", "0.5201576", "0.50803155", "0.5019443", "0.4960203", "0.4960203", "0.48229623", "0.48113853", "0.47528282", "0.4749227", "0.47139454", "0.4708914", "0.46942207", "0.45897645", "0.4503111", "0.4495447", "0.44623482", "0.44459543", "0.44147334", "0.44084543", "0.438873", "0.4382264", "0.437827", "0.4375548", "0.43749082", "0.43674165", "0.43563923", "0.43403897" ]
0.5771705
1
Get key type (applies for maps).
public function getKeyType() { return $this->keyType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_key_type() {\n return 0;\n }", "public function getKeyType();", "public function keyType(): ?string;", "public function getKeyType(): string\n {\n return 'string';\n }", "public function getKeyType()\n {\n return 'string';\n }", "public function getKeyType()\n {\n return 'string';\n }", "public function getKeyType()\n {\n return 'string';\n }", "function keyTypes()\n {\n return array('pattern' => 'K');\n }", "public static function getKey($type) {\n\t\t$type = strtolower(str_replace('drop', '', $type));\n\n\t\tif ($type === 'primary') return 'PRIMARY KEY';\n\t\tif ($type === 'index') return 'INDEX';\n\t\tif ($type === 'unique') return 'UNIQUE';\n\n\t\treturn 'FOREIGN KEY';\n\t}", "public function type(string $key)\n {\n return $this->redis->type($key);\n }", "function monsterinsights_get_license_key_type() {\n\t$type = false;\n\t$license = monsterinsights_get_license();\n\tif ( ! empty( $license['type'] ) && is_string( $license['type'] ) ) {\n\t\tif ( in_array( $license['type'], array( 'master', 'pro', 'plus', 'basic' ) ) ) {\n\t\t\t$type = $license['type'];\n\t\t}\n\t}\n\treturn $type;\n}", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n\t{\n\t\t$types = $this->getValidTypes();\n\n\t\treturn $types[$this->type];\n\t}", "public function get_type();", "public function keyTypeParameter(): Parameter\\KeyTypeParameter\n {\n return self::_checkType($this->get(Parameter\\JWKParameter::P_KTY),\n Parameter\\KeyTypeParameter::class);\n }", "public function getType()\n {\n if (array_key_exists(\"type\", $this->_propDict)) {\n return $this->_propDict[\"type\"];\n } else {\n return null;\n }\n }", "public function getType()\n {\n if (array_key_exists(\"type\", $this->_propDict)) {\n return $this->_propDict[\"type\"];\n } else {\n return null;\n }\n }", "public function getTypeText()\n {\n return ($this->isPending() ? 'Key Request' : 'Key');\n }" ]
[ "0.81791925", "0.7667091", "0.7639854", "0.71320474", "0.6989893", "0.6989893", "0.6989893", "0.67017", "0.6682409", "0.66455775", "0.6620695", "0.65567243", "0.65567243", "0.65567243", "0.65567243", "0.65567243", "0.65567243", "0.65567243", "0.65567243", "0.65567243", "0.65567243", "0.6555001", "0.6555001", "0.6555001", "0.6482562", "0.6448722", "0.63949466", "0.6372232", "0.6372232", "0.63717407" ]
0.81701165
1
User Account Info Page [logged in?]
public function info() { $data = array(); if ($this->user->is_logged_in()) { $this->user->get_user($this->user->getMyId()); $data['user'] = $this->user; } $this->load->view('account/account_info', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loggedin() {\n $this->checkAccess('user',false,false);\n\n $template = new Template;\n $user = new User($this->db);\n\n //get user details\n $user->getByEmail($this->f3->get('SESSION.email'));\n $this->f3->set('user', $user);\n\n //get user followers\n $this->f3->set('followers', $user->getUserFollowers($this->f3->get('SESSION.cid'))[0]);\n\n //get user waiting position\n $this->f3->set('waitrank', $user->getUserWaitPosition($this->f3->get('SESSION.cid'))[0]);\n\n echo $template->render('header.html');\n echo $template->render('user/user.html');\n echo $template->render('footer.html');\n }", "public function myAccount() {\n if ($this->_model->isLogged()) {\n $username = $_SESSION['user'];\n $email = $this->_model->getMailFromSessionUsername();\n $checked = $this->_model->getNotifsFromSessionUsername();\n $edit_success = \"<p class='flash_success'>\" . $this->_model->getFlash('edit_success') . \"</p>\";\n $edit_err = \"<p class='flash_err'>\" . $this->_model->getFlash('edit_err') . \"</p>\";\n $this->render('General.Account', compact('username', 'email', 'edit_success', 'edit_err', 'checked'));\n }\n else {\n $this->login();\n }\n }", "public function actionUserInfo()\n {\n $data['userInfos'] = Fly::m('blog.models.BlogModel')->getUser(1);\n $this->render('user_info', $data);\n }", "public function info()\n {\n $this->isUser();\n\n $this->data['noCabinetOrAdmin'] = true;\n\n $userModel = new UserModel();\n\n $userInfo = $userModel->getUserByEmail(Session::get('login'));\n\n $this->data['info'] = $userInfo;\n\n $this->render('info');\n }", "public function account() {\n if ($this->ion_auth->logged_in()) {\n // Refresh the session\n $this->ion_auth->login_remembered_user();\n $this->body_class[] = 'my_account';\n\n $this->page_title = 'My Account';\n\n $this->current_section = 'my_account';\n\n $user = $this->ion_auth->user()->row_array();\n// var_dump($user);\n\n $this->render_page('user/account', array('user' => $user));\n } else {\n redirect('login');\n }\n \n \n }", "public function PrintAuthInfo() \n {\n if($this->IsAuthenticated())\n echo \"Du är inloggad som: <b>\" . $this->GetAcronym() . \"</b> (\" . $this->GetName() . \")\";\n else\n echo \"Du är <b>UTLOGGAD</b>.\";\n }", "function getUserBarInfo() {\r\n if (isUserLogged()) {\r\n if (isUserAdmin()) {\r\n echo '<a href=\"user.php\">User: ' . $_SESSION['user'] . \"</a>\";\r\n } else {\r\n echo 'User: ' . $_SESSION['user'];\r\n }\r\n echo ' | <a href=\"purchase.php\">Basket</a>';\r\n } else {\r\n echo '<a href=\"login.php\">Sign in/Register</a>';\r\n }\r\n }", "function get_info() {\n\n\n\n echo $this->username;\n echo $this->password;\n\n\n if ( ! $this->username || ! $this->password) {\n // CODE TO RELOAD SIGN-IN PAGE WITH 'ERROR' MESSAGE\n }\n\n else {\n echo $this->username;\n echo $this->password;\n\n $this->setup_page();\n\n // $this->connect_to_database();\n }\n }", "public function information_user()\n {\n //Model\n $username = $_SESSION['username'];\n $rs = $this->Nhansu->get_information_user($username);\n if ($rs) {\n $this->view(\"master_page\", [\n \"page\" => \"information_user\",\n \"url\" => \"../\",\n \"info_user\" => $rs,\n \"phongban\" => $this->Phongban->ListAll(),\n \"chucvu\" => $this->Chucvu->ListAll(),\n\n ]);\n }\n }", "private function userDisplay() {\n $showHandle = $this->get('username');\n if (isset($showHandle)) {\n echo '<li class=\"user-handle\">'.$showHandle.'</li>';\n }\n }", "function grabUserAccountInfo(){\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\t\t\n\t\t$app \t = JFactory::getApplication();\n\t\t$session = JFactory::getSession();\n\t\t$post \t = $app->input->post->getArray();\n\t\t\n\t\t$session->set('userInfo', $post, 'register');\n\t\t\n\t\t//find step 3 or 4; step 4 = normal registration; step 3 = skip plan\n\t\t$skipPlan \t= $session->get('skipPlan', 0, 'register');\n\t\t$step = ($skipPlan) ? 'step=3' : 'step=4';\n\t\t\n\t\t$link = JRoute::_('index.php?option=com_jblance&view=guest&layout=usergroupfield&'.$step, false);\n\t\t$this->setRedirect($link);\n\t\treturn false;\n\t}", "function get_loggedin_info($info)\n{\n\t$CI = &get_instance();\n\t$user = $CI->session->userdata('user');\n\n\treturn $user[$info];\n}", "public function profile() {\n\t\tif($this->checkLoggedIn()) {\n\t\t\treturn $this->view->render('profile_view');\n\t\t}\n\t}", "public function authDoView(){\n if(!$this->authUser()){\n echo '{\"status\":-1,\"result\":\"/user/login?prePage='.$_SERVER['HTTP_REFERER'].'\"}';\n exit();\n }\n }", "public function getMyAccountInfo()\n {\n $ajax_data = array();\n $user_id = $this->user_session->getUserId();\n\n if ($user_id) {\n $user = $this->user_logic->getUserById($user_id);\n if ($user !== false) {\n if (! empty($user) AND is_array($user)) {\n $user = array_pop($user);\n $ajax_data['code'] = 0;\n $ajax_data['data']['user'] = $user;\n $ajax_data['message'] = 'Successfully retrieved user info';\n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'User does not exist'; \n } \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Failed to get user info'; \n } \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Invalid user id';\n }\n \n $this->ajax_respond($ajax_data);\n }", "function index()\n {\n // Check if there errors from the forms, and display them.\n $this->registry->template->loginSend = Util::checkExcistInSession($this->loginError);\n $this->registry->template->registerSend = Util::checkExcistInSession($this->registerError);\n\n // If the user is loggedIn show the logout button\n if ($this->registry->userAccount->isLogedIn()) {\n $this->registry->template->show('account-loggedin');\n } else {\n $this->registry->template->show('account');\n }\n }", "function userInfo($info){\r\n\t\t\tif(isset($_SESSION['Auth']->$info)){\r\n\t\t\t\treturn $_SESSION['Auth']->$info;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}", "public function displayUserPage() {\n\t if(!isset($_SESSION['userID'])) {\n\t \t//redirect\n\t \theader('Location:index.php?page=home');\n\t }\t\n\t\tif(!isset($_POST['logout'])) {\n\n\t\t\t$html = '<h2 class=\"redhead\">' . $_SESSION['firstName'] .' Page <br/> Welcome to your Account!</h2>'; \n\t\t\t\t\n\t\t\t$html .= '<div class=\"left half\"><h3>Start Rating Childcare Centres Now!</h3><p>The system of rating uses averaging. The parents rates the center with 5 as the highest and 1 is the lowest. The Centre with the highest score is ranked as no. 1 and so forth. </p>';\t\n\t\t\n\t\t\t$html .= '<form method=\"POST\" action=\"'. $_SERVER['REQUEST_URI'] .'\" class=\"left\">';\n\t\t\t$html .= '<input type=\"submit\" name=\"logout\" value=\"Logout\" class=\"blue whitefont\">';\n\t\t\t$html .= '</form> </div><br/>';\t\t\t\n\n\t\t\treturn $html;\t\t \t\t\t\t\t\n\t\t} else {\n\t\t\t\t$this -> model -> processLogout();\t\t\t\t\t\n\t\t\t\theader('Location:index.php?page=login');\n\t\t}\n\t\t\t\n\t}", "public function userinfo()\n {\n if($user = $this->Session->read('user')){\n if(!empty($this->request->data)){\n //update thong tin\n }\n $this->set('user', $user);\n }else{\n $this->redirect(array('action' => 'login', ''));\n }\n }", "function LoggedIn() {\n\t\treturn $this->Get('UserDetails');\n\t}", "function users_user_view($args)\n{\n // If has logged in, header to index.php\n if (pnUserLoggedIn()) {\n return pnRedirect(pnConfigGetVar('entrypoint', 'index.php'));\n }\n\n // create output object\n $pnRender = & pnRender::getInstance('Users');\n\n // other vars\n $pnRender->assign(pnModGetVar('Users'));\n\n return $pnRender->fetch('users_user_view.htm');\n}", "public function accountAction()\n {\n \tif(!in_array($this->_user->{User::COLUMN_STATUS}, array(User::STATUS_BANNED, User::STATUS_PENDING, User::STATUS_GUEST))){\n \t\t$this->_forward('homepage');\n \t\treturn;\n \t}\n \t$this->view->registerForm = new User_Form_Register();\n \t$this->view->loginForm = new User_Form_Login();\n }", "public function accountInfo(): Response\n {\n // logged in, or are logged in via a remember me cookie\n $this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');\n\n // ...\n }", "public function account()\n {\n if (Login::isConnected()) {\n $this->generateView(array());\n } else {\n $this->index();\n }\n\n }", "function userLoggedIn()\n{\n\tif(Auth::check()) {\n\t\t// Log::info('');\n\t\theader('Location: /users/account?id=' . Auth::id() );\n\t\tdie();\n\t}\n}", "public function get_user_info($info)\n {\n Session::_start();\n return Session::_get(\"user\", $info);\n }", "function user_logged_in($user_id) {\n \n }", "public function index()\n {\n $account = new User();\n\n $view = new View('account/overview.twig');\n return $view->setData([\n 'account' => $account->find($_SESSION['user'])\n ])->build();\n }", "protected function isUserLoggedIn() {}", "protected function isUserLoggedIn() {}" ]
[ "0.73454934", "0.71608096", "0.7129549", "0.71237254", "0.69842905", "0.696578", "0.6953128", "0.6926733", "0.687448", "0.67931473", "0.675132", "0.6699616", "0.6661584", "0.6658045", "0.6650993", "0.66439354", "0.6643903", "0.66413444", "0.66325027", "0.66321415", "0.66311276", "0.66024894", "0.658045", "0.6557245", "0.6551122", "0.6529621", "0.6506265", "0.65002245", "0.6455734", "0.6455734" ]
0.78777677
0
Displays the current progress and Steps done/ to be done.
public function progress() { $data = array(); if (!$this->user->is_logged_in()) { redirect("/account/info"); } $this->user->get_user($this->user->getMyId()); $data['user'] = $this->user; $data['current'] = str_replace('overview', 'play', $this->user->get_next_step()); $this->load->view('account/progress', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function showProgress()\n {\n $allQuestions = $this->questionRepository->list(['id', 'question']);\n $this->transformProgressList($allQuestions);\n\n $this->console->info( ' ************ Your progress is ************');\n\n foreach ($this->progress as $option) {\n $validate = $option['is_true'] ? __('True') : __('False');\n $this->console->info( ' Question: ' . $option['question']);\n if(null !== $option['is_true'])\n $this->console->info( ' Answer: ' . $option['answer'] . '('.$validate .')');\n $this->console->info( ' ');\n }\n $this->console->info( ' *******************************************');\n }", "private function display_progress_bar($args){\n $number_of_steps = count($this->step_ids);\n $current_step = $args['step'];\n\n echo '<ul class=\"list-unstyled\">';\n for($i = 1; $i < $number_of_steps - 1; $i++){\n echo '<li style=\"display:inline-block; margin-right:15px;\">Step ' . $i . '</li>';\n }\n echo '</ul>';\n }", "public function render()\n {\n $this->currentStepId = array_search($this->currentStepName, $this->steps);\n $this->totalNumberOfSteps = count($this->steps);\n\n $this->percentDone = round(($this->currentStepId) * 100 / ($this->totalNumberOfSteps - 1));\n $this->percentToDo = 100 - $this->percentDone;\n\n $this->nextModuleName = '';\n if (isset($this->steps[$this->currentStepId + 1])) {\n $this->nextModuleName = $this->steps[$this->currentStepId + 1];\n }\n $this->previousModuleName = '';\n if (isset($this->steps[$this->currentStepId - 1])) {\n $this->previousModuleName = $this->steps[$this->currentStepId - 1];\n }\n $this->previousPreviousModuleName = '';\n if (isset($this->steps[$this->currentStepId - 2])) {\n $this->previousPreviousModuleName = $this->steps[$this->currentStepId - 2];\n }\n\n $this->piwikVersion = Version::VERSION;\n\n return parent::render();\n }", "private function showAnswers() : void\n {\n $this->showProgress();\n }", "protected function printProgress($action, $current, $total) {\n $progress = $total - $current;\n $percent = round(($progress / $total) * 100);\n echo \"<p><b><i>{$action}: {$progress} of {$total} (~{$percent}%)</i></b></p>\";\n flush();\n }", "public static function step()\n\t{\n\t\tself::show(self::$_step++);\n\t}", "function show_completed_page(&$infos)\n\t\t{\n\t\t\t$this->t->set_file('activity_completed', 'activity_completed.tpl');\n\t\t\t$this->t->set_block('activity_completed', 'report_row', 'rowreport');\n\t\t\t//build an icon array for show_engine_infos\n\t\t\t$icon_array = Array();\n\t\t\t\n\t\t\t$icon_array['ok'] \t\t= '<img src=\"'.$GLOBALS['egw']->common->image('workflow', 'check').'\">';\n\t\t\t$icon_array['failure'] \t\t= '<img src=\"'.$GLOBALS['egw']->common->image('workflow', 'stop').'\">';\n\t\t\t$icon_array['transition'] \t= '<img src=\"'.$GLOBALS['egw']->common->image('workflow', 'transition').'\">';\n\t\t\t$icon_array['transition_human'] = '<img src=\"'.$GLOBALS['egw']->common->image('workflow', 'transition_human').'\">';\n\t\t\t$icon_array['activity'] \t= '<img src=\"'.$GLOBALS['egw']->common->image('workflow', 'auto_activity').'\">';\n\t\t\t$icon_array['dot'] \t\t= '<img src=\"'.$GLOBALS['egw']->common->image('workflow', 'puce').'\">&nbsp;';\n\t\t\t$this->show_engine_infos($infos, $icon_array);\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'wf_procname'\t=> $this->process_name,\n\t\t\t\t'procversion'\t=> $this->process_version,\n\t\t\t\t'actname'\t=> $this->activity_name,\n\t\t\t\t'rowreport'\t=> '',\n\t\t\t));\n\n\t\t\t$this->translate_template('activity_completed');\n\t\t\t$this->t->pparse('output', 'activity_completed');\n\t\t\t$this->show_after_running_page();\n\t\t}", "public function actionProgress($total=100){\n $select = $this->select('pilih sample : ', [1=>'sample1', 2=>'sample2']);\n if($select==1){\n Console::startProgress(0, $total);\n for ($n = 1; $n <= $total; $n++) {\n usleep($total);\n Console::updateProgress($n, $total);\n }\n Console::endProgress();\n }\n else{\n # Git clone like progress (showing only status information):\n Console::startProgress(0, $total, 'Counting objects: ', false);\n for ($n = 1; $n <= $total; $n++) {\n usleep($total);\n Console::updateProgress($n, $total);\n }\n Console::endProgress(\"done.\" . PHP_EOL);\n }\n }", "public function progressAction(){\n $groupID = $this->_request->getParam('g');\n \n $group_DB = new Application_Model_DbTable_Group();\n $groupName = $group_DB->getName($groupID);\n $this->view->group_name = $groupName;\n \n $plans_DB = new Application_Model_DbTable_Planing();\n if (!isset($_SESSION['Default']['field'])) {\n $this->view->field_error = true;\n } else {\n $plans = $plans_DB->getByGroup ($groupID, $_SESSION['Default']['field']);\n $this->view->plans = $plans;\n\n $this->view->groupID = $groupID;\n }\n }", "public function completed()\r\n {\r\n set_meta('title', 'Done');\r\n $progress = app()->make(Progress::class);\r\n $progress->reset();\r\n\r\n return view('antares/installer::installation.completed');\r\n }", "public function showInstallProgress()\r\n {\r\n return redirect()->to(handles('antares::install/progress'));\r\n }", "protected function UpdateProgress($action, $done=0, $total=0)\n\t{\n\t\tstatic $lastPercent;\n\t\tif($total > 0) {\n\t\t\t$percent = ceil($done/$total*100);\n\t\t}\n\t\telse {\n\t\t\t$percent = 100;\n\t\t}\n\t\t// We only show an updated progress bar if the rounded percentage has actually chanegd\n\t\tif($percent == $lastPercent) {\n\t\t\treturn;\n\t\t}\n\n\t\t$lastPercent = $percent;\n\t\t$action = sprintf($action, $done, $total);\n\t\techo \"<script type='text/javascript'>\\n\";\n\t\techo sprintf(\"self.parent.UpdateProgress('%s', '%s');\", str_replace(array(\"\\n\", \"\\r\", \"'\"), array(\" \", \"\", \"\\\\'\"), $action), $percent);\n\t\techo \"</script>\";\n\t\tflush();\n\t}", "public function progress()\n\t{\n\t\t$data['user'] \t\t\t= $this->user;\n \t$iduser \t\t\t\t= $this->user['iduser'];\n \t\n\t\t$get_header \t\t\t= $this->db->get_where('header', array('header_is_displayed' => 'Y'));\n\t\t$get_footer \t\t\t= $this->db->get_where('footer', array('footer_is_displayed' => 'Y'));\n\t\t\n\t\t$namalengkap = $this->userform_model->ambilnama($iduser);\n $nama = $namalengkap->nama_lengkap;\n\t\t//print_r($nama); die;\n\t\t$data['nama']\t\t= $nama;\n\t\t$data['get_header']\t\t= $get_header;\n\t\t$data['get_footer']\t\t= $get_footer;\n\t\t$this->load->view('progress', $data);\n\t}", "function show_migrate_multisite_files_progress( $current, $total ) {\n echo \"<span style='position: absolute;z-index:$current;background:#F1F1F1;'>Parsing Blog \" . $current . ' - ' . round($current / $total * 100) . \"% Complete</span>\";\n echo(str_repeat(' ', 256));\n if (@ob_get_contents()) {\n @ob_end_flush();\n }\n flush();\n}", "public function displayFinished() \n {\n if ($this->has_finished) {\n return '<i style=\"font-size:25px;color:#449D44;\" class=\"fa fa-check\" aria-hidden=\"true\"></i>';\n } else {\n return '<i style=\"font-size:25px;color:#C9302C;\" class=\"fa fa-times\" aria-hidden=\"true\"></i>';\n }\n }", "function renderProgress($tot_complete, $tot_failed, $total, $show_title = false) {\n\t\n\tif($total == 0) return '';\n\t$perc_complete \t= round(($tot_complete / $total) * 100, 2);\n\t$perc_failed \t= round(($tot_failed / $total) * 100, 2);\n\t\n\t$title = str_replace('[total]', $total, Lang::t('_PROGRESS_TITLE', 'course'));\n\t$title = str_replace('[complete]', $tot_complete, $title);\n\t$title = str_replace('[failed]', $tot_failed, $title);\n\t\n\t$html = '';\n\tif($show_title === true) $html .= '<span class=\"progress_title\">'.$title.'</span><br />';\n\tif($perc_complete >= 100) {\n\t\t\n\t\t$html .= \"\\n\".'<div class=\"box_progress_complete\" title=\"'.$title.'\">'\n\t\t\t.'<div class=\"nofloat\">'\n\t\t\t.'</div></div>'.\"\\n\";\n\t} elseif($perc_failed + $perc_complete >= 100) {\n\t\t\n\t\t$html .= \"\\n\".'<div class=\"box_progress_failed\" title=\"'.$title.'\">';\n\t\tif($perc_complete != 0) $html .= '<div class=\"bar_complete\" style=\"width: '.$perc_complete.'%;\"></div>';\n\t\t$html .= '<div class=\"nofloat\">'\n\t\t\t.'</div></div>'.\"\\n\";\n\t} else {\n\t\t\n\t\t$html .= \"\\n\".'<div class=\"box_progress_bar\" title=\"'.$title.'\">';\n\t\tif($perc_complete != 0) $html .= '<div class=\"bar_complete\" style=\"width: '.$perc_complete.'%;\"></div>';\n\t\tif($perc_failed != 0) $html .= '<div class=\"bar_failed\" style=\"width: '.$perc_failed.'%;\"></div>';\n\t\t$html .= '<div class=\"nofloat\">'\n\t\t\t.'</div></div>'.\"\\n\";\n\t}\n\t\n\treturn $html;\n}", "public function showResults()\n {\n $tracker = Tracker::getInstance();\n\n $tracker->outputStats();\n if (count($tracker->getFailures())) {\n $tracker->output(\"\\nFAILURES\\n\", null, null, true);\n $tracker->outputFailures();\n }\n\n if (count($tracker->getErrors())) {\n $tracker->output(\"\\nERRORS\\n\");\n $tracker->outputErrors();\n }\n\n $tracker->output(\"\\n\");\n\n if (count($tracker->getFailures())) {\n return;\n }\n\n if ($this->coverageDirectory()) {\n $tracker->output('Generating coverage report as html...' . \"\\n\");\n $this->_generateCoverageHtml();\n return $tracker->output('Done' . \"\\n\");\n }\n\n if ($this->showCoverage()) {\n $this->_generateCoverageCommandLine();\n return;\n }\n }", "function showUploadCompletePage() {\n\t\t$this->setCacheLevelNone();\n\t\t$this->render($this->getTpl('uploadComplete', '/account'));\t\t\n\t\n\t}", "public function form_footer_progress_status_percentage_html() {\n\n\t\t?>\n\t\t<div class=\"wpforms-conversational-form-footer-progress-status-percentage\">\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s - Percentage of fields completed. */\n\t\t\t\t\\esc_html__(\n\t\t\t\t\t'%s%% completed',\n\t\t\t\t\t'wpforms-conversational-forms'\n\t\t\t\t),\n\t\t\t\t'<span class=\"completed\">100</span>'\n\t\t\t);\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}", "protected function getDisplayText($step) {\n $numPackages = sizeof($this->workPackages);\n return ($step>=0 && $step<$numPackages) ? $this->workPackages[$step]['name'].\" ...\" :\n ($step>=$numPackages ? \"Done\" : \"\");\n }", "public function getOutput() {\n if($this->strLogfile != \"\") {\n $strTemplateID = $this->objTemplates->readTemplate(\"/core/module_installer/installer.tpl\", \"installer_log\", true);\n $this->strLogfile = $this->objTemplates->fillTemplate(\n array(\n \"log_content\" => $this->strLogfile,\n \"systemlog\" => $this->getLang(\"installer_systemlog\")\n ), $strTemplateID\n );\n }\n\n\n //build the progress-entries\n $strCurrentCommand = (isset($_GET[\"step\"]) ? $_GET[\"step\"] : \"\");\n if($strCurrentCommand == \"\")\n $strCurrentCommand = \"phpsettings\";\n\n $arrProgressEntries = array(\n \"phpsettings\" => $this->getLang(\"installer_step_phpsettings\"),\n \"config\" => $this->getLang(\"installer_step_dbsettings\"),\n \"loginData\" => $this->getLang(\"installer_step_adminsettings\"),\n \"modeSelect\" => $this->getLang(\"installer_step_modeselect\"),\n \"install\" => $this->getLang(\"installer_step_modules\"),\n \"samplecontent\" => $this->getLang(\"installer_step_samplecontent\"),\n \"finish\" => $this->getLang(\"installer_step_finish\"),\n );\n\n $strProgress = \"\";\n $strTemplateEntryTodoID = $this->objTemplates->readTemplate(\"/core/module_installer/installer.tpl\", \"installer_progress_entry\", true);\n $strTemplateEntryCurrentID = $this->objTemplates->readTemplate(\"/core/module_installer/installer.tpl\", \"installer_progress_entry_current\", true);\n $strTemplateEntryDoneID = $this->objTemplates->readTemplate(\"/core/module_installer/installer.tpl\", \"installer_progress_entry_done\", true);\n\n $strTemplateEntryID = $strTemplateEntryDoneID;\n foreach($arrProgressEntries as $strKey => $strValue) {\n $arrTemplateEntry = array();\n $arrTemplateEntry[\"entry_name\"] = $strValue;\n\n //choose the correct template section\n if($strCurrentCommand == $strKey) {\n $strProgress .= $this->objTemplates->fillTemplate($arrTemplateEntry, $strTemplateEntryCurrentID, true);\n $strTemplateEntryID = $strTemplateEntryTodoID;\n }\n else\n $strProgress .= $this->objTemplates->fillTemplate($arrTemplateEntry, $strTemplateEntryID, true);\n\n }\n $arrTemplate = array();\n $arrTemplate[\"installer_progress\"] = $strProgress;\n $arrTemplate[\"installer_version\"] = $this->strVersion;\n $arrTemplate[\"installer_output\"] = $this->strOutput;\n $arrTemplate[\"installer_forward\"] = $this->strForwardLink;\n $arrTemplate[\"installer_backward\"] = $this->strBackwardLink;\n $arrTemplate[\"installer_logfile\"] = $this->strLogfile;\n $strTemplateID = $this->objTemplates->readTemplate(\"/core/module_installer/installer.tpl\", \"installer_main\", true);\n\n $strReturn = $this->objTemplates->fillTemplate($arrTemplate, $strTemplateID);\n $strReturn = $this->callScriptlets($strReturn);\n $this->objTemplates->setTemplate($strReturn);\n $this->objTemplates->deletePlaceholder();\n $strReturn = $this->objTemplates->getTemplate();\n return $strReturn;\n }", "public function form_footer_progress_status_proportion_html() {\n\n\t\t?>\n\t\t<div class=\"wpforms-conversational-form-footer-progress-status-proportion\">\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %1$s - Number of fields completed, %2$s - Number of fields in total. */\n\t\t\t\t\\esc_html__(\n\t\t\t\t\t'%1$s of %2$s completed',\n\t\t\t\t\t'wpforms-conversational-forms'\n\t\t\t\t),\n\t\t\t\t'<span class=\"completed\"></span>',\n\t\t\t\t'<span class=\"completed-of\"></span>'\n\t\t\t);\n\t\t\t?>\n\t\t</div>\n\t\t<div class=\"wpforms-conversational-form-footer-progress-status-proportion-completed\" style=\"display: none\">\n\t\t\t<?php \\esc_html_e( 'Form completed', 'wpforms-conversational-forms' ); ?>\n\t\t</div>\n\t\t<?php\n\t}", "private function renderOutputWithController() \n\t{\n\t\tprintf('%s', $this->controller->go());\n\t}", "public function render()\n {\n $queue_size = $this->manager->getQueueSize();\n $worker_statuses = $this->manager->getWorkerStatuses();\n\n $this->clear();\n $this->line('Spider Manager Dashboard. Press Ctrl+C to exit.');\n $this->line('Queue size: ' . $queue_size);\n\n $this->hr();\n foreach ($worker_statuses as $i => $status) {\n $status = $status == WorkerStatus::WORKING ? $this->green($status) : $this->gray($status);\n $this->line('Worker '.sprintf('%04d', $i).': '.$status);\n }\n $this->hr();\n }", "public static function print_progress($copied, $skipped)\n {\n echo \"\\033[30D\";\n echo \"Copied: \" . str_pad($copied, 6, ' ', STR_PAD_RIGHT) . \" Skipped: \" . str_pad($skipped, 6, ' ', STR_PAD_RIGHT); \n }", "public function display()\n\t{\n\t\tprint_r(\"<br/>RedheadDuck looks like this!<br/>\");\n\t}", "function show_answers_progress($real_taskcount, $taskcount, $pid, $colspan = -1){\n\t\n\tif($colspan == -1){\n\t\t$colspan = \"\";\n\t}else{\n\t\t$colspan = \" colspan = '$colspan'\";\n\t}\n\t\n\t//taskcount formatting\n\t$delta_tc = $taskcount - $real_taskcount;\n\t$const = 60;\n\tif($delta_tc >= 0 || $taskcount == 0){\n\t\t$width = $const;\n\t}else{\n\t\t$width = $const * $taskcount / $real_taskcount;\n\t\t$sec_width = $const * abs($delta_tc) / $real_taskcount;\n\t}\n\t\n\techo \"<td$colspan>\n\t\t<meter id='bar$pid' min='0' max='100' low='25' high='75' optimum='100' value='\";\n\tif($taskcount == 0){\n\t\techo \"0\";\n\t}else{\n\t\techo $real_taskcount / $taskcount * 100;\n\t}\n\techo \"' style='width:\".$width.\"%;'></meter>\";\n\tif($delta_tc < 0 && $taskcount != 0){\n\t\techo \"<meter min='0' max='100' low='0' high='0' optimum='0' value='100' style='width:\".$sec_width.\"%;'></meter>\";\n\t}\n\techo \"<label for='bar$pid'> $real_taskcount/$taskcount</label>\";\n\techo \"</td>\";\n}", "function flush() {\r\n\t\t\tob_start();\r\n\t\t\t?>\r\n\t\t\t <div class=\"progressbar\" style=\"position:relative;overflow:hidden; height: <?php echo $this->height ; ?>px;width:<?php echo $this->length ; ?>px;\">\r\n\t\t\t\t<img src=\"<?php echo plugin_dir_url(\"/\").\"/\".str_replace(basename(__FILE__),\"\",plugin_basename( __FILE__)); ?>/img/progressbar.png\" style='position:absolute;left:0;top:-<?php echo floor(2*$this->height) ; ?>px;height:<?php echo floor(3*$this->height) ; ?>px;width:<?php echo $this->length ; ?>px;'/>\r\n\t\t\t\t<img id=\"<?php echo $this->id.\"_image\"; ?>\" src=\"<?php echo plugin_dir_url(\"/\").\"/\".str_replace(basename(__FILE__),\"\",plugin_basename( __FILE__)); ?>/img/progressbar.png\" style='position:absolute;left:0;top:0px;height:<?php echo floor(3*$this->height) ; ?>px;width:<?php echo floor($this->length*$this->start/100) ; ?>px;'/>\r\n\t\t\t\t<div id=\"<?php echo $this->id.\"_text\"; ?>\" style='position:absolute;left:0;top:0px;height:<?php echo $this->height; ?>px;text-align:center;line-height:<?php echo $this->height; ?>px;width:<?php echo $this->length ; ?>px;'><?php echo $this->insideText?>&nbsp;</div>\r\n\t\t\t</div>\r\n\t\t\t\r\n\t\t\t<?php\r\n\t\t\techo ob_get_clean();\r\n\t\t}", "public function actionDetails()\n\t{\n\t $this->layout='main';\n\t \n $user_data = Users::model()->findByPk(Yii::app()->user->id);\n $step_completed = $user_data->step_completed;\n\n if($user_data->user_role == 2 && $step_completed < 5){\n $this->render('start', ['step_completed' =>$step_completed]);\n }else{ $this->render('details'); }\t\n\t}", "public static function progress($done, $total, $msg = '', $msglen = null)\n\t\t{\n\t\t\tif ($done <= $total) {\n\t\t\t\t$size = self::get_width();\n\t\t\t\t$msglen = is_null($msglen) ? strlen($msg):$msglen;\n\t\t\t\t$psize = abs($size - $msglen - 12);\n\n\t\t\t\t$perc = (double) ($done/$total);\n\t\t\t\t$bar = floor($perc*$psize);\n\n\t\t\t\t$status_bar = \"\\r [\";\n\t\t\t\t$status_bar .= str_repeat(\"=\", $bar);\n\n\t\t\t\tif ($bar < $psize) {\n\t\t\t\t\t$status_bar .= \">\";\n\t\t\t\t\t$status_bar .= str_repeat(\" \", $psize - $bar -1);\n\t\t\t\t} else {\n\t\t\t\t\t$status_bar.=\"=\";\n\t\t\t\t}\n\n\t\t\t\t$disp = number_format($perc*100, 0);\n\t\t\t\t$status_bar .= \"] $disp%\";\n\n\t\t\t\t$left = $total - $done;\n\t\t\t\t$status_bar .= \": \".$msg;\n\n\t\t\t\tif (($blank = $size - strlen($status_bar)) > 0) {\n\t\t\t\t\t$status_bar .= str_repeat(' ', $blank);\n\t\t\t\t}\n\n\t\t\t\techo $status_bar;\n\t\t\t\tflush();\n\n\t\t\t\tif($done == $total) {\n\t\t\t\t\t\\Helper\\Cli::out();\n\t\t\t\t}\n\t\t\t}\n\t\t}" ]
[ "0.75575596", "0.7044762", "0.6753969", "0.64469326", "0.64225984", "0.640198", "0.63812846", "0.6318462", "0.6296183", "0.6282982", "0.62557954", "0.62289554", "0.61976266", "0.61645347", "0.61196804", "0.61053854", "0.60718536", "0.60505325", "0.6045323", "0.60347486", "0.59864956", "0.5969512", "0.59530294", "0.59180415", "0.59007317", "0.58978635", "0.5865908", "0.5837613", "0.5814276", "0.5801903" ]
0.70732975
1
Set the Collection data to the Table Object.
public function setData(Collection $Collection): void { $this->Collection = $Collection; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCollection()\n {\n $cl = $this->nameCollection;\n $this->collection = self::$database->$cl;\n }", "public function setCollection(\\Magento\\Framework\\Data\\Collection $collection) {\n $this->collection = $collection;\n }", "public function setUp()\n {\n foreach ($this->data as $row) {\n $this->table->insert($row);\n }\n\n parent::setUp();\n\n }", "public function setCollection(Collection $collection): void\n {\n $this->collection = $collection;\n\n // Map the properties of the base collection\n $this->mapProperties($this->collection);\n\n $this->setUsers();\n }", "public function setData() {\n\t\t$this->import($this->get());\n\t}", "public static function setTable($name = ''){\n\t\tif(! self::$db){\n\t\t\tself::setDbName();\n\t\t}\n\t\tif($name){\n\t\t\treturn self::$collection = self::$db->$name;\n\t\t}else{\n\t\t\treturn self::$collection = self::$db->$table;\n\t\t}\n\t}", "public function initTable(){\n\t\t\t\n\t\t}", "private function tinydb_datafill($data)\n {\n // Fix up access information\n $this->tinydb_access_manager = new \\TinyDb\\Internal\\AccessManager($this->tinydb_get_reflector());\n foreach (static::tinydb_get_table_info()->table_info() as $name => $field) {\n unset($this->$name);\n }\n\n // Set the information from the database\n $this->tinydb_rowdata = $data;\n }", "private function setTable()\n {\n if (is_null($this->table)) {\n $this->table = $this->getTableName();\n }\n }", "protected function setData($data) {\n $this->data = collect($data);\n }", "public function fillData( PostIt $PostIt, Collection $data )\n {\n $PostIt->fill( $data->toArray() );\n\n $PostIt->save();\n\n return $PostIt;\n }", "public function load()\n {\n if (count($this->table)) {\n $this->value = array_pop($this->table);\n }\n }", "public function initEtablissements()\n {\n $this->collEtablissements = new PropelObjectCollection();\n $this->collEtablissements->setModel('Etablissement');\n }", "public function set_all_data($data)\n\t{\n\t\t$this->_data = $data;\n\t}", "protected function _initsTable() {}", "public function __construct() {\n $this->columnas = new ArrayCollection();\n }", "function setTable($table) {\r\r\n\t\t$this->table = $table;\r\r\n\t}", "protected function setUp() {\n $this->object = new Table;\n }", "protected function populateTable() {\n\t\t$query = \"\n\t\tINSERT INTO `items` VALUES (1, 'Candy', 'Crush', '1924 Sucka Drive', 'Stripper');\n\t\tINSERT INTO `items` VALUES (2, 'John', 'Smith', '9999 The Way', 'Unemployeed');\n\t\t\";\n\t\t$this->PDO->query($query);\n\t}", "public function setData($data)\n {\n $this->rowData = $data;\n }", "private function createCollection()\n {\n $class = get_class($this->data);\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }", "public function setTable(Table $table): void\n {\n $this->table = $table;\n }", "public function save()\n {\n array_push($this->table, $this->value);\n }", "function setAllData(&$data) {\n\t\t$this->_data =& $data;\n\t}", "public function getTableData()\n\t{\n\t}", "public function setTableDefinition()\n {\n foreach ($this->_columns as $column) {\n $this->hasColumn($column['name'], $column['type'], $column['length'], $column['options']);\n }\n }", "private function populateDummyTable() {}", "private function prepare_data(){\r\n\t\t\t$this->data_table['cols'] = array();\r\n\t\t\t\r\n\t\t\tforeach($this->columns as $column_id => $column_info){\r\n\t\t\t\tswitch($column_info['type']){\r\n\t\t\t\t\tcase 'number':\r\n\t\t\t\t\tcase 'float':\r\n\t\t\t\t\tcase 'currency':\r\n\t\t\t\t\t\t$column_info['type'] = 'number';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t$column_info['type'] = 'string';\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->data_table['cols'][] = array_merge(array('id' => $column_id), $column_info);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$rows_count = sizeof(reset($this->data));\r\n\t\t\t\r\n\t\t\tfor($i = 0; $i < $rows_count; $i++){\r\n\t\t\t\t$c = array();\r\n\t\t\t\t\r\n\t\t\t\tforeach($this->columns as $column_id => $column_info){\r\n\t\t\t\t\t$value = $this->data[$column_id][$i];\r\n\t\t\t\t\t$c[] = array('v' => $value);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->data_table['rows'][] = array('c' => $c);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->data_table = json_encode($this->data_table);\r\n\t\t}", "public function load()\n {\n $pdo = $this->getDbConnection();\n $query = \"SELECT * FROM {$this->dbTable}\";\n $data = $pdo->query($query)->fetchAll(\\PDO::FETCH_ASSOC);\n\n foreach ($data as ['key' => $key, 'value' => $value]) {\n $this->setData($key, $value);\n }\n }", "public function setTable($table);" ]
[ "0.61740935", "0.5982793", "0.5805614", "0.5736228", "0.5708509", "0.5701421", "0.5687937", "0.56327903", "0.5616224", "0.5604099", "0.55113167", "0.5484863", "0.5455524", "0.54291433", "0.5416777", "0.5415401", "0.5396353", "0.53894746", "0.53751767", "0.53708917", "0.5366494", "0.5363428", "0.5363243", "0.5353099", "0.53530526", "0.53368175", "0.5334016", "0.53140134", "0.5310946", "0.53071594" ]
0.6440375
0
Get array of Labels.
public function getLabels(): array { return $this->labels; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getLabels(): array;", "public function labels()\n {\n return array();\n }", "public function labels(): array\n {\n return [];\n }", "public function getLabels()\n {\n $headers = $this->getDefaultHeaders();\n $response = $this->client->request(\n 'GET',\n $this->api . $this->repo . \"/labels\",\n array(\n \"headers\" => $headers\n )\n );\n \n if ($response->getStatusCode() == 200) {\n $body = $response->getBody();\n $body = json_decode($body, true);\n return $body;\n }\n\n return array();\n }", "public function getLabels();", "public function getLabels();", "public function getLabels();", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return array_values(array_unique($this->labels));\n }", "public function getLabels() {\r\n return $this->labels;\r\n }", "public function getLabels()\n {\n return isset($this->labels) ? $this->labels : null;\n }", "public static function labelsPlainArray()\n\t{\n\t\t$rows = DB::table('labels')->where(\"lang\", \"EN\")->orderBy(\"key\")->get(); // DV0001\n\t\tforeach($rows as $row) {\n\t\t\t$output[] = $row->key;\n\t\t}\n\t\treturn $output;\n\t}", "public function getLabels()\n {\n if (is_null($this->labels)) {\n $this->labels = collect();\n $testlabel_models = TestLabel::where([\n ['buildid', '=', $this->buildid],\n ['outputid', '=', $this->outputid],\n ])->get();\n foreach ($testlabel_models as $testlabel_model) {\n $label = new Label();\n $label->Id = $testlabel_model->labelid;\n $text = $label->GetText();\n $this->labels->put($text, $label);\n }\n }\n return $this->labels;\n }", "public function getLabelsList(){\n return $this->_get(6);\n }", "public function getLabelsList(){\n return $this->_get(2);\n }" ]
[ "0.8889515", "0.8322369", "0.8316176", "0.82619953", "0.80908847", "0.80908847", "0.80908847", "0.7871494", "0.7871494", "0.7871494", "0.7871494", "0.7871494", "0.7871494", "0.7871494", "0.7871494", "0.7871494", "0.7871494", "0.7871494", "0.7871494", "0.7871494", "0.7871494", "0.7871494", "0.7871494", "0.7843284", "0.7805255", "0.7712425", "0.75955886", "0.7582359", "0.73109907", "0.7289066" ]
0.8456396
1
Check if a field has a replacement pattern.
public function hasFieldReplacement(string $field): bool { return isset($this->field_replacements[$field]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function hasPregReplace() {\n\t\treturn isset($this->replaces);\n\t}", "public static function isFieldValid(Field $field): bool\n {\n return $field instanceof PatternField;\n }", "public function hasReplacement( string $name ) : bool;", "public function canResolveField($field)\n {\n return false === strpos($field, '.');\n }", "public function has($_field);", "public function already_appended($pattern)\n\t{\n\t\treturn (bool)($this->that->preg_match_PLAIN($pattern) OR $this->that->preg_match_HTML($pattern)); \n\t}", "function pfb_match_filter_field($flent, $fields) {\n\tif (isset($fields)) {\n\t\tforeach ($fields as $key => $field) {\n\t\t\tif (empty($field)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (strpos($field, '!') !== FALSE) {\n\t\t\t\t$field = substr($field, 1);\n\t\t\t\t$field_regex = str_replace('/', '\\/', str_replace('\\/', '/', $field));\n\t\t\t\tif (@preg_match(\"/{$field_regex}/i\", $flent[$key])) {\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$field_regex = str_replace('/', '\\/', str_replace('\\/', '/', $field));\n\t\t\t\tif (!@preg_match(\"/{$field_regex}/i\", $flent[$key])) {\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn TRUE;\n}", "public function getPatternedField(string $field);", "public function setPattern($pattern) {}", "protected function areFieldChangeFunctionsValid() {}", "function filter_pattern($value)\n {\n global $pattern;\n return !strncmp($pattern, $value, strlen($pattern));\n }", "public static function is_valid_shortcut($field)\n\t{\n\t\treturn App_Utils_Validation::is_valid_regexp($field, cpf_config('APP.VALIDATION.SHORTCUT_REGEXP'));\n\t}", "private function matchesPattern($pattern)\n {\n if (preg_match('/' . $pattern . '/u', $this->str)) {\n return true;\n } else {\n return false;\n }\n }", "public function hasRepeatedStringField()\n {\n return count($this->get(self::REPEATED_STRING_FIELD)) !== 0;\n }", "public function matches($str, $field)\n\t{\n\t\tif ( ! isset($_POST[$field]))\n\t\t{\n\t\t\treturn FALSE;\t\t\t\t\n\t\t}\n\t\t\n\t\t$field = $_POST[$field];\n\n\t\treturn ($str !== $field) ? FALSE : TRUE;\n\t}", "function check_replacement ($conn,$data, $final_valid, $defected) {\n\n\tif ($final_valid == \"YES\" AND $defected == \"Defected\") {\n\t\treturn \"VALID\";\n\t}\n\telse {\n\t return \"INVALID\" ; \n\t}\n}", "function validarNombre($variable, $pattern){\n if (preg_match($pattern, $variable)) {\n return \tTrue;\n }\n return false;\n }", "function _matches($field, $other_field)\r\n\t{\r\n\t\treturn ($this->{$field} !== $this->{$other_field}) ? FALSE : TRUE;\r\n\t}", "static public function is_pattern($pattern)\n\t{\n\t\treturn (strpos($pattern, '<') !== false) || (strpos($pattern, ':') !== false);\n\t}", "protected function replaceField(Field $field){\n }", "public function hasField($field){\n\t\t#if[compile-time]\n\t\tCoreType::assertString($field);\n\t\t#endif\n\t\t$this->_connect();\n\t\t$fields = $this->_getAttributes();\n\t\treturn in_array($field, $fields);\n\t}", "public static function isMatchVaribleRegexPattern($value=null)\r\n {\r\n // determines if the variable that can be used\r\n // in the route file meets the regex rule.\r\n return (preg_match('@\\{(.*?)\\}@is',$value)) ? true : false;\r\n }", "public function hasPlaceholders();", "public function patternMatches($fieldName,$validation){\n\t\tif (isSet($_SESSION[$fieldName])){\n\t\t\treturn preg_match($validation,$_SESSION[$fieldName]);\n\t\t}\n\t}", "public function patternExists(string $id) : bool;", "function isBadPhone( string $field )\r\n {\r\n \r\n return ( array_search( $field, BAD_PHONES ) !== false || !preg_match( ALLOWED_CODES, $field ) ); \r\n }", "public function is_registered($pattern_name)\n {\n }", "public function hasField(string $field): bool;", "public function matches(Pattern $pattern);", "public function hasValue(string $field): bool;" ]
[ "0.62857735", "0.5981456", "0.58648974", "0.58528006", "0.55580354", "0.54394835", "0.5431845", "0.5411922", "0.5316236", "0.52655107", "0.52470887", "0.5219204", "0.52190346", "0.52129245", "0.5200667", "0.52000356", "0.5194565", "0.5190763", "0.51823705", "0.51764005", "0.51698613", "0.5148142", "0.5126879", "0.5112374", "0.51093054", "0.5103855", "0.5093595", "0.5070314", "0.5067271", "0.50533485" ]
0.7110213
0
Get array of Field Replacements.
public function getFieldReplacements(): array { return $this->field_replacements; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getReplacements()\n {\n if (isset($this->raw->replacements)) {\n return (array) $this->raw->replacements;\n }\n\n return array();\n }", "public function getPatternedFields(): array;", "public function getReplaces(): array {\n return [];\n }", "public function getFieldsArray() {\n\t\t\treturn $this->fields_array;\n\t\t}", "protected function replacements(): array\n {\n return [\n 'modelSingularCapitalized' => $this->modelSingularCapitalized(),\n 'values' => $this->values(),\n 'buttons' => $this->buttons(),\n ];\n }", "public function getAllFields()\n {\n return array_merge($this->_fields, $this->_changedFields);\n }", "public function providerFieldValues()\n {\n return [\n ['non_existent_field', []],\n ['empty_field', []],\n ['empty_field_2', []],\n [\n 'acf_value_field',\n [\n ['test-1' => 'test 1'],\n ['test-1' => 'test 2'],\n ['test-1' => 'test 3'],\n ],\n ],\n [\n 'acf_option_field',\n [\n [\n 'label' => 'test 1',\n 'slug' => 'test-1',\n ],\n [\n 'label' => 'test 2',\n 'slug' => 'test-2',\n ],\n ],\n ],\n ];\n }", "public function getProcessedReplacements()\n {\n $values = $this->getReplacements();\n\n if (null !== ($git = $this->getGitHashPlaceholder())) {\n $values[$git] = $this->getGitHash();\n }\n\n if (null !== ($git = $this->getGitShortHashPlaceholder())) {\n $values[$git] = $this->getGitHash(true);\n }\n\n if (null !== ($git = $this->getGitTagPlaceholder())) {\n $values[$git] = $this->getGitTag();\n }\n\n if (null !== ($git = $this->getGitVersionPlaceholder())) {\n $values[$git] = $this->getGitVersion();\n }\n\n if (null !== ($date = $this->getDatetimeNowPlaceHolder())) {\n $values[$date] = $this->getDatetimeNow($this->getDatetimeFormat());\n }\n\n $sigil = $this->getReplacementSigil();\n\n foreach ($values as $key => $value) {\n unset($values[$key]);\n\n $values[\"$sigil$key$sigil\"] = $value;\n }\n\n return $values;\n }", "public function getFields() {\n $field = $this->get('field');\n return null !== $field ? $field : array();\n }", "final public function getAllFields()\r\n {\r\n return array($this->_field);\r\n }", "public function getReplaces(): ReplaceCollection;", "public function getFields() {\n $modifiable_fields = [];\n $type = $this->getType();\n $bundle = $this->getBundle();\n // Get _all_ defined fields. This should return an associative array.\n $fields = Framework::instance()->fieldInfoFields();\n foreach ($fields as $field => $info) {\n if (isset($info['bundles'][$type]) && is_array($info['bundles'][$type]) && in_array($bundle, $info['bundles'][$type]) && $this->filter($field)) {\n $this->addModifier($modifiable_fields, 'field', $field);\n }\n }\n return $modifiable_fields;\n }", "public function prepareFields(): array\n\t{\n\t\t$fields = [];\n\t\tforeach ($this->getFieldsToDisplay(static::DISPLAY_IN_FILTER) as $field => $fieldParams)\n\t\t{\n\t\t\t$customMethod = $this->getCustomFieldOptionMethodIfExists($field);\n\t\t\tif (!empty($fieldParams['filterOptionPreset']))\n\t\t\t{\n\t\t\t\t$options = $this->prepareFieldOptionByPreset($fieldParams);\n\t\t\t}\n\t\t\telseif ($customMethod)\n\t\t\t{\n\t\t\t\t$options = $this->$customMethod($fieldParams);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$options = [\n\t\t\t\t\t'type' => $fieldParams['type'],\n\t\t\t\t\t'default' => $fieldParams['defaultFilter']\n\t\t\t\t];\n\t\t\t}\n\n\t\t\t$fields[$field] = [\n\t\t\t\t'options' => $options,\n\t\t\t];\n\t\t}\n\n\t\t$this->prepareParentFields($fields);\n\n\t\t$result = [];\n\t\tforeach($fields as $name => $field)\n\t\t{\n\t\t\t$result[$name] = $this->createField($name, (!empty($field['options']) ? $field['options'] : []));\n\t\t}\n\n\t\tif ($this->factory->isCrmTrackingEnabled())\n\t\t{\n\t\t\t\\Bitrix\\Crm\\Tracking\\UI\\Filter::appendFields($result, $this);\n\t\t}\n\n\t\treturn $result;\n\t}", "public function fields(): array\n {\n return MyField::withSlug('name', MyField::withMeta([\n MyField::relation('categories')\n ->fromModel(ProductCategory::class, 'name')\n ->multiple(),\n MyField::uploadMedia(),\n MyField::input('price')\n ->step(0.001)\n ->required(),\n MyField::input('discount')\n ->step(0.001)\n ->required(),\n MyField::quill('body'),\n MyField::switcher('is_active')\n ->value(true)\n ]));\n }", "public function getFields(): array\n {\n return $this->fields;\n }", "public function getFields(): array\n {\n return $this->fields;\n }", "protected function getAllReplacements() {\n\t\tif (!is_array($this->replacementsCache)) {\n\t\t\t$modelReplacements = Config::get('replaceable.' . get_called_class() . '.replacements', []);\n\t\t\t$globalReplacements = Config::get('replaceable.*.replacements', []);\n\t\t\t$this->replacementsCache = array_merge($globalReplacements, $modelReplacements);\n\t\t}\n\n\t\treturn $this->replacementsCache;\n\t}", "private function getFields()\n {\n return [\n [\n \"field_type\" => \"text\",\n \"field_name\" => \"first_name\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n [\n \"field_type\" => \"text\",\n \"field_name\" => \"last_name\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n [\n \"field_type\" => \"checkbox\",\n \"field_name\" => \"happy\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n [\n \"field_type\" => \"select\",\n \"field_name\" => \"character\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => [\n [\"value\" => \"biff\", \"label\" => \"Biff\"],\n [\"value\" => \"marty\", \"label\" => \"Marty\"],\n [\"value\" => \"doc\", \"label\" => \"Doc Brown\"],\n [\"value\" => \"jennifer\", \"label\" => \"Jennifer\"],\n [\"value\" => \"needles\", \"label\" => \"Needles\"],\n ]\n ],\n [\n \"field_type\" => \"checkbox\",\n \"field_name\" => \"kids\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n ];\n }", "public function getChangeset(): array\n\t{\n\t\t$changes = [];\n\n\t\tforeach ($this->getNonMetadataFields() as $key => $value) {\n\t\t\tif (! isset($this->initialFieldValues[$key]) || $value !== $this->initialFieldValues[$key]) {\n\t\t\t\t$changes[$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $changes;\n\t}", "public function getFieldsWithUpdate()\n {\n return array_filter($this->fieldChanges, function ($fieldChange) {\n return $fieldChange->hasChange();\n });\n }", "public function getFields()\n\t{\n\t\treturn [];\n\t}", "public function getFields(){\n if($fields = json_decode($this->fields)){\n\n // si la variable es un array, tengo que concatenar sus valores porque el component/slot no admite paso de arrays\n // foreach ($fields as &$value) {\n // if(is_array($value) && sizeof($value)){\n\n // if(!is_object($value[0])){ // tengo que dejar tranquilos a los arrays que tienen objetos dentro, que son del repeater y no de un select2 multiple por ej\n // $value = implode($value,',');\n // }\n\n // }\n // }\n\n return $fields;\n }\n else{\n return [];\n }\n }", "protected function replacements(): array\n {\n return [\n 'useModel' => $this->useModel(),\n 'modelClass' => $this->modelClass(),\n 'useSeeder' => $this->useSeeder(),\n 'seed' => $this->seed(),\n ];\n }", "public function fields()\n {\n return array_map(\n function (array $field) {\n return Field::fromArray($field);\n },\n $this->client->get('field')\n );\n }", "public function getFields(): array;", "public function getFields(): array;", "public function getFields(): array;", "public function getFields() : array {\n\t\treturn $this->fields;\n\t}", "public function getFields(): array\n {\n $fields = [];\n\n foreach ($this->getGroups() as $group) {\n foreach ($group->fields as $field) {\n $fields[$field->id ?? \\count($fields)] = $field;\n }\n }\n\n return $fields;\n }", "public function values_as_array() {\n $Data = array();\n foreach ($this->__fields() as $field) {\n $v = $this->$field->cleaned_value();\n if ($v instanceof Newforms_File_Object) continue;\n $Data[$field] = $v;\n }\n return $Data;\n }" ]
[ "0.67094177", "0.6581179", "0.632138", "0.62687904", "0.61752635", "0.6167777", "0.61544096", "0.6133821", "0.60789096", "0.6060479", "0.60374373", "0.603728", "0.5987658", "0.5983393", "0.5976312", "0.5976312", "0.5957291", "0.5942206", "0.5910858", "0.5910759", "0.5908768", "0.5896189", "0.5886965", "0.5867383", "0.5864676", "0.5864676", "0.5864676", "0.58636", "0.5848744", "0.5840645" ]
0.8786153
0
Convenience method for setting a linking pattern on a field.
public function addLinkingPattern(string $field_name, string $href): void { // Make and set the linking pattern $this->field_replacements[$field_name] = '<a href="'.$href.'">{'.$field_name.'}</a>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPattern($pattern) {}", "public function setPattern($pattern)\n {\n $this->_pattern = $pattern;\n }", "public function testSetReferencePattern1()\n {\n $this->object->setReferencePattern('%', '%');\n\n // test data to use\n $data = [\n 'test1' => '%wow1%',\n 'test2' => [\n 'test3' => '%wow3%'\n ],\n 'wow1' => '%test2.test3%',\n 'wow3' => 'xxx'\n ];\n $this->object->set(null, $data);\n\n $this->assertEquals('xxx', $this->object->get('test1'));\n }", "public function setPattern($pattern) {\n $this->pattern = $pattern;\n return $this;\n }", "public function SetPattern ($pattern) {\n\t\t$this->pattern = $pattern;\n\t\treturn $this;\n\t}", "public function setPattern(?string $pattern): static\n {\n $this->pattern = $pattern;\n return $this;\n }", "function AddLinkPrefix($pSet, $field, $link)\n{\n\tif(strpos($link,\"://\")===false && substr($link,0,7)!=\"mailto:\")\n\t\treturn $pSet->getLinkPrefix($field).$link;\n\treturn $link;\n}", "public function setPatternIdentifier(PatternIdentifier $identifier)\n {\n $this->patternIdentifier = $identifier;\n }", "public function setPattern($pattern)\n {\n $this->pattern = $pattern;\n return $this;\n }", "public function setPattern($pattern)\n {\n $this->pattern = $pattern;\n return $this;\n }", "public function setPattern($value)\n\t{\n\t\t$this->setViewState('Pattern',$value,'');\n\t}", "public function getPatternedField(string $field);", "public function setPatternedField(string $field, $value): ObjectInterface;", "public function setPattern($pattern)\n {\n $this->options['pattern'] = $pattern;\n\n return $this;\n }", "public function addLinkingPatternByRoute(string $field_name, string $route_name, array $replacement_map = [], $query_string = []): void\n {\n $Route = Route::getRoutes()->getByName($route_name);\n if ($Route == null) {\n throw new InvalidRouteException('Invalid route name '.$route_name);\n }\n\n $uri = $Route->uri;\n foreach ($replacement_map as $key => $new) {\n $uri = str_replace($key, $new, $uri);\n }\n\n if (is_array($query_string) && count($query_string) > 0) {\n $uri .= '?'.implode('&', array_map(function ($key, $val) {\n return $key.'='.$val;\n }, array_keys($query_string), $query_string));\n } elseif (is_string($query_string)) {\n $uri .= '?'.$query_string;\n }\n\n // If it already has a linking pattern, replace $field_name with that linking pattern\n $link_text = (isset($this->field_replacements[$field_name]) ? $this->field_replacements[$field_name] : '{'.$field_name.'}');\n\n // Make and set the linking pattern\n $this->field_replacements[$field_name] = '<a href=\"/'.$uri.'\">'.$link_text.'</a>';\n }", "public function setSlugPattern($pattern);", "public function createExternalLinkPattern(array $data): void\n {\n $uri = 'external-link-patterns';\n $required = [\n 'pattern' => self::TYPE_STRING,\n 'linkReplacement' => self::TYPE_STRING,\n ];\n $this->throwIfInvalid($required, $data);\n\n $this->client->post($this->buildUrl($uri), $data);\n }", "function setUrlLink(){\n if( $this->id == 0 ) return;\n $url = $this->aFields[\"url\"]->toString();\n if( $url == \"\" ) return;\n $url = strip_tags( preg_replace( \"/[\\\"']/\", \"\", $url ) );\n if( !$this->aFields[\"url\"]->editable ) $this->aFields[\"url\"]->display = false;\n $this->aFields[\"url_link\"]->display = true;\n $this->aFields[\"url_link\"]->value = \"<a href=\\\"\".$url.\"\\\">\".$url.\"</a>\";\n }", "public function setByKey($field, $key)\n {\n \n if (isset(static::$links[$field])) {\n \n $this->data[$field] = $this->orm->getIdByKey(\n SFormatStrings::subToCamelCase(static::$links[$field]),\n $key\n );\n \n } else {\n throw new LibDb_Exception('Invalid Route '.$field);\n }\n \n }", "public function pattern($key, $pattern)\n {\n $this->patterns[$key] = $pattern;\n }", "function _prep_url($field)\r\n\t{\r\n\t\t$this->{$field} = $this->form_validation->prep_url($this->{$field});\r\n\t}", "public function setPattern(string $countryCode, string $pattern) : void\n {\n $this->patterns[$countryCode] = $pattern;\n }", "public function setPattern($pattern) {\n if ($pattern instanceof PanelsPatternInterface) {\n $this->pattern = $pattern;\n $this->configuration['pattern'] = $pattern->getPluginId();\n }\n elseif (is_string($pattern)) {\n $this->pattern = NULL;\n $this->configuration['pattern'] = $pattern;\n }\n else {\n throw new \\Exception(\"Pattern must be a string or PanelsPatternInterface object\");\n }\n\n return $this;\n }", "public function setLink($link);", "public static function getPatternUrl()\n {\n return handles('antares::customfields/index');\n }", "function addLinkToField($fieldName,$renderClass=\"\"){\r\n\t\t$this->fieldsToLink[$fieldName]=$renderClass;\r\n\t}", "public function setDashPattern($pattern) {}", "function setRefFields($val) {\n $this->_refFields = $val;\n }", "public function set_permalink_structure($structure = '')\n {\n global $wp_rewrite;\n\n $wp_rewrite->init();\n $wp_rewrite->set_permalink_structure($structure);\n $wp_rewrite->flush_rules();\n }", "function setFieldLinks(array $fieldLinks) {\n if ($fieldLinks !== ($oldFieldLinks = $this->fieldLinks)) {\n if ($this->immutable) throw self::immutableException();\n if (!$fieldLinks) throw new Ac_E_InvalidCall(\"\\$fieldLinks must not be empty\");\n $this->fieldLinks = $fieldLinks;\n $this->fieldLinksRev = array_flip($fieldLinks);\n $this->srcNNIdsRelation = false;\n }\n }" ]
[ "0.63645095", "0.5949829", "0.58516496", "0.5824148", "0.5730673", "0.5727742", "0.56747746", "0.5599634", "0.55771893", "0.55771893", "0.55607605", "0.55489045", "0.55346584", "0.5311512", "0.5288819", "0.5287096", "0.5266842", "0.5211332", "0.5210005", "0.51585627", "0.51575255", "0.5131731", "0.5088463", "0.5072314", "0.5048383", "0.5016442", "0.500739", "0.49984193", "0.49694848", "0.49652323" ]
0.67723024
0
Convenience method for creating a link replacement pattern by route name.
public function addLinkingPatternByRoute(string $field_name, string $route_name, array $replacement_map = [], $query_string = []): void { $Route = Route::getRoutes()->getByName($route_name); if ($Route == null) { throw new InvalidRouteException('Invalid route name '.$route_name); } $uri = $Route->uri; foreach ($replacement_map as $key => $new) { $uri = str_replace($key, $new, $uri); } if (is_array($query_string) && count($query_string) > 0) { $uri .= '?'.implode('&', array_map(function ($key, $val) { return $key.'='.$val; }, array_keys($query_string), $query_string)); } elseif (is_string($query_string)) { $uri .= '?'.$query_string; } // If it already has a linking pattern, replace $field_name with that linking pattern $link_text = (isset($this->field_replacements[$field_name]) ? $this->field_replacements[$field_name] : '{'.$field_name.'}'); // Make and set the linking pattern $this->field_replacements[$field_name] = '<a href="/'.$uri.'">'.$link_text.'</a>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generateI18nPatterns($routeName, Route $route);", "function route($route_name)\n {\n global $router; \n return $router->generate($route_name);\n }", "public static function when($pattern, Closure $callback, $name = null)\n {\n $apricot = self::getInstance();\n\n if (null !== $apricot->prefix) {\n $pattern = '/' === $pattern ? $apricot->prefix : $apricot->prefix . $pattern;\n }\n\n $originalPattern = $pattern;\n $pattern = preg_replace('#:([a-zA-Z0-9_]+)#is', '(.+)', $pattern);\n\n // Override an existing route with the exact same pattern\n foreach($apricot->routes as $routeName => $route) {\n if ($route['original_pattern'] == $originalPattern) {\n unset($apricot->routes[$routeName]);\n }\n }\n\n if (null === $name) {\n $name = count($apricot->routes);\n }\n\n $apricot->routes[$name] = array(\n 'pattern' => $pattern,\n 'original_pattern' => $originalPattern,\n 'callback' => $callback\n );\n }", "public function addLinkingPattern(string $field_name, string $href): void\n {\n // Make and set the linking pattern\n $this->field_replacements[$field_name] = '<a href=\"'.$href.'\">{'.$field_name.'}</a>';\n }", "public function pattern($name, $pattern)\n {\n $this->routeObject->addPattern($name, $pattern);\n return $this;\n }", "public function generate ( $routeName, $params = [] ) {\n if ( !isset( $this->namedRoutes[ $routeName ] ) ) {\n throw new \\Exception(\"Route '{$routeName}' does not exist.\");\n }\n // Replace named parameters\n $route = $this->namedRoutes[$routeName];\n // prepend base path to route url again\n $url = $route;\n if ( preg_match_all( self::PARSE_REGEX, $route, $matches, PREG_SET_ORDER)) {\n foreach($matches as $match) {\n list($block, $pre, $type, $param, $optional) = $match;\n if ( $pre ) {\n $block = substr($block, 1);\n }\n if( isset( $params[$param] ) ) {\n $url = str_replace($block, $params[$param], $url);\n } elseif ($optional) {\n $url = str_replace($pre . $block, '', $url);\n }\n }\n }\n return $url;\n }", "public function generate($routeName, $params = [])\n {\n // Check if named route exists\n if ( !isset($this->namedRoutes[$routeName]) ) {\n throw new RuntimeException(\"Route '{$routeName}' does not exist\");\n }\n // Replace named parameters\n $route = $this->namedRoutes[$routeName];\n // prepend base path to route url again\n $url = $this->basePath . $route;\n if ( $matches = Stringify::matchAll('`(/|\\.|)\\[([^:\\]]*+)(?::([^:\\]]*+))?\\](\\?|)`',$route,-1,PREG_SET_ORDER) ) {\n foreach ($matches as $index => $match) {\n list($block, $pre, $type, $param, $optional) = $match;\n if ( $pre ) {\n $block = substr($block,1);\n }\n if ( isset($params[$param]) ) {\n // Part is found, replace for param value\n $url = Stringify::replace($block, $params[$param],$url);\n } elseif ( $optional && $index !== 0 ) {\n // Only strip preceding slash if it's not at the base\n $url = Stringify::replace(\"{$pre}{$block}\",'',$url);\n } else {\n // Strip match block\n $url = Stringify::replace($block,'',$url);\n }\n }\n }\n return $url;\n }", "function route($name, $params = [])\n{\n $url = \\Atom\\Routing\\Router::instance()->url($name, $params);\n\n $scheme = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? $_SERVER['HTTPS'] : 'http://';\n\n return startsWith($url, '/') ?\n $scheme . $_SERVER['HTTP_HOST'] . $url:\n $scheme . $_SERVER['HTTP_HOST'] . '/' . $url;\n}", "public function getRoute($name){ }", "function link_to_route($name, $title = null, $parameters = [], $attributes = [])\n {\n return app('html')->linkRoute($name, $title, $parameters, $attributes);\n }", "function link_to_route($name, $title = null, $parameters = [], $attributes = [])\n {\n return app('html')->linkRoute($name, $title, $parameters, $attributes);\n }", "function make_link($params = null) {\n $params = func_get_args();\n $name = array_shift($params);\n $url = call_user_func_array('url_for', $params);\n \n return sprintf('<a href=\"%s\">%s</a>', $url, $name);\n}", "public function pattern($name, $value)\n {\n Route::pattern($name, $value);\n }", "public function route(string $replace, string $name, array $parameters = [], bool $blank = false): static\n {\n return $this->away($replace, route($name, $parameters), $blank);\n }", "function link_to_route(string $name, ?string $title = null, array $parameters = [], array $attributes = []): Htmlable\n {\n return \\app('html')->linkRoute($name, $title, $parameters, $attributes);\n }", "public function generate($routeName, $params = [])\n {\n if (!($route = $this->getRoute($routeName))) {\n throw new RouteInvalidArgumentException(\"Route [$routeName] not registered.\");\n }\n\n if (!$this->hasMatchType($route->getPath())) {\n return $this->getRoutingPath() . $route->getPath();\n }\n\n $subject = $route->getPath();\n $replace = '';\n foreach ($params as $param) {\n $replace = preg_replace('/:(\\w+)/i', $param, $subject, 1);\n $subject = $replace;\n }\n\n return $this->getRoutingPath() . $replace;\n }", "public function addNamedRoute($name, $url, $controller, $method) {\n $this->pathes[$url] = ['controller' =>$controller, 'method' => $method, 'name' => $name ];\n }", "public static function toRoute($name)\n {\n return self::to(RouteHandler::getByName($name)[0]);\n }", "public static function link_to_route($name, $title = null, $parameters = array(), $attributes = array()) {\n\t\treturn static::link(URL::to_route($name, $parameters), $title, $attributes);\n\t}", "public function addRoute($name, $route, $priority = null);", "function klein_compile_route( $route ) {\n\tif ( preg_match_all( '`(/|\\.|)\\[([^:\\]]*+)(?::([^:\\]]*+))?\\](\\?|)`', $route, $matches, PREG_SET_ORDER ) ) {\n\t\t$match_types = array(\n\t\t\t'i' => '[0-9]++',\n\t\t\t'a' => '[0-9A-Za-z]++',\n\t\t\t'h' => '[0-9A-Fa-f]++',\n\t\t\t'*' => '.+?',\n\t\t\t'**' => '.++',\n\t\t\t'' => '[^/]+?',\n\t\t);\n\t\tforeach ( $matches as $match ) {\n\t\t\tlist( $block, $pre, $type, $param, $optional ) = $match;\n\n\t\t\tif ( isset( $match_types[ $type ] ) ) {\n\t\t\t\t$type = $match_types[ $type ];\n\t\t\t}\n\t\t\tif ( $pre === '.' ) {\n\t\t\t\t$pre = '\\.';\n\t\t\t}\n\t\t\t// Older versions of PCRE require the 'P' in (?P<named>)\n\t\t\t$pattern = '(?:' . ( $pre !== '' ? $pre : null ) . '(' . ( $param !== '' ? \"?P<$param>\" : null ) . $type . '))' . ( $optional !== '' ? '?' : null );\n\n\t\t\t$route = str_replace( $block, $pattern, $route );\n\t\t}\n\t}\n\n\treturn \"`^$route$`\";\n}", "public static function set($name, $uri_callback = NULL, $regex = NULL)\n\t{\n\t\tif($uri_callback === TRUE)\n\t\t{\n\t\t\t$uri_callback = ___($name);\n\t\t}\n\t\t\n\t\treturn Route::$_routes[$name] = new Route($uri_callback, $regex);\n\t}", "public function route($name, array $params = [])\n {\n return $this->setUrl(\n route($name, $params)\n );\n }", "function route(string $name, $params = [])\n{\n return Route::route($name, $params);\n}", "protected function addRoute($name)\n {\n $plural = strtolower(Str::pluralStudly($name));\n $file_loc = base_path() . '/routes/web.php';\n $route = \"\\nRoute::resource('$plural', '{$name}Controller');\";\n\n $this->files->append($file_loc, $route);\n $this->info('Model resource route created successfully.');\n }", "public function testRouteSetsCustomTemplate()\n {\n $route = new \\Slim\\Route('/hello/*', function () {});\n $route->setPattern('/hello/:name');\n $this->assertEquals('/hello/:name', $route->getPattern());\n }", "public function link(string $name, array $params = [], array $options = []): string;", "public static function route($routeName,$param = Array(),$withBase = true)\n\t{\n\t\treturn self::createByRoute($routeName,$param,$withBase);\n\t}", "public function addRoute($name, \\Yaf\\Route_Interface $route){\r\n\t\t$this->_routes[$name]\t= $route;\r\n\t }", "public function testUrlGenerationNamedRoute(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect(\n '/users',\n ['controller' => 'Users', 'action' => 'index'],\n ['_name' => 'users-index']\n );\n $routes->connect(\n '/users/{name}',\n ['controller' => 'Users', 'action' => 'view'],\n ['_name' => 'test']\n );\n $routes->connect(\n '/view/*',\n ['action' => 'view'],\n ['_name' => 'Articles::view']\n );\n\n $url = Router::url(['_name' => 'test', 'name' => 'mark']);\n $this->assertSame('/users/mark', $url);\n\n $url = Router::url([\n '_name' => 'test', 'name' => 'mark',\n '?' => ['page' => 1, 'sort' => 'title', 'dir' => 'desc', ],\n ]);\n $this->assertSame('/users/mark?page=1&sort=title&dir=desc', $url);\n\n $url = Router::url(['_name' => 'Articles::view']);\n $this->assertSame('/view/', $url);\n\n $url = Router::url(['_name' => 'Articles::view', '1']);\n $this->assertSame('/view/1', $url);\n\n $url = Router::url(['_name' => 'Articles::view', '_full' => true, '1']);\n $this->assertSame('http://localhost/view/1', $url);\n\n $url = Router::url(['_name' => 'Articles::view', '1', '#' => 'frag']);\n $this->assertSame('/view/1#frag', $url);\n }" ]
[ "0.6135151", "0.59848183", "0.5944712", "0.592391", "0.5907689", "0.5808504", "0.57717246", "0.57711285", "0.57193106", "0.5652937", "0.5652937", "0.56470156", "0.5637944", "0.5607559", "0.5607001", "0.55856323", "0.5584579", "0.5547021", "0.5505485", "0.5472079", "0.5445687", "0.5408698", "0.540817", "0.54024124", "0.53996414", "0.5347093", "0.5345722", "0.5328956", "0.5320482", "0.53137535" ]
0.64150184
0
Make a view and extend $extends in $section, $blade_data is the data array to pass to View::make().
public function makeView(array $blade_data = [], string $extends = '', string $section = ''): \Illuminate\View\View { $blade_data['Table'] = $this; $blade_data['extends'] = $extends; $blade_data['section'] = $section; $this->Theme->prepareTableView($this); $template = ($extends != '' ? 'table-extend' : 'table'); return $this->getThemeView($template, $blade_data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function makeView($blade_data, $extends='', $section=''){\n\t\t$blade_data['Form'] = $this;\n\t\t$blade_data['extends'] = $extends;\n\t\t$blade_data['section'] = $section;\n\t\t\n\t\treturn View::make('form-maker::form', $blade_data);\n\t}", "public function make($view, $data = array());", "private static function build($blade, $data = []) {\n /**\n * Set data\n */\n static::$data = $data;\n\n $child = app(get_called_class());\n\n if(request()->ajax()) {\n if(method_exists($child, 'render')) {\n return $child->render();\n }\n\n throw new LadminException('No method render found in the class ' . get_called_class());\n \n }\n \n if(method_exists($child, 'options')) {\n $options = array_merge($data, $child->options());\n return view($blade, $options);\n }\n\n throw new LadminException('No method options found in the class ' . get_called_class());\n }", "public static function make($name, $data=array())\r\n\t{\r\n\t\t$view = new BladeView($name);\r\n\t\t$view->with($data);\r\n\t\treturn $view;\r\n\t}", "function includeView($name, $data = null)\n {\n if (is_array($data)) {\n extract($data);\n }\n include($_SERVER[\"DOCUMENT_ROOT\"] . \"/views/$name.php\");\n }", "function view($templateChain, $array = null){ \n if($array != null){\n foreach($array as $key=>$value){ \n $$key = $value;\n }\n } \n $template = str_replace('.', '/', $templateChain); \n $partsAndInludes = Response::view($template); \n if(!is_array($partsAndInludes)){\n include($partsAndInludes);\n return;\n }\n \n $parts = $partsAndInludes['parts'];\n $includes = $partsAndInludes['includes'];\n \n $templateName = $template.'.php';\n $maxCount = (count($parts) > count($includes))? count($parts) : count($includes);\n for($x=0; $x<$maxCount; $x++){ \n if(isset($parts[$x])){\n $tmpName = appDir('Views/tmp/part'.$x.'.php');\n $fileHandle = fopen($tmpName, 'w'); \n $content = preg_replace(\"/^(partial\\(['\\\"]|render\\(['\\\"])[a-zA-Z0-9-_.]+(['\\\"]\\))/\", '', $parts[$x]); \n fwrite($fileHandle, $content);\n fclose($fileHandle); \n include_once($tmpName); \n } \n \n if(isset($includes[$x]) && $includes[$x] == 'content'){\n $tmp_name = appDir('Views/tmp/content-part.php');\n $fileContent = file_get_contents(appDir('Views/'.$templateName));\n $fileHandle = fopen($tmp_name, 'w'); \n $mainContent = preg_replace(\"/^(\\@layout\\(['\\\"])[a-zA-Z0-9-_.]+(['\\\"]\\))/\", '', $fileContent); \n fwrite($fileHandle, $mainContent);\n fclose($fileHandle); \n include_once($tmp_name);\n continue;\n }elseif(isset($includes[$x])){\n $file = str_replace('.', '/', $includes[$x]).'.php';\n include_once(appDir('Views/'.$file));\n } \n } \n}", "function view($name, $data = [])\n{\n extract($data); // reverse of the compact() function\n\n return require \"app/views/{$name}.view.php\";\n}", "public function partial($key, $view, $data = array())\n\t{\n\t\treturn $this->with($key, $this->factory->make($view, $data));\n\t}", "public function renderView($view, $data=null){\n\t\tif (request()->ajax()) {\n\t\t\t$format = request()->format ?? \"\";\n\t\t\tif(strtolower($format) == \"json\"){\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t\treturn View::make($view)->with($data)->renderSections()['content'];\n\t\t}\n\t\treturn view($view)->with($data);\n\t}", "public function set_partial( $name, $view, $data = array() ) {\n $this->_partials[ $name ] = array( 'view' => $view, 'data' => $data );\n return $this;\n }", "public function partial($view, array $data = array())\n\t{\n\t\treturn View::make('partials.'.$view, $data)->render();\n\t}", "public function view(string $view, array $data = []): self\n {\n $path = '';\n\n // N'est-il pas namespaced ? on cherche le dossier en fonction du parametre \"view_base\"\n if (strpos($view, '\\\\') === false) {\n $path = $this->config['view_dir'] ?? '';\n if (! empty($path)) {\n $path .= '/';\n }\n }\n\n $view = view($path . $view, $data);\n if (! empty($this->config['template'])) {\n $view->setLayout($this->config['template']);\n }\n\n return $this->html($view->get(false));\n }", "public function with($data, $view)\n {\n return $data = [\n 'myFields' => $this->fields(),\n 'myFieldGroup' => $this->fields('myFieldGroup'),\n 'myFieldGroupItem' => $this->fields('myFieldGroup')->groupItem,\n 'myFieldGroupSubItem' => $this->fields('myFieldGroup')->groupItem['subItem'],\n ];\n }", "public function view($view, $data = []): void\n {\n foreach ($data as $name => $value) {\n ${$name} = $value;\n }\n ob_start();\n $dir = __DIR__ . '/../Views/';\n include $dir . 'header.php';\n include $dir . $view . '.php';\n include $dir . 'footer.php';\n ob_flush();\n }", "public static function make($viewname, array $data = [])\n {\n return static::singleton()->getTemplate()->render($viewname, $data);\n }", "function generate($content_view, $template_view, $data = null)\n {\n include 'mvcphp/views/'.$template_view;\n }", "public function view()\n {\n $this->processParametersForView();\n \n if ($this->view === 'main/base') { //Legacy and body\n extract($this->data);\n \n include(__DIR__ . '/../View/' . $this->view . '.php');\n \n return;\n }\n \n //Templates\n $this->latteView();\n }", "public function partial($view, array $data = array())\r\n {\r\n $layout = $this->layout;\r\n $this->layout = null;\r\n $this->render($view, $data);\r\n $this->layout = $layout;\r\n }", "public function loadViews($view = null, $data = null)\n\t{\n\t\tif ($data) {\n\t\t\t$data['view'] = $view;\n\t\t\techo view(\"includes/header\", $data);\n\t\t\techo view($view, $data);\n\t\t\techo view(\"includes/footer\", $data);\n\t\t} else {\n\t\t\techo view(\"includes/header\");\n\t\t\techo view($view);\n\t\t\techo view(\"includes/footer\");\n\t\t}\n\t}", "protected function view($view, $data = [], $mergeData = [])\n {\n return view()->make(\"scaffold::{$view}\", $data, $mergeData);\n }", "private function _layout($data, $view)\n\t{\n\t\t$this->load->view('siswa/view/' . $view, $data);\n\t}", "public function partial($view,$data=array(),$name=null)\n\t{\n\t\t/* always return */\n\t\t$partial = $this->view($view,$data,true);\n\n\t\t/*\n\t\tif name is provided then place directly into the view variable $name\n\t\tand return $this (loader) to allow chaining\n\t\t*/\n\t\tif ($name) {\n\t\t\t$this->_ci_cached_vars[$name] = $partial;\n\t\t\treturn $this;\n\t\t}\n\n\t\t/* return the partial */\n\t\treturn $partial;\n\t}", "public function make($view, $data = [], $mergeData = [])\n {\n return $this->render($view, $data, $mergeData);\n }", "protected function makeViews()\n {\n new MakeView($this, $this->files);\n }", "private function _template($data, $view)\n\t{\n\t\t$this->load->view('mahasiswa/views/' . $view, $data);\n\t}", "private function _template($data, $view)\n\t{\n\t\t$this->load->view('mahasiswa/views/' . $view, $data);\n\t}", "function viewc($view = null, $data = array(), $mergeData = array()) {\n $router = Route::getCurrentRoute()->getActionName();\n $module = substr($router, strripos($router, 'Controllers\\\\') + 12, (strrpos($router, '\\\\') - (strripos($router, 'Controllers\\\\') + 12)));\n $controller = substr($router, strripos($router, '\\\\') + 1, (strpos($router, 'Controller@')) - (strripos($router, '\\\\') + 1));\n $action = substr($router, strpos($router, '@') + 1);\n $route = ['module' => $module,\n 'controller' => $controller,\n 'action' => $action,\n ];\n $data = array_merge($data, $route);\n $factory = app('Illuminate\\Contracts\\View\\Factory');\n if (func_num_args() === 0) {\n return $factory;\n }\n\n return $factory->make($view, $data, $mergeData);\n }", "protected function view($view, $data = array()) {\n $path = dirname(__FILE__) . '/../view/';\n $file = $path . $view . '.php';\n\n if(file_exists($file)) {\n extract($data);\n \n require_once $file;\n }\n }", "private function loadView($view, $data){\n $resolver = new TemplateMapResolver();\n $resolver->setMap(array(\n 'stepTemplate' => ROOT_PATH . '/module/BackOffice/view/back-office/wager/partials/wagerTypes/' . $view . '.phtml'\n ));\n \n //Create a view object and resolve the path base on the template map resolver above.\n $view = new PhpRenderer();\n $view->setResolver($resolver);\n \n //Create a view to use with the established template and add any variables that view will use.\n $viewModel = new ViewModel();\n $viewModel->setTemplate('stepTemplate')->setVariables(array(\n 'data' => $data\n ));\n \n return $view->render($viewModel);\n }", "public function views($name, $data = array())\n { \n $this->var['output'] .= $this->CI->load->view($name, $data, true); \n return $this; \n }" ]
[ "0.7832069", "0.5986022", "0.59177226", "0.57994395", "0.5615787", "0.55639905", "0.55493045", "0.55291384", "0.5512683", "0.546915", "0.5448926", "0.54399824", "0.5438336", "0.5435707", "0.5410121", "0.5407713", "0.5380427", "0.5364797", "0.5354264", "0.5347256", "0.5334332", "0.53251785", "0.531005", "0.53091", "0.53074396", "0.53074396", "0.5299049", "0.529497", "0.52667254", "0.52628136" ]
0.74060684
1
This method adds a passed farmer's farm produce, it accepts the farmer's ID. No Production ID.
public function add($id = null) { $this->Production->User->id = $id; if (!$this->Production->User->exists()) { throw new NotFoundException(__('This farmer does not exist!')); } if ($this->request->is('post')) { $this->Production->create(); //Trying to obtain the information from the URL by accessing the 'passed' arguments from the Request Parameters $farmerId = $this->request->params['pass'][0]; //i am setting the the Farmer's Id of this record to the passed Id in the URL. $this->request->data['Production']['user_id'] = $farmerId; //i am setting the entry person of this record to the currently logged in user. $this->request->data['Production']['field_officer_id'] = $this->Auth->user('id'); if ($this->Production->save($this->request->data)) { $this->Session->setFlash(__('The farmer\'s produce has been saved')); $this->redirect(array('action' => 'index')); } else { $this->Session->setFlash(__('This farmer\'s produce could not be saved. Please, try again.')); } }//end if ($this->request->is('post')) $farmer = $this->Production->User->find( 'first', array( 'conditions' => array('User.id' => $id) ) ); $products = $this->Production->Product->find('list'); $this->set(compact('farmer', 'products')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createFarm($square_id, $world_id) {\n\twriteLog(\"createFarm(): Square ID: \" . $square_id);\n\t\n\t$square_type = getSquareType($square_id);\n\twriteLog(\"createFarm(): Square Type: \" . $square_type);\n\t\n\tif ($square_type == \"land\" && canIAffordIt('farm', $world_id) == 1) {\n\t\n\t\t$dml = \"UPDATE oddworld.square SET square_type = 'farm' WHERE square_id = \" . $square_id . \";\";\n\t\t$status = doInsert($dml);\n\t\tif ($status == TRUE) {\n\t\t\twriteLog(\"createFarm(): Farm created!\");\n\t\t} else {\n\t\t\twriteLog(\"createFarm(): ERROR: Farm not created!\");\n\t\t}\n\t\t\n\t\t# Create farm feature\n\t\t$feature_name = generateFeatureName('farm');\n\t\t$dml = \"INSERT INTO oddworld.feature (feature_type, feature_name, square_id, feature_size) VALUES ('farm', '\" . $feature_name . \"', \" . $square_id . \", 0);\";\n\t\t$status = doInsert($dml);\n\t\tif ($status == TRUE) {\n\t\t\twriteLog(\"createFarm(): Farm feature created!\");\n\t\t} else {\n\t\t\twriteLog(\"createFarm(): ERROR: Farm feature not created!\");\n\t\t}\n\t\t\n\t\t# Reduce funds based on number of features of this type already in existence\n\t\tbuyFeature('farm', $world_id);\n\t\t\t\n\t} else {\n\t\twriteLog(\"createFarm(): ERROR: Not a land square, or can't afford it.\");\n\t\twriteEvent(\"Farm not created! You can't afford it :-(\");\n\t}\t\n\t\n}", "public function view($id = null) {\n\t\t$this->Production->id = $id;\n\t\tif (!$this->Production->exists()) {\n\t\t\tthrow new NotFoundException(__('The selected farm produce is invalid!'));\n\t\t}\n\t\t$this->set('production', $this->Production->read(null, $id));\n\t}", "function addMerchant($vars){\n\tglobal $db;\n\t//should do some kind of security checks to prevent duplicate entries...(not in scope)\n\t$id = $db->insert('merchants', $vars);\n\tif($id){\n\t\t//return id merchantid\n\t\treturn $id;\n\t}else{\n\t\treturn false;\n\t}\n\t\n}", "public function addPlant(){\n\t\t$plant = new Plant;\n\t\t$plant->Plant_Name = Input::get('Plant_Name');\n\t\t$plant->Date_Placed = date(\"Y-m-d H:i:s\", strtotime(Input::get('Date_Placed')));\n\t\t$plant->Plant_Stage = Input::get('Plant_Stage');\n\t\t$plant->save();\n\n\t\t$cameraSlot = Input::get('Camera_ID_Side');\n\t\tif($cameraSlot != \"none\"){\n\t\t\t$camera_id = (int)substr($cameraSlot, 0, -1);\n\t\t\t$camera_side = substr($cameraSlot, -1);\n\n\t\t\t$camera = Camera::where('ID', $camera_id)->first();\n\n\t\t\tif($camera_side === 'L'){\n\t\t\t\t$camera->Current_Left_Plant_ID = $plant->ID;\n\t\t\t}else{\n\t\t\t\t$camera->Current_Right_Plant_ID = $plant->ID;\n\t\t\t}\n\t\t\t$camera->save();\n\t\t}\n\n\t\treturn Redirect::to('/');\n\t}", "public static function addCraft()\n\t\t{\n\t\t\t$stageDBO = DatabaseObjectFactory::build('material');\n\t\t\t$arr = ['material_id','unit_price','name'];\n\t\t\t$stageDBO->SetJoin(['[><]item' => 'item_id']);\n\t\t\t$materials = $stageDBO->getRecords($arr);\n\t\t\tinclude('views/pages/addCraft.php');\n\t\t}", "public function delete($id = null) {\n\t\tif (!$this->request->is('post')) {\n\t\t\tthrow new MethodNotAllowedException();\n\t\t}\n\t\t$this->Production->id = $id;\n\t\tif (!$this->Production->exists()) {\n\t\t\tthrow new NotFoundException(__('Invalid production'));\n\t\t}\n\t\tif ($this->Production->delete()) {\n\t\t\t$this->Session->setFlash(__('Farm Produce deleted'));\n\t\t\t$this->redirect(array('action' => 'index'));\n\t\t}\n\t\t$this->Session->setFlash(__('Farm Produce was not deleted'));\n\t\t$this->redirect(array('action' => 'index'));\n\t}", "public function prepare4mixAdd($params) {\n \textract($params);\n \t$ws = new WasteStreams($db);\n \t$storageObj= new Storage($db);\n \t$isDeletedStorageError='false';\n \tif (isset($id)) {\n \t\t$this->resultParams['loadedWaste'] = $ws->getWasteStreamsFromMix($id);\n \t}\n\n \tif ($isForm) {\n \t\t$this->isForm=true;\n\n \t\t$date = $jmix->creationTime;\n \t\t//var_Dump($jmix);\n \t\t\n \t\t$wsCount = count($wastes); \n \t\t\t \t\n \t\t$storageValidation = array();\n \t\t$deletedStorageValidation = array(); \n\n \t\t$unittype = new Unittype($db);\n \t\t\n \t\tfor ($i=0;$i<$wsCount;$i++) {\n \t\t\t$pollutionCount = count($wastes[$i]->pollutions);\n \t\t\t$storage = $wastes[$i]->storageId;\n \t\t\t\n \t\t\t//\tTODO: test properly\n \t\t\t$compareResult = $storageObj->compareDateWasteAndDeletedStorage($storage,$date); \n \t\t\t\t\t\n \t\t\tif ($compareResult==1) {\n \t\t\t\t//\tTODO: not tested\n \t\t\t\t$storageName = $storageObj->getStorageNameByID($storage);\n \t\t\t\t$deletedStorageValidation[$i] =\"Warning: Storage ($storageName) was remote before $date\";\n \t\t\t\t$isDeletedStorageError='true';\n \t\t\t} else {\n \t\t\t\t$deletedStorageValidation[$i] = \"false\";\n \t\t\t}\n\n \t\t\tif ($pollutionCount == 0) {\n\t\t\t\t\t//\tTODO: not tested\n\t \t\t\t$wasteData = array (\n\t \t\t\t\t\"id\"\t\t\t=> $wastes[$i]->wasteStreamId,\t\t\t\t\t\t\n\t\t \t\t\t\"value\"\t\t\t=> $wastes[$i]->quantity,\n\t\t\t\t\t\t\"unittypeClass\"\t=> $unittype->getUnittypeClass($wastes[$i]->unittypeId),\n\t\t\t\t\t\t\"unittypeID\"\t=> $wastes[$i]->unittypeId, //it's no 'false' in any case cause we don't use percent any more in waste streams!\n\t\t\t\t\t\t'storage_id'\t=> $wastes[$i]->storageId\n\t \t\t\t);\t\n\t \t\t\t//validation for storages!!!\twe'll prepare array with storage_id indexes that collected data with values+unittypes witch we'll add to storages\t\n\t \t\t\tif (!isset($storageValidation[$storage][$wasteData['unittypeID']])) {\n\t \t\t\t\t$storageValidation[$storage][$wasteData['unittypeID']] = $wasteData['value'];\n\t \t\t\t} else {\n\t \t\t\t\t$storageValidation[$storage][$wasteData['unittypeID']] += $wasteData['value'];\n\t \t\t\t}\t\t\t\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t \t\t\t$this->resultParams['waste'][$i] = $wasteData;\n\t \t\t\t \t\t\t\n \t\t\t} else {\n \t\t\t\t\n \t\t\t\t$this->resultParams['waste'][$i] = array();\n \t\t\t\t$this->resultParams['waste'][$i]['count'] = $pollutionCount;\n \t\t\t\t$this->resultParams['waste'][$i]['storage_id'] = $storage;\n \t\t\t\t$this->resultParams['waste'][$i]['id'] = $wastes[$i]->wasteStreamId;\n \t\t\t\t\n \t\t\t\t\n \t\t\t\t$value = 0;\n\t \t\t\tfor ($j=0;$j<$pollutionCount;$j++) {\n\t\t \t\t\t$wasteData = array (\n\t\t \t\t\t\t\"id\"\t\t\t=> $wastes[$i]->pollutions[$j]->pollutionId,\t\t\t\t\t\t\n\t\t\t \t\t\t\"value\"\t\t\t=> $wastes[$i]->pollutions[$j]->quantity,\n\t\t\t\t\t\t\t\"unittypeID\"\t=> (isset($wastes[$i]->pollutions[$j]->unittypeId)) ? $wastes[$i]->pollutions[$j]->unittypeId : false\n\t\t \t\t\t);\t\n\t\t \t\t\t\n\t\t \t\t\tif ($wasteData['unittypeID']) {\n\t\t \t\t\t\t$wasteData['unittypeClass'] = $unittype->getUnittypeClass($wasteData['unittypeID']);\t\n\t\t \t\t\t}\n\t\t \t\t\t\t\t \t\t\t\t\t \t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t \t\t\t$this->resultParams['waste'][$i][$j] = $wasteData;\n\t\t \t\t\t$value += $wasteData['value'];\n\t\t \t\t\t\n\t\t \t\t\t//validation for storages!!! we'll prepare array with storage_id indexes that collected data with values+unittypes witch we'll add to storages\n\t\t \t\t\tif (!isset($storageValidation[$storage][$wasteData['unittypeID']])) {\n\t\t \t\t\t\t$storageValidation[$storage][$wasteData['unittypeID']] = $wasteData['value'];\n\t\t \t\t\t} else {\n\t\t \t\t\t\t$storageValidation[$storage][$wasteData['unittypeID']] += $wasteData['value'];\n\t\t \t\t\t}\t\t \t\t\t\n\t \t\t\t}\n \t\t\t} \t\t\t\t\n \t\t} \t\t \t\t\t\n \t $storage = new Storage($db);\n \t \n \t\t$storageOverflow = $storage->validateOverflow($storageValidation, $date, $id);\t \n \t\t\n \t\t\n \t\tif ($storageOverflow !== false) {\n\t \t\t$result['storageError'] = \"Error! Choosen storages are overflow!\";\n\t \t}\n\t \t$result['storageOverflow'] = json_encode($storageOverflow);\n\t \t \t \n \t} else {\n \t\t//\tTODO: not tested\n \t\t$this->isForm=false;\n \t\tif (isset($id)) {\n \t\t\t$mix = new Mix($db);\n \t\t\t$mixDetails = $mix->getMixDetails($id);\n \t\t\t$date = $mixDetails['creationTime'];\n \t\t} else {\n \t\t\t$date = date('m-d-Y');\n \t\t}\n \t\t$result['storageOverflow'] = json_encode(false);\n \t}\n \t\n \t//echo \"<br/>now we should convert $date from mm-dd-yyyy into yyyy-mm-dd\";\n \t//echo \"$date\";\n \t\n \t//$date = substr($date,-4,4).\"-\".substr($date,0,2).\"-\".substr($date,3,2);\n \t\n \t\n \t\n \t$dateO = DateTime::createFromFormat($jmix->dateFormat,$jmix->creationTime);\n \t\n \t$date = $dateO->format(\"Y-m-d\");\n \t\n \t//echo \"<br/>$date\";\n \t//exit;\n\n \t//\tTODO: I'm not sure that it work correctly\n\t\tif ($deletedStorageValidation == null) {\n\t\t\t$result['deletedStorageValidation'] = 'false';\n\t\t} else {\n\t\t\t$result['deletedStorageValidation'] = json_encode($deletedStorageValidation);\n\t\t}\t\t\n\t\t\n\t\t$result['isDeletedStorageError']=$isDeletedStorageError;\t\t\n \t$result['wasteStreamsList'] = json_encode($ws->getWasteStreamsFullList());\n \t$result['wasteStreamsWithPollutions'] = json_encode($ws->getWasteStreamsToPollutionsList());\n\n \t$storage = new Storage($db);\n \t$result['storages'] = json_encode($storage->getCurrentStoragesGroupedByWaste($facilityID,$date,$id));\n \t\n \treturn $result;\n }", "public function run()\n {\n factory(Elbow\\Medium::class, 10)->create(['manufacturer_id' => $this->manufacturerId()]);\n }", "function add_medidor($params)\n {\n $this->db->insert('medidor',$params);\n return $this->db->insert_id();\n }", "public function run(Faker $faker)\n { \n \t$pack1 = new Pack;\n \t$pack1 -> pname = '手袋单人份';\n \t$pack1 -> save();\n $pack2 = new Pack;\n $pack2 -> pname = '礼盒双人份';\n $pack2 -> save();\n $pack3 = new Pack;\n $pack3 -> pname = '全家福礼包';\n $pack3 -> save();\n }", "public function show(Farmer $farmer)\n {\n $farmer = Farmer::find($farmer->id);\n return $farmer;\n }", "function addANewFighter($arg, $playerIdLogin) {\n //TODO: get the fighter to automatically start level 1, with all skills at 1 and health at maximum (10?)\n //TODO: X and Y position must be decided when the fighter joins the arena\n $fighterData = $arg;\n $fighterTable = TableRegistry::get('fighters');\n $fighter = $fighterTable->newEntity();\n $fighter->name = $fighterData['name'];\n $fighter->player_id = $playerIdLogin;\n\n $fighters = $this->find('all');\n $fightersArray = $fighters->toArray();\n\n $restart = 1;\n\n while ($restart == 1) {\n\n $randX = rand(0, 14);\n $randY = rand(0, 9);\n $restart = 0;\n\n for ($i = 0; $i < count($fightersArray); $i++) {\n if (($fightersArray[$i]['coordinate_x'] == $randX) && ($fightersArray[$i]['coordinate_y'] == $randY)) {\n $restart = 1;\n }\n }\n }\n\n $fighter->coordinate_x = $randX;\n $fighter->coordinate_y = $randY;\n $fighter->level = '1';\n $fighter->xp = '0';\n\n if ($fighterData['Class'] == 0) {\n $fighter->skill_sight = '2';\n $fighter->skill_strength = '1';\n $fighter->skill_health = '5';\n $fighter->current_health = '5';\n }\n\n if ($fighterData['Class'] == 1) {\n $fighter->skill_sight = '3';\n $fighter->skill_strength = '1';\n $fighter->skill_health = '5';\n $fighter->current_health = '5';\n }\n\n if ($fighterData['Class'] == 2) {\n $fighter->skill_sight = '2';\n $fighter->skill_strength = '1';\n $fighter->skill_health = '8';\n $fighter->current_health = '8';\n }\n\n if ($fighterData['Class'] == 3) {\n $fighter->skill_sight = '2';\n $fighter->skill_strength = '2';\n $fighter->skill_health = '5';\n $fighter->current_health = '5';\n }\n\n\n $fighterTable->save($fighter);\n $imgId= rand(1, 24);\n if( $fighterData[\"imgNum\"] != \"\"){\n $imgId= $fighterData[\"imgNum\"];\n }\n\n $file = new File('img/A'. $imgId .'.PNG'); // change here\n\n $file->copy('img/'.$fighter->id.'.PNG', true);\n }", "public function pushToFareye()\r\n {\r\n $collection = Mage::getModel('marketplace/fareyedataqueue')->getCollection();\r\n $collection->addFieldToFilter('processed', 'queued');\r\n foreach ($collection as $queued) {\r\n $fareye = Mage::getModel('marketplace/fareyedataqueue')->load($queued->getId());\r\n $processData = $fareye->getData();\r\n if (empty($processData['merchant_code']) || empty($processData['product_name'])) {\r\n //$fareye->setProcessed(\"paused\");\r\n $fareye->setProcessed(\"queued\");//queued so that in case the seller information is filled, their orders can be placed to fareye\r\n $fareye->setPausedReason(\"One of the necessary field is missing (merchant_code, product_name).\");\r\n $fareye->save();\r\n continue;\r\n } else {\r\n $fareye->setProcessed(\"processing\");\r\n $fareye->save();\r\n //check if seller is pushed if not push it first.\r\n $sellerInfo = Mage::getModel('marketplace/sellerprofile')->load($processData['merchant_code'],\r\n 'seller_id');\r\n if ($sellerInfo->getPushedToFareye() !== 1) {\r\n $this->pushSellerToFareye($sellerInfo->getSellerId());\r\n }\r\n }\r\n /*echo \"<pre>\";\r\n print_r($processData);\r\n echo \"</pre>\";*/\r\n $processData['merchant_id'] = $processData['merchant_code'];\r\n $merchantCode = $processData['merchant_code'];//remove merchant_code from processData after this\r\n unset($processData['merchant_code']);\r\n unset($processData['id']);\r\n unset($processData['created_at']);\r\n unset($processData['processed_at']);\r\n unset($processData['processed']);\r\n //merchant_name, amount_to_be_collected got removed from fareye process so unset it here too\r\n unset($processData['merchant_name']);\r\n unset($processData['amount_to_be_collected']);\r\n unset($processData['paused_reason']);\r\n\r\n //echo \"<pre>\";\r\n //print_r($processData);\r\n $processData = array_filter($processData);\r\n\r\n //format phone numbers as per fareye\r\n $processData['customer_contact_number'] = $this->getFareyeFormatPhoneNumber($processData['customer_contact_number']);\r\n $processData['merchant_contact_number'] = $this->getFareyeFormatPhoneNumber($processData['merchant_contact_number']);\r\n\r\n //fill other required fields by the fareye, if they are empty\r\n $processData['address_line2'] = (empty($processData['address_line2'])) ? \"Nill\" : $processData['address_line2'];\r\n $processData['other_product_options'] = (empty($processData['other_product_options'])) ? \"Not included\" : $processData['other_product_options'];\r\n\r\n //print_r($processData);\r\n $data = [\r\n [\r\n 'merchantCode' => $merchantCode,//remove merchant_code from processData after this\r\n 'referenceNumber' => $processData['product_unique_id'],\r\n 'processDefinitionCode' => 'main_process',\r\n 'processData' => $processData,\r\n 'processUserMappings' => []\r\n ]\r\n ];\r\n $jsonData = json_encode($data);\r\n /*echo \"<pre>\";\r\n echo $jsonData;\r\n echo \"</pre>\";*/\r\n try {\r\n $url = Mage::helper('marketplace/Url')->getFareyeNewProcessUrl(false);\r\n //echo $url;\r\n $httpClient = new Varien_Http_Client($url);\r\n $response = $httpClient->setRawData($jsonData, 'application/json')->request('POST');\r\n //print_r($response);\r\n if ($response->isSuccessful()) {\r\n $jsonRespnse = $response->getBody();\r\n $responseStdObj = json_decode($jsonRespnse);\r\n //print_r($responseStdObj);\r\n if ($responseStdObj->failCount > 0) {\r\n //print_r($responseStdObj->failureList[0]->failReason);\r\n if (strpos($responseStdObj->failureList[0]->failReason, \"already exist\") !== false) {\r\n //if record already exist error is there mark it as processed\r\n $fareye->setProcessed(\"processed\");\r\n //log it too and mention that it has changed to processed\r\n $referenceNumber = $responseStdObj->failureList[0]->referenceNumber;\r\n Mage::log(\"FAREYE Due to Already Exist Error it was changed to Processed: ReferenceNumber # $referenceNumber\");\r\n } else {\r\n //if there is something else log it\r\n $fareye->setProcessed(\"queued\");\r\n Mage::log(\"FAREYE: \" . $responseStdObj->failureList[0]->failReason);\r\n }\r\n } else {\r\n //successfully pushed\r\n $fareye->setProcessed(\"processed\");\r\n }\r\n } else {\r\n Mage::log(\"FAREYE: \" . print_r($response, true));\r\n $fareye->setProcessed(\"queued\");\r\n }\r\n } catch (Exception $e) {\r\n Mage::logException($e);\r\n $fareye->setProcessed(\"queued\");\r\n } finally {\r\n $fareye->save();\r\n }\r\n }\r\n }", "public function add_department_officer()\n {\n if (validate('save_department_officer') == FALSE) {\n $return_data = array(\n 'status' => false,\n 'message' => 'Some fields have errors.',\n 'fields' => validation_error_array()\n );\n } else {\n $locID = get_post('DepartmentLocationID');\n $DepartmentID = get_post('DepartmentID');\n $SubDepartmentID = (int) get_post('SubDepartmentID');\n $accountID = get_post('SelectedAccountID');\n $functionTypeID = (int) get_post('FunctionTypeID');\n $position = get_post('Position');\n\n // find by data\n $officerWhere = array(\n 'DepartmentID' => $DepartmentID,\n 'SubDepartmentID' => $SubDepartmentID, \n 'DepartmentLocationID' => $locID,\n 'AccountID' => $accountID,\n 'FunctionTypeID' => $functionTypeID\n );\n $officer = $this->mgovdb->getRecords('Dept_Officers', $officerWhere, 'id', array(1));\n if (count($officer)) {\n $officer = (object) $officer[0];\n }\n\n if ($officer == false) {\n // new record\n $insertData = array(\n 'DepartmentID' => $DepartmentID,\n 'SubDepartmentID' => $SubDepartmentID,\n 'DepartmentLocationID' => $locID,\n 'AccountID' => $accountID,\n 'FunctionTypeID' => $functionTypeID,\n 'Position' => $position,\n 'LastUpdate' => date('Y-m-d H:i:s')\n );\n\n if (($ID = $this->mgovdb->saveData('Dept_Officers', $insertData))) {\n usleep(100);//minor delay fetch after add\n $return_data = array(\n 'status' => true,\n 'message' => 'Department officer has been assigned successfully.',\n 'id' => $ID,\n 'data' => $this->departmentdb->getDepartmentOfficer($ID, 'id')\n );\n\n } else {\n $return_data = array(\n 'status' => false,\n 'message' => 'Assigning department officer failed. Please try again.'\n );\n }\n } else {\n $return_data = array(\n 'status' => false,\n 'message' => 'Officer already assigned on this deparment with the same function.',\n );\n }\n\n }\n\n response_json($return_data);\n }", "public function produce(int $partition, int $msgflags, string $payload, string $key = NULL): void { }", "public function AddFFPMByID(AddFFPMByID $parameters)\n {\n return $this->__soapCall('AddFFPMByID', array($parameters));\n }", "public function add() {\n\n\t\t//Initializing variables\n\t\t$titles = ''; $farmerGroups = '';\n\n\t\tif ($this->request->is('post')) {\n\n\t\t\t//i am manually setting the 'users.user_category_id' field to a value equivalent to farmers in the 'user_category' table\n\t\t\t$this->request->data['User']['user_category_id'] = 3;\n\n\t\t\t//i am setting the entry person of this record to the currently logged in user.\n\t\t\t$this->request->data['User']['entered_by'] = $this->Auth->user('id');\n\n\t\t\t//i am setting the buying station of the farmer to that of the currently logged in Field-Officer\n\t\t\t$this->request->data['User']['buying_station_id'] = $this->Auth->user('buying_station_id');\n\n\t\t\t$this->User->create();\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('Information has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The info about the farmer could not be saved. Please, review your entry & try again!'));\n\t\t\t}\n\t\t}\n\n\t\t$titles = $this->User->Title->find('list');\n\t\t$farmerGroups = $this->User->FarmerGroup->find('list', array(\n\t\t\t'conditions' => array('FarmerGroup.buying_station_id' => $this->Auth->user('buying_station_id')),\n\t\t));\n\t\t$this->set(compact('titles', 'genders', 'farmerGroups'));\n\n\t}", "public function mf_create_makers( $args, $assoc_args ) {\n\n\t\t$args = array(\n\t\t\t'posts_per_page' => 2000,\n\t\t\t'post_type' => 'mf_form',\n\t\t\t'post_status' => 'accepted',\n\n\t\t\t// Prevent new posts from affecting the order\n\t\t\t'orderby' => 'ID',\n\t\t\t'order' => 'ASC',\n\n\t\t\t// Speed this up\n\t\t\t'no_found_rows' => true,\n\t\t\t'update_post_meta_cache' => false,\n\t\t\t'update_post_term_cache' => false,\n\t\t);\n\n\t\t// Get the first set of posts\n\t\t$query = new WP_Query( $args );\n\n\t\twhile ( $query->have_posts() ) : $query->the_post();\n\t\t\n\t\tglobal $post;\n\t\t\t\n\t\tsetup_postdata( $post );\n\n\t\t$application = json_decode( html_entity_decode( str_replace( array( \"\\'\", \"u03a9\" ), array( \"'\", '&#8486;' ), $post->post_content ), ENT_COMPAT, 'utf-8' ) );\n\t\t$type = ( isset( $application->form_type ) ) ? $application->form_type : 'null';\n\n\t\tif ( $type == 'exhibit' ) {\n\t\t\tWP_CLI::line( 'Exhibit' );\n\n\t\t\tif ( $application->maker == 'A group or association' ) {\n\t\t\t\tWP_CLI::line( 'A group or association | ID: ' . get_the_ID() );\n\n\t\t\t\t$the_title = $application->group_name ? $application->group_name : $application->name;\n\t\t\t\t$title = htmlspecialchars( $the_title );\n\t\t\t\t$maker = get_page_by_title( $title, OBJECT, 'maker' );\n\n\t\t\t\techo ( isset( $maker->post_title ) ) ? WP_CLI::success( 'Found: ' . $maker->post_title ) : WP_CLI::warning( 'no title...' ) ;\n\n\t\t\t\tif ( ! $maker ) {\n\t\t\t\t\t// Setup post object...\n\t\t\t\t\t$content = ( $application->group_bio ? htmlspecialchars_decode( $application->group_bio ) : null );\n\t\t\t\t\t$my_post = array(\n\t\t\t\t\t\t'post_title' => $title,\n\t\t\t\t\t\t'post_content' => $content,\n\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t'post_type'\t\t=> 'maker'\n\t\t\t\t\t); \n\n\t\t\t\t\t$pid = wp_insert_post( $my_post );\n\t\t\t\t\tif ( is_wp_error( $pid ) ) {\n\t\t\t\t\t\tWP_CLI::warning( $title );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWP_CLI::success( $title );\n\t\t\t\t\t}\n\n\t\t\t\t\t$website = ( $application->project_website ) ? $application->project_website : null;\n\t\t\t\t\tif ( ! empty( $website ) ) {\n\t\t\t\t\t\t$web = update_post_meta( $pid, 'website', $website );\n\n\t\t\t\t\t\tif ( ! empty( $web ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'website = ' . $website );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'website = ' . $website );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$video = ( $application->project_video ) ? $application->project_video : null;\n\t\t\t\t\tif ( ! empty( $video ) ) {\n\t\t\t\t\t\t$vid = update_post_meta( $pid, 'video', $video );\n\n\t\t\t\t\t\tif ( ! empty( $vid ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Video = ' . $video );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Video = ' . $video );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$post_id = get_the_ID();\n\t\t\t\t\tif ( ! empty( $post_id ) ) {\n\t\t\t\t\t\t$mfei_record = add_post_meta( $pid, 'mfei_record', $post_id );\n\n\t\t\t\t\t\tif ( ! empty( $mfei_record ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$photo_url = ( $application->group_photo ) ? $application->group_photo : null;\n\t\t\t\t\tif ( ! empty( $photo_url ) ) {\n\t\t\t\t\t\t$photo = add_post_meta( $pid, 'photo_url', $photo_url, true );\n\n\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Photo = ' . $photo_url );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Photo = ' . $photo_url );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$mf = ( $application->maker_faire ) ? $application->maker_faire : null;\n\t\t\t\t\tif ( ! empty( $mf ) ) {\n\t\t\t\t\t\t$faire = add_post_meta( $pid, 'maker_faire', $mf, true );\n\n\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$pid = $maker->ID;\n\n\t\t\t\t\t$website = ( $application->project_website ) ? $application->project_website : null;\n\t\t\t\t\tif ( ! empty( $website ) ) {\n\t\t\t\t\t\t$web = update_post_meta( $pid, 'website', $website );\n\n\t\t\t\t\t\tif ( ! empty( $web ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Website = ' . $website );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Website = ' . $website );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$video = ( $application->project_video ) ? $application->project_video : null;\n\t\t\t\t\tif ( ! empty( $video ) ) {\n\t\t\t\t\t\t$vid = update_post_meta( $pid, 'video', $video );\n\n\t\t\t\t\t\tif ( ! empty( $vid ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Video = ' . $video );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Video = ' . $video );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$post_id = get_the_ID();\n\t\t\t\t\tif ( ! empty( $post_id ) ) {\n\t\t\t\t\t\t$mfei_record = add_post_meta( $pid, 'mfei_record', $post_id );\n\n\t\t\t\t\t\tif ( ! empty( $mfei_record ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$photo_url = ( $application->group_photo ) ? $application->group_photo : null;\n\t\t\t\t\tif ( ! empty( $photo_url ) ) {\n\t\t\t\t\t\t$photo = add_post_meta( $pid, 'photo_url', $photo_url, true );\n\n\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Photo = ' . $photo );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Photo = ' . $photo );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$mf = ( $application->maker_faire ) ? $application->maker_faire : null;\n\t\t\t\t\tif ( ! empty( $mf ) ) {\n\t\t\t\t\t\t$faire = add_post_meta( $pid, 'maker_faire', $mf, true );\n\n\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t// Some users didn't select an maker type... so loop them here.\n\t\t\t} elseif ( $application->maker == 'One maker' || $application->maker == '' ) {\n\t\t\t\tWP_CLI::line( 'One Maker | ID: ' . get_the_ID() );\n\n\t\t\t\t$the_title = $application->maker_name ? $application->maker_name : $application->name;\n\t\t\t\t$title = htmlspecialchars( $the_title );\n\t\t\t\t$maker = get_page_by_title( $title, OBJECT, 'maker' );\n\n\t\t\t\techo ( isset( $maker->post_title ) ) ? WP_CLI::success( 'Found: ' . $maker->post_title ) : WP_CLI::warning( 'no title...' );\n\n\t\t\t\tif ( ! $maker ) {\n\t\t\t\t\t// Setup post object...\n\t\t\t\t\t$content = ( $application->maker_bio ? htmlspecialchars_decode( $application->maker_bio ) : null );\n\t\t\t\t\t$my_post = array(\n\t\t\t\t\t\t'post_title' => $title,\n\t\t\t\t\t\t'post_content' => $content,\n\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t'post_type'\t\t=> 'maker'\n\t\t\t\t\t);\n\n\t\t\t\t\t$pid = wp_insert_post( $my_post );\n\t\t\t\t\tif ( is_wp_error( $pid ) ) {\n\t\t\t\t\t\tWP_CLI::warning( $title );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWP_CLI::success( $title );\n\t\t\t\t\t}\n\n\t\t\t\t\t$website = ( $application->project_website ) ? $application->project_website : null;\n\t\t\t\t\tif ( ! empty( $website ) ) {\n\t\t\t\t\t\t$web = update_post_meta( $pid, 'website', $website );\n\n\t\t\t\t\t\tif ( ! empty( $web ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Website = ' . $website );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Website = ' . $website );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$video = ( $application->project_video ) ? $application->project_video : null;\n\t\t\t\t\tif ( ! empty( $video ) ) {\n\t\t\t\t\t\t$vid = update_post_meta( $pid, 'video', $video );\n\n\t\t\t\t\t\tif ( ! empty( $vid ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Video = ' . $video );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Video = ' . $video );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$post_id = get_the_ID();\n\t\t\t\t\tif ( ! empty( $post_id ) ) {\n\t\t\t\t\t\t$mfei_record = add_post_meta( $pid, 'mfei_record', $post_id );\n\n\t\t\t\t\t\tif ( ! empty( $mfei_record ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$photo_url = ( $application->m_maker_photo_thumb ) ? $application->m_maker_photo_thumb : null;\n\t\t\t\t\tif ( ! empty( $photo_url ) ) {\n\t\t\t\t\t\t$photo = add_post_meta( $pid, 'photo_url', $photo_url, true );\n\n\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Photo = ' . $photo_url );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Photo = ' . $photo_url );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$mf = ( $application->maker_faire ) ? $application->maker_faire : null;\n\t\t\t\t\tif ( !empty( $mf ) ) {\n\t\t\t\t\t\t$faire = add_post_meta( $pid, 'maker_faire', $mf, true );\n\n\t\t\t\t\t\tif ( !empty( $photo ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$pid = $maker->ID;\n\n\t\t\t\t\t$website = ( $application->project_website ) ? $application->project_website : null;\n\t\t\t\t\tif ( ! empty( $website ) ) {\n\t\t\t\t\t\t$web = update_post_meta( $pid, 'website', $website );\n\n\t\t\t\t\t\tif ( ! empty( $web ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Website = ' . $website );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Website = ' . $website );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$video = ( $application->project_video ) ? $application->project_video : null;\n\t\t\t\t\tif ( !empty( $video ) ) {\n\t\t\t\t\t\t$vid = update_post_meta( $pid, 'video', $video );\n\n\t\t\t\t\t\tif ( !empty( $vid ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Video = ' . $video );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Video = ' . $video );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$post_id = get_the_ID();\n\t\t\t\t\tif ( !empty( $post_id ) ) {\n\t\t\t\t\t\t$mfei_record = add_post_meta( $pid, 'mfei_record', $post_id );\n\n\t\t\t\t\t\tif ( !empty( $mfei_record ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$photo_url = ( $application->m_maker_photo_thumb ) ? $application->m_maker_photo_thumb : null;\n\t\t\t\t\tif ( !empty( $photo_url ) ) {\n\t\t\t\t\t\t$photo = add_post_meta( $pid, 'photo_url', $photo_url, true );\n\n\t\t\t\t\t\tif ( !empty( $photo ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Photo = ' . $photo );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Photo = ' . $photo );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$mf = ( $application->maker_faire ) ? $application->maker_faire : null;\n\t\t\t\t\tif ( !empty( $mf ) ) {\n\t\t\t\t\t\t$faire = add_post_meta( $pid, 'maker_faire', $mf, true );\n\n\t\t\t\t\t\tif ( !empty( $photo ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif ( $application->maker == 'A list of makers' ) {\n\t\t\t\tWP_CLI::line('A List of Makers | ID: ' . get_the_ID() );\n\t\t\t\t\n\t\t\t\t$maker_list = ( isset( $application->m_maker_name ) ) ? $application->m_maker_name : $application->project_name;\n\t\t\t\t$i = 0;\n\n\t\t\t\tif ( is_array( $maker_list ) ) {\n\t\t\t\t\tforeach ( $maker_list as $maker_name ) {\n\t\t\t\t\t\t$the_title = $application->m_maker_name[ $i ] ? $application->m_maker_name[ $i ] : $application->project_name;\n\t\t\t\t\t\t$title = htmlspecialchars( $the_title );\n\t\t\t\t\t\t$maker = get_page_by_title( $title, OBJECT, 'maker' );\n\n\t\t\t\t\t\techo ( isset( $maker->post_title ) ) ? WP_CLI::success( 'Found: ' . $maker->post_title ) : WP_CLI::warning( 'no title...' ) ;\n\n\t\t\t\t\t\tif ( ! $maker ) {\n\t\t\t\t\t\t\t// Setup post object...\n\t\t\t\t\t\t\t$content = ( isset( $application->m_maker_bio[ $i ] ) ? htmlspecialchars_decode( $application->m_maker_bio[ $i ] ) : null);\n\t\t\t\t\t\t\t$my_post = array(\n\t\t\t\t\t\t\t\t'post_title' => $title,\n\t\t\t\t\t\t\t\t'post_content' => $content,\n\t\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t\t'post_type'\t\t=> 'maker'\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$pid = wp_insert_post( $my_post );\n\t\t\t\t\t\t\tif ( is_wp_error( $pid ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'Maker Name: ' . $title );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'Maker Name: ' . $title );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$website = ( $application->project_website ) ? $application->project_website : null;\n\t\t\t\t\t\t\tif ( ! empty( $website ) ) {\n\t\t\t\t\t\t\t\t$web = update_post_meta( $pid, 'website', $website );\n\n\t\t\t\t\t\t\t\tif ( ! empty( $web ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'Website = ' . $website );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'Website = ' . $website );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$video = ( $application->project_video ) ? $application->project_video : null;\n\t\t\t\t\t\t\tif ( ! empty( $video ) ) {\n\t\t\t\t\t\t\t\t$vid = update_post_meta( $pid, 'video', $video );\n\n\t\t\t\t\t\t\t\tif ( ! empty( $vid ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'Video = ' . $video );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'Video = ' . $video );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$post_id = get_the_ID();\n\t\t\t\t\t\t\tif ( ! empty( $post_id ) ) {\n\t\t\t\t\t\t\t\t$mfei_record = add_post_meta( $pid, 'mfei_record', $post_id );\n\n\t\t\t\t\t\t\t\tif ( ! empty( $mfei_record ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$photo_url = ( $application->m_maker_photo[ $i ] ) ? $application->m_maker_photo[ $i ] : null;\n\t\t\t\t\t\t\tif ( ! empty( $photo_url ) ) {\n\t\t\t\t\t\t\t\t$photo = add_post_meta( $pid, 'photo_url', $photo_url, true );\n\n\t\t\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'Photo = ' . $photo_url );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'Photo = ' . $photo_url );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$mf = ( $application->maker_faire ) ? $application->maker_faire : null;\n\t\t\t\t\t\t\tif ( ! empty( $mf ) ) {\n\t\t\t\t\t\t\t\t$faire = add_post_meta( $pid, 'maker_faire', $mf, true );\n\n\t\t\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::line( 'Updating Meta...' );\n\t\t\t\t\t\t\t$pid = $maker->ID;\n\n\t\t\t\t\t\t\t$website = ( $application->project_website ) ? $application->project_website : null;\n\t\t\t\t\t\t\tif ( ! empty( $website ) ) {\n\t\t\t\t\t\t\t\t$web = update_post_meta( $pid, 'website', $website );\n\n\t\t\t\t\t\t\t\tif ( ! empty( $web ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'Website = ' . $website );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'Website = ' . $website );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$video = ( $application->project_video ) ? $application->project_video : null;\n\t\t\t\t\t\t\tif ( ! empty( $video ) ) {\n\t\t\t\t\t\t\t\t$vid = update_post_meta( $pid, 'video', $video );\n\n\t\t\t\t\t\t\t\tif ( ! empty( $vid ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'Video = ' . $video );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'Video = ' . $video );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$post_id = get_the_ID();\n\t\t\t\t\t\t\tif ( ! empty( $post_id ) ) {\n\t\t\t\t\t\t\t\t$mfei_record = add_post_meta( $pid, 'mfei_record', $post_id );\n\n\t\t\t\t\t\t\t\tif ( ! empty( $mfei_record ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$photo_url = ( isset( $application->m_maker_photo[ $i ] ) ) ? $application->m_maker_photo[ $i ] : null;\n\t\t\t\t\t\t\tif ( ! empty( $photo_url ) ) {\n\t\t\t\t\t\t\t\t$photo = add_post_meta( $pid, 'photo_url', $photo_url, true );\n\n\t\t\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'Photo = ' . $photo );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'Photo = ' . $photo );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$mf = ( $application->maker_faire ) ? $application->maker_faire : null;\n\t\t\t\t\t\t\tif ( ! empty( $mf ) ) {\n\t\t\t\t\t\t\t\t$faire = add_post_meta( $pid, 'maker_faire', $mf, true );\n\n\t\t\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t// Some users failed to fill in their name... so we need to provide something?\n\t\t\t\t} else {\n\t\t\t\t\t$the_title = $application->name ? $application->name : $application->project_name;\n\t\t\t\t\t$title = htmlspecialchars( $the_title );\n\t\t\t\t\t$maker = get_page_by_title( $title, OBJECT, 'maker' );\n\n\t\t\t\t\techo ( isset( $maker->post_title ) ) ? WP_CLI::success( 'Found: ' . $maker->post_title ) : WP_CLI::warning( 'no title...' ) ;\n\n\t\t\t\t\tif ( ! $maker ) {\n\t\t\t\t\t\t// Setup post object...\n\t\t\t\t\t\t$content = ( isset( $application->m_maker_bio[0] ) ? htmlspecialchars_decode( $application->m_maker_bio[0] ) : null);\n\t\t\t\t\t\t$my_post = array(\n\t\t\t\t\t\t\t'post_title' => $title,\n\t\t\t\t\t\t\t'post_content' => $content,\n\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t'post_type'\t\t=> 'maker'\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$pid = wp_insert_post( $my_post );\n\t\t\t\t\t\tif ( is_wp_error( $pid ) ) {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Maker Name: ' . $title );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::success( 'Maker Name: ' . $title );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$website = ( $application->project_website ) ? $application->project_website : null;\n\t\t\t\t\t\tif ( ! empty( $website ) ) {\n\t\t\t\t\t\t\t$web = update_post_meta( $pid, 'website', $website );\n\n\t\t\t\t\t\t\tif ( ! empty( $web ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'Website = ' . $website );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'Website = ' . $website );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$video = ( $application->project_video ) ? $application->project_video : null;\n\t\t\t\t\t\tif ( ! empty( $video ) ) {\n\t\t\t\t\t\t\t$vid = update_post_meta( $pid, 'video', $video );\n\n\t\t\t\t\t\t\tif ( ! empty( $vid ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'Video = ' . $video );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'Video = ' . $video );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$post_id = get_the_ID();\n\t\t\t\t\t\tif ( ! empty( $post_id ) ) {\n\t\t\t\t\t\t\t$mfei_record = add_post_meta( $pid, 'mfei_record', $post_id );\n\n\t\t\t\t\t\t\tif ( ! empty( $mfei_record ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$photo_url = ( $application->m_maker_photo[0] ) ? $application->m_maker_photo[0] : null;\n\t\t\t\t\t\tif ( ! empty( $photo_url ) ) {\n\t\t\t\t\t\t\t$photo = add_post_meta( $pid, 'photo_url', $photo_url, true );\n\n\t\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'Photo = ' . $photo_url );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'Photo = ' . $photo_url );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$mf = ( $application->maker_faire ) ? $application->maker_faire : null;\n\t\t\t\t\t\tif ( ! empty( $mf ) ) {\n\t\t\t\t\t\t\t$faire = add_post_meta( $pid, 'maker_faire', $mf, true );\n\n\t\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWP_CLI::line( 'Updating Meta...' );\n\t\t\t\t\t\t$pid = $maker->ID;\n\n\t\t\t\t\t\t$website = ( $application->project_website ) ? $application->project_website : null;\n\t\t\t\t\t\tif ( ! empty( $website ) ) {\n\t\t\t\t\t\t\t$web = update_post_meta( $pid, 'website', $website );\n\n\t\t\t\t\t\t\tif ( ! empty( $web ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'Website = ' . $website );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'Website = ' . $website );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$video = ( $application->project_video ) ? $application->project_video : null;\n\t\t\t\t\t\tif ( ! empty( $video ) ) {\n\t\t\t\t\t\t\t$vid = update_post_meta( $pid, 'video', $video );\n\n\t\t\t\t\t\t\tif ( ! empty( $vid ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'Video = ' . $video );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'Video = ' . $video );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$post_id = get_the_ID();\n\t\t\t\t\t\tif ( ! empty( $post_id ) ) {\n\t\t\t\t\t\t\t$mfei_record = add_post_meta( $pid, 'mfei_record', $post_id );\n\n\t\t\t\t\t\t\tif ( ! empty( $mfei_record ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$photo_url = ( isset( $application->m_maker_photo[0] ) ) ? $application->m_maker_photo[0] : null;\n\t\t\t\t\t\tif ( ! empty( $photo_url ) ) {\n\t\t\t\t\t\t\t$photo = add_post_meta( $pid, 'photo_url', $photo_url, true );\n\n\t\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'Photo = ' . $photo );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'Photo = ' . $photo );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$mf = ( $application->maker_faire ) ? $application->maker_faire : null;\n\t\t\t\t\t\tif ( ! empty( $mf ) ) {\n\t\t\t\t\t\t\t$faire = add_post_meta( $pid, 'maker_faire', $mf, true );\n\n\t\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ( $type == 'presenter' ) {\n\t\t\tWP_CLI::line( 'Presenter' );\n\n\t\t\tif ( $application->presentation_type == 'Presentation' ) {\n\t\t\t\tWP_CLI::line( 'Presentation | ID: ' . get_the_ID() );\n\n\t\t\t\t$the_title = $application->presenter_name[0] ? $application->presenter_name[0] : $application->name;\n\t\t\t\t$title = htmlspecialchars( $the_title );\n\t\t\t\t$presentation = get_page_by_title( $title, OBJECT, 'maker' );\n\n\t\t\t\techo ( isset( $presentation->post_title ) ) ? WP_CLI::success( 'Found: ' . $presentation->post_title ) : WP_CLI::warning( 'no title...' );\n\n\t\t\t\tif ( ! $presentation ) {\n\t\t\t\t\t// Setup post object...\n\t\t\t\t\t$content = ( $application->presenter_bio[0] ? htmlspecialchars_decode( $application->presenter_bio[0] ) : null );\n\t\t\t\t\t$my_post = array(\n\t\t\t\t\t\t'post_title' => $title,\n\t\t\t\t\t\t'post_content' => $content,\n\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t'post_type'\t\t=> 'maker'\n\t\t\t\t\t);\n\n\t\t\t\t\t$pid = wp_insert_post( $my_post );\n\t\t\t\t\tif ( is_wp_error( $pid ) ) {\n\t\t\t\t\t\tWP_CLI::warning( $title );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWP_CLI::success( $title );\n\t\t\t\t\t}\n\n\t\t\t\t\t$website = ( $application->presentation_website ) ? $application->presentation_website : null;\n\t\t\t\t\tif ( ! empty( $website ) ) {\n\t\t\t\t\t\t$web = update_post_meta( $pid, 'presentation_website', $website );\n\n\t\t\t\t\t\tif ( !empty( $web ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Website = ' . $website );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Website = ' . $website );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$video = ( $application->video ) ? $application->video : null;\n\t\t\t\t\tif ( ! empty( $video ) ) {\n\t\t\t\t\t\t$vid = update_post_meta( $pid, 'video', $video );\n\n\t\t\t\t\t\tif ( ! empty( $vid ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Video = ' . $video );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Video = ' . $video );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$post_id = get_the_ID();\n\t\t\t\t\tif ( ! empty( $post_id ) ) {\n\t\t\t\t\t\t$mfei_record = add_post_meta( $pid, 'mfei_record', $post_id );\n\n\t\t\t\t\t\tif ( ! empty( $mfei_record ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$photo_url = ( $application->presenter_photo[0] ) ? $application->presenter_photo[0] : null;\n\t\t\t\t\tif ( ! empty( $photo_url ) ) {\n\t\t\t\t\t\t$photo = add_post_meta( $pid, 'presenter_photo', $photo_url, true );\n\n\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Photo = ' . $photo_url );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Photo = ' . $photo_url );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Get the Maker Faire year\n\t\t\t\t\t$mf = ( $application->maker_faire ) ? $application->maker_faire : null;\n\t\t\t\t\tif ( ! empty( $mf ) ) {\n\t\t\t\t\t\t$faire = add_post_meta( $pid, 'maker_faire', $mf, true );\n\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tWP_CLI::line( 'Updating Meta...' );\n\t\t\t\t\t$pid = $presentation->ID;\n\n\t\t\t\t\t$website = ( $application->presentation_website ) ? $application->presentation_website : null;\n\t\t\t\t\tif ( ! empty( $website ) ) {\n\t\t\t\t\t\t$web = update_post_meta( $pid, 'presentation_website', $website );\n\n\t\t\t\t\t\tif ( ! empty( $web ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Video = ' . $website );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Video = ' . $website );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$video = ( $application->video ) ? $application->video : null;\n\t\t\t\t\tif ( ! empty( $video ) ) {\n\t\t\t\t\t\t$vid = update_post_meta( $pid, 'video', $video );\n\n\t\t\t\t\t\tif ( ! empty( $vid ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Video = ' . $video );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Video = ' . $video );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$post_id = get_the_ID();\n\t\t\t\t\tif ( ! empty( $post_id ) ) {\n\t\t\t\t\t\t$mfei_record = add_post_meta( $pid, 'mfei_record', $post_id );\n\n\t\t\t\t\t\tif ( ! empty( $mfei_record ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'mfei_record updated = ' . $post_id );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'mfei_record updated = ' . $post_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$photo_url = ( $application->presenter_photo[0] ) ? $application->presenter_photo[0] : null;\n\t\t\t\t\tif ( ! empty( $photo_url ) ) {\n\t\t\t\t\t\t$photo = add_post_meta( $pid, 'photo_url', $photo_url, true );\n\n\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Photo = ' . $photo );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Photo = ' . $photo );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$mf = ( $application->maker_faire ) ? $application->maker_faire : null;\n\t\t\t\t\tif ( ! empty( $mf ) ) {\n\t\t\t\t\t\t$faire = add_post_meta( $pid, 'maker_faire', $mf, true );\n\n\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\tWP_CLI::success( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif ( $application->presentation_type == 'Panel Presentation' ) {\n\t\t\t\tWP_CLI::line( 'Panel Presentation | ID: ' . get_the_ID() );\n\n\t\t\t\t$presentation_list = ( isset( $application->presenter_name ) ) ? $application->presenter_name : $application->name;\n\t\t\t\t$i = 0;\n\n\t\t\t\tif ( is_array( $presentation_list ) ) {\n\t\t\t\t\tforeach ( $presentation_list as $presenter_name ) {\n\t\t\t\t\t\t// We may need to revise this? If $application->m_maker_name[ $i ] return false, we may end up generating multiple\n\t\t\t\t\t\t// makers with the same title. If there are two empty maker name fields, that will generate dups.\n\t\t\t\t\t\t// Any other good idea around this? - CG\n\t\t\t\t\t\t$the_title = $application->presenter_name[ $i ] ? $application->presenter_name[ $i ] : $application->name;\n\t\t\t\t\t\t$title = htmlspecialchars( $the_title );\n\t\t\t\t\t\t$maker = get_page_by_title( $title, OBJECT, 'maker' );\n\n\t\t\t\t\t\techo ( isset( $maker->post_title ) ) ? WP_CLI::success( 'Found: ' . $maker->post_title ) : WP_CLI::warning( 'no title...' ) ;\n\n\t\t\t\t\t\tif ( ! $maker ) {\n\t\t\t\t\t\t\t// Setup post object...\n\t\t\t\t\t\t\t$content = ( isset( $application->presenter_bio[ $i ] ) ? htmlspecialchars_decode( $application->presenter_bio[ $i ] ) : null);\n\t\t\t\t\t\t\t$my_post = array(\n\t\t\t\t\t\t\t\t'post_title' => $title,\n\t\t\t\t\t\t\t\t'post_content' => $content,\n\t\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t\t'post_type'\t\t=> 'maker'\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$pid = wp_insert_post( $my_post );\n\t\t\t\t\t\t\tif ( is_wp_error( $pid ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'Presenter Name: ' . $title );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'Presenter Name: ' . $title );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$website = ( $application->presentation_website ) ? $application->presentation_website : null;\n\t\t\t\t\t\t\tif ( ! empty( $website ) ) {\n\t\t\t\t\t\t\t\t$web = update_post_meta( $pid, 'website', $website );\n\t\t\t\t\t\t\t\tif ( ! empty( $web ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'website = ' . $website );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'website = ' . $website );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$video = ( $application->video ) ? $application->video : null;\n\t\t\t\t\t\t\tif ( ! empty( $video ) ) {\n\t\t\t\t\t\t\t\t$vid = update_post_meta( $pid, 'video', $video );\n\t\t\t\t\t\t\t\tif ( ! empty( $vid ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'Video = ' . $video );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'Video = ' . $video );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$post_id = get_the_ID();\n\t\t\t\t\t\t\tif ( ! empty( $post_id ) ) {\n\t\t\t\t\t\t\t\t$mfei_record = add_post_meta( $pid, 'mfei_record', $post_id );\n\n\t\t\t\t\t\t\t\tif ( ! empty( $mfei_record ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$photo_url = ( $application->presenter_photo[ $i ] ) ? $application->presenter_photo[ $i ] : null;\n\t\t\t\t\t\t\tif ( ! empty( $photo_url ) ) {\n\t\t\t\t\t\t\t\t$photo = add_post_meta( $pid, 'photo_url', $photo_url, true );\n\n\t\t\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'Photo = ' . $photo_url );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'Photo = ' . $photo_url );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$mf = ( $application->maker_faire ) ? $application->maker_faire : null;\n\t\t\t\t\t\t\tif ( ! empty( $mf ) ) {\n\t\t\t\t\t\t\t\t$faire = add_post_meta( $pid, 'maker_faire', $mf, true );\n\n\t\t\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::line( 'Updating Meta...' );\n\t\t\t\t\t\t\t$pid = $maker->ID;\n\n\t\t\t\t\t\t\t$website = ( $application->presentation_website ) ? $application->presentation_website : null;\n\t\t\t\t\t\t\tif ( ! empty( $website ) ) {\n\t\t\t\t\t\t\t\t$web = update_post_meta( $pid, 'website', $website );\n\n\t\t\t\t\t\t\t\tif ( ! empty( $web ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'website = ' . $website );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'website = ' . $website );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$video = ( $application->video ) ? $application->video : null;\n\t\t\t\t\t\t\tif ( ! empty( $video ) ) {\n\t\t\t\t\t\t\t\t$vid = update_post_meta( $pid, 'video', $video );\n\n\t\t\t\t\t\t\t\tif ( ! empty( $vid ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'Video = ' . $video );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'Video = ' . $video );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$post_id = get_the_ID();\n\t\t\t\t\t\t\tif ( ! empty( $post_id ) ) {\n\t\t\t\t\t\t\t\t$mfei_record = add_post_meta( $pid, 'mfei_record', $post_id );\n\n\t\t\t\t\t\t\t\tif ( ! empty( $mfei_record ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'mfei_record = ' . $post_id );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$photo_url = ( isset( $application->presenter_photo[ $i ] ) ) ? $application->presenter_photo[ $i ] : null;\n\t\t\t\t\t\t\tif ( ! empty( $photo_url ) ) {\n\t\t\t\t\t\t\t\t$photo = add_post_meta( $pid, 'photo_url', $photo_url, true );\n\n\t\t\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'Photo = ' . $photo );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'Photo = ' . $photo );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$mf = ( $application->maker_faire ) ? $application->maker_faire : null;\n\t\t\t\t\t\t\tif ( ! empty( $mf ) ) {\n\t\t\t\t\t\t\t\t$faire = add_post_meta( $pid, 'maker_faire', $mf, true );\n\n\t\t\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\t\t\tWP_CLI::success( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tWP_CLI::warning( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t// There are inconsistencies with the form names... We need to handle an instance that is a panel but \n\t\t\t\t// doesn't contain an array of panelists. That makes me a sad panda.\n\t\t\t\t} else {\n\t\t\t\t\t$the_title = $application->name ? $application->name : null;\n\t\t\t\t\t$title = htmlspecialchars( $the_title );\n\t\t\t\t\t$maker = get_page_by_title( $title, OBJECT, 'maker' );\n\n\t\t\t\t\techo ( isset( $maker->post_title ) ) ? WP_CLI::success( 'Found: ' . $maker->post_title ) : WP_CLI::warning( 'no title...' ) ;\n\n\t\t\t\t\tif ( ! $maker ) {\n\t\t\t\t\t\t// Setup post object...\n\t\t\t\t\t\t$content = ( isset( $application->presenter_bio[0] ) ? htmlspecialchars_decode( $application->presenter_bio[0] ) : null);\n\t\t\t\t\t\t$my_post = array(\n\t\t\t\t\t\t\t'post_title' => $title,\n\t\t\t\t\t\t\t'post_content' => $content,\n\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t'post_type'\t\t=> 'maker'\n\t\t\t\t\t\t); \n\n\t\t\t\t\t\t$pid = wp_insert_post( $my_post );\n\t\t\t\t\t\tif ( is_wp_error( $pid ) ) {\n\t\t\t\t\t\t\tWP_CLI::warning( 'Presenter Name: ' . $title );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWP_CLI::success( 'Presenter Name: ' . $title );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$website = ( $application->presentation_website ) ? $application->presentation_website : null;\n\t\t\t\t\t\tif ( ! empty( $website ) ) {\n\t\t\t\t\t\t\t$web = update_post_meta( $pid, 'website', $website );\n\n\t\t\t\t\t\t\tif ( ! empty( $web ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'website = ' . $website );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'website = ' . $website );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$video = ( $application->video ) ? $application->video : null;\n\t\t\t\t\t\tif ( ! empty( $video ) ) {\n\t\t\t\t\t\t\t$vid = update_post_meta( $pid, 'video', $video );\n\n\t\t\t\t\t\t\tif ( ! empty( $vid ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'Video = ' . $video );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'Video = ' . $video );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$post_id = get_the_ID();\n\t\t\t\t\t\tif ( ! empty( $post_id ) ) {\n\t\t\t\t\t\t\t$mfei_record = add_post_meta( $pid, 'mfei_record', $post_id );\n\n\t\t\t\t\t\t\tif ( ! empty( $mfei_record ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'mfei_record created = ' . $post_id );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'mfei_record created = ' . $post_id );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$photo_url = ( $application->presenter_photo[0] ) ? $application->presenter_photo[0] : null;\n\t\t\t\t\t\tif ( ! empty( $photo_url ) ) {\n\t\t\t\t\t\t\t$photo = add_post_meta( $pid, 'photo_url', $photo_url, true );\n\n\t\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'Photo = ' . $photo_url );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'Photo = ' . $photo_url );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$mf = ( $application->maker_faire ) ? $application->maker_faire : null;\n\t\t\t\t\t\tif ( ! empty( $mf ) ) {\n\t\t\t\t\t\t\t$faire = add_post_meta( $pid, 'maker_faire', $mf, true );\n\n\t\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWP_CLI::line( 'Updating Meta...' );\n\t\t\t\t\t\t$pid = $maker->ID;\n\n\t\t\t\t\t\t$website = ( $application->presentation_website ) ? $application->presentation_website : null;\n\t\t\t\t\t\tif ( ! empty( $website ) ) {\n\t\t\t\t\t\t\t$web = update_post_meta( $pid, 'website', $website );\n\n\t\t\t\t\t\t\tif ( ! empty( $web ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'website = ' . $website );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'website = ' . $website );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$video = ( $application->video ) ? $application->video : null;\n\t\t\t\t\t\tif ( ! empty( $video ) ) {\n\t\t\t\t\t\t\t$vid = update_post_meta( $pid, 'video', $video );\n\n\t\t\t\t\t\t\tif ( ! empty( $vid ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'Video = ' . $video );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'Video = ' . $video );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$post_id = get_the_ID();\n\t\t\t\t\t\tif ( ! empty( $post_id ) ) {\n\t\t\t\t\t\t\t$mfei_record = add_post_meta( $pid, 'mfei_record', $post_id );\n\n\t\t\t\t\t\t\tif ( ! empty( $mfei_record ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'mfei_record updated = ' . $post_id );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'mfei_record updated = ' . $post_id );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$photo_url = ( isset( $application->presenter_photo[0] ) ) ? $application->presenter_photo[0] : null;\n\t\t\t\t\t\tif ( ! empty( $photo_url ) ) {\n\t\t\t\t\t\t\t$photo = add_post_meta( $pid, 'photo_url', $photo_url, true );\n\n\t\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'Photo = ' . $photo );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'Photo = ' . $photo );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$mf = ( $application->maker_faire ) ? $application->maker_faire : null;\n\t\t\t\t\t\tif ( ! empty( $mf ) ) {\n\t\t\t\t\t\t\t$faire = add_post_meta( $pid, 'maker_faire', $mf, true );\n\n\t\t\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\t\t\tWP_CLI::success( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tWP_CLI::warning( 'Maker Faire = ' . $mf );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ( $type == 'performer' ) {\n\t\t\tWP_CLI::line( 'Performer | ID: ' . get_the_ID() );\n\n\t\t\t$the_title = $application->performer_name ? $application->performer_name : $application->name;\n\t\t\t$title = htmlspecialchars( $the_title );\n\t\t\t$performer = get_page_by_title( $title, OBJECT, 'maker' );\n\n\t\t\techo ( isset( $performer->post_title ) ) ? WP_CLI::success( 'Found: ' . $performer->post_title ) : WP_CLI::warning( 'no title...' );\n\n\t\t\tif ( ! $performer ) {\n\t\t\t\t// Setup post object...\n\t\t\t\t$content = ($application->public_description ? htmlspecialchars_decode( $application->public_description ) : null);\n\t\t\t\t$my_post = array(\n\t\t\t\t\t'post_title' => $title,\n\t\t\t\t\t'post_content' => $content,\n\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t'post_type'\t\t=> 'maker'\n\t\t\t\t);\n\n\t\t\t\t$pid = wp_insert_post( $my_post );\n\t\t\t\tif ( is_wp_error( $pid ) ) {\n\t\t\t\t\tWP_CLI::warning( $title );\n\t\t\t\t} else {\n\t\t\t\t\tWP_CLI::success( $title );\n\t\t\t\t}\n\n\t\t\t\t// Get Website URL\n\t\t\t\t$website = ( $application->performer_website ) ? $application->performer_website : null;\n\t\t\t\tif ( ! empty( $website ) ) {\n\t\t\t\t\t$web = update_post_meta( $pid, 'performer_website', $website );\n\n\t\t\t\t\tif ( ! empty( $web ) ) {\n\t\t\t\t\t\tWP_CLI::success( 'Website = ' . $website );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWP_CLI::warning( 'Website = ' . $website );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Get Video URL\n\t\t\t\t$video = ( $application->performer_video ) ? $application->performer_video : null;\n\t\t\t\tif ( ! empty( $video ) ) {\n\t\t\t\t\t$vid = update_post_meta( $pid, 'video', $video );\n\n\t\t\t\t\tif ( ! empty( $vid ) ) {\n\t\t\t\t\t\tWP_CLI::success( 'Video = ' . $video );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWP_CLI::warning( 'Video = ' . $video );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Get Post ID\n\t\t\t\t$post_id = get_the_ID();\n\t\t\t\tif ( ! empty( $post_id ) ) {\n\t\t\t\t\t$mfei_record = add_post_meta( $pid, 'mfei_record', $post_id );\n\n\t\t\t\t\tif ( ! empty( $mfei_record ) ) {\n\t\t\t\t\t\tWP_CLI::success( 'mfei_record = ' . $post_id );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWP_CLI::warning( 'mfei_record = ' . $post_id );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Get Photo URL\n\t\t\t\t$photo_url = ( $application->performer_photo ) ? $application->performer_photo : null;\n\t\t\t\tif ( ! empty( $photo_url ) ) {\n\t\t\t\t\t$photo = add_post_meta( $pid, 'presenter_photo', $photo_url, true );\n\n\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\tWP_CLI::success( 'Photo = ' . $photo_url );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWP_CLI::warning( 'Photo = ' . $photo_url );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Get the Maker Faire year\n\t\t\t\t$mf = ( $application->maker_faire ) ? $application->maker_faire : null;\n\t\t\t\tif ( ! empty( $mf ) ) {\n\t\t\t\t\t$faire = add_post_meta( $pid, 'maker_faire', $mf, true );\n\n\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\tWP_CLI::success( 'Maker Faire = ' . $mf );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWP_CLI::warning( 'Maker Faire = ' . $mf );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tWP_CLI::line( 'Updating Meta...' );\n\t\t\t\t$pid = $performer->ID;\n\n\t\t\t\t$website = ( $application->performer_website ) ? $application->performer_website : null;\n\t\t\t\tif ( ! empty( $website ) ) {\n\t\t\t\t\t$web = update_post_meta( $pid, 'performer_website', $website );\n\n\t\t\t\t\tif ( ! empty( $web ) ) {\n\t\t\t\t\t\tWP_CLI::success( 'Website = ' . $website );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWP_CLI::warning( 'Website = ' . $website );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$video = ( $application->performer_video ) ? $application->performer_video : null;\n\t\t\t\tif ( ! empty( $video ) ) {\n\t\t\t\t\t$vid = update_post_meta( $pid, 'video', $video );\n\n\t\t\t\t\tif ( ! empty( $vid ) ) {\n\t\t\t\t\t\tWP_CLI::success( 'Video = ' . $video );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWP_CLI::warning( 'Video = ' . $video );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$post_id = get_the_ID();\n\t\t\t\tif ( ! empty( $post_id ) ) {\n\t\t\t\t\t$mfei_record = add_post_meta( $pid, 'mfei_record', $post_id );\n\n\t\t\t\t\tif ( ! empty( $mfei_record ) ) {\n\t\t\t\t\t\tWP_CLI::success( 'mfei_record = ' . $post_id );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWP_CLI::warning( 'mfei_record = ' . $post_id );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$photo_url = ( $application->performer_photo ) ? $application->performer_photo : null;\n\t\t\t\tif ( ! empty( $photo_url ) ) {\n\t\t\t\t\t$photo = add_post_meta( $pid, 'photo_url', $photo_url, true );\n\n\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\tWP_CLI::success( 'Photo = ' . $photo );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWP_CLI::warning( 'Photo = ' . $photo );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$mf = ( $application->maker_faire ) ? $application->maker_faire : null;\n\t\t\t\tif ( ! empty( $mf ) ) {\n\t\t\t\t\t$faire = add_post_meta( $pid, 'maker_faire', $mf, true );\n\n\t\t\t\t\tif ( ! empty( $photo ) ) {\n\t\t\t\t\t\tWP_CLI::success( 'Maker Faire = ' . $mf );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWP_CLI::warning( 'Maker Faire = ' . $mf );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tWP_CLI::line( '' );\n\t\tendwhile;\n\t\tWP_CLI::success( \"Boom!\" );\n\t}", "function stInterDogmaEffect() { $current_effect_type = self::getGameStateValue('current_effect_type');\n \n // Indicate the potential new (non-demand) dogma to come\n if ($current_effect_type == 0) { // I demand dogma : there is only one for this version of this game\n $current_effect_number = 1; // Switch on the first non-demand dogma, if exists\n }\n else {\n $current_effect_number = self::getGameStateValue('current_effect_number') + 1; // Next non-demand dogma, if exists\n }\n \n $card_id = self::getGameStateValue('dogma_card_id');\n $card = self::getCardInfo($card_id);\n \n // Check whether this new dogma exists actually or not\n if ($current_effect_number > 3 || $card['non_demand_effect_'.$current_effect_number] === null) {\n // No card has more than 3 non-demand dogma => there is no more effect\n // or the next non-demand-dogma effect is not defined\n \n $sharing_bonus = self::getGameStateValue('sharing_bonus');\n $launcher_id = self::getGameStateValue('active_player');\n \n // Stats\n $i_demand_effects = false;\n $executing_players = self::getExecutingPlayers();\n foreach($executing_players as $player_id => $stronger_or_equal) {\n if ($player_id == $launcher_id) {\n continue;\n }\n if ($stronger_or_equal) { // This player had effectively shared some dogma effects of the card\n self::incStat(1, 'sharing_effects_number', $player_id);\n }\n else { // The card had an I demand effect, and at least one player executed it with effects\n self::incStat(1, 'i_demand_effects_number', $player_id);\n $i_demand_effects = true;\n }\n\n }\n if ($i_demand_effects) {\n self::incStat(1, 'dogma_actions_number_with_i_demand', $launcher_id);\n }\n if ($sharing_bonus == 1) {\n self::incStat(1, 'dogma_actions_number_with_sharing', $launcher_id);\n }\n \n // Award the sharing bonus if needed\n if ($sharing_bonus == 1) {\n self::notifyGeneralInfo('<span class=\"minor_information\">${text}</span>', array('i18n'=>array('text'), 'text'=>clienttranslate('Sharing bonus.')));\n $player_who_launched_the_dogma = self::getGameStateValue('active_player');\n try {\n self::executeDraw($player_who_launched_the_dogma); // Draw a card with age consistent with player board\n }\n catch (EndOfGame $e) {\n // End of the game: the exception has reached the highest level of code\n self::trace('EOG bubbled from self::stInterDogmaEffect');\n self::trace('interDogmaEffect->justBeforeGameEnd');\n $this->gamestate->nextState('justBeforeGameEnd');\n return;\n }\n }\n \n // The active player may have changed during the dogma. Reset it on the player whose turn was\n $this->gamestate->changeActivePlayer($launcher_id);\n \n // Reset player table\n self::resetPlayerTable();\n \n // [R] Disable the flags used when in dogma \n self::setGameStateValue('dogma_card_id', -1);\n self::setGameStateValue('current_effect_type', -1);\n self::setGameStateValue('current_effect_number', -1);\n self::setGameStateValue('sharing_bonus', -1);\n self::setGameStateValue('current_player_under_dogma_effect', -1);\n self::setGameStateValue('step', -1);\n self::setGameStateValue('step_max', -1);\n self::setGameStateValue('special_type_of_choice', -1);\n self::setGameStateValue('choice', -1);\n self::setGameStateValue('splay_direction', -1);\n self::setGameStateValue('n_min', -1);\n self::setGameStateValue('n_max', -1);\n self::setGameStateValue('solid_constraint', -1);\n self::setGameStateValue('owner_from', -1);\n self::setGameStateValue('location_from', -1);\n self::setGameStateValue('owner_to', -1);\n self::setGameStateValue('location_to', -1);\n self::setGameStateValue('bottom_to', -1);\n self::setGameStateValue('age_min', -1);\n self::setGameStateValue('age_max', -1);\n self::setGameStateValue('color_array', -1);\n self::setGameStateValue('with_icon', -1);\n self::setGameStateValue('without_icon', -1);\n self::setGameStateValue('not_id', -1);\n self::setGameStateValue('can_pass', -1);\n self::setGameStateValue('n', -1);\n self::setGameStateValue('id_last_selected', -1);\n self::setGameStateValue('age_last_selected', -1);\n self::setGameStateValue('color_last_selected', -1);\n self::setGameStateValue('score_keyword', -1);\n self::setGameStateValue('auxiliary_value', -1);\n for($i=1; $i<=9; $i++) {\n self::setGameStateInitialValue('nested_id_'.$i, -1);\n self::setGameStateInitialValue('nested_current_effect_number_'.$i, -1);\n }\n \n // End of this player action\n self::trace('interDogmaEffect->interPlayerTurn');\n $this->gamestate->nextState('interPlayerTurn');\n return;\n }\n \n // There is another (non-demand) effect to perform\n self::setGameStateValue('current_effect_type', 1);\n self::setGameStateValue('current_effect_number', $current_effect_number);\n \n // Jump to this effect\n self::trace('interDogmaEffect->dogmaEffect');\n $this->gamestate->nextState('dogmaEffect');\n }", "function addBrand($name, $supplier_id)\n {\n// if ($supplierFind)\n// $supplier = $supplierFind['supplier_id'];\n// else {\n// $newSupplier = $this->insert(\"INSERT INTO `suppliers`(`name`)\n// VALUES ('$supplier')\");\n// $supplier = $newSupplier;\n// }\n\n return $this->insert(\"\n INSERT INTO `brands`(`name`, `supplier_id`)\n VALUES ('$name', $supplier_id)\");\n }", "private function writePerformers () {\n\t\t$GLOBALS[\"logger\"]->debug(\"writePerformers\");\n\t\tif ($this->performers != NULL) {\n\t\t\tforeach ($this->performers as $performer) {\n\t\t\t\t$GLOBALS[\"logger\"]->debug(\"Got a performer {$performer->id}\");\n\t\t\t\t// $performer is an Actor\n\t\t\t\t$newRec = ORM::for_table(self::REPTS_PERFS_TABLE)->create();\n\t\t\t\t$newRec->report_id = $this->id;\n\t\t\t\t$newRec->actor_id = $performer->id;\n\t\t\t\t$newRec->save();\n//\t\t\t\t$insstmt = \"INSERT INTO REPORTS_PERFORMERS (REPORT_ID, ACTOR_ID) \" .\n//\t\t\t\t\t\"VALUES ($rptid, $actid)\";\n\t\t\t}\n\t\t}\n\t}", "function vistaportal_form_premed_add($form, &$form_state) {\n $form_state['p_num_schools']++;\n $form_state['rebuild'] = TRUE;\n }", "public function produceFreshSoda($productionOrder)\n {\n $option = $this->rules()->getProductionRule();\n $inventory = $this->inventory;\n $report = \"\";\n\n if ($option == 'optimized')\n {\n foreach ($productionOrder as $order)\n {\n $key = $order->number;\n $report .= \"Depósito $key :\";\n if ($inventory->tanks->$key->contains =='water') // temos água\n {\n $qttToProduce = self::rd0($inventory->tanks->$key->quantity / $this->rules()->getMaterialConsumption('water'));\n $neededSugar = self::rd0($qttToProduce * $this->rules()->getMaterialConsumption('sugar'));\n $neededCoffee = self::rd0($qttToProduce * $this->rules()->getMaterialConsumption('coffee'));\n if ($inventory->sugar >= $neededSugar && $inventory->coffee >= $neededCoffee) // temos café e açucar\n {\n // Vamos produzir\n $report .= \"Produzidos $qttToProduce unidades\";\n $inventory->tanks->$key->contains = 'freshSoda';\n $inventory->tanks->$key->quantity = $qttToProduce;\n $inventory->sugar -= $neededSugar;\n $inventory->coffee -= $neededCoffee;\n }\n else\n {\n $report .= \"Falta matéria prima\";\n }\n }\n else\n {\n $report .= \"Não contém água\";\n }\n }\n }\n\n\n if ($option == 'strictPlayerOrder')\n {\n foreach ($productionOrder as $order)\n {\n $key = $order->number;\n $report .= \"Depósito $key :\";\n\n // Verificar se foram especificadas as MP\n if ($order->sugar == 0 && $order->coffee == 0)\n {\n //Não foi especificado a quantidade de materias primas a usar. Relatamos e saltamos para próxima ordem\n $report .= \"Falta especificar matéria prima; \";\n continue;\n }\n\n // Verificar existência de MP\n if ($order->sugar > $inventory->sugar || $order->coffee > $inventory->coffee)\n {\n //Não temos MP suficientes para produzir. Relatamos e saltamos para próxima ordem\n $report .= \"Falta matéria prima; \";\n continue;\n }\n \n // Calcular os valores de fórmula\n $qttToProduce = self::rd0($inventory->tanks->$key->quantity / $this->rules()->getMaterialConsumption('water'));\n $formulaSugar = self::rd0($qttToProduce * $this->rules()->getMaterialConsumption('sugar'));\n $formulaCoffee = self::rd0($qttToProduce * $this->rules()->getMaterialConsumption('coffee'));\n\n // Verificamos formulação e conteúdo do depósito\n if($inventory->tanks->$key->contains != 'water' || $order->sugar != $formulaSugar || $order->coffee != $formulaCoffee)\n {\n // Ordem não obedece a formulação ou depósito não contém água\n // Produzimos refresco defeituoso, relatamos e saltamos para próxima ordem\n if ($inventory->tanks->$key->contains == 'water') $inventory->tanks->$key->quantity = $qttToProduce;\n $inventory->sugar -= $order->sugar;\n $inventory->coffee -= $order->coffee;\n $inventory->tanks->$key->contains = 'damagedSoda';\n $report .= \"Formulação errada; \";\n continue;\n }\n\n // Produzimos refresco em conformidade com a formulação e relatamos\n $inventory->tanks->$key->quantity = $qttToProduce;\n $inventory->sugar -= $order->sugar;\n $inventory->coffee -= $order->coffee;\n $inventory->tanks->$key->contains = 'freshSoda';\n $report .= \"Produção OK; \";\n }\n\n }\n $this->inventory = $inventory;\n return $report;\n }", "public function store(Request $request)\n { \n $id= Auth::id();\n \n $poc= DB::table('pocs')\n ->select('city')\n ->where('city','=',$request->city)\n ->first();\n if ($poc==NULL) {\n return view('farmers.poc')->withPoc($poc);\n }\n\n $user= User::find($id);\n $user->profile=1;\n $user->save();\n\n $farmer = new Farmer;\n \n $farmer->user_id=$id;\n $farmer->fname=$request->fname;\n $farmer->lname=$request->lname;\n $farmer->age=$request->age;\n $farmer->address=$request->address;\n $farmer->state=$request->state;\n $farmer->city=$request->city;\n $farmer->pincode=$request->pincode;\n $farmer->vegetable=$request->vegetable;\n $farmer->rating=0;\n $farmer->loan=0;\n\n $farmer->save();\n \n \n //redirect to another base\n \n return redirect()->route('farmers.show',$request->city);\n\n }", "public function run()\n {\n factory(Spare::class, 20)->create();\n }", "public function create($id, $id_part, $id_match)\n {\n //\n }", "public function recruit($perso) {\n\t\t\t$this->fighters[] = $perso;\n\t}", "public function farm()\n {\n return $this->belongsTo('App\\Farm', 'farm_id');\n }", "public function addProductLine( $product_id, $combination_id = null, $quantity = 1.0, $params = [] )\n {\n // Do the Mambo!\n $line_type = 'product';\n\n // Customer\n $customer = $this->customer;\n $salesrep = array_key_exists('sales_rep_id', $params) \n ? SalesRep::find( (int) $params['sales_rep_id'] ) \n : $customer->salesrep;\n \n // Currency\n $currency = $this->document_currency;\n\n // Product\n if ($combination_id>0) {\n $combination = Combination::with('product')->with('product.tax')->findOrFail(intval($combination_id));\n $product = $combination->product;\n $product->reference = $combination->reference;\n $product->name = $product->name.' | '.$combination->name;\n } else {\n $product = Product::with('tax')->findOrFail(intval($product_id));\n }\n\n $reference = $product->reference;\n $name = array_key_exists('name', $params) \n ? $params['name'] \n : $product->name;\n\n $measure_unit_id = $product->measure_unit_id;\n\n $package_measure_unit_id = array_key_exists('package_measure_unit_id', $params) \n ? $params['package_measure_unit_id'] \n : $product->measure_unit_id;\n\n $pmu_conversion_rate = 1.0; // Temporarily default\n\n $pmu_label = ''; // Temporarily default\n\n // Measure unit stuff...\n if ( $package_measure_unit_id != $measure_unit_id )\n {\n $mu = $product->measureunits->where('id', $measure_unit_id )->first();\n $pmu = $product->measureunits->where('id', $package_measure_unit_id)->first();\n\n $pmu_conversion_rate = $pmu->conversion_rate;\n\n $quantity = $quantity * $pmu_conversion_rate;\n\n $pmu_label = array_key_exists('pmu_label', $params) && $params['pmu_label']\n ? $params['pmu_label'] \n : $pmu->name.' : '.(int) $pmu_conversion_rate.'x'.$mu->name;\n \n }\n\n // $cost_price = $product->cost_price;\n // Do this ( because of getCostPriceAttribute($value) ):\n $cost_price = $product->getOriginal('cost_price');\n $cost_average = $product->cost_average;\n\n // Tax\n $tax = $product->tax;\n $taxing_address = $this->taxingaddress;\n $tax_percent = $tax->getTaxPercent( $taxing_address );\n $sales_equalization = array_key_exists('sales_equalization', $params) \n ? $params['sales_equalization'] \n : $customer->sales_equalization;\n\n // Product Price\n $price = $product->getPrice();\n// if ( $price->currency->id != $currency->id ) {\n// $price = $price->convert( $currency );\n// }\n $unit_price = $price->getPrice();\n\n // Calculate price per $customer_id now!\n // $customer_price = $product->getPriceByCustomer( $customer, $quantity, $currency );\n $customer_price = $product->getPriceByCustomerPriceList( $customer, $quantity, $currency );\n\n // Is there a Price for this Customer?\n if (!$customer_price) return null; // Product not allowed for this Customer\n\n $customer_price->applyTaxPercent( $tax_percent );\n $unit_customer_price = $customer_price->getPrice();\n\n // Still with me? \n if ( $package_measure_unit_id != $measure_unit_id &&\n \n // Is there any package rule?\n $pack_rule = $customer->getPackageRule( $product, $package_measure_unit_id, $currency ) )\n {\n // Calculate quantity conversion\n $pmu_conversion_rate = $pack_rule->conversion_rate;\n $pmu_label = $pack_rule->name;\n\n // Assumes $pack_rule is not null\n // $package_price = $pack_rule->price;\n $customer_final_price = new Price( $pack_rule->getUnitPrice() );\n $customer_final_price->applyTaxPercent( $tax_percent );\n\n // Still one thing left: rule_type = 'promo' (avoid)\n $promo_rule = null;\n \n\n } else {\n //\n $customer_final_price = $product->getPriceByCustomerPriceRules( $customer, $quantity, $currency );\n\n // Still one thing left: rule_type = 'promo'\n $promo_rule = $customer->getExtraQuantityRule( $product, $currency );\n }\n\n\n\n \n if ( !$customer_final_price )\n $customer_final_price = clone $customer_price; // No price Rules available\n \n // Better price?\n if ( $customer_final_price->getPrice() > $unit_customer_price )\n {\n $customer_final_price = clone $customer_price;\n }\n $unit_customer_final_price = $customer_final_price->getPrice();\n\n\n // Still one thing left: rule_type = 'promo'\n $extra_quantity = 0.0;\n $extra_quantity_label = '';\n\n if ($promo_rule)\n {\n // First: Does it apply?\n if ( $unit_customer_final_price == $unit_customer_price ) // No price rule has been applied\n {\n $extra_quantity = floor( $quantity / $promo_rule->from_quantity ) * $promo_rule->extra_quantity;\n $extra_quantity_label = $extra_quantity > 0 ? $promo_rule->name : '';\n }\n }\n\n\n\n // Price Policy\n $pricetaxPolicy = array_key_exists('prices_entered_with_tax', $params) \n ? $params['prices_entered_with_tax'] \n : $customer_price->price_is_tax_inc;\n/*\n // Customer Final Price\n if ( array_key_exists('prices_entered_with_tax', $params) && array_key_exists('unit_customer_final_price', $params) )\n {\n $unit_customer_final_price = new Price( $params['unit_customer_final_price'], $pricetaxPolicy, $currency );\n\n $unit_customer_final_price->applyTaxPercent( $tax_percent );\n\n } else {\n\n $unit_customer_final_price = clone $customer_price;\n }\n*/\n // Discount\n $discount_percent = array_key_exists('discount_percent', $params) \n ? $params['discount_percent'] \n : 0.0;\n\n // Final Price\n $final_price = clone $customer_final_price;\n// if ( $discount_percent ) \n// $unit_final_price->applyDiscountPercent( $discount_percent );\n\n // Sales Rep\n $sales_rep_id = array_key_exists('sales_rep_id', $params) \n ? $params['sales_rep_id'] \n : optional($salesrep)->id;\n \n $commission_percent = array_key_exists('sales_rep_id', $params) && array_key_exists('commission_percent', $params) \n ? $params['commission_percent'] \n : optional($salesrep)->getCommission( $product, $customer ) ?? 0.0;\n\n\n\n // Misc\n $line_sort_order = array_key_exists('line_sort_order', $params) \n ? $params['line_sort_order'] \n : $this->getNextLineSortOrder();\n/*\n $extra_quantity = array_key_exists('extra_quantity', $params) \n ? $params['extra_quantity'] \n : 0.0;\n\n $extra_quantity_label = array_key_exists('extra_quantity_label', $params) \n ? $params['extra_quantity_label'] \n : '';\n*/\n $notes = array_key_exists('notes', $params) \n ? $params['notes'] \n : '';\n\n\n // Build OrderLine Object\n $data = [\n 'line_sort_order' => $line_sort_order,\n 'line_type' => $line_type,\n 'product_id' => $product_id,\n 'combination_id' => $combination_id,\n 'reference' => $reference,\n 'name' => $name,\n 'quantity' => $quantity,\n 'measure_unit_id' => $measure_unit_id,\n 'extra_quantity' => $extra_quantity,\n 'extra_quantity_label' => $extra_quantity_label,\n\n 'package_measure_unit_id' => $package_measure_unit_id,\n 'pmu_conversion_rate' => $pmu_conversion_rate,\n 'pmu_label' => $pmu_label,\n\n 'prices_entered_with_tax' => $pricetaxPolicy,\n \n 'cost_price' => $cost_price,\n 'cost_average' => $cost_average,\n 'unit_price' => $unit_price,\n 'unit_customer_price' => $unit_customer_price,\n 'unit_customer_final_price' => $customer_final_price->getPrice(),\n 'unit_customer_final_price_tax_inc' => $customer_final_price->getPriceWithTax(),\n 'unit_final_price' => $final_price->getPrice(),\n 'unit_final_price_tax_inc' => $final_price->getPriceWithTax(), \n 'sales_equalization' => $sales_equalization,\n 'discount_percent' => $discount_percent,\n 'discount_amount_tax_incl' => 0.0, // floatval( $request->input('discount_amount_tax_incl', 0.0) ),\n 'discount_amount_tax_excl' => 0.0, // floatval( $request->input('discount_amount_tax_excl', 0.0) ),\n\n 'total_tax_incl' => $quantity * $final_price->getPriceWithTax(),\n 'total_tax_excl' => $quantity * $final_price->getPrice(),\n\n 'tax_percent' => $tax_percent,\n 'commission_percent' => $commission_percent,\n 'notes' => $notes,\n 'locked' => 0,\n \n // 'customer_order_id',\n 'tax_id' => $tax->id,\n 'sales_rep_id' => $sales_rep_id,\n ];\n\n $extra_data = [];\n\n // Ecotaxes stuff\n if ( Configuration::isTrue('ENABLE_ECOTAXES') && ($product->ecotax_id>0) )\n {\n //\n $extra_data = [\n 'ecotax_id' => $product->ecotax_id,\n 'ecotax_amount' => $product->ecotax->amount,\n 'ecotax_total_amount' => $quantity * $product->ecotax->amount,\n ];\n }\n\n $data += $extra_data;\n\n\n // Finishing touches\n $lineClass = $this->getClassName().'Line';\n $document_line = ( new $lineClass() )->create( $data );\n\n $this->lines()->save($document_line);\n\n\n // Let's deal with taxes\n $product->sales_equalization = $sales_equalization;\n $rules = $product->getTaxRules( $this->taxingaddress, $this->customer );\n\n $document_line->applyTaxRules( $rules );\n\n // Hummm! What about extra units (quantity at no cost)?\n if ( $extra_quantity > 0.0 )\n {\n // Re-Build OrderLine Object\n $data['line_sort_order'] = $line_sort_order + 1; // Stay close to previous line, because this line \"is a child of\" previous line\n $data['quantity'] = $extra_quantity;\n\n $data['extra_quantity'] = 0.0;\n $data['extra_quantity_label'] = '';\n\n $data['unit_customer_final_price'] = 0.0;\n $data['unit_customer_final_price_tax_inc'] = 0.0;\n\n $data['unit_final_price'] = 0.0;\n $data['unit_final_price_tax_inc'] = 0.0;\n\n $data['total_tax_incl'] = 0.0;\n $data['total_tax_excl'] = 0.0;\n\n $data['notes'] = $extra_quantity_label;\n\n // Add extra line\n $document_extra_line = ( new $lineClass() )->create( $data );\n\n $this->lines()->save($document_extra_line);\n\n\n // Let's deal with taxes\n $document_extra_line->applyTaxRules( $rules );\n }\n\n\n // Now, update Document Totals\n $this->makeTotals();\n\n\n // Good boy, bye then\n return $document_line;\n\n }", "public function store($id)\n {\n $requisitionForm = RequisitionForm::create(array(\n \"vendor\" => Input::get(\"vendor\"),\n \"vendor_no\" => Input::get(\"vendor_no\"),\n \"address\" => Input::get(\"address\"),\n \"particular_id\" => Input::get(\"particular_id\"),\n ));\n\n return \"<h3 class='text-success'> RequisitionForm Registered Successful </h3>\";\n\n }" ]
[ "0.5544999", "0.5222093", "0.46992844", "0.4687974", "0.45313016", "0.45190394", "0.45171067", "0.44795826", "0.4437303", "0.44330385", "0.43853965", "0.43791267", "0.437684", "0.43543538", "0.43433112", "0.43394727", "0.43392795", "0.43353906", "0.43281603", "0.43229273", "0.43051368", "0.42933118", "0.4286879", "0.42786714", "0.427513", "0.42669156", "0.42550015", "0.42503607", "0.42488846", "0.42435196" ]
0.6734126
0
/ |========================================================== | get corrupted match proposal
public function getCorruptedMatchProposal($matchId,$teamId) { $queryString="SELECT * FROM corruption_match WHERE match_id=$matchId AND receiver=$teamId AND response=0"; $query = $this->db->query($queryString); $result=$query->result_array(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getExhaustionExplanation ();", "public function match() {\r\n\t\treturn false;\r\n\t}", "public function testFailingOnMismatchedExpectation() {\n\t\t$test = new IncorrectOutputSingleExpectationTestCase( 'test' );\n\t\t$result = $test->run();\n\n\t\t$this->assertSame( 1, $result->failureCount() );\n\t\t$this->assertSame( 1, \\count( $result ) );\n\n\t\t$failures = $result->failures();\n\t\t$this->assertStringContainsString(\n\t\t\t\"Failed asserting that 'The quick brown fox jumps over the lazy dog' matches PCRE pattern \\\"#\",\n\t\t\t$failures[0]->exceptionMessage()\n\t\t);\n\t}", "public function getMatch();", "function yy_r143(){$this->_retvalue = '<='; }", "function yy_r139(){$this->_retvalue = '!='; }", "public function tellInvalidCard()\n {\n }", "public function corruptionAccepted($matchId)\n {\n /*$queryString=\"SELECT *\n FROM corruption_match\n WHERE match_id=$matchId\";\n $query = $this->db->query($queryString);\n $result=$query->result_array();\n\n return $result;*/\n $queryString=\"UPDATE corruption_match\n SET response=1\n WHERE match_id=$matchId\";\n $query = $this->db->query($queryString);\n }", "function compare_results(&$matcher, &$expected, &$obtained, &$ismatchpassed, &$fullpassed, &$indexfirstpassed, &$indexlastpassed, &$nextpassed, &$leftpassed) {\n $ismatchpassed = ($expected['is_match'] == $obtained['is_match']);\n $fullpassed = ($expected['full'] == $obtained['full']);\n $result = $ismatchpassed && $fullpassed;\n if ($obtained['is_match'] && $expected['is_match']) { // TODO - what if we need a character with no match?\n // checking indexes\n if ($matcher->is_supporting(preg_matcher::SUBPATTERN_CAPTURING)) {\n $indexfirstpassed = ($expected['index_first'] == $obtained['index_first']);\n $indexlastpassed = ($expected['index_last'] == $obtained['index_last']);\n } else {\n $indexfirstpassed = ($expected['index_first'][0] == $obtained['index_first'][0]);\n $indexlastpassed = ($expected['index_last'][0] == $obtained['index_last'][0]);\n }\n // checking next possible character\n if ($matcher->is_supporting(preg_matcher::NEXT_CHARACTER)) {\n $nextpassed = (($expected['next'] === '' && $obtained['next'] === '') || // both results are empty\n ($expected['next'] !== '' && $obtained['next'] !== '' && strstr($expected['next'], $obtained['next']) != false)); // expected 'next' contains obtained 'next'\n } else {\n $nextpassed = true;\n }\n // checking number of characters left\n if ($matcher->is_supporting(preg_matcher::CHARACTERS_LEFT)) {\n $leftpassed = in_array($obtained['left'], $expected['left']);\n } else {\n $leftpassed = true;\n }\n $result = $result && $indexfirstpassed && $indexlastpassed && $nextpassed && $leftpassed;\n } else {\n $indexfirstpassed = true;\n $indexlastpassed = true;\n $nextpassed = true;\n $leftpassed = true;\n }\n return $result;\n }", "function process_nonmatches(&$output, &$text_old, &$text_new)\n\t{\n\t\t$s1 = sizeof($text_old);\n\t\t$s2 = sizeof($text_new);\n\n\t\tif ($s1 > 0 AND $s2 == 0)\n\t\t{\n\t\t\t// lines deleted\n\t\t\tarray_unshift($output, new vB_Text_Diff_Entry(implode(\"\\n\", $text_old), ''));\n\t\t}\n\t\telse if ($s2 > 0 AND $s1 == 0)\n\t\t{\n\t\t\t// lines added\n\t\t\tarray_unshift($output, new vB_Text_Diff_Entry('', implode(\"\\n\", $text_new)));\n\t\t}\n\t\telse if ($s1 > 0 AND $s2 > 0)\n\t\t{\n\t\t\t// substitution\n\t\t\tarray_unshift($output, new vB_Text_Diff_Entry(implode(\"\\n\", $text_old), implode(\"\\n\", $text_new)));\n\t\t}\n\n\t\t$text_old = array();\n\t\t$text_new = array();\n\t}", "function clean_pre($matches)\n {\n }", "protected function _refine() {\n\n\t}", "public function amazing()\n\t{\n\t\tif (preg_match('/^\\(\\?+\\) \\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(Ass Backwards (2013) WEBrip XviD AC3 (english subs)) [18/35] - \"Ass Backwards (2013) WEBrip XviD AC3 (english subs).part17.rar\" yEnc\n\t\tif (preg_match('/^\\([\\w!.,&_ ()\\[\\]\\'\\`-]{8,}\\)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(Angels4Always) [1/1] - \"Vermeulen, John - De tweelingparadox.rar\" yEnc\n\t\tif (preg_match('/^\\(Angels4Always\\)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Heaven_en_Fayth Presenteren Diana Gabaldon - Reiziger Cyclus 01 - De Reiziger[0/3] - \"Diana Gabaldon - Reiziger Cyclus 01 - De Reiziger.nzb\" yEnc\n\t\tif (preg_match('/^[\\w!.,&_ ()\\[\\]\\'\\`-]{8,}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //www.wolfsteamers.info [1/6] - \"Wohnen Bauen Leben - Sommer 2014.par2\" - 16,46 MB yEnc\n\t\tif (preg_match('/^www\\.wolfsteamers\\.info[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //096XZFUPQ0PxH4441H14fU8V - [34/99] - \"096XZFUPQ0PxH4441H14fU8V.part033.rar\" yEnc\n\t\tif (preg_match('/^\\w+[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //05VANmA80DckBho \"05VANmA80DckBho.part07.rar\"08/94 yEnc\n\t\tif (preg_match('/^\\w+[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t '\\d+(\\/\\d+)[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(Slaapkop post voor http://the-ultimate-force.org.ua/) [0/7] - \"Wham - I'm Your Man (1985).nzb\" yEnc\n\t\tif (preg_match('/^\\(.+the-ultimate-force\\.org\\.ua\\/\\)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(001/101) - P2H - \"L62WD8P4U539A7.par2\" - 4,66 GB - Z9F6KN7SXRCY845 yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) - P2H - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '[-_\\s]{0,3}\\d+([.,]\\d+)? [kKmMgG][bB][-_\\s]{0,3}\\w+[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(001/101) \"654258ItB1418pBRDNS264159.par2\" - 9,74 GB - yEnc\n\t\t//(001/105) - Description - \"oH291TB0bPxf3lqm1P7QQ.par2\" - 4,56 GB - yEnc\n\t\t//(03/43) - FTTEAM.INFO - \"JDSJ2J4ENASJCKR-FTTEAM.INFO.part02.rar\" - 2,04 GB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\)([-_ ]{0,4}(Description|FTTEAM\\.INFO))?[-_ ]{0,4}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[3];\n\t\t} //- - [001/242] - \"C65JuogI92CwfMo2TiX59.par2\" yEnc\n\t\tif (preg_match('/^[-_ .]{0,4}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //- \"5nivJ7V6Q2jqAR34bZ8m.part46.rar\" yEnc\n\t\tif (preg_match('/^[-_ .]{0,4}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //- \"7UAF6LE2PDM38NB.par2\" - 8,53 GB - yEnc\n\t\tif (preg_match('/^[-_ .]{0,4}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //- [01/10] - \"file.xyz\" yEnc - [001/107] - \"86u1Qr8mm56jGiW7nUPTM.par2\" yEnc\n\t\tif (preg_match('/^[-_ ]{0,4}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\".+\" yEnc[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "function yy_r145(){$this->_retvalue = '!=='; }", "function preg_match_all(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): ?int\n{\n error_clear_last();\n $safeResult = \\preg_match_all($pattern, $subject, $matches, $flags, $offset);\n if ($safeResult === false) {\n throw PcreException::createFromPhpError();\n }\n return $safeResult;\n}", "function yy_r119(){$this->_retvalue = '!'.$this->yystack[$this->yyidx + 0]->minor; }", "public function bloaf()\n\t{\n\t\tif (preg_match('/^([a-f0-9]{32}) - \\(\\d+\\/\\d+\\) - \"[a-f0-9]{32}.+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[10/17] - \"EGk13kQ1c8.part09.rar\" - 372.48 MB <-> usenet-space-cowboys.info <-> powered by secretusenet.com <-> yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' - \\d+[,.]\\d+ [mMkKgG][bB] .+? usenet-space.+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(Neu bei Bitfighter vom 23-07-2013) - \"01 - Sido - Bilder Im Kopf.mp3\" yEnc\n\t\tif (preg_match('/^\\((.+?)\\) - \".+?\" yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //(2/8) \"Mike.und.Molly.S01E22.Maennergespraeche.GERMAN.DL.DUBBED.720p.BluRay.x264-TVP.part1.rar\" - 1023,92 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' - \\d+[,.]\\d+ [mMkKgG][bB] - yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //4y (PW) [@ usenet-4all.info - powered by ssl.news -] [27,35 GB] [001/118] \"1f8867bb6f89491793d3.part001.rar\" yEnc\n\t\tif (preg_match('/^.+? (-|\\(PW\\))\\s+\\[.+? -\\] \\[\\d+[,.]\\d+ [mMkKgG][bB]\\] \\[\\d+\\/\\d+\\] \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Bennos Special Tools DVD - Die Letzte <> DRM <><> PW <> - (002/183) \"Bennos Special Tools DVD - Die Letzte.nfo\" - 8,28 GB - yEnc\n\t\tif (preg_match('/^(\\[[A-Za-z]+\\]\\.)?([a-zA-Z0-9].+?)([\\^<> ]+give-me-all\\.org[\\^<> ]+|[\\^<> ]+)DRM[\\^<> ]+.+? - \\(\\d+\\/\\d+\\)\\s+\".+?\" - .+? yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//(1/9) - CyberLink.PhotoDirector.4.Ultra.4.0.3306.Multilingual - \"CyberLink.PhotoDirector.4.Ultra.4.0.3306.Multilingual.par2\" - 154,07 MB - yEnc\n\t\t//(1/5) - Mac.DVDRipper.Pro.4.0.8.Mac.OS.X- \"Mac.DVDRipper.Pro.4.0.8.Mac.OS.X.rar\" - 24,12 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) - (.+?) ?- \".+?\" - \\d+[,.]\\d+ [mMkKgG][bB] - yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[3/3 Helene Fischer - Die Biene Maja 2013 MP3 Helene Fischer - Die Biene Maja 2013 MP3.mp3.vol0+1.PAR2\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+ (.+?)\\..+?\" yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //Uploader.Presents-Mutter.und.Sohn.German.2013.DVDRiP.x264-XFi[01/27]\"xf-mutterusohn.nfo\" yEnc\n\t\tif (preg_match('/^Uploader\\.Presents-(.+)[\\(\\[]\\d+\\/\\d+[\\)\\]]\".+\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "public function GetMatch ();", "public function moovee()\n\t{\n\t\tif (preg_match('/\\[ENJOY\\]-\\[FULL\\]-\\[.+\\]-\\[ (.+) \\]-\\[\\d+\\/\\d+\\]-\".+\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} ///PROUT Movie (2010) NTSC DVD [157/15768] - \"PROUTmovie_NTSC.part155.rar\" yEnc\n\t\tif (preg_match('/^(.+DVD.*) \\[\\d+\\/\\d+\\] - \".+\" yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//[ Hammer.of.the.Gods.2013.720p.WEB-DL.DD5.1.H.264-ELiTE ]-[01/44] - \"Hammer.of.the.Gods.2013.720p.WEB-DL.DD5.1.H.264-ELiTE.par2\" yEnc\n\t\t//[134863]-[ Rihanna.No.Regrets.2013.720p.WEB-DL.DD5.1.H.264-PZK ]-[52/52] - \"Rihanna.No.Regrets.2013.720p.WEB-DL.DD5.1.H.264-PZK.vol127+76.par2\" yEnc\n\t\t//[Hard.Target.1993.UNRATED.720p.BluRay.x264-88keyz] - [001/101] - \"Hard.Target.1993.UNRATED.720p.BluRay.x264-88keyz.nfo\"\n\t\t//[ Fast.And.Furious.6.2013.720p.WEB-DL.AAC2.0.H.264-HDCLUB ]-[REAL]-[01/54] - \"Fast.And.Furious.6.2013.720p.WEB-DL.AAC2.0.H.264-HDCLUB.nfo\" yEnc\n\t\tif (preg_match('/^(\\[\\d+\\]-)?\\[ ?([a-zA-Z0-9.-]{6,}) ?\\](-\\[REAL\\])? ?- ?\\[\\d+\\/\\d+\\] - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //\"Nights.of.Cabiria.1957.NTSC.DVD.x264-Tree\"(23/57) \"Nights.of.Cabiria.1957.NTSC.DVD.x264-Tree.part22.rar\" - 2.40 GB yEnc\n\t\tif (preg_match('/^\"(.+(DVD|BluRay|BRRip).+)\"\\(\\d+\\/\\d+\\) \".+\".+[GMK]B yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(????) [0/1] - \"A.Good.Day.to.Die.Hard.2013.nzb\" yEnc\n\t\tif (preg_match('/^\\(\\?{4}\\) \\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[xxxxx]-[#a.b.moovee@EFNet]-[ xxxxx ]-[02/66] - \"tulob88.part01.rar\" yEnc\n\t\tif (preg_match('/^\\[x+\\]-\\[.+?\\]-\\[ x+ \\]-\\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//Groove.2000.iNTERNAL.DVDRip.XviD-UBiK - [001/111] - \"ubik-groove-cd1.par2\" yEnc\n\t\t//Antony.and.Cleopatra.1972.720p.WEB-DL.H264-brento -[35/57] - \"Antony.and.Cleopatra.1972.720p.WEB-DL.AAC2.0.H.264-brento.part34.rar\" yEnc\n\t\tif (preg_match('/^([a-zA-Z0-9._-]+) - ?\\[\\d+\\/\\d+\\] - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(Iron.Man.3.2013.R5.DVDRip.XviD-AsA) (01/26) - \"Iron.Man.3.2013.R5.DVDRip.XviD-AsA.part01.part.sfv\" yEnc\n\t\tif (preg_match('/^\\(([a-zA-Z0-9.-]+)\\) \\(\\d+\\/\\d+\\) - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(Classic Surf) Morning.Of.The.Earth.1971 [03/29] - \"Morning.Of.The.Earth.1971.part02.rar\" yEnc\n\t\tif (preg_match('/^\\([a-zA-Z0-9].+?\\) ([a-zA-Z0-9.-]+) \\[\\d+\\/\\d+\\] - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[51/62] Morrissey.25.Live.Concert.2013.BDRip.x264-N0TSC3N3 - \"n0tsc3n3-morrissey.25.live.2013.bdrip.x264.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\] (.+) - \".+\" yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //[AD120512-00006]-[UnOFFSc3n4iT]-[0131105] Chloe.Tra.Seduzione.E.Inganno.2009.iTALiAN.DVDRip.XviD-TRL [19/41] - \"trl-chltsdzn.part18.rar\" yEnc\n\t\tif (preg_match('/^\\[\\w+-\\w+\\]-\\[\\w+\\]-\\[\\d+\\] (.+) \\[\\d+\\/\\d+\\] - \".+\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Breathe.In.2013.BRRip.x264-4UN [01/39] - \"Breathe.In.2013.BRRip.x264-4UN.nfo\" yEnc\n\t\tif (preg_match('/^(.+x264.+) \\[\\d+\\/\\d+\\] - \".+\" yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //The.CyB3rMaFiA.PimPs.YouR.RiDE.WiTH [REPACK] [40/42] - \"d2p5uypp7yn3drpk1080417.vol255+064.par2\" yEnc\n\t\tif (preg_match('/^(.+) \\[REPACK\\] \\[\\d+\\/\\d+\\] - \".+\" yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //[ Oklahoma\\!.1955.720p.WEB-DL.AAC2.0.H.264-CtrlHD ]-[32/55] - \"Oklahoma.1955.720p.WEB-DL.AAC2.0.H.264-CtrlHD.part31.rar\" yEnc\n\t\tif (preg_match('/\\[ (.+WEB-DL.+) \\]-\\[\\d+\\/\\d+\\] - \"(.+)\\.(mp4|mkv|ts|rar|par.+)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //REQ: working copy of \"That Darn Cat 1997 Xvid-Any grp\" Plz Ty (47/60) \"geckos-ghr2011-xvid.r44\" - 744,19 MB - Gun.Hill.Road.2011.LIMITED.DVDRip.XviD-GECKOS yEnc\n\t\tif (preg_match('/^REQ:.+\".+\".+\\(\\d+\\/\\d+\\) \".+\" - \\d+[,.]\\d+ [MGK]B - (.+) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(T.U.F The real thing I Frankenstein 2014 NL Subs T.U.F) [01/52] - \"I Frankenstein 2014 NL Subs.par2\" yEnc\n\t\tif (preg_match('/^\\(T\\.U\\.F The real thing (.+?) T\\.U\\.F\\)/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //(Ringside.The.Best.of.Mike.Tyson.DVDRip.x264.AC3-FCZ)[01/68] - \"Ringside.The.Best.of.Mike.Tyson.DVDRip.1.of.2.x264.AC3-FCZ.nfo\" yEnc\n\t\tif (preg_match('/^\\(([\\w.-]+)\\)\\[\\d+\\/(\\d+\\])[-_\\s]{0,3}\".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "public function cd_lossless()\n\t{\n\t\t////Flac Flood Modern Talking - America - \"1 - Modern Talking - Win The Race.flac\" (01/18) (29,12 MB) 549,35 MB yEnc\n\t\tif (preg_match('/^Flac Flood( -)? (.+?) - \".+?\" \\(\\d+\\/\\d+\\) .+? yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//Cannonball Adderley - Nippon Soul [01/17] \"00 - Cannonball Adderley - Nippon Soul.nfo\" yEnc\n\t\t//Black Tie White Noise [01/24] - \"00 - David Bowie - Black Tie White Noise.nfo\" yEnc\n\t\tif (preg_match('/^([a-zA-Z0-9].+?) \\[\\d+\\/\\d+\\]( -)? \"\\d{2,} - .+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//The Allman Brothers Band - Statesboro Blues [Swingin' Pig - Bootleg] [1970 April 4] - File 09 of 19: Statesboro Blues.cue yEnc\n\t\t//[1977] Joan Armatrading - Show Some Emotion - File 15 of 20: 06 Joan Armatrading - Opportunity.flac yEnc\n\t\tif (preg_match('/^((\\[\\d{4}\\] )?[a-zA-Z0-9].+?) - File \\d+ of \\d+: .+? yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //The Allman Brothers Band - The Fillmore Concerts [1971] - 06 The Allman Brothers Band - Done Somebody Wrong.flac yEnc\n\t\tif (preg_match('/^([A-Z0-9].+? - [A-Z0-9].+? \\[\\d{4}\\]) - \\d{2,} .+? yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //The Velvet Underground - Peel Slow And See (Box Set) Disc 5 of 5 - 13 The Velvet Underground - Oh Gin.flac yEnc\n\t\tif (preg_match('/^([A-Z0-9].+? - [A-Z0-9].+? Disc \\d+ of \\d+) - [A-Z0-9].+?\\..+? yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(28/55) \"Ivan Neville - If My Ancestors Could See Me Now.par2\" - 624,44 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' - \\d+[,.]\\d+ [mMkKgG][bB] - yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "public function etc()\n\t{\n\t\tif (preg_match('/^\\[scnzbefnet\\] (.+?) \\[\\d+\\/(\\d+\\]) - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //..:[DoAsYouLike]:.. 116,12 MB \"Graphite v8.9.17 SP4R4.nfo\" 3,00 kB yEnc\n\t\tif (preg_match('/^.+\\[DoAsYouLike\\].+\\d+[.,]\\d+ [kKmMgG][bB].+\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' (\\d+[.,])?\\d+ ([kKmMgG])?[bB][-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(047/550) \"Enf.S02E02.G.D.D.W.7.H.x2-e.vol105+99.PAR2\" - 36,13 GB -Enf.S02.G.D.D.W.7.H.x2-e yEnc\n\t\t//[3/3] - \"Mayle Peter - Der Coup von Marseille.epub.vol0+1.par2\" - 956,83 kB {UR} yEnc\n\t\tif (preg_match('/^[\\(\\[]\\d+\\/\\d+[\\)\\]][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '.+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<<<Old but Sold>>> <<< >< >< \"German Top 50 ODC - 12.08.2013.nfo\" >< 02/33 (541,61 MB) >< 10,93 kB > yEnc\n\t\tif (preg_match('/^.+Old but Sold.+>< \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' >< \\d+\\/\\d+ \\(\\d+[.,]\\d+ [kKmMgG][bB]\\).+ yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<<<THOR for Usenet-Space-Cowboys>>> - 1Password V1.0.9.236 Setup Key.PAR2 yEnc\n\t\tif (preg_match('/^.+Usenet-Space-Cowboys.+> - ([A-Z0-9][a-zA-Z0-9\\. ]{6,})([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4}).+ yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //704900999555666777123978 - [398/415] - \"Jormungand Complete [720p] mHD.part31.rar\" yEnc\n\t\tif (preg_match('/^\\d+[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Man.Of.Steel.2013.BRRip.x264.AC3-UNiQUE - [02/38] - \"Man.Of.Steel.2013.BRRip.x264.AC3-UNiQUE.part01.rar\" yEnc\n\t\tif (preg_match('/^[\\w. -]+[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w.()-]{8,}?\\b)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<<<< old but sold >>>> < USC> <\"K11 - Kommissare im Einsatz (DE) NDS.part3.rar\">[04/11] 74,54 MB yEnc\n\t\tif (preg_match('/^.+old but sold.+([\\w. ()-]{8,}?\\b)' . $this->e0 .\n\t\t\t\t\t '>\\[\\d+\\/\\d+\\][-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Uploader.Presents-ACDC.Let.There.Be.Rock.1980.720p.BluRay.DD5.1.x264-DON(00/47]\"rock.ac3.720p.nzb\" yEnc\n\t\tif (preg_match('/^Uploader\\.Presents-([\\w. ()-]{8,}?\\b)[\\(\\[]\\d+\\/\\d+\\]\".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Bitsum.Technologies.Process.Lasso.Pro.v6.5.00.Cracked-EAT - [3/4] - \"eat.vol0+1.par2\" yEnc\n\t\tif (preg_match('/^([\\w.()-]{8,})[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<<<usenet-space-cowboys.info>>> USC <<<Powered by https://secretusenet.com><Medieval Wii Pal>< \"Medieval Wii Pal.vol108+29.par2\" >< 60/60 (4,82 GB) >< 95,77 MB > yEnc\n\t\tif (preg_match('/^.+?usenet-space.+?Powered by.+? \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '.+? \\d+\\/(\\d+.+?)$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Uploader.Presents-ACDC.Let.There.Be.Rock.1980.720p.BluRay.DD5.1.x264-DON(00/47]\"rock.ac3.720p.nzb\" yEnc\n\t\tif (preg_match('/^Uploader\\.Presents-([\\w. ()-]{8,}?\\b)[\\(\\[]\\d+\\/\\d+\\]\".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Bitsum.Technologies.Process.Lasso.Pro.v6.5.00.Cracked-EAT - [3/4] - \"eat.vol0+1.par2\" yEnc\n\t\tif (preg_match('/^([\\w.()-]{8,})[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<<<usenet-space-cowboys.info>>> USC <<<Powered by https://secretusenet.com><Medieval Wii Pal>< \"Medieval Wii Pal.vol108+29.par2\" >< 60/60 (4,82 GB) >< 95,77 MB > yEnc\n\t\tif (preg_match('/^.+?usenet-space.+?Powered by.+? ([\\w. ()-]{8,}?\\b)' . $this->e0 .\n\t\t\t\t\t '.+? \\d+\\/(\\d+.+?)$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //W33d5.S01.720p.BluRay.x264 - \"W33d5.S01.720p.BluRay.x264.part63.rar\" yEnc\n\t\tif (preg_match('/^[\\w. -]+[-_\\s]{0,3}\"([\\w.()-]{8,}?\\b)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Man.Of.Steel.2013.BRRip.x264.AC3-UNiQUE - [02/38] - \"Man.Of.Steel.2013.BRRip.x264.AC3-UNiQUE.part01.rar\" yEnc\n\t\tif (preg_match('/^[\\w. -]+[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w.()-]{8,}?\\b)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //>GOU<< XUS Clock Plus v1.5.0 with Key [TorDigger].PAR2 >>www.SSL-News.info< yEnc\n\t\tif (preg_match('/^>GOU<< ([\\w.\\[\\]() -]{8,}?\\b)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rarr|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4}).+www\\.SSL-News\\.info<[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Man.Of.Steel.2013.BRRip.x264.AC3-UNiQUE - [02/38] - \"Man.Of.Steel.2013.BRRip.x264.AC3-UNiQUE.part01.rar\" yEnc\n\t\tif (preg_match('/^[\\w. -]+[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w.()-]{8,}?\\b)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //>GOU<< XUS Clock Plus v1.5.0 with Key [TorDigger].PAR2 >>www.SSL-News.info< yEnc\n\t\tif (preg_match('/^>GOU<< ([\\w.\\[\\]() -]{8,}?\\b)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rarr|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4}).+www\\.SSL-News\\.info<[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"Drains_READNFO-VACE.nfo\" yEnc\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "public function e_book_flood()\n\t{\n\t\tif (preg_match('/^New eBooks.+[ _-]{0,3}(\"|#34;)(.+?.+)\\.(par|vol|rar|nfo).*?(\"|#34;)/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//World War II History - \"Spies of the Balkans - Alan Furst.mobi\" yEnc\n\t\t//True Crime \"T. J. English - Havana Nocturne (v5.0).mobi\" yEnc\n\t\t//E C Tubb Flood - \"E C Tubb - Dumarest 31 The Temple of Truth.epub\" - yEnc\n\t\tif (preg_match('/^[A-Za-z ]+[-_\\s]{0,3}\"(.+?)\\.(txt|pdf|mobi|epub|azw)\"[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //SFF Dump - \"Thomas M. Disch - Camp Concentration.epub\" (1033/1217) - 226.47 kB - yEnc\n\t\tif (preg_match('/^SFF Dump - \"(.+?)\\.(txt|pdf|mobi|epub|azw)\" \\(\\d+\\/\\d+\\) - \\d+[.,]\\d+ [kKmMgG][bB] - yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(American Curves - Summer 2012) [01/10] - \"AMECURSUM12.par2\" yEnc\n\t\tif (preg_match('/^\\(([a-zA-Z0-9 -]+)\\) \\[\\d+\\/(\\d+\\]) - \".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Patterson flood - Mobi - 15/45 \"James Patterson - AC 13 - Double Cross.mobi\"\n\t\tif (preg_match('/(.+?)[-_\\s]{0,3}\\d+\\/(\\d+[-_\\s]{0,3}\".+?)\\.(txt|pdf|mobi|epub|azw)\"( \\(\\d+\\/\\d+\\))?( )?$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//Re: REQ: Jay Lake's Mainspring series/trilogy (see titles inside) - \"Lake, Jay - Clockwork Earth 03 - Pinion [epub].rar\" 405.6 kBytes yEnc\n\t\t//Attn: Brownian - \"del Rey, Maria - Paradise Bay (FBS).rar\" yEnc\n\t\t//New Scan \"Herbert, James - Sepulchre (html).rar\" yEnc\n\t\tif (preg_match('/^(Attn:|Re: REQ:|New Scan).+?[-_\\s]{0,3}\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")[-_\\s]{0,3}(\\d+[.,]\\d+ [kKmMgG][bB](ytes)?)? yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//\"Gabaldon, Diana - Outlander [5] The Fiery Cross.epub\" yEnc\n\t\t//Kiny Friedman \"Friedman, Kinky - Prisoner of Vandam Street_ A Novel, The.epub\" yEnc\n\t\tif (preg_match('/.*\"(.+?)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[001/125] (NL Epub Wierook Set 49) - \"Abulhawa, Susan - Litteken van David_Ochtend in Jenin.epub\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\] .+? - \"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\") yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/1) \"Radiological Imaging of the Kidney - E. Quaia (Springer, 2011) WW.pdf\" - 162,82 MB - (Radiological Imaging of the Kidney - E. Quaia (Springer, 2011) WW) yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/7) \"0865779767.epub\" - 88,93 MB - \"Anatomic Basis of Neurologic Diagnosis - epub\" yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \".+(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")([-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB])?[-_\\s]{0,3}\"(.+?)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[4];\n\t\t}\n\t\t//Re: REQ: Jay Lake's Mainspring series/trilogy (see titles inside) - \"Lake, Jay - Clockwork Earth 03 - Pinion [epub].rar\" 405.6 kBytes yEnc\n\t\t//Attn: Brownian - \"del Rey, Maria - Paradise Bay (FBS).rar\" yEnc\n\t\t//New Scan \"Herbert, James - Sepulchre (html).rar\" yEnc\n\t\tif (preg_match('/^(Attn:|Re: REQ:|New Scan).+?[-_\\s]{0,3}\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")[-_\\s]{0,3}(\\d+[.,]\\d+ [kKmMgG][bB](ytes)?)? yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//*FULL REPOST* New eBooks 26 Nov 2012 & 20% PAR2 Set - \"Elisabeth Kyle - The Captain's House (siPDF).rar\"\n\t\t//*REPOST* New eBooks 23 Nov 2012 - \"Charles Culver - [The 11th Floor 02] - Awakening (mobi).rar\"\n\t\tif (preg_match('/^\\*(FULL )?REPOST\\* New eBooks.+[-_\\s]{0,3}\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\")$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//1 - 5 July 2013 - Search for number at end of title - Bevin Alexander - How Hitler Could Have Won World War II- The Fatal Errors That Lead to Nazi Defeat (epub).rar - 14418-25255-6053.rar.txt yEnc\n\t\t//10 July 2013 - Search 4 Numeric String at End of Subject - Andew Hodges - Alan Turing- The Enigma (Centenary Edition) (kf8 mobi).rar = 21317-25234-21710.rar.txt yEnc\n\t\tif (preg_match('/^.+?Search (for|4) (number|Numeric String) at end of (title|Subject)[-_\\s]{0,3}(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4})[-\\=_ ]{0,3}\\d+[-_\\s]{0,3}.+?yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[4];\n\t\t} //\"Back to Pakistan_ A Fifty-Year Journey - Leslie Noyes Mass.pdf\" 2778K\n\t\tif (preg_match('/^\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\")[-_\\s]{0,3}\\d+[kKmMgG]$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//[002/182] A. E. Van Vogt - The Anarchistic Colossus.mobi mobi flood\n\t\t//[002/115] Alan Dean Foster - Alien.mobi sf single author flood\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}(.+)\\.(txt|pdf|mobi|epub|azw)[-_\\s]{0,3}.+flood( )?$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[2/4] Graham Masterton - Descendant.mobi\n\t\tif (preg_match('/^\\[\\d+\\/(\\d+\\]) (.+?)\\.(txt|pdf|mobi|epub|azw)/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//14. Alexander Kent - [Bolitho 12] - Signal Close Action (v2.0) (epub).epubAs Req Alexander Kent yEnc\n\t\t//22.The Darkening Sea - Alexander Kent.epubAs Req Alexander Kent yEnc\n\t\tif (preg_match('/^\\d+\\. {0,1}(.+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})As Req.+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //reposting 2012-10-31 new ebooks with 35.74 pars - AD&D - [Tomes] - The Rod of Seven Parts - Douglas Niles (mobi).rar yEnc\n\t\tif (preg_match('/^reposting \\d+-\\d+-\\d+ new ebooks.+ pars[-_\\s]{0,3}(.+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4}) yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //15 - Men at Arms.pdf yEnc\n\t\tif (preg_match('/^\\d+ - (.+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4}) yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//Filling Req for Delderfield- To Serve Them All My Days - R F Delderfield.mobi [6/6] - yEnc\n\t\t//Filling Request - Armistead Maupin - 1 - Tales of the City.mobi [1/8] - yEnc\n\t\tif (preg_match('/^Filling Req(uest)?( for \\w+)?[-_\\s]{0,3}(.+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4}) \\[\\d+\\/\\d+\\] - yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[3];\n\t\t} //ATTN:Fozz E Bear Rogue - Danielle Steel.epub yEnc\n\t\tif (preg_match('/^ATTN:Fozz E Bear (.+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4}) yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //As Requested - Silent Spring - Rachel Carson.epub [1/2] - yEnc\n\t\tif (preg_match('/^As Requested - (.+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4}) \\[\\d+\\/\\d+\\] - yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Attn: fastpiety - your requests - Countess of Carnarvon - Lady Almina and the Real Downton Abbey- The Lost Legacy of Highclere Castle (epub).epub [1/1] - yEnc\n\t\tif (preg_match('/^Attn: fastpiety - your requests[-_\\s]{0,3}(.+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4}) \\[\\d+\\/\\d+\\] - yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Amanda Ashley - [Night 02] - Night's Touch (v5.0) (epub).epub yEnc\n\t\tif (preg_match('/^(.+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4}) yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //A Game of Thrones 01- George R. R. Martin.mobi_as found yEnc\n\t\tif (preg_match('/^([^.]{8,})\\.[A-Za-z0-9]{2,4}_as found[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Ben Carson - America the Beautiful- Rediscovering What Made This Nation Great (epub).epub - File 1 of 1 - yEnc\n\t\tif (preg_match('/^([^.]{8,})\\.[A-Za-z0-9]{2,4}[-_\\s]{0,3}File \\d+ of \\d+[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Re: Attn Reg143- (Morse 7) The Secret of Annexe 3 - Colin Dexter.mobi [11/14] - yEnc\n\t\tif (preg_match('/^Re: Attn Reg143- ([^.]{8,})\\.[A-Za-z0-9]{2,4}[-_\\s]{0,3}\\[\\d+\\/\\d+\\][- ]{0,4}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //New eBooks 20 Aug 2012 - File 001 of 409 - yEnc\n\t\tif (preg_match('/^([\\w.,& ()\\[\\]\\'\\`-]{8,}?)[-_\\s]{0,3}File \\d+ of \\d+[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Re: Request - 05 L. E. Modesitt - Princeps.mobi [5/7] - yEnc\n\t\tif (preg_match('/^Re: Request[- ]{0,4}\\d+[-_\\s]{0,3}([^.]{8,})([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}\\[\\d+\\/\\d+\\][- ]{0,4}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(Bighathi) [4/4] - \"Letters to Penthouse XXiLetters to Penthouse XXI - The Editors of Penthouse Magazine.epub\" yEnc\n\t\tif (preg_match('/^\\(.+\\)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //(HUMAN BIO & MED 207) [02/39] - \"Organic Chemistry 6th ed - L. Wade {SOLUTIONS MANUAL - J. Simek] (Pearson, 2006) WW.pdf\" *REPOST* yEnc\n\t\tif (preg_match('/^\\(.+\\)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 . '.+REPOST.+[-_\\s]{0,3}yEnc$/ui', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //01 - The Colour of Magic.pdf yEnc\n\t\tif (preg_match('/^\\d+[-_\\s]{0,3}([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}-]{8,}?\\b.?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/ui', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //(Esperanto novel) - H.A. Luyken - Pro ICtar.epub yEnc\n\t\tif (preg_match('/^\\(.+\\)[-_\\s]{0,3}([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}-]{8,}?\\b.?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/ui', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //All I have - not checked John D MacDonald - April Evil.epub yEnc\n\t\tif (preg_match('/^All I have - not checked[-_\\s]{0,3}([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}-]{8,}?\\b.?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/ui', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //As req \"Aftermath - Peter Robinson.mobi\" yEnc Peter Robinson - Inspector Banks 12\n\t\tif (preg_match('/^As req[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 . '[-_\\s]{0,3}yEnc.+$/ui', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //As req \"Aftermath - Peter Robinson.mobi\" yEnc Peter Robinson - Inspector Banks 12\n\t\tif (preg_match('/^Attn.+\\[\\d+-\\d+\\][-_\\s]{0,3}([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}-]{8,}?\\b.?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/ui', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //ATTN: Robert A. Ely - Wilde, Lori - Zero Control [html].rar yEnc\n\t\tif (preg_match('/^Attn:[-_\\s]{0,3}([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}-]{8,}?\\b.?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/ui', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //ATTN: Drake@Darkest air.com - Kurtz, Katherine - Heirs of Saint Camber 03 - The Bastard Prince [txt].zip yEnc\n\t\tif (preg_match('/^Attn:.+\\.com[-_\\s]{0,3}([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}-]{8,}?\\b.?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/ui', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //reposting 2012-10-27 new ebooks with 35.74 pars - M William Phelps - Sleep In Heavenly Peace (mobi).rar yEnc\n\t\tif (preg_match('/^reposting.+pars[-_\\s]{0,3}([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}-]{8,}?\\b.?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/ui', $this->subject, $match)) {\n\t\t\treturn $match[1];} //A Tradition of Victory - Alexander Kent.epub yEnc\n\t\tif (preg_match('/^([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}-]{8,}?\\b.?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/ui', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//\"Gabaldon, Diana - Outlander [5] The Fiery Cross.epub\" yEnc\n\t\t//Kiny Friedman \"Friedman, Kinky - Prisoner of Vandam Street_ A Novel, The.epub\" yEnc\n\t\tif (preg_match('/.*\"(.+?)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t$this->subject,\n\t\t\t$match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "public function disabled_test_parse_grade_replace_message() {\n $message = '\n <imsx_POXEnvelopeRequest xmlns = \"http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0\">\n <imsx_POXHeader>\n <imsx_POXRequestHeaderInfo>\n <imsx_version>V1.0</imsx_version>\n <imsx_messageIdentifier>999998123</imsx_messageIdentifier>\n </imsx_POXRequestHeaderInfo>\n </imsx_POXHeader>\n <imsx_POXBody>\n <replaceResultRequest>\n <resultRecord>\n <sourcedGUID>\n <sourcedId>' .\n '{&quot;data&quot;:{&quot;instanceid&quot;:&quot;2&quot;,&quot;userid&quot;:&quot;2&quot;},&quot;hash&quot;:' .\n '&quot;0b5078feab59b9938c333ceaae21d8e003a7b295e43cdf55338445254421076b&quot;}' .\n '</sourcedId>\n </sourcedGUID>\n <result>\n <resultScore>\n <language>en-us</language>\n <textString>0.92</textString>\n </resultScore>\n </result>\n </resultRecord>\n </replaceResultRequest>\n </imsx_POXBody>\n </imsx_POXEnvelopeRequest>\n';\n\n $parsed = lti_parse_grade_replace_message(new SimpleXMLElement($message));\n\n $this->assertEquals($parsed->userid, '2');\n $this->assertEquals($parsed->instanceid, '2');\n $this->assertEquals($parsed->sourcedidhash, '0b5078feab59b9938c333ceaae21d8e003a7b295e43cdf55338445254421076b');\n\n $ltiinstance = (object)array('servicesalt' => '4e5fcc06de1d58.44963230');\n\n lti_verify_sourcedid($ltiinstance, $parsed);\n }", "function yy_r4(){ $this->_retvalue = ''; }", "function yy_r74(){ $this->_retvalue = 'OUTER'; }", "function verifyRegEx(){\n parent::doExpandAdvanceSection();\n $this->type(TEXT_EDITOR, \"\");\n $this->click(LINK_SEARCH);\n $this->type(TEXT_EDITOR, (TEXT_SAMPLE_REGEX));\n $this->type(INPUT_SEARCH, (TEXT_SEARCH_REGEX));\n $this->type(INPUT_REPLACE, (TEXT_REPLACE_REGEX));\n $this->click(CHK_REGEX);\n $this->click(BUTTON_REPLACEALL);\n $this->click(BUTTON_CANCEL);\n $this->click(BUTTON_PREVIEW);\n $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));\n try {\n $this->assertEquals((TEXT_REGEX_PREVIEW), $this->getText(TEXT_PREVIEW_TEXT1));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n try {\n $this->assertEquals((TEXT_REGEX_PREVIEW), $this->getText(TEXT_PREVIEW_TEXT2));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n try {\n $this->assertEquals((TEXT_REGEX_PREVIEW), $this->getText(TEXT_PREVIEW_TEXT3));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n }", "public function getRawMatches()\n {\n return $this->rawMatches;\n }", "function do_assertions($matchername, $regex, $str, $obtained, $ismatchpassed, $fullpassed, $indexfirstpassed, $indexlastpassed, $nextpassed, $leftpassed, $assertionstrue = false) {\n $this->assertTrue($assertionstrue || $ismatchpassed, \"$matchername failed 'is_match' check on regex '$regex' and string '$str'\");\n if (!$ismatchpassed) {\n echo 'obtained result ' . $obtained['is_match'] . ' for \\'is_match\\' is incorrect<br/>';\n }\n $this->assertTrue($assertionstrue || $fullpassed, \"$matchername failed 'full' check on regex '$regex' and string '$str'\");\n if (!$fullpassed) {\n echo 'obtained result ' . $obtained['full'] . ' for \\'full\\' is incorrect<br/>';\n }\n if (array_key_exists('index_first', $obtained)) {\n $this->assertTrue($assertionstrue || $indexfirstpassed, \"$matchername failed 'index_first' check on regex '$regex' and string '$str'\");\n if (!$indexfirstpassed) {\n echo 'obtained result '; print_r($obtained['index_first']); echo ' for \\'index_first\\' is incorrect<br/>';\n }\n }\n if (array_key_exists('index_last', $obtained)) {\n $this->assertTrue($assertionstrue || $indexlastpassed, \"$matchername failed 'index_last' check on regex '$regex' and string '$str'\");\n if (!$indexlastpassed) {\n echo 'obtained result '; print_r($obtained['index_last']); echo ' for \\'index_last\\' is incorrect<br/>';\n }\n }\n if (array_key_exists('next', $obtained)) {\n $this->assertTrue($assertionstrue || $nextpassed, \"$matchername failed 'next' check on regex '$regex' and string '$str'\");\n if (!$nextpassed) {\n echo 'obtained result \\'' . $obtained['next'] . '\\' for \\'next\\' is incorrect<br/>';\n }\n }\n if (array_key_exists('left', $obtained)) {\n $this->assertTrue($assertionstrue || $leftpassed, \"$matchername failed 'left' check on regex '$regex' and string '$str'\");\n if (!$leftpassed) {\n echo 'obtained result \\'' . $obtained['left'] . '\\' for \\'left\\' is incorrect<br/>';\n }\n }\n }", "protected function remove_iunreserved_percent_encoded($match)\n {\n }", "public function testParseWithTwoTokensWithLookaheadRemoval(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([Grammar::T_I, Grammar::T_X, Grammar::T_I, Grammar::T_X]);\n }" ]
[ "0.5711836", "0.5265807", "0.5207734", "0.50305563", "0.50183773", "0.50049865", "0.49946687", "0.49930918", "0.49823987", "0.49759617", "0.49592847", "0.49541044", "0.493959", "0.49275696", "0.49258554", "0.49193656", "0.49104398", "0.48937345", "0.48811996", "0.4877627", "0.48752758", "0.47967952", "0.47784337", "0.47725028", "0.4762282", "0.47537264", "0.4753138", "0.47487932", "0.4743024", "0.47204885" ]
0.6100062
0
/ |========================================================== | Return offensive methods |========================================================== |
public function getOffensiveMethods() { $queryString="SELECT * FROM corruption_offensive_methods ORDER BY value ASC"; $query = $this->db->query($queryString); $result=$query->result_array(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getdefensiveMethods()\n {\n $queryString=\"SELECT *\n FROM corruption_defensive_methods\n ORDER BY value ASC\";\n $query = $this->db->query($queryString);\n $result=$query->result_array();\n\n return $result;\n }", "function method_no_specs() {}", "public function action_methods()\n\t{\n\t\t$this->runTest('gcc', 100000, 'get_called_class every time');\n\t\t$this->runTest('gcc_cached', 100000, 'caching get_called_class');\n\t}", "public function methods();", "#[Pure]\n public function getMethod() {}", "public function getActiveMethods();", "private function private_method() {}", "public function getMethods();", "public function getMethods();", "public function getMethods();", "public function getMethods(): array;", "public function getMethods(): array;", "public function testCoverAllMethods();", "#[Pure]\n public function getMethod(): string {}", "abstract public function provideFunctors();", "#[Pure]\n public function getRequestMethod() {}", "private function method1()\n\t{\n\t}", "public function getMethods($class);", "public function __invoke();", "public function __invoke();", "public function __invoke();", "public function __invoke();", "static function getmethods() {\n $a_methods = call_user_func(array('PluginFusioninventoryStaticmisc', 'task_methods'));\n $a_modules = PluginFusioninventoryModule::getAll();\n foreach ($a_modules as $data) {\n if (is_callable(array('Plugin'.ucfirst($data['directory']).'Staticmisc', 'task_methods'))) {\n $a_methods = array_merge($a_methods, \n call_user_func(array('Plugin'.ucfirst($data['directory']).'Staticmisc', 'task_methods')));\n }\n }\n return $a_methods;\n }", "protected static function __getTypeHintAbleMethods()\n {\n return [];\n }", "abstract protected function getDirectGetters();", "public function none(){\n return call_user_func_array($this->fetchStaticClassName() . '::' . __FUNCTION__, func_get_args());\n }", "abstract public function __invoke(): void;", "public function getMethods()\n {\n // it returns all methods from all parent objects, and I only want\n // this to return the methods from this object only.\n return array(\n 'shouldBeCalled',\n 'getMIMEType',\n 'getTitle',\n 'getSize',\n 'getDescription',\n 'getLastModified',\n 'getCreated',\n 'hasChildren',\n 'getDirectories',\n 'getFiles',\n 'rename',\n 'delete',\n 'getAllChildren',\n 'move',\n 'newDirectory'\n );\n }", "abstract protected function doEvil();", "public static function getDisabledMethods()\n {\n return array();\n }" ]
[ "0.6478334", "0.6436764", "0.638438", "0.62645423", "0.6147758", "0.6054092", "0.5827823", "0.58267117", "0.58267117", "0.58267117", "0.5728935", "0.5728935", "0.57219756", "0.5689669", "0.56495726", "0.5642633", "0.5625845", "0.5614534", "0.56105614", "0.56105614", "0.56105614", "0.56105614", "0.5574586", "0.5571325", "0.5550139", "0.55485207", "0.55453", "0.55452853", "0.5532894", "0.55222553" ]
0.6766701
0
/ |========================================================== | Return defensive methods |========================================================== |
public function getdefensiveMethods() { $queryString="SELECT * FROM corruption_defensive_methods ORDER BY value ASC"; $query = $this->db->query($queryString); $result=$query->result_array(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function method_no_specs() {}", "public function getOffensiveMethods()\n {\n $queryString=\"SELECT *\n FROM corruption_offensive_methods\n ORDER BY value ASC\";\n $query = $this->db->query($queryString);\n $result=$query->result_array();\n\n return $result;\n }", "public function action_methods()\n\t{\n\t\t$this->runTest('gcc', 100000, 'get_called_class every time');\n\t\t$this->runTest('gcc_cached', 100000, 'caching get_called_class');\n\t}", "public function none(){\n return call_user_func_array($this->fetchStaticClassName() . '::' . __FUNCTION__, func_get_args());\n }", "public function methods();", "public static function getDisabledMethods()\n {\n return array();\n }", "abstract protected function doEvil();", "#[Pure]\n public function getMethod() {}", "private function private_method() {}", "protected function checkDisableFunctions() {}", "protected static function __getTypeHintAbleMethods()\n {\n return [];\n }", "function isExpensive() {\n\t\treturn true;\n\t}", "public function getActiveMethods();", "public function avoidMethod(string $method): bool {}", "abstract protected function _unimplemented() : Exception;", "abstract protected function _unimplemented() : Exception;", "abstract protected function _unimplemented() : Exception;", "public function optionsUnusedMethods($id = null, $data) { return \"\"; }", "public function optionsUnusedMethods($id = null, $data) { return \"\"; }", "protected function getWarningWhenMethodUnavailable() {}", "public function testCoverAllMethods();", "public function methodsWithoutMagic($classOrObject, $filters = array('public'))\n\t{\n\t\treturn $this->methods($classOrObject, $filters, $this->magicMethods);\n\t}", "abstract public function provideFunctors();", "public function getMethods();", "public function getMethods();", "public function getMethods();", "private function _callToDefault()\n {\n foreach (get_class_methods($this) as $method) {\n try {\n $that = new ReflectionMethod($this, $method);\n } catch (ReflectionException $exception) {\n break;\n }\n if (\n $that->isProtected()\n && !array_key_exists($method, $this->query())\n ) {\n $this->{$method}($this->builder);\n }\n }\n }", "static function getmethods() {\n $a_methods = call_user_func(array('PluginFusioninventoryStaticmisc', 'task_methods'));\n $a_modules = PluginFusioninventoryModule::getAll();\n foreach ($a_modules as $data) {\n if (is_callable(array('Plugin'.ucfirst($data['directory']).'Staticmisc', 'task_methods'))) {\n $a_methods = array_merge($a_methods, \n call_user_func(array('Plugin'.ucfirst($data['directory']).'Staticmisc', 'task_methods')));\n }\n }\n return $a_methods;\n }", "private function method1()\n\t{\n\t}", "public function getDynamicMethods()\n {\n return [];\n }" ]
[ "0.6971257", "0.66801876", "0.6151427", "0.59392697", "0.59383243", "0.58445126", "0.57827723", "0.5713528", "0.5693863", "0.56596094", "0.5632309", "0.5613476", "0.55612034", "0.5524399", "0.5521699", "0.5521699", "0.5521699", "0.5495727", "0.5495727", "0.5479577", "0.547834", "0.54505336", "0.54213357", "0.5416156", "0.5416156", "0.5416156", "0.540812", "0.5402539", "0.5356702", "0.5346902" ]
0.7193832
0
/ |========================================================== | Get defensive method infos
public function getDefensiveMethodInfos($defensiveMethodId) { $queryString="SELECT * FROM corruption_defensive_methods WHERE corruption_defensive_id=$defensiveMethodId"; $query = $this->db->query($queryString); $result=$query->result_array(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getdefensiveMethods()\n {\n $queryString=\"SELECT *\n FROM corruption_defensive_methods\n ORDER BY value ASC\";\n $query = $this->db->query($queryString);\n $result=$query->result_array();\n\n return $result;\n }", "public function getOffensiveMethods()\n {\n $queryString=\"SELECT *\n FROM corruption_offensive_methods\n ORDER BY value ASC\";\n $query = $this->db->query($queryString);\n $result=$query->result_array();\n\n return $result;\n }", "public function action_methods()\n\t{\n\t\t$this->runTest('gcc', 100000, 'get_called_class every time');\n\t\t$this->runTest('gcc_cached', 100000, 'caching get_called_class');\n\t}", "public function getInfo() {}", "public function getInfo() {}", "abstract public function infoAll();", "function getInfo();", "public function getInfo();", "protected function collectInformation() {}", "abstract public function information();", "public function getMoreInfo( $method )\n\t{\n\t\treturn NULL;\n\t}", "protected function info()\n\t\t{\n\t\t}", "public function getInformation();", "public function getOffensiveMethodInfos($offensiveMethodId)\n {\n $queryString=\"SELECT *\n FROM corruption_offensive_methods\n WHERE corruption_offensive_id=$offensiveMethodId\";\n $query = $this->db->query($queryString);\n $result=$query->result_array();\n\n return $result;\n }", "public function optionsUnusedMethods($id = null, $data) { return \"\"; }", "public function optionsUnusedMethods($id = null, $data) { return \"\"; }", "public function getInfo()\r\n {\r\n return $this->setNuki(\r\n __FUNCTION__\r\n );\r\n }", "public function getMethodDescriptors(): array;", "function InfoTips()\n\t{\n\t\treturn $this->infotips;\n\t}", "function method_no_specs() {}", "public function info();", "public function info();", "public function getUsage() {\n\t\t// this function is not yet used.\n\t}", "public function getInfo()\n\t{\n\t\treturn array();\n\t}", "public function getInfo()\n {\n return $this->addAction(Flag::getInfo());\n }", "function getMethodsHead()\n {\n\n }", "public function info()\n {\n $info = [\n 'id' => $this->id,\n 'action' => $this->action,\n 'condition' => $this->condition,\n 'expressions' => $this->expressions,\n 'logMessageFormat' => $this->logMessageFormat,\n 'logLevel' => $this->logLevel,\n 'isFinalState' => $this->isFinalState,\n 'createTime' => $this->createTime,\n 'finalTime' => $this->finalTime,\n 'stackFrames' => array_map(function ($sf) {\n return $sf->info();\n }, $this->stackFrames),\n 'evaluatedExpressions' => array_map(function ($exp) {\n return $exp->info();\n }, $this->evaluatedExpressions),\n ];\n if ($this->labels) {\n $info['labels'] = $this->labels;\n }\n if ($this->userEmail) {\n $info['userEmail'] = $this->userEmail;\n }\n if ($this->location) {\n $info['location'] = $this->location->info();\n }\n if ($this->status) {\n $info['status'] = $this->status->info();\n }\n if ($this->variableTable) {\n $info['variableTable'] = $this->variableTable->info();\n }\n return $info;\n }", "function info()\n\t{\n\t\treturn array();\n\t}", "public function info()\n\t{\n\t\treturn false;\n\t}", "protected function getWarningWhenMethodUnavailable() {}" ]
[ "0.6968975", "0.6227429", "0.6033932", "0.5984762", "0.5984762", "0.59702384", "0.59007984", "0.58990455", "0.5833039", "0.5829695", "0.5817807", "0.5805676", "0.5788936", "0.5757169", "0.57430214", "0.57430214", "0.57304573", "0.57050633", "0.56663346", "0.5654523", "0.5620288", "0.5620288", "0.5618546", "0.5609704", "0.56026256", "0.55891013", "0.55720335", "0.55652344", "0.55307025", "0.5514744" ]
0.6665586
1
/ |========================================================== | update team secondary potential |========================================================== |
public function increaseTeamSecondaryPotential($potential,$teamId,$action) { switch($action){ case "ATT"; $queryString="UPDATE teams SET secondary_experience_att=secondary_experience_att+$potential WHERE team_id=$teamId"; break; case "MIL"; $queryString="UPDATE teams SET secondary_experience_mil=secondary_experience_mil+$potential WHERE team_id=$teamId"; break; case "DEF"; $queryString="UPDATE teams SET secondary_experience_def=secondary_experience_def+$potential WHERE team_id=$teamId"; break; case "GB"; $queryString="UPDATE teams SET secondary_experience_gb=secondary_experience_gb+$potential WHERE team_id=$teamId"; break; } $query = $this->db->query($queryString); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateTeam($team)\n\t{\n\t}", "public function updateTeamToCertification($team);", "function modify_team($teamname, $teamlead, $status) {\n\n $qUpdate = \"UPDATE authteam SET teamlead='$teamlead', status='$status'\n\n\t\t\t\t\t WHERE teamname='$teamname'\";\n\n $qUserStatus = \"UPDATE authuser SET status='$status' WHERE team='$teamname'\";\n\n\n\n if ($teamname == \"Admin\" AND $status == \"inactive\") {\n\n return \"Admin team cannot be inactivated.\";\n } elseif ($teamname == \"Ungrouped\" AND $status == \"inactive\") {\n\n return \"Ungrouped team cannot be inactivated.\";\n } else {\n\n $link = new mysqli($this->HOST, $this->USERNAME, $this->PASSWORD, $this->DBNAME);\n if ($link->connect_error) {\n die(\"Error al conectarse a la BD $dbname: \" . $mysqli->connect_error);\n }\n\n\n\n // UPDATE STATUS IF STATUS OF TEAM IS INACTIVATED\n // OLD CODE - DO NOT REMOVE\n //$userresult = mysql_db_query($this->DBNAME, $qUserStatus);\n // REVISED CODE\n\n $userresult = $link - query($qUserStatus);\n\n\n\n // OLD CODE - DO NOT REMOVE\n // $result = mysql_db_query($this->DBNAME, $qUpdate);\n // REVISED CODE\n\n $result = $link->query($qUpdate);\n\n\n\n return 1;\n }\n }", "public function update_team_score(){\n\t\tif($this->authenticate_api()){\n\t\t\t\n\t\t\t$response = array( \"status\" => \"error\" );\n\t\t\t$response['message'] = \"Somthing Wrong\";\n $required_fields = array(\"match_id\");\n $status = $this->verifyRequiredParams($required_fields);\n\t\t\t$match_id= $this->request->getVar(\"match_id\");\n\t\t\t\n\t\t\tif($this->ifempty($match_id, \"match id\")!== true){\n $response['message'] = $this->ifempty($match_id, \"match id\");\n $this->sendResponse($response);\n }\n if($this->ifexists('tbl_tournament_match', $match_id, 'id') != true){\n $response['message'] = \"Please enter valid match id\";\n $this->sendResponse($response);\n }\t\t\t\n\t\t\tif($match_id){\t\t\t\t\n\t\t\t\t$match_tournament_team = $this->db->table('tbl_tournament_match')->where('id', $match_id)->get()->getRowArray();\n\t\t\t\tif($match_tournament_team){\n\t\t\t\t\t$team_id = $match_tournament_team['team_id'];\n\t\t\t\t\t$opponent_team_id = $match_tournament_team['opponent_team_id'];\n\t\t\t\t\t$match_end_status = $match_tournament_team['match_end_status'];\n\t\t\t\t\t$match_end_status_for_opponent_team = $match_tournament_team['match_end_status_for_opponent_team'];\n\t\t\t\t\tif($match_end_status == 1 && $match_end_status_for_opponent_team == 1){\n\t\t\t\t\t\t$where_match_team['match_id'] = $team_id;\n\t\t\t\t\t\t$where_match_opponent_team['match_id'] = $opponent_team_id;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$match_team = $this->db->table('tbl_match_team')->where($where_match_team);\n\t\t\t\t\t\t$match_opponent_team = $this->db->table('tbl_match_team')->where($where_match_opponent_team);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$match_team_goal = $this->db->query(\"SELECT SUM(g) as Total_g FROM tbl_match_team where match_id = \".$team_id)->getRowArray();\n\t\t\t\t\t\t$match_opponent_team_goal = $this->db->query(\"SELECT SUM(g) as Total_g FROM tbl_match_team where match_id = \".$opponent_team_id)->getRowArray();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$match_team_goal['Total_g'] = $match_team_goal['Total_g'] ? $match_team_goal['Total_g'] : 0;\n\t\t\t\t\t\t$match_team_goal['Total_g'] = $match_opponent_team_goal['Total_g'] ? $match_opponent_team_goal['Total_g'] : 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($match_team_goal['Total_g'] > $match_opponent_team_goal['Total_g']){\n\t\t\t\t\t\t\t$winner_team_id = $team_id;\n\t\t\t\t\t\t}else if($match_team_goal['Total_g'] < $match_opponent_team_goal['Total_g']){\n\t\t\t\t\t\t\t$winner_team_id = $opponent_team_id;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$winner_team_id = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$tbl_tournament_match_result_data['match_id'] = $match_id; \n\t\t\t\t\t\t$tbl_tournament_match_result_data['team_id_score'] = $match_team_goal['Total_g']; \n\t\t\t\t\t\t$tbl_tournament_match_result_data['opponent_team_id_score'] = $match_opponent_team_goal['Total_g']; \n\t\t\t\t\t\t$tbl_tournament_match_result_data['winner_team_id'] = $winner_team_id;\n\t\t\t\t\t\t$response['status'] = \"success\";\n\t\t\t\t\t\t$table_name = 'tbl_tournament_match_result';\n\t\t\t\t\t\t$id = $match_id;\n\t\t\t\t\t\t$fild_to_check = 'match_id';\n\t\t\t\t\t\tif($this->ifexists($table_name,$id,$fild_to_check)){\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$response['message'] = \"Team score already Added\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$tbl_tournament_match_result = $this->db->table($table_name)->insert($tbl_tournament_match_result_data);\n\t\t\t\t\t\t\tif($tbl_tournament_match_result)\n\t\t\t\t\t\t\t\t$response['message'] = \"Team score Added Successfully\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t$this->sendResponse($response);\t\t\t\n\t\t\t\n\t\t}\n\t}", "public function decreaseTeamSecondaryPotential($potential,$teamId,$action)\n {\n switch($action){\n\n case \"ATT\";\n $queryString=\"UPDATE teams\n SET secondary_experience_att=secondary_experience_att-$potential\n WHERE team_id=$teamId\";\n break;\n\n case \"MIL\";\n $queryString=\"UPDATE teams\n SET secondary_experience_mil=secondary_experience_mil-$potential\n WHERE team_id=$teamId\";\n break;\n\n case \"DEF\";\n $queryString=\"UPDATE teams\n SET secondary_experience_def=secondary_experience_def-$potential\n WHERE team_id=$teamId\";\n break;\n\n case \"GB\";\n $queryString=\"UPDATE teams\n SET secondary_experience_gb=secondary_experience_gb-$potential\n WHERE team_id=$teamId\";\n break;\n\n }\n\n $query = $this->db->query($queryString);\n }", "public function updateTeamToPendingCertification($team);", "public function updateTeamToUnCertification($team);", "public function actionUpdate_team(){ // anoop 21-11-18\n //redirect a user if not super admin\n if (!Yii::$app->CustomComponents->check_permission('assign_team')) {\n return $this->redirect(['site/index']);\n } \n $model = new DvUsersRole(); \n if (Yii::$app->request->post()){\n $user_of_manager = array();\n if (isset($_POST['user_of_manager'])) {\n $user_of_manager = $_POST['user_of_manager'];\n }\n $manager_id = $_POST['manager'];\n $new_manager_id = $_POST['new_manager'];\n // get manager email\n $manager_email = Yii::$app->db->createCommand(\"SELECT email FROM assist_users WHERE id = '$manager_id' AND status = 1 \")->queryAll();\n $manageremail = $manager_email[0]['email'];\n\n if (empty($new_manager_id) || $new_manager_id == 0) {\n Yii::$app->db->createCommand(\"UPDATE assist_user_meta SET meta_value = '' WHERE meta_key = 'team' AND meta_value = '$manager_id' \")->execute();\n Yii::$app->session->setFlash('success', 'The Team for Manager with Email Address <u>' . $manageremail . '</u> is Successfully Removed.');\n } else {\n // get new manager email\n $Nmanager_email = Yii::$app->db->createCommand(\"SELECT email FROM assist_users WHERE id = '$new_manager_id' AND status = 1 \")->queryAll();\n $Nmanageremail = $Nmanager_email[0]['email'];\n if (!empty($user_of_manager)) {\n $user_of_manager_str = implode(\",\", $user_of_manager);\n Yii::$app->db->createCommand(\"UPDATE assist_user_meta SET meta_value = '$new_manager_id' WHERE meta_key = 'team' AND meta_value = '$manager_id' AND uid IN($user_of_manager_str)\")->execute();\n Yii::$app->session->setFlash('success', 'The selected Managers are Successfully assigned to Manger with Email Address <u>' . $Nmanageremail . '</u>');\n } else {\n\n Yii::$app->db->createCommand(\"UPDATE assist_user_meta SET meta_value = '$new_manager_id' WHERE meta_key = 'team' AND meta_value = '$manager_id' \")->execute();\n Yii::$app->session->setFlash('success', 'The Team for Manager with Email Address <u>' . $manageremail . '</u> is Successfully assigned to Manger with Email Address <u>' . $Nmanageremail . '</u>');\n }\n }\n return $this->redirect(['dv-users/assign_team']);\n } else {\n\n return $this->render('assign_team', [ 'model' => $model]);\n }\n }", "function ChangeRiderTeam($oDB, $riderID, $newRacingTeamID, $newCommutingTeamID)\n{\n $oldTeamInfo = GetRiderTeamInfo($oDB, $riderID);\n // build SQL to set new rider teams\n $updateCmds = \"SET CommutingTeamID=$newCommutingTeamID, RacingTeamID=$newRacingTeamID\";\n // remove admin rights when rider changes teams\n if($newRacingTeamID!=$oldTeamInfo['RacingTeamID'])\n {\n $updateCmds .= \", sRacingTeamAdmin=0\";\n }\n if($newCommutingTeamID!=$oldTeamInfo['CommutingTeamID'])\n {\n $updateCmds .= \", sCommutingTeamAdmin=0\";\n }\n // execute the commands to change teams\n $oDB->query(\"UPDATE rider $updateCmds WHERE RiderID=$riderID\");\n if($oDB->errno==0)\n {\n // Copy rider photo to new team if rider does not already have a photo for that team\n $existingPhoto = $oDB->DBCount(\"rider_photos\", \"RiderID=$riderID AND TeamID=$newRacingTeamID\");\n if($newRacingTeamID!=$oldTeamInfo['RacingTeamID'] && $existingPhoto==0)\n {\n $oDB->query(\"INSERT rider_photos (RiderID, TeamID, Picture, ActionPicture, LastModified)\n SELECT $riderID, $newRacingTeamID, Picture, ActionPicture, LastModified\n FROM rider_photos\n WHERE RiderID=$riderID AND TeamID={$oldTeamInfo['RacingTeamID']}\");\n }\n }\n // Build response array\n if($oDB->errno!=0)\n {\n $result['success'] = false;\n $result['message'] = \"[\" . $oDB->errno . \"] SQL Error\";// . $oDB->error;\n // --- needed so Ext returns failureType of 'server' (FYI: could also be used to do server-side field validation)\n $result['errors'][] = array('id' => 'CtrlID', 'msg' => 'Error Msg' );\n }\n else\n {\n $result['success'] = true;\n }\n return($result);\n}", "function wieting_change_one_volunteer_action( $object, $context ) {\n global $user;\n if ( !array_key_exists( 3, $user->roles )) {\n drupal_set_message( t( 'Only a mangaer can change a volunteer assignment!' ));\n return;\n }\n\n static $objects = array( ); // array must be static to persist between rows (calls)\n\n array_push( $objects, $object );\n $count = count( $objects );\n\n /*\n print '<pre>';\n print 'The $object is: ';\n McFate_Dump( $object );\n print 'The $context is: ';\n McFate_Dump( $context );\n print 'Count of $objects is now ' . $count = count( $objects );\n print '</pre>';\n */\n\n // If exactly one performance was selected...proceed.\n\n if ( $count === 1 ) {\n $args = $objects[0]->field_performance_manager[0]['uid'].'/';\n $args .= $objects[0]->field_performance_ticket_seller[0]['uid'].'/';\n for ( $i=0; $i<4; $i++ ) {\n if ( $m = $objects[0]->field_performance_monitors[$i]['uid'] ) { $args .= $m.'/'; }\n if ( $c = $objects[0]->field_performance_concessions[$i]['uid'] ) { $args .= $c.'/'; }\n }\n $path = 'performance_team_vbo/'.$args;\n unset( $objects );\n drupal_goto( $path ); // Invoke the form.\n }\n\n return;\n}", "protected function updateTeamStats()\n {\n $conditions = array('stats.needs_update' => true);\n $fields = array('league_id');\n $teams_needing_update = Teams::all(compact('conditions', 'fields'));\n\n $team_id_list = array();\n $team_stats = array();\n foreach ($teams_needing_update as $team) {\n $team_id_list[] = $team->_id;\n $team_stats[(string)$team->_id] = array(\n 'wins' => 0,\n 'losses' => 0,\n 'point_differential' => 0\n );\n }\n\n // Grab all of the games that apply to these teams, standings should be re-calced from the ground up.\n $conditions = array('teams' => array('$in' => $team_id_list), 'scores' => array('$exists' => true), 'winner' => array('$ne' => null));\n $fields = array('scores', 'winner', 'teams', 'league_id');\n $relevant_games_list = Games::all(compact('conditions', 'fields'));\n\n $league_list = array();\n foreach ($relevant_games_list as $game) {\n // Calculate stats for each team\n foreach ($game->getTeams() as $t) {\n $team_id = (string)$t->_id;\n if (!isset($team_stats[$team_id])) {\n // If we didn't pull all of this team's games, do not update their stats. \n continue;\n }\n\n if ($t->_id == $game->winner) {\n $team_stats[$team_id]['wins']++;\n $team_stats[$team_id]['point_differential'] += $game->getScoreDiff();\n } else {\n $team_stats[$team_id]['losses']++;\n $team_stats[$team_id]['point_differential'] -= $game->getScoreDiff();\n }\n }\n\n // Make sure we have a list of all of the leagues being updated\n $league_list[] = $game->league_id;\n }\n\n // Do the team stats updates:\n foreach ($team_stats as $team_id => $stats) {\n $conditions = array('_id' => new \\MongoId($team_id));\n $query = array('$set' => array('stats' => $stats));\n Teams::update($query, $conditions);\n }\n\n // Mark leagues as needing an update\n $league_list = array_unique($league_list);\n $conditions = array('_id' => array('$in' => $league_list));\n $query = array('$set' => array('needs_standings_update' => true));\n Leagues::update($query, $conditions); \n }", "public function testUpdateInvalidTeam() {\n\t\t// create a Team with a non null team id and watch it fail\n\t\t$team = new Team($this->sport->getSportId(), SprotsTest::INVALID_KEY, $this->VALID_TEAMAPIID, $this->VALID_TEAMCITY, $this->VALID_TEAMNAME);\n\t\t$team->insert($this->getPDO());\n\t\t$team->update($this->getPDO());\n\t}", "public function increaseTeamPrimaryPotential($potential,$teamId,$action)\n {\n switch($action){\n\n case \"ATT\";\n $queryString=\"UPDATE teams\n SET experience_att=experience_att+$potential\n WHERE team_id=$teamId\";\n break;\n\n case \"MIL\";\n $queryString=\"UPDATE teams\n SET experience_mil=experience_mil+$potential\n WHERE team_id=$teamId\";\n break;\n\n case \"DEF\";\n $queryString=\"UPDATE teams\n SET experience_def=experience_def+$potential\n WHERE team_id=$teamId\";\n break;\n\n case \"GB\";\n $queryString=\"UPDATE teams\n SET experience_gb=experience_gb+$potential\n WHERE team_id=$teamId\";\n break;\n\n }\n\n $query = $this->db->query($queryString);\n }", "function guidoleen_post_team($postid, $postval)\n{\n\tif( $postval->post_type == 'post_team' )\n\t{\n // Functie member\n\t\tif( isset($_POST['team_function']))\n\t\t{\n\t\t\tupdate_post_meta($postid, 'team_function', $_POST['team_function'] );\n }\n \n // Email member\n\t\tif( isset($_POST['team_email']))\n\t\t{\n\t\t\tupdate_post_meta($postid, 'team_email', $_POST['team_email'] );\n\t\t}\n\t}\n}", "public function decreaseTeamPrimaryPotential($potential,$teamId,$action)\n {\n switch($action){\n\n case \"ATT\";\n $queryString=\"UPDATE teams\n SET experience_att=experience_att-$potential\n WHERE team_id=$teamId\";\n break;\n\n case \"MIL\";\n $queryString=\"UPDATE teams\n SET experience_mil=experience_mil-$potential\n WHERE team_id=$teamId\";\n break;\n\n case \"DEF\";\n $queryString=\"UPDATE teams\n SET experience_def=experience_def-$potential\n WHERE team_id=$teamId\";\n break;\n\n case \"GB\";\n $queryString=\"UPDATE teams\n SET experience_gb=experience_gb-$potential\n WHERE team_id=$teamId\";\n break;\n\n }\n\n $query = $this->db->query($queryString);\n }", "public function short_update($roster_player_data, $team_id = false){\n if(isset($roster_player_data[\"playerId\"]) && $roster_player_data[\"playerId\"] > 0){\n $data = $GLOBALS[\"db_fi\"]->fetch_array($GLOBALS[\"db_fi\"]->query(\"SELECT * FROM esports_player WHERE player_id = '\".$GLOBALS[\"db_fi\"]->real_escape_string($roster_player_data[\"playerId\"]).\"'\"));\n \n if(isset($data[\"id\"]) && $data[\"id\"] > 0){\n $sql = \"UPDATE esports_player SET \";\n $sql_type = \"update\";\n } else {\n $sql = \"INSERT INTO esports_player SET player_id = '\".$GLOBALS[\"db_fi\"]->real_escape_string($roster_player_data[\"playerId\"]).\"', \";\n $sql_type = \"insert\";\n }\n \n $sql .= \"name = '\".$GLOBALS[\"db_fi\"]->real_escape_string($roster_player_data[\"name\"]).\"'\";\n $sql .= \", role = '\".$GLOBALS[\"db_fi\"]->real_escape_string($roster_player_data[\"role\"]).\"'\";\n $sql .= \", is_starter = '\".$GLOBALS[\"db_fi\"]->real_escape_string($roster_player_data[\"isStarter\"]).\"'\";\n \n if($team_id != false){\n $sql .= \", team_id = '\".$GLOBALS[\"db_fi\"]->real_escape_string($team_id).\"'\";\n }\n \n if($sql_type == \"update\"){\n $sql .= \" WHERE id = '\".$data[\"id\"].\"'\";\n }\n $GLOBALS[\"db_fi\"]->query($sql);\n return true;\n }\n return false;\n }", "public function testUpdateValidTeam() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"team\");\n\n\t\t// Create a new team and insert into mySQL\n\t\t$team = new Team(null, $this->sport->getSportId(), $this->VALID_TEAMAPIID, $this->VALID_TEAMCITY, $this->VALID_TEAMNAME);\n\t\t$team->insert($this->getPDO());\n\n\t\t// edit the Team and update it in mySQL\n\t\t$team->setTEAMAPIID($this->VALID_TEAMAPIID2);\n\t\t$team->setTEAMCITY($this->VALID_TEAMCITY2);\n\t\t$team->setTEAMNAME($this->VALID_TEAMNAME2);\n\t\t$team->update($this->getPDO());\n\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoTeam = Team::getTeamByTeamId($this->getPDO(), $team->getTeamId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"team\"));\n\t\t$this->assertEquals($pdoTeam->getTeamSportId(), $this->sport->getSportId());\n\t\t$this->assertEquals($pdoTeam->getTeamApiId(), $this->VALID_TEAMAPIID2);\n\t\t$this->assertEquals($pdoTeam->getTeamCity(), $this->VALID_TEAMCITY2);\n\t\t$this->assertEquals($pdoTeam->getTeamName(), $this->VALID_TEAMNAME2);\n\t\t//$this->assertEquals($pdoTeam->getTeamSportId(), $this->VALID_TEAMSPORTID);\n\t}", "public function testUpdateSiteMembership()\n {\n }", "public function testUpdateVendorComplianceSurvey()\n {\n }", "public function test_squad_server_admin_force_team_change()\n {\n $this->assertTrue($this->postScriptumServer->adminForceTeamChange('Test'));\n }", "function updateLeagueUser(\n $league_id,\n $user_id,\n $player_name,\n $paid,\n $join_date,\n $active_status,\n &$ref_status_text = '' // notunique, emailnotvalid, \n){\n\n writeDataToFile(\"\n 'league_id, ' $league_id,\n 'user_id, ' $user_id,\n 'player_name, ' $player_name,\n 'paid, ' $paid,\n 'join_date, ' $join_date,\n 'active_status' $active_status,\", __FILE__, __LINE__);\n\n $mysql_update = \"\n UPDATE nspx_leagueplayer \n SET playername = ?,\n active = ?,\n paid = ?,\n joindate = ?\n WHERE userid = ?\n AND leagueid = ?\n LIMIT 1\";\n \n $status = 0;\n $ref_status_text = '';\n $update_count = '';\n while (1) {\n \n if (!($paid == 1 || $paid == 2)) {\n $ref_status_text = 'paidoneortwo';\n break;\n }\n if (!($active_status == 1 || $active_status == 2)) {\n $ref_status_text = 'activeoneortwo';\n break;\n }\n writeDataToFile(\"11 updateLeagueUser() '$ref_status_text', '$status', '$update_count'\", __FILE__, __LINE__);\n \n $driver = new mysqli_driver();\n $driver->report_mode = MYSQLI_REPORT_OFF;\n \n try {\n $conn = db_connect();\n $sth = $conn->prepare($mysql_update);\n $sth->bind_param(\"siisii\",\n $player_name,\n $active_status,\n $paid,\n $join_date,\n $user_id,\n $league_id); \n \n writeDataToFile(\"22 updateLeagueUser() '$ref_status_text', '$status', '$update_count'\", __FILE__, __LINE__);\n if (!$sth->execute()) {\n $ref_status_text = 'updatefail';\n break;\n }\n $sth->store_result();\n $update_count = $sth->affected_rows;\n writeDataToFile(\" the return count is $update_count\", __FILE__, __LINE__);\n if ($update_count === 0) {\n $ref_status_text = 'updatenorows';\n $status = 1;\n break;\n }\n } catch (mysqli_sql_exception $e) {\n $ermsg = \"updateUser() \\n\" .\n 'sql: ' . $mysql_update . \"\\n\\n\" .\n '$league_id = ' . $league_id . \", \\n\" .\n '$player_name = ' . $player_name . \", \\n\" .\n '$user_id = ' . $user_id . \", \\n\" .\n '$active_status = ' . $active_status . \", \\n\" .\n 'MYSQL ERROR TO STRING: ' . $e->__toString();\n writeDataToFile($ermsg, __FILE__, __LINE__);\n $ref_status_text = 'dberror';\n break;\n }\n $status = 1;\n break;\n }\n writeDataToFile(\"33 updateLeagueUser() '$ref_status_text', '$status', '$update_count'\", __FILE__, __LINE__);\n @ $sth->close();\n return $status;\n}", "public function update(Request $request, Team $team)\n {\n //\n }", "public function update(Request $request, Team $team)\n {\n //\n }", "public function update(Request $request, Team $team)\n {\n //\n }", "public function update(Request $request, Team $team)\n {\n //\n }", "public function update(Request $request, Team $team)\n {\n //\n }", "public function update(Request $request, Team $team)\n {\n //\n }", "public function updateUrgencyStatuses() {\n\n\n $deadlineOverdue = date('Y-m-d H:i:s', strtotime('-' . Configure::read('TICKET.OVERDUE_DAYS') . ' days'));\n $overdueTickets = $this->getPendingTicketsByAge($deadlineOverdue);\n\n foreach ($overdueTickets as $i => $overdueTicket) {\n\n $this->id = $overdueTicket['Ticket']['ticket_id'];\n $overdueTicket['Ticket']['status'] = 'Overdue';\n $this->save($overdueTicket, array('validate' => false, 'modified' => false, 'callbacks' => false));\n }\n\n\n $deadlineUrgend = date('Y-m-d H:i:s', strtotime('-' . Configure::read('TICKET.URGEND_DAYS') . ' days'));\n $urgendTickets = $this->getPendingTicketsByAge($deadlineUrgend, array('New', 'Requested'));\n\n foreach ($urgendTickets as $i => $urgendTicket) {\n\n $this->id = $urgendTicket['Ticket']['ticket_id'];\n $urgendTicket['Ticket']['status'] = 'Urgend';\n $this->save($urgendTicket, array('validate' => false, 'modified' => false, 'callbacks' => false));\n }\n\n }", "public function updateVolunteer()\n {\n \t// database connection and sql query to update volunteer\n \t$core = Core::dbOpen();\n\t\t\t\t\n\t\tif( $this->volunteerID == 0 ) { // add volunteer\n\t\t\t$sql = \"INSERT INTO volunteer ( programID, firstName, lastName, phone, email, active )\n\t\t\t\t\t\t\tVALUES (:programID, :firstName, :lastName, :phone, :email, :active)\";\n\t\t\n\t\t} else { // update volunteer\n\t\t\t$sql = \"UPDATE volunteer SET firstName = :firstName, lastName = :lastName, phone = :phone, email = :email, active = :active\n\t\t\t\t\t\t\tWHERE volunteerID = :id\";\n\t\t}\n\t\t\n \t$stmt = $core->dbh->prepare($sql);\n \t\n\t\tif( $this->volunteerID == 0 ) { \n\t\t\t$stmt->bindParam(':programID', $this->programID); \n\t\t} else { \n\t\t\t$stmt->bindParam(':id', $this->volunteerID); \n\t\t}\n\t\t\n\t\t$stmt->bindParam(':firstName', $this->firstName);\n \t$stmt->bindParam(':lastName', $this->lastName);\n \t$stmt->bindParam(':phone', $this->phone);\n \t$stmt->bindParam(':email', $this->email);\n \t$stmt->bindParam(':active', $this->active);\n \tCore::dbClose();\n \t\n \t// execute stmt\n \ttry\n \t{\n \t\tif( $stmt->execute() )\n\t\t\t{\n\t\t\t\tif( $this->volunteerID == 0 )\n\t\t\t\t\t $this->volunteerID = $core->dbh->lastInsertId(); \n\t\t\t}\n \t}\n \tcatch (PDOException $e )\n \t{\n \t\techo \"Update volunteer failed\";\n \t}\n\t\t\n\t\t// clear previous volunteer positions\n\t\t$this->clearPositions();\n \t\n \t// add positions\n \tif($this->positions != null)\n {\n \t\t$core = Core::dbOpen();\n \t\t$sql = \"INSERT INTO volunteer_position (volunteerID, positionID) VALUES (:volunteerID, :positionID)\";\n \t\t$stmt = $core->dbh->prepare($sql);\n \t\t\n \tforeach ( $this->positions as $value )\n \t{\n \t\t$stmt->bindParam(':volunteerID', $this->volunteerID);\n \t\t$stmt->bindParam(':positionID', $value);\n \t\t\n \t\t\ttry {\n \t\t\t\t$stmt->execute();\n \t\t\t} catch( PDOException $e ) {\n \t\t\techo \"Add volunteer positons Failed!\";\n \t\t\t}\n \t\t}\n \t\t\n \t\tCore::dbClose();\n }\n\n \treturn false;\n }", "function updateTeamDetails($TeamID, $Input = array())\n {\n $UpdateArray = array_filter(array(\n 'TeamFlag' => @$Input['TeamFlag'],\n 'TeamName' => @$Input['TeamName'],\n 'TeamNameShort' => @$Input['TeamNameShort']\n ));\n if (!empty($UpdateArray)) {\n $this->db->where('TeamID', $TeamID);\n $this->db->limit(1);\n $this->db->update('sports_teams', $UpdateArray);\n\n /* Edit Into MongoDB */\n mongoDBConnection();\n $this->fantasydb->sports_teams->updateOne(\n ['_id' => $Input['TeamGUID']],\n ['$set' => array_filter(array('TeamID' => (int) $TeamID,'TeamFlag' => @$UpdateArray['TeamFlag'],'TeamName' => @$UpdateArray['TeamName'],'TeamNameShort' => @$UpdateArray['TeamNameShort']))],\n ['upsert' => true]\n );\n }\n return TRUE;\n }" ]
[ "0.6717696", "0.6569541", "0.65178734", "0.6450432", "0.6449285", "0.64154524", "0.62756664", "0.62279546", "0.6091837", "0.6050576", "0.603368", "0.59439063", "0.5940974", "0.5919817", "0.59158516", "0.5913516", "0.5870438", "0.583997", "0.5832746", "0.5831232", "0.577445", "0.5752232", "0.5752232", "0.5752232", "0.5752232", "0.5752232", "0.5752232", "0.5751644", "0.57378614", "0.57317835" ]
0.67095804
1
protected $organization_id; protected $email_id; protected $password; protected $token; protected $token_auto_regenerate = TRUE; // You can disable auto generate invalid token. protected $guzzle; Constructor. $organization_id: Organisation ID. $email_id: Address mail. $password: Passe word. $token: token if you wont use a unique token. Manage Auth Tokens:
public function __construct($organization_id) { Parent::__construct(); // $this->guzzle = new \GuzzleHttp\Client(); // dd('$organization',$organization ); $this->organization_id = $organization_id; // $this->email_id = Auth::user()->email; // $this->password = Auth::user()->zoho_password; // $this->token = (Auth::user()->zoho_token) ? Auth::user()->zoho_token : $this->GetToken($this->email_id, $this->password); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $this->API_TOKEN = env('API_TOKEN');\n// $this->API_TOKEN = '9876543210'; //TODO REMOVE THIS LINE AND REMOVE ABOVE COMMENT\n }", "private function setToken() {\n\n /* valid register */\n $request = $this->post('/v1/register', [\n 'firstname' => 'John',\n 'lastname' => 'Doe',\n 'email' => '[email protected]',\n 'password' => 'secret',\n ]);\n\n /* valid login */\n $this->post('/v1/login', [\n 'email' => '[email protected]',\n 'password' => 'secret',\n ]);\n\n }", "public function __construct($email , $token)\n {\n $this->token = $token;\n $this->email = $email;\n }", "abstract public function getAuthToken();", "public function __construct() {\n\t\t$client = new \\GuzzleHttp\\Client;\n\t\t$this->client = $client;\n\n\t\t$response = $this->client->request('POST', 'http://api.thingsee.com/v2/accounts/login', \n\t\t\t['json' => \n\t\t\t\t[\n\t\t\t\t\t'email' => Config::get('thingsee.email'), \n\t\t\t\t\t'password' => Config::get('thingsee.password')\n\t\t\t\t]\n\t\t\t]);\n\n\t\t// Obsolete, 401 and 500 will be caught in the calling function\n\t\t$statusCode = $response->getStatusCode();\n\n\t\t$data = json_decode($response->getBody(), true);\n\t\t$this->accountAuthToken = $data['accountAuthToken'];\n\t}", "public function __construct($email, $password) {\n\n$this->email = $email;\n$this->password = $password;\n}", "function __get_auth_token() {\n\n if ($this->auth_token === null) {\n\n $this->auth_token =\n $this->__create_auth_token($this->email,\n $this->password,\n $this->auth_account_type,\n $this->auth_service);\n\n }\n\n return $this->auth_token;\n\n}", "public function __construct() {\n global $apiConfig;\n if (! empty($apiConfig['developer_key'])) {\n $this->developerKey = $apiConfig['developer_key'];\n }\n if (! empty($apiConfig['oauth2_client_id'])) {\n $this->clientId = $apiConfig['oauth2_client_id'];\n }\n if (! empty($apiConfig['oauth2_client_secret'])) {\n $this->clientSecret = $apiConfig['oauth2_client_secret'];\n }\n if (! empty($apiConfig['oauth2_redirect_uri'])) {\n $this->redirectUri = $apiConfig['oauth2_redirect_uri'];\n }\n if (! empty($apiConfig['oauth2_access_type'])) {\n $this->accessType = $apiConfig['oauth2_access_type'];\n }\n if (! empty($apiConfig['oauth2_approval_prompt'])) {\n $this->approvalPrompt = $apiConfig['oauth2_approval_prompt'];\n }\n }", "public function __construct() {\r\n\t\t$this->endpoints = array(\r\n\t\t\t'sendPasswordResetRequest' => array(\r\n\t\t\t\t'required_role' => self::PUBLIC_ACCESS,\r\n\t\t\t\t'params' => array(\r\n\t\t\t\t\t'forgotten_password_email' => array('required', 'valid-email')\r\n\t\t\t\t)\r\n\t\t\t),\r\n\t\t\t'checkPasswordResetHash' => array(\r\n\t\t\t\t'required_role' => self::PUBLIC_ACCESS,\r\n\t\t\t\t'params' => array(\r\n\t\t\t\t\t'user_id' => 'required',\r\n\t\t\t\t\t'hash' => 'required'\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\t#request params\r\n\t\t$this->params = $this->checkRequest();\r\n\t}", "public function __construct()\n {\n $this->salt = base_convert(sha1(uniqid(mt_rand(), true)), 16, 36);\n $this->enabled = false;\n $this->locked = false;\n $this->expired = false;\n $this->roles = new ArrayCollection();\n $this->credentialsExpired = false;\n $this->confirmationToken = base64_encode(utf8_encode(openssl_random_pseudo_bytes(10)));\n $this->createdAt = new \\DateTime();\n }", "public function __construct()\n {\n $this->setTokenName(config('infusionsoft.token_name'));\n $this->setClientId(config('infusionsoft.client_id'));\n $this->setClientSecret(config('infusionsoft.client_secret'));\n $this->setRedirectUri(url(config('infusionsoft.redirect_uri')));\n if (config('infusionsoft.debug')) {\n $this->setDebug(true);\n }\n $new_token = false;\n if (Storage::exists($this->token_name)) {\n $token = unserialize(Storage::get($this->token_name));\n $this->setToken(new Token($token));\n } elseif (Request::has('code')) {\n $this->requestAccessToken(Request::get('code'));\n $new_token = true;\n } else {\n throw new InfusionsoftException(sprintf(\n 'You must authorize your application here: %s',\n $this->getAuthorizationUrl()\n ), 1);\n }\n $token = $this->getToken();\n $expired = ($token->getEndOfLife() - (time() * 2)) <= 0 ? true : false;\n if ($expired || $new_token) {\n $extra = $token->getExtraInfo();\n if (!$new_token) {\n $token = $this->refreshAccessToken();\n }\n Storage::disk(config('infusionsoft.filesystem'))->put($this->token_name, serialize([\n \"access_token\" => $token->getAccessToken(),\n \"refresh_token\" => $token->getRefreshToken(),\n \"expires_in\" => $token->getEndOfLife(),\n \"token_type\" => $extra['token_type'],\n \"scope\" => $extra['scope'],\n ]));\n }\n }", "public function __construct($token, $email)\n {\n $this->token = $token;\n $this->email = $email;\n }", "public function __construct(array $options = null)\n\t{\n\t\tif ( ! isset($options['access_token']))\n\t\t{\n\t\t\tthrow new Exception('Required option not passed: access_token'.PHP_EOL.print_r($options, true));\n\t\t}\n\t\t\n\t\t// if ( ! isset($options['expires_in']) and ! isset($options['expires']))\n\t\t// {\n\t\t// \tthrow new Exception('We do not know when this access_token will expire');\n\t\t// }\n\n\t\t$this->access_token = $options['access_token'];\n\t\t\n\t\t// Some providers (not many) give the uid here, so lets take it\n\t\tisset($options['uid']) and $this->uid = $options['uid'];\n\t\t\n\t\t//Vkontakte uses user_id instead of uid\n\t\tisset($options['user_id']) and $this->uid = $options['user_id'];\n\t\t\n\t\t//Mailru uses x_mailru_vid instead of uid\n\t\tisset($options['x_mailru_vid']) and $this->uid = $options['x_mailru_vid'];\n\t\t\n\t\t// We need to know when the token expires, add num. seconds to current time\n\t\tisset($options['expires_in']) and $this->expires = time() + ((int) $options['expires_in']);\n\t\t\n\t\t// Facebook is just being a spec ignoring jerk\n\t\tisset($options['expires']) and $this->expires = time() + ((int) $options['expires']);\n\t\t\n\t\t// Grab a refresh token so we can update access tokens when they expires\n\t\tisset($options['refresh_token']) and $this->refresh_token = $options['refresh_token'];\n\t}", "function __create_auth_token($email, $password, $account_type, $service) {\n\n return new AuthToken($email, $password, $account_type, $service);\n\n}", "public function __construct(){\r\n //$this->id = $id;\r\n //$this->email = $email;\r\n //$this->username = $username;\r\n //$this->password = $password;\r\n //$this->TDG = new UserTDG;\r\n }", "function __construct()\n\t{\n\t\t$this->salt = \"ovancop1234\";\n\t\t$this->token = str_shuffle('cmsaj23y4ywdni237yeisa');\n\t\t$this->date = date('Y-m-d H:i:s');\n\n\t}", "public function __construct()\r\n\t\t{\r\n\t\t\t$this->api_id = self::API_ID;\r\n\t\t\t$this->api_secret = self::API_SECRET;\r\n\t\t}", "public function __construct()\n {\n $this->client = new Client([\n 'base_uri' => config('tpay.end_point_url') . '/api/t-pay/v1/oauth2/',\n 'timeout' => config('tpay.timeout'),\n 'connect_timeout' => config('tpay.connect_timeout'),\n 'protocols' => ['http', 'https'],\n ]);\n $this->accessToken;\n }", "function __construct(){\n\t\t$this->key = TRELLO_DEV_KEY;\n\t\t$this->token = TRELLO_USER_TOKEN;\n\n\t\t$this->curl = new Curl();\n\t}", "public function __construct()\n {\n $this->clienteRepository = new ClienteRepository();\n $this->middleware('guest')->except('logout');\n // Unique Token\n $this->token = uniqid(base64_encode(Str::random(60)));\n }", "public function __construct () {\n // Merchant ID\n $this->_mid = \"\";\n\n // User ID\n $this->_userID = \"\";\n\n // Password\n $this->_password = \"\";\n\n // Developer ID\n $this->_devID = \"\";\n\n // Device ID\n $this->_deviceID = \"\";\n\n // API server\n $this->_tsepApiServer = \"https://stagegw.transnox.com\";\n }", "function getAuthToken()\n {\n \treturn $this->_authToken;\n }", "public function __construct()\n {\n parent::__construct();\n $this->githubClient = new Client([\n // 'auth' => [getenv('GITHUB_USERNAME'), getenv('GITHUB_TOKEN')],\n 'auth' => [config('env.GITHUB_USERNAME'), config('env.GITHUB_TOKEN')],\n ]);\n }", "public function setUp() {\n\t\t$this->client = new ElggApiClient(elgg_get_site_url(), $this->apikey->public);\n\t\t$result = $this->client->obtainAuthToken($this->user->username, 'pass123');\n\t\tif (!$result) {\n\t\t echo \"Error in getting auth token!\\n\";\n\t\t}\n\t}", "public function __construct()\n {\n parent::__construct();\n \trequire_once APPPATH . 'third_party/GuzzleHttp/functions_include.php';\n\t\trequire_once APPPATH . 'third_party/GuzzleHttp/Psr7/functions_include.php';\n\t\trequire_once APPPATH . 'third_party/GuzzleHttp/Promise/functions_include.php';\n\t\trequire_once APPPATH . 'third_party/Psr/bootstrap.php';\n\t\trequire_once APPPATH . 'third_party/GuzzleHttp/bootstrap.php';\n\t\trequire_once APPPATH . 'third_party/Mailjet/bootstrap.php';\n\t\t$APIPublicKey = 'ec4f81b2894ce3aeb5f987effcf10fd5';\n\t\t$APISecretKey = '80fc6f04059c6c5231924f124c351041';\n\t\t$this->mailjet = new Mailjet\\Client($APIPublicKey, $APISecretKey);\n\t\t//$this->FromEmail = '[email protected]';\n\t\t//$this->FromName = 'Economicar';\n }", "public function __construct()\n {\n $this->client = new Client([\n 'base_uri' => config('sportmonks.api_url'),\n 'verify' => app('env') !== 'production' ? false : true,\n ]);\n\n $this->apiToken = config('sportmonks.api_token');\n\n if (empty($this->apiToken)) {\n throw new \\InvalidArgumentException('No API token set');\n }\n\n $this->timezone = !empty(config('sportmonks.timezone'))\n ? config('sportmonks.timezone')\n : config('app.timezone');\n\n $this->withoutData = !empty(config('sportmonks.skip_data'))\n ? config('sportmonks.skip_data')\n : false;\n }", "public function getToken()\n\t{\n\n\t}", "public function __construct()\n\t\t{\n\t\t\t$this->_username = \"lenykoskey\";\n\t\t\t$this->_apiKey = \"abbfa09e621a6ece272a254e3fcd910657ff46e88f82db205499603d06dda908\";\n\n\t\t}", "public function __construct()\n {\n parent::__construct();\n\n /* setup base parameters for authentication */\n $this->baseParams = [\n 'ts' => date('Y-m-d H:i:s'), //timestamp\n 'apikey' => config('marvel.public_key'), //public key\n 'hash' => md5(date('Y-m-d H:i:s').config('marvel.private_key').config('marvel.public_key')), //md5 combination of ts, private key and public key\n ];\n }", "public function __construct()\n {\n \n // API accepts only POST request for now\n if ($_SERVER['REQUEST_METHOD'] != 'POST') {\n // echo \"Method is not post\";\n $this->throwException(REQUEST_METHOD_NOT_VALID, 'Request Method is not valid');\n }\n // open input stream from HTTP POST\n $input_stream = fopen('php://input', 'r');\n $this->request = stream_get_contents($input_stream);\n \n $this->validateRequest($this->request);\n \n // generate user object\n $this->user = new user();\n \n \n // Switch-case to handle different type request\n // Probalby best practice is list all cases here, so not a single service(function) is available without intend\n switch ($this->serviceName) \n {\n\n case \"validateAccessToken\":\n $this->validateAccessToken();\n break;\n case \"validateRefreshToken\":\n $this->validateRefreshToken();\n break;\n case \"generateToken\":\n //\n break;\n case \"getUserPermById\":\n $this->validateAccessToken();\n $this->getUserPermById();\n break;\n // list all authorization needed services here\n case \"startProcessingImages\":\n case \"getEventCodes\":\n case \"editEvent\":\n case \"getEventList\":\n case \"eventFromHashId\":\n case \"printUnusedCodes\":\n case \"clearUnusedCodes\":\n case \"generateCodes\":\n case \"getUnusedCodes\":\n case \"getUsedCodes\":\n case \"deleteUser\":\n case \"addUser\":\n case \"editUser\":\n case \"getUsers\":\n case \"getPermissions\":\n case \"getRoles\":\n case \"testAuthorization\":\n $this->validateAccessToken();\n break;\n // These request do not require authorization\n // Carefully add functions here\n case \"getGallery\":\n case \"isGalleryAvailable\":\n break;\n default:\n //If service is allready implemented but not list above we get this error\n $this->throwException(API_DOES_NOT_EXIST, \"API does not exist.\");\n }\n \n }" ]
[ "0.6583158", "0.6470143", "0.641855", "0.64160603", "0.63310164", "0.6313332", "0.630198", "0.6249095", "0.61161524", "0.61111426", "0.6107594", "0.61038476", "0.6066762", "0.60335946", "0.6002458", "0.60008997", "0.59723395", "0.5966116", "0.59412235", "0.5929867", "0.5901297", "0.58820313", "0.5868245", "0.5865389", "0.5846857", "0.5832233", "0.583152", "0.58170927", "0.5805834", "0.5804215" ]
0.69774234
0
Clear filter of visited Resources
public function clearVisited() { $this->getFilter()->clear($this->getProject() . 'visited'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeAllFilters();", "public function resetFilters() {\n $this->filters = array();\n }", "public function removeFilters();", "public function reset()\n\t{\n\t\tupdate_option($this->filterName, array());\n\t}", "public function reset() : void\n {\n\n // load the filters that has to be resetted\n $filters = $this->getFilters();\n\n // reset the filters\n foreach ($filters as $filter) {\n if ($filter instanceof PregMatchFilterInterface) {\n $filter->reset();\n }\n }\n }", "public function filter() {\r\n\t\t$this->resource->filter();\r\n\t}", "public function deleteAllResources() {\n\t\t$this->resources = array();\n\t}", "function clear_filters($filterName = null)\n{\n if ($pluginBroker = get_plugin_broker()) {\n $pluginBroker->clearFilters($filterName);\n }\n}", "private function clear()\n {\n $this->mappedQueries = [];\n $this->mappedFilters = [];\n $this->requestData = [];\n }", "public function resetFilter()\n {\n $this->actor = null;\n $this->addTimestamp = null;\n $this->encryptSignature = null;\n $this->expires = null;\n $this->serviceSecurityKey = null;\n $this->signAllHeaders = null;\n $this->tokenReferenceEncryption = null;\n $this->tokenReferenceSignature = null;\n $this->userSecurityKey = null;\n }", "public static function clear_all() {\n\t\tstatic::$cache = array();\n\t\tstatic::$mapping = array();\n\t}", "private function _clearCache()\n {\n Cache::forget(\"roaddamage-resource:{$this->id}\");\n foreach ($this->getReports() as $report) {\n Cache::forget(\"report-resource:{$report->id}\");\n }\n }", "public function resetFilters()\n {\n unset($this->options['AmazonOrderId']);\n unset($this->options['FinancialEventGroupId']);\n $this->resetTimeLimits();\n }", "public function clearCache() {\n\t\tYii::app()->user->setState('nlsLoadedResources', array());\n\t}", "public function clearWhere()\n {\n \t$this->_where = null;\n }", "public function CleanFilter(){\n\t\t$this->_objectFilter = new Model_Aclusuariosonline();\n\t}", "private function restoreFilters()\n {\n if (count($this->wordpressFilters) > 0) {\n $filters = $this->wordpress->getFilters();\n\n foreach ($this->wordpressFilters as $filterKey => $filter) {\n $filters[$filterKey] = $filter;\n }\n\n $this->wordpress->setFilters($filters);\n $this->wordpressFilters = [];\n }\n }", "public function clearSuccessful()\n {\n $this->getFilter()->clear($this->getProject() . 'parsed');\n $this->getResultsStorage()->clear(ResultsStorageInterface::STATUS_SUCCESS);\n $this->getLogger()->debug('Cleared \"visited\" and \"scheduled\" filters');\n }", "protected function clear() {}", "public function removeAllFilters()\n\t{\n\t\t$this->filters = [];\n\t\treturn $this;\n\t}", "public function removeAll() {}", "public function removeAll() {}", "public function removeAll() {}", "public function removeAll() {}", "public function removeAll() {}", "public function removeAll() {}", "public function reset()\r\n\t{\r\n\t\t$this->first = null;\r\n\t\t$this->alreadyIncluded = array();\r\n\t\t$this->depths = array();\r\n\t}", "public function clearFilters()\n {\n $this->parameterFilters = array();\n\n return $this;\n }", "function removeAll() ;", "function removeAll() ;" ]
[ "0.71913314", "0.71107495", "0.6940135", "0.6519467", "0.6508074", "0.6449197", "0.64328986", "0.638552", "0.63595414", "0.6312196", "0.62840015", "0.62813926", "0.6274459", "0.6237364", "0.62206644", "0.6212543", "0.616541", "0.6156031", "0.6141826", "0.6118417", "0.6109679", "0.6109679", "0.6109679", "0.6109679", "0.6108736", "0.6108736", "0.6097247", "0.60879076", "0.60479236", "0.60479236" ]
0.77535236
0
Clear filter of scheduled Resources
public function clearScheduled() { $this->getFilter()->clear($this->getProject() . 'scheduled'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeFilters();", "public function resetFilters()\n {\n unset($this->options['AmazonOrderId']);\n unset($this->options['FinancialEventGroupId']);\n $this->resetTimeLimits();\n }", "public function removeAllFilters();", "public function resetFilters() {\n $this->filters = array();\n }", "public function filter() {\r\n\t\t$this->resource->filter();\r\n\t}", "function clear_filters($filterName = null)\n{\n if ($pluginBroker = get_plugin_broker()) {\n $pluginBroker->clearFilters($filterName);\n }\n}", "public function reset()\n\t{\n\t\tupdate_option($this->filterName, array());\n\t}", "public function deleteAllResources() {\n\t\t$this->resources = array();\n\t}", "public function clearPending();", "public function clearFilters()\n {\n $this->parameterFilters = array();\n\n return $this;\n }", "public function CleanFilter(){\n\t\t$this->_objectFilter = new Model_Aclusuariosonline();\n\t}", "public function clearSuccessful()\n {\n $this->getFilter()->clear($this->getProject() . 'parsed');\n $this->getResultsStorage()->clear(ResultsStorageInterface::STATUS_SUCCESS);\n $this->getLogger()->debug('Cleared \"visited\" and \"scheduled\" filters');\n }", "private function _clearCache()\n {\n Cache::forget(\"roaddamage-resource:{$this->id}\");\n foreach ($this->getReports() as $report) {\n Cache::forget(\"report-resource:{$report->id}\");\n }\n }", "public function resetFilter()\n {\n $this->actor = null;\n $this->addTimestamp = null;\n $this->encryptSignature = null;\n $this->expires = null;\n $this->serviceSecurityKey = null;\n $this->signAllHeaders = null;\n $this->tokenReferenceEncryption = null;\n $this->tokenReferenceSignature = null;\n $this->userSecurityKey = null;\n }", "public function clearWhere()\n {\n \t$this->_where = null;\n }", "public function reset() : void\n {\n\n // load the filters that has to be resetted\n $filters = $this->getFilters();\n\n // reset the filters\n foreach ($filters as $filter) {\n if ($filter instanceof PregMatchFilterInterface) {\n $filter->reset();\n }\n }\n }", "public function resetFilterReport() {\n\t\t$this->table->resetOffset();\n\t\t$this->table->resetFilter();\n\t\t$this->report();\n\t}", "public function removeAllFilters()\n\t{\n\t\t$this->filters = [];\n\t\treturn $this;\n\t}", "public function clear(): void\n {\n $app = App::get();\n $list = $app->data->getList()\n ->filterBy('key', '.temp/cache/', 'startWith');\n foreach ($list as $item) {\n $app->data->delete($item->key);\n };\n }", "public function clearCache() {\n\t\tYii::app()->user->setState('nlsLoadedResources', array());\n\t}", "public function cleanScheduleAction(){\n \t$actual = new Frogg_Time_Time();\n \t$cleaning_day = $actual->subtract(3*24*60*60);\n \t$cleaning_stamp = $cleaning_day->getUnixTstamp();\n \t$sql = new Frogg_Db_Sql('DELETE FROM `scheduled` WHERE `timestamp` < '.$cleaning_stamp);\n \tdie;\n }", "private function restoreFilters()\n {\n if (count($this->wordpressFilters) > 0) {\n $filters = $this->wordpress->getFilters();\n\n foreach ($this->wordpressFilters as $filterKey => $filter) {\n $filters[$filterKey] = $filter;\n }\n\n $this->wordpress->setFilters($filters);\n $this->wordpressFilters = [];\n }\n }", "public function clearAll() {}", "public function clearAll();", "public function clearAll();", "public function resetFilters()\n {\n $this->filters = array();\n\n return $this;\n }", "public function clearCOMConditions()\n {\n $this->collCOMConditions = null; // important to set this to NULL since that means it is uninitialized\n }", "public static function deactivateAll()\n {\n foreach (self::$_activeFilters as $target => $filter) {\n $filter->deactivate();\n }\n }", "public function clearVisited()\n {\n $this->getFilter()->clear($this->getProject() . 'visited');\n }", "public function resetTimeLimits()\n {\n unset($this->options['RequestedFromDate']);\n unset($this->options['RequestedToDate']);\n }" ]
[ "0.6856936", "0.67182255", "0.6621482", "0.6518339", "0.6444722", "0.63463163", "0.62133527", "0.6200486", "0.6138635", "0.60996115", "0.602172", "0.59422934", "0.59174", "0.59133786", "0.582702", "0.5820791", "0.57783026", "0.5776156", "0.57720166", "0.57356787", "0.57250774", "0.5712686", "0.56837404", "0.563148", "0.563148", "0.562984", "0.56255805", "0.5621398", "0.56016403", "0.55969465" ]
0.80476165
0
Clear information about failed Resources
public function clearFailed() { $this->getResultsStorage()->clear(ResultsStorageInterface::STATUS_FETCH_FAILED); $this->getResultsStorage()->clear(ResultsStorageInterface::STATUS_PARSE_ERROR); $this->getLogger()->debug('Cleared "failed" and "not-parsed" filters'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clearResources()\n {\n AM_Tools::clearContent($this->_getIssueHelpPage()->getThumbnailPresetType(), $this->_getIssueHelpPage()->id_issue);\n AM_Tools::clearResizerCache($this->_getIssueHelpPage()->getThumbnailPresetType(), $this->_getIssueHelpPage()->id_issue);\n }", "function ClearError() \r\n{ \r\n$this->LastError = null; \r\n}", "public function deleteAllResources() {\n\t\t$this->resources = array();\n\t}", "protected function clearResults() {\n\t\t$this->error = '';\n\t\t$this->status_org = false;\n\t\t$this->status_new = false;\n\t}", "public function clearErrors() {\n $this->errorCodes = [];\n }", "public function clear() {\n $this->_errors = array();\n }", "protected function clear()\n {\n $this->error = '';\n $this->success = false;\n }", "public function clearFailedValidationData()\n {\n FormUtil::clearValidationFailedObjects($this->_objPath);\n }", "public function clearExceptions()\r\r\n {\r\r\n $this->exceptions = array();\r\r\n }", "public function clearError() {\n $this->errors = array();\n }", "public function reset()\n {\n $this->values[self::_INFO] = null;\n $this->values[self::_EXIT] = Down_ErrorInfo_Exit::noneed;\n }", "protected function clearError()\n {\n $this->lastError = null;\n }", "public function reset()\n {\n $this->errors = array();\n }", "public function resetErrors() {}", "public function clearErrors()\n {\n $this->errors = array();\n }", "public function clearErrors()\n {\n $this->errorMessages = [];\n }", "public function clearErrors() {\n $this->fErrors = Array();\n }", "public function reset()\n {\n $this->values[self::ERRMSG] = null;\n $this->values[self::RET] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_SERVER_INFO] = array();\n }", "public function clearErrors()\n {\n $this->errors = [];\n }", "public function cleanup() {\r\n\t\t$this->resource->cleanup();\r\n\t}", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_INFO] = null;\n }", "public function clean() {\n $this->requires = array();\n $this->getResource()->clear();\n }", "private function resetErrors() {\n $this->errors = array();\n }", "public function clearCache() {\n\t\tYii::app()->user->setState('nlsLoadedResources', array());\n\t}", "public function clearCheckInformations()\n\t{\n\t\t$this->collCheckInformations = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function reset() {\n $this->values[self::ERROR] = null;\n $this->values[self::LINE_INFO_LIST] = array();\n $this->values[self::TICKET_ORDER_INFO] = null;\n }", "public static function clearCapturedErrors() {\n self::$capturedErrors = array();\n }", "public function reset() {\n $this->values[self::ERR_NO] = null;\n $this->values[self::ERR_MSG] = null;\n $this->values[self::CONTENTS] = array();\n }", "protected function resetErrors() {\n $this->errors = array();\n }" ]
[ "0.6565199", "0.628577", "0.62834895", "0.6246545", "0.6156242", "0.6129662", "0.60088646", "0.6005085", "0.5969712", "0.5968586", "0.59132165", "0.5900586", "0.58962953", "0.58950144", "0.58742803", "0.5871748", "0.58457834", "0.58330554", "0.5825198", "0.5788923", "0.57458097", "0.57396716", "0.5726846", "0.5657458", "0.56282103", "0.5589337", "0.55627394", "0.5561872", "0.5561467", "0.5535584" ]
0.6658006
0
Register all rest API routes
public static function register_rest_routes() { foreach (static::$apis as $api) { $api->register_rest_route(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register_routes() {\n $namespace = 'junglehunter/v1';\n register_rest_route(\n $namespace,\n '/all',\n array(\n 'methods' => 'GET',\n 'callback' => array($this, 'junglehunter_get_all')\n )\n );\n }", "public function register_rest_routes() {\n\t\t$controllers = array(\n\t\t\t'GF_REST_Entries_Controller',\n\t\t\t'GF_REST_Entry_Properties_Controller',\n\t\t\t'GF_REST_Entry_Notifications_Controller',\n\t\t\t'GF_REST_Notes_Controller',\n\t\t\t'GF_REST_Entry_Notes_Controller',\n\t\t\t'GF_REST_Form_Entries_Controller',\n\t\t\t'GF_REST_Form_Results_Controller',\n\t\t\t'GF_REST_Form_Submissions_Controller',\n\t\t\t'GF_REST_Forms_Controller',\n\t\t\t'GF_REST_Feeds_Controller',\n\t\t\t'GF_REST_Form_Feeds_Controller',\n\t\t);\n\n\t\tforeach ( $controllers as $controller ) {\n\t\t\t$controller_obj = new $controller();\n\t\t\t$controller_obj->register_routes();\n\t\t}\n\t}", "public function register_api_endpoints() {\n\n\t\tregister_rest_route( 'nock/v1', '/messages', array(\n\t\t\t'methods' => array( 'POST' ),\n\t\t\t'callback' => array( $this, 'send_message' ),\n\t\t) );\n\n\t\tregister_rest_route( 'nock/v1', '/accounts', array(\n\t\t\t'methods' => array( 'GET' ),\n\t\t\t'callback' => array( $this, 'get_accounts' ),\n\t\t) );\n\n\t\tregister_rest_route( 'nock/v1', '/groups', array(\n\t\t\t'methods' => array( 'GET' ),\n\t\t\t'callback' => array( $this, 'get_groups' ),\n\t\t) );\n\n\t\tregister_rest_route( 'nock/v1', '/sms', array(\n\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t'callback' => array( $this, 'capture_sms' ),\n\t\t) );\n\n\t}", "public function register_rest_routes() {\n\t\t/**\n\t\t * Setting up custom route for podcast\n\t\t */\n\t\tregister_rest_route(\n\t\t\t'ssp/v1',\n\t\t\t'/podcast',\n\t\t\tarray(\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => array( $this, 'get_rest_podcast' ),\n\t\t\t)\n\t\t);\n\n\t\t/**\n\t\t * Setting up custom route for podcast\n\t\t */\n\t\tregister_rest_route(\n\t\t\t'ssp/v1',\n\t\t\t'/podcast_update',\n\t\t\tarray(\n\t\t\t\t'methods' => 'POST',\n\t\t\t\t'callback' => array( $this, 'update_rest_podcast' ),\n\t\t\t)\n\t\t);\n\n\t\t/**\n\t\t * Setting up custom route for episodes\n\t\t */\n\t\t$controller = new Episodes_Controller();\n\t\t$controller->register_routes();\n\n\t}", "public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_items' ),\n\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t'args' => array(),\n\t\t\t)\n\t\t) );\n }", "public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_shops' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_shop' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base . '/manager', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'register_shop_manager' ),\n\t\t\t)\n\t\t) );\n\t}", "public function register_routes() {\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback' => array( $this, 'parse_url_details' ),\n\t\t\t\t\t'args' => array(\n\t\t\t\t\t\t'url' => array(\n\t\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t\t'description' => __( 'The URL to process.' ),\n\t\t\t\t\t\t\t'validate_callback' => 'wp_http_validate_url',\n\t\t\t\t\t\t\t'sanitize_callback' => 'sanitize_url',\n\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'permission_callback' => array( $this, 'permissions_check' ),\n\t\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}", "public function register_routes() {\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_item' ),\n\t\t\t\t'args' => array(),\n\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'update_item' ),\n\t\t\t\t'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),\n\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t),\n\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t) );\n\t}", "private function registerApiRoutes(): void\n {\n $detect = app(Detect::class);\n $monitor = app(Monitor::class);\n\n $type = Settings::TYPE__ROUTE_API_FILE;\n if (!$detect->resourceEnabled($type)) {\n return;\n }\n\n $monitor->startTimer('register ' . $type);\n\n foreach ($detect->getRouteApiFiles() as $path) {\n Route::middleware($detect->routeApiMiddleware())\n ->group($detect->basePath($path));\n }\n $monitor->incRegCount($type, count($detect->getRouteApiFiles()));\n\n $monitor->stopTimer('register ' . $type);\n }", "public function register_routes()\n {\n\n $namespace = 'api/v1';\n $base = 'categories';\n\n register_rest_route($namespace, '/' . $base, array(\n array(\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => array($this, 'create_item'),\n 'permission_callback' => array($this, 'create_item_permissions_check'),\n 'args' => $this->get_endpoint_args_for_item_schema(true),\n ),\n ));\n\n register_rest_route($namespace, '/' . $base . '/(?P<id>\\d+)', array(\n array(\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array($this, 'update_item'),\n 'permission_callback' => array($this, 'create_item_permissions_check'),\n 'args' => $this->get_endpoint_args_for_item_schema(true),\n ),\n ));\n }", "public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/location', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::CREATABLE,\n\t\t\t\t'callback' => array( $this, 'update_user_location' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/quiz-result', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'save_quiz_result' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/ranking/(?P<park>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_ranking' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/point/(?P<slug>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_point' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/point/(?P<id>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'set_point_location' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/option/(?P<key>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_option' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/user', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'update_user' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/photo', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'upload_photo' ),\n\t\t\t)\n\t\t) );\n\t}", "protected function registerRoutes()\n {\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n }", "public function register_routes() {\n\n register_rest_route( $this->namespace, '/' . $this->base, array(\n array(\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => array( $this->service, 'create' ),\n 'permission_callback' => array( $this, 'getAdminUserCheck' ),\n 'args' => $this->get_endpoint_args_for_item_schema( true ),\n 'accept_json' => true\n ),\n ) );\n\n register_rest_route( $this->namespace, '/' . $this->base . '/(?P<id>[\\d]+)', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array( $this->service, 'get' ),\n 'permission_callback' => array( $this, 'getAllUserCheck' ),\n 'args' => array(\n 'context' => array(\n 'default' => 'view',\n )\n ),\n ),\n\n array(\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array( $this->service, 'update' ),\n 'permission_callback' => array( $this, 'getAdminUserCheck' ),\n 'args' => $this->get_endpoint_args_for_item_schema( false ),\n 'accept_json' => true\n ),\n\n array(\n 'methods' => WP_REST_Server::DELETABLE,\n 'callback' => array( $this->service, 'delete' ),\n 'permission_callback' => array( $this, 'getAdminUserCheck' ),\n 'args' => array(\n 'force' => array(\n 'default' => false,\n ),\n ),\n ),\n ) );\n }", "public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_items' ),\n\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t'args' => $this->get_collection_params(),\n\t\t\t),\n\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<status>[\\w-]+)', array(\n\t\t\t'args' => array(\n\t\t\t\t'status' => array(\n\t\t\t\t\t'description' => __( 'An alphanumeric identifier for the status.' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_item' ),\n\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t\t'args' => array(\n\t\t\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t) );\n\t}", "public static function register_endpoints() {\n // endpoints will be registered here\n register_rest_route( Liang_API_Endpoints::$base_url, '/index', array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array( 'Liang_API_Endpoints', 'get_index' ),\n ) );\n }", "public function register_routes(): void {\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\t[\n\t\t\t\t[\n\t\t\t\t\t'methods' => WP_REST_Server::ALLMETHODS,\n\t\t\t\t\t'callback' => [ $this, 'status_check' ],\n\t\t\t\t\t'permission_callback' => [ $this, 'status_check_permissions_check' ],\n\t\t\t\t\t'args' => [\n\t\t\t\t\t\t'content' => [\n\t\t\t\t\t\t\t'description' => __( 'Test HTML content.', 'web-stories' ),\n\t\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t}", "function register_routes(){\n \tregister_rest_route( parent::get_api_base(), $this->controller . 'get' , array(\n \t\t'methods' => WP_REST_Server::READABLE,\n \t\t'callback' => array($this,'run_cron'),\n\n \t\t//'permission_callback' => array( $this, 'get_item_permissions_check' ),\n \t));\n\t}", "public function register_routes() {\n\t\t$version = '1';\n\t\t$namespace = 'askmedesk/v' . $version;\n register_rest_route( $namespace, '/tipi-richiesta', array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => [$this, 'get_tipi_richiesta'],\n 'permission_callback' => [$this, 'askmedesk_permission_check']\n\t\t));\n\t\tregister_rest_route($namespace, '/creazione-richiesta', array(\n\t\t\t'methods' => WP_REST_Server::CREATABLE,\n\t\t\t'callback' => [$this, 'crea_richiesta'],\n\t\t\t'permission_callback' => [$this, 'askmedesk_permission_check'],\n\t\t\t'args' => $this->get_endpoint_args_for_item_schema( false )\n\t\t));\n\t}", "public function register_routes() {\n\t\tregister_rest_route( $this->namespace, $this->route, [\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => [$this, 'get_options']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => [$this, 'update_options'],\n\t\t\t\t'permission_callback' => [$this, 'update_option_permissions_check']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::DELETABLE,\n\t\t\t\t'callback' => [$this, 'delete_options'],\n\t\t\t\t'permission_callback' => [$this, 'delete_option_permissions_check']\n\t\t\t]\n\t\t] );\n\n\t\tregister_rest_route( $this->namespace, $this->route . '/(?P<slug>.+)', [\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => [$this, 'get_option']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => [$this, 'update_option'],\n\t\t\t\t'permission_callback' => [$this, 'update_option_permissions_check']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::DELETABLE,\n\t\t\t\t'callback' => [$this, 'delete_option'],\n\t\t\t\t'permission_callback' => [$this, 'delete_option_permissions_check']\n\t\t\t]\n\t\t] );\n\t}", "public function register_routes() {\n\n\t\t$namespace = $this->namespace;\n\n\t\t$base = $this->rest_base;\n\n\t\tregister_rest_route( $namespace, '/' . $base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::CREATABLE,\n\t\t\t\t'callback' => array( $this, 'create_item' ),\n\t\t\t\t'permission_callback' => array( $this, 'create_item_permissions_check' ),\n\t\t\t\t'args' => $this->get_collection_params(),\n\t\t\t),\n\t\t) );\n\t}", "public function routes()\n {\n register_rest_route('can', '/donation-forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'fundraisingPages'\n ],\n ]);\n\n register_rest_route('can', '/forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'forms'\n ],\n ]);\n\n register_rest_route('can', '/petitions', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'petitions'\n ],\n ]);\n\n register_rest_route('can', '/person/add', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'addPerson'\n ],\n ]);\n }", "function register_rest_routes() {\n\tif ( class_exists( '\\WP_REST_Controller' ) ) {\n\t\tinclude_once __DIR__ . '/wprest-shortcodes-controller.php';\n\t\t$controller = new rest\\WPREST_Shortcodes_Controller();\n\t\t$controller->register_routes();\n\t}\n}", "protected function registerRoutes()\n {\n Route::group($this->routeConfiguration(), function () {\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n });\n }", "protected function registerRoutes()\n {\n Route::group($this->routeConfiguration(), function () {\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n });\n }", "public function add_rest_api_routes() {\n\t\t// Clerk setting get configuration endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/getconfig',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'getconfig_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Clerk setting set configuration endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/setconfig',\n\t\t\tarray(\n\t\t\t\t'methods' => 'POST',\n\t\t\t\t'callback' => array( $this, 'setconfig_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Product endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/product',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'product_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Product endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/page',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'page_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Category endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/category',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'category_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Order endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/order',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'order_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Customer endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/customer',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'customer_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Version endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/version',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'version_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Version endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/plugin',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'plugin_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t// Log endpoint.\n\t\tregister_rest_route(\n\t\t\t'clerk',\n\t\t\t'/log',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => array( $this, 'log_endpoint_callback' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\t}", "private function register_routes() {\n\t\t$routes = $this->get_routes();\n\t\tforeach ( $routes as $route ) {\n\t\t\t$route->register();\n\t\t}\n\t}", "protected function registerRoutes()\n {\n $this->registerWebRoutes();\n $this->registerApiRoutes();\n }", "private function registerRoutes(){\n $appRouter = require_once __DIR__.'/../../routes/app.php';\n $this->registerApplicationRoutes($appRouter);\n $this->registerApplicationRoutes($appRouter, false);\n $this->registerAuthenticationRoutes();\n }", "public function register_routes() {\n register_rest_route( $this->namespace, '/' . $this->rest_base, array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array( $this, 'get_items' ),\n 'permission_callback' => array( $this, 'get_items_permissions_check' ),\n 'args' => $this->get_collection_params(),\n 'show_in_index' => true,\n ),\n array(\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => array( $this, 'create_item' ),\n 'permission_callback' => array( $this, 'create_item_permissions_check' ),\n 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ),\n 'show_in_index' => true,\n ),\n 'schema' => array( $this, 'get_public_item_schema' ),\n ) );\n\n register_rest_route( $this->namespace, '/back_project', array(\n array(\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => array($this, 'backProjectApiCallback'),\n 'permission_callback' => array( $this, 'get_items_permissions_check' ),\n 'args' => array(\n 'project_id' => array(\n 'validate_callback' => function($param, $request, $key) {\n return is_numeric( $param );\n }\n ),\n 'amount' => array(\n 'validate_callback' => function($param, $request, $key) {\n return is_numeric( $param );\n }\n ),\n ),\n ),\n ) );\n\n register_rest_route( $this->namespace, '/get_balance', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array($this, 'getBalance'),\n 'permission_callback' => array( $this, 'get_items_permissions_check' ),\n ),\n ) );\n\n register_rest_route( $this->namespace, '/get_transactions', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array($this, 'getTransactions'),\n 'permission_callback' => array( $this, 'get_items_permissions_check' ),\n ),\n ) );\n\n /**\n * endpoint for sending coins to all accounts\n */\n register_rest_route( $this->namespace, '/setCoinsToAll', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array($this, 'setCoinsToAll'),\n 'permission_callback' => array( $this, 'get_items_permissions_check' ),\n 'args' => array(\n 'amount' => array(\n 'validate_callback' => function($param, $request, $key) {\n return is_numeric( $param );\n }\n ),\n ),\n ),\n ) );\n\n register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\\d]+)', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array( $this, 'get_item' ),\n 'permission_callback' => array( $this, 'get_item_permissions_check' ),\n 'args' => array(\n 'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n ),\n 'show_in_index' => true,\n ),\n array(\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array( $this, 'update_item' ),\n 'permission_callback' => array( $this, 'update_item_permissions_check' ),\n 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),\n 'show_in_index' => true,\n ),\n array(\n 'methods' => WP_REST_Server::DELETABLE,\n 'callback' => array( $this, 'delete_item' ),\n 'permission_callback' => array( $this, 'delete_item_permissions_check' ),\n 'args' => array(\n 'force' => array(\n 'default' => true,\n 'description' => __( 'Whether to bypass trash and force deletion.' ),\n ),\n ),\n 'show_in_index' => false,\n ),\n 'schema' => array( $this, 'get_public_item_schema' ),\n ) );\n }", "public function rest_api_init() {\n register_rest_route('h5p/v1', '/post/(?P<id>\\d+)', array(\n 'methods' => 'GET',\n 'callback' => array($this, 'rest_api_post'),\n 'args' => array(\n 'id' => array(\n 'validate_callback' => function ($param, $request, $key) {\n return $param == intval($param);\n }\n ),\n ),\n 'permission_callback' => array($this, 'rest_api_permission')\n ));\n\n register_rest_route('h5p/v1', 'all', array(\n 'methods' => 'GET',\n 'callback' => array($this, 'rest_api_all'),\n 'permission_callback' => array($this, 'rest_api_permission')\n ));\n }" ]
[ "0.84524643", "0.8186029", "0.81378144", "0.8137637", "0.81153286", "0.80908096", "0.8053311", "0.80347514", "0.79807097", "0.7979295", "0.79330146", "0.79285026", "0.79153883", "0.7875627", "0.78228325", "0.77830195", "0.7780726", "0.7765854", "0.77462834", "0.77395916", "0.77348924", "0.7712512", "0.77082044", "0.77082044", "0.76919574", "0.7686107", "0.7660582", "0.7647761", "0.76443815", "0.76187116" ]
0.9180096
0
Create the migration file.
private function create_migration(){ $file = $this->path('migrations') . date('Y_m_d_His') . '_create_slender_table.php'; $this->write_file($file, static::$migrationCode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createMigrationFile()\n {\n $fieldObjects = $this->getFields();\n\n if (@$fieldObjects['id']) {\n unset($fieldObjects['id']);\n }\n\n if (@$fieldObjects['created_at'] && @$fieldObjects['updated_at']) {\n $this->addGenericCall((new Base())->timestamps());\n\n unset($fieldObjects['created_at'], $fieldObjects['updated_at']);\n } // if\n\n if (@$fieldObjects['deleted_at']) {\n $this->addGenericCall((new Base())->softDeletes());\n\n unset($fieldObjects['deleted_at']);\n } // if\n\n $schema = implode(', ', $fieldObjects);\n\n if (strpos($schema, 'enum') !== false) {\n $this->getCommand()->info(sprintf('Please change the enum field of table \"%s\" manually.',\n $this->getName()));\n }\n\n if ($this->isPivotTable()) {\n $tables = array_keys($this->getForeignKeys());\n\n Artisan::call(\n 'make:migration:pivot',\n [\n 'tableOne' => $tables[0],\n 'tableTwo' => $tables[1]\n ]\n );\n } else {\n Artisan::call(\n 'make:migration:schema',\n [\n 'name' => \"create_{$this->getName()}_table\",\n '--model' => $this->needsLaravelModel(),\n '--schema' => $fieldObjects ? $schema : ''\n ]\n );\n\n $migrationFiles = glob(\n database_path('migrations') . DIRECTORY_SEPARATOR . \"*_create_{$this->getName()}_table.php\"\n );\n }\n\n return @$migrationFiles ? end($migrationFiles) : '';\n }", "private function make()\n {\n \n $file = database_path().'/migrations/'.$this->fileName.'.php';\n \n $content = $this->blueprint();\n \n $this->file_write( $file, $content );\n \n }", "protected function createMigration()\n {\n $table = Str::snake(Str::pluralStudly(class_basename($this->argument('name'))));\n\n $this->call('make:migration', [\n 'name' => \"create_{$table}_table\",\n '--create' => $table,\n ]);\n }", "protected function createMigration()\n {\n $table = Str::snake(Str::pluralStudly(class_basename($this->argument('name'))));\n\n if ($this->option('pivot')) {\n $table = Str::singular($table);\n }\n try {\n\n $this->call('make:migration', [\n 'name' => \"create_{$table}_table\",\n '--create' => $table,\n ]);\n } catch (\\Exception $e) {\n $this->error($e->getMessage());\n }\n }", "protected function createMigration()\n {\n $migrationsOptions = [\n 'migrationName' => 'create_' . Str::plural(strtolower($this->info['modelName'])) . '_table',\n 'module' => $this->info['moduleName'],\n ];\n\n if ($this->optionHasValue('index')) {\n $migrationsOptions['--index'] = $this->option('index');\n }\n\n if ($this->optionHasValue('unique')) {\n $migrationsOptions['--unique'] = $this->option('unique');\n }\n\n if ($this->optionHasValue('data')) {\n $migrationsOptions['--data'] = $this->option('data');\n }\n\n if ($this->optionHasValue('uploads')) {\n $migrationsOptions['--uploads'] = $this->option('uploads');\n }\n\n if ($this->optionHasValue('int')) {\n $migrationsOptions['--int'] = $this->option('int');\n }\n\n if ($this->optionHasValue('bool')) {\n $migrationsOptions['--bool'] = $this->option('bool');\n }\n\n if ($this->optionHasValue('float')) {\n $migrationsOptions['--float'] = $this->option('float');\n }\n if ($this->optionHasValue('table')) {\n $migrationsOptions['--table'] = $this->option('table');\n }\n\n if (isset($this->info['parent'])) {\n $migrationsOptions['--parent'] = $this->info['parent'];\n }\n\n Artisan::call('engez:migration', $migrationsOptions);\n }", "protected function writeMigrations()\n {\n $files = $this->migrator->create($this->options);\n\n foreach($files as $file)\n {\n $path = pathinfo($file, PATHINFO_FILENAME);\n $this->line(\" <fg=green;options=bold>create</fg=green;options=bold> $path\");\n }\n }", "protected function createMigrationTable()\n {\n $migration_table = $this->config_file->getMigrationTable();\n\n $resource = $this->db_adapter->query(\"\n CREATE TABLE $this->migration_table (\n file VARCHAR PRIMARY KEY,\n ran_at TIMESTAMP DEFAULT NOW()\n );\n \");\n }", "protected function createMigration()\n {\n $name = $this->argument('name');\n\n $this->call('wizard:migration', [\n 'name' => $name,\n ]);\n }", "public function createMigrationsTable(): void;", "public function migrate()\n {\n $fileSystem = new Filesystem();\n\n $fileSystem->copy(\n __DIR__.'/../database/migrations/2018_06_29_032244_create_laravel_follow_tables.php',\n __DIR__.'/database/migrations/create_laravel_follow_tables.php'\n );\n\n foreach ($fileSystem->files(__DIR__.'/database/migrations') as $file) {\n $fileSystem->requireOnce($file);\n }\n\n (new \\CreateLaravelFollowTables())->up();\n (new \\CreateUsersTable())->up();\n (new \\CreateOthersTable())->up();\n }", "private function migration()\n {\n $location = $this->args['location'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR;\n if (!is_dir($location))\n {\n mkdir($location);\n }\n\n $backtrace = debug_backtrace();\n $calling_function = $backtrace[1]['function'];\n\n if ($calling_function === \"model\")\n {\n $class_name = 'Migration_Add_';\n $filename = 'add_';\n $table_name = '';\n\n if (!empty($this->args['subdirectories']))\n {\n $dirs = explode(DIRECTORY_SEPARATOR, $this->args['subdirectories']);\n $dirs = join('_', $dirs);\n $class_name .= strtolower($dirs) . '_';\n $filename .= strtolower($dirs) . '_';\n $table_name .= strtolower($dirs) . '_';\n }\n $args = array(\n 'class_name' => $class_name . Inflector::pluralize($this->args['name']),\n 'table_name' => $table_name . Inflector::pluralize(strtolower($this->args['name'])),\n 'filename' => $filename . Inflector::pluralize(ApplicationHelpers::underscorify($this->args['name'])) . '.php',\n 'application_folder' => $this->args['application_folder'],\n 'parent_class' => $this->args['parent_migration'],\n 'extra' => $this->extra\n );\n\n $template_name = 'migration';\n }\n else\n {\n $args = array(\n 'class_name' => 'Migration_' . $this->args['name'],\n 'table_name' => $this->get_table_name_out_of_migration_name(),\n 'filename' => $this->args['filename'],\n 'application_folder' => $this->args['application_folder'],\n 'parent_class' => $this->args['parent_migration'],\n 'extra' => $this->extra\n );\n\n $template_name = 'empty_migration';\n }\n\n $template = new TemplateScanner($template_name, $args);\n $migration = $template->parse();\n\n $migration_number = MigrationHelpers::get_migration_number($this->args['location']);\n $filename = $location . $migration_number . '_' . $args['filename'];\n $potential_duplicate_migration_filename = MigrationHelpers::decrement_migration_number($migration_number) . '_' . $args['filename'];\n $potential_duplicate_migration = $location . $potential_duplicate_migration_filename;\n\n $message = \"\\t\";\n if (file_exists($potential_duplicate_migration))\n {\n $message .= 'Migration already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $potential_duplicate_migration_filename;\n }\n else if (file_put_contents($filename, $migration) && MigrationHelpers::add_migration_number_to_config_file($this->args['location'], $migration_number))\n {\n $message .= 'Created Migration: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $migration_number . '_' . $args['filename'];\n }\n else\n {\n $message .= 'Unable to create migration: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $migration_number . '_' . $this->args['filename'];\n }\n\n fwrite(STDOUT, $message . PHP_EOL);\n\n return;\n }", "protected function makeMigration()\n {\n new MakeMigration($this, $this->files);\n }", "public static function createMigration($generation){\n\n $dir = database_path().\"/migrations/\";\n $dir_entities = app_path().\"/\".$generation['head']['directory'];\n\n if (!file_exists($dir)){\n mkdir($dir, 0777, true);\n }\n \n if ($generation){\n \n $function = new Functions();\n $migration = new Migration();\n $sequence = 10;\n foreach($generation['schema']['class'] as $value){\n \n $nameFile = $value->table[\"name\"];\n \n $fullname = (@$generation['head']['namemodel'] == \"Y\") ? \"Y\" : \"N\";\n $nameClass = $function->getNameClass($nameFile,$fullname);\n \n if (!$function->fileExistsContent($dir, \"_create_\".strtolower($nameFile).\"_table\")){\n \n $str = \"\";\n $str .= \"<?php\\n\\n\";\n $str .= self::getHead();\n $str .= \"use Illuminate\\Database\\Schema\\Blueprint;\\n\";\n $str .= \"use Illuminate\\Database\\Migrations\\Migration;\\n\";\n\n if (str_contains($nameFile, \"_\")){\n $class_name = explode(\"_\",$nameFile);\n $nameClass = $function->getNameClassFirstUpperCase($class_name[0]).$function->getNameClassFirstUpperCase($class_name[1]);\n }\n \n $str .= \"class Create\".$function->getNameClassFirstUpperCase($nameFile).\"Table extends Migration\\n\";\n $str .= \"{\\n\";\n $str .= \"\\n\\n\\n\";\n $str .= \"\\t/**\\n\";\n $str .= \"\\t* Run the migrations.\\n\";\n $str .= \"\\t*\\n\";\n $str .= \"\\t* @return void\\n\";\n $str .= \"\\t*/\\n\";\n $str .= \"\\tpublic function up()\\n\";\n $str .= \"\\t{\\n\";\n \n if (@$generation['head']['addcon'] == \"Y\"){\n $str .= \"\\t\\t\\tSchema::connection('\".$generation['head']['connection'].\"')->create('\".$nameFile.\"', function (Blueprint \\$table) {\\n\";\n } else {\n $str .= \"\\t\\t\\tSchema::create('\".$nameFile.\"', function (Blueprint \\$table) {\\n\";\n }\n $tmField = sizeof($value->table[\"fields\"]);\n if ($tmField > 0){\n \n foreach($value->table[\"fields\"] as $field){\n \n $addField = true;\n if (@sizeof($value->table[\"foreign\"]) > 0){\n foreach ($value->table[\"foreign\"] as $vl){\n if ($field->name == $vl->foreign){\n $addField = false;\n break;\n }\n unset($vl);\n }\n }\n if ($addField){\n $str .= \"\\t\\t\\t\\t\".$migration->getMigrationField($field, @$value->table['index']).\"\\n\";\n }\n unset($field);\n }\n \n if (@sizeof($value->table['foreign']) > 0){\n foreach ($value->table['foreign'] as $chave){\n $str .= $migration->getMigrationForeign($chave);\n unset($chave);\n }\n }\n \n $str .= \"\\t\\t\\t\\t\\$table->timestamps();\\n\";\n }\n $str .= \"\\t\\t\\t});\\n\";\n $str .= \"\\t}\\n\";\n \n $str .= \"\\t\\n\\n\\n\";\n $str .= \"\\t/**\\n\";\n $str .= \"\\t * Reverse the migrations.\\n\";\n $str .= \"\\t *\\n\";\n $str .= \"\\t * @return void\\n\";\n $str .= \"\\t */\\n\";\n $str .= \"\\tpublic function down()\\n\";\n $str .= \"\\t{\\n\";\n if ($generation['head']['connection'] != \"\") {\n $str .= \"\\t\\t\\tSchema::connection('\".$generation['head']['connection'].\"')->drop('\".$nameFile.\"');\\n\";\n } else {\n $str .= \"\\t\\t\\tSchema::drop('\".$nameFile.\"');\\n\";\n }\n $str .= \"\\t}\\n\";\n \n $str .= \"\\n\\n}\";\n $micro = microtime();\n $micro = str_ireplace(\".\", \"\", $micro);\n $file_name = date('Y').\"_\".date('m').\"_\".date('d').\"_\".date('Hmisu').$sequence.\"_create_\".strtolower($nameFile).\"_table.php\";\n $sequence++;\n if (!file_exists($dir.$file_name)){\n $fp4 = fopen($dir. $file_name, \"w+\");\n $escreve2 = fwrite($fp4, $str);\n fclose($fp4);\n chmod($dir . $file_name,0777);\n }\n unset($value);\n\n } else {\n\n $name_search = $dir_entities.\"/field/fields_\".strtolower($nameClass).\".php\";\n if (file_exists($name_search)){\n\n $nameclass_alter = date('Y').date('m').date('d').date('Hmisu');\n\n $strFileMigration = \"\";\n $strFileMigration .= \"<?php\\n\";\n $strFileMigration .= self::getHead();\n $strFileMigration .= \"use Illuminate\\Database\\Schema\\Blueprint;\\n\";\n $strFileMigration .= \"use Illuminate\\Database\\Migrations\\Migration;\\n\";\n $strFileMigration .= \"use Illuminate\\Support\\Facades\\Schema;\\n\";\n $strFileMigration .= \"\\n\";\n $strFileMigration .= \"class AddField\".$nameclass_alter.$nameClass.\"Table extends Migration\\n\";\n $strFileMigration .= \"{\\n\";\n $strFileMigration .= \"\\n\";\n $strFileMigration .= \"\\tpublic function up()\\n\";\n $strFileMigration .= \"\\t{\\n\";\n $strFileMigration .= \"\\n\";\n if ($generation['head']['connection'] != \"\") {\n $strFileMigration .= \"\\t\\tSchema::connection('\".$generation['head']['connection'].\"')->table('\".$nameFile.\"', function (\\$table) {\\n\";\n } else {\n $strFileMigration .= \"\\t\\tSchema::table('\".$nameFile.\"', function (\\$table) {\\n\";\n }\n\n $ponteiro = fopen ($dir_entities.\"/field/fields_\".strtolower($nameClass).\".php\",\"r\");\n $stream = \"\";\n while (!feof ($ponteiro)) {\n $stream .= fgets($ponteiro,4096);\n }\n fclose ($ponteiro); \n\n $tmField = sizeof($value->table[\"fields\"]);\n $criaMigration = false;\n if ($tmField > 0){\n \n foreach($value->table[\"fields\"] as $field){\n $addField = false;\n if ($field->name != \"id\"){\n $one_search = \"'\".$field->name.\"'\";\n //$sec_search = \"'\".$field->name.\"'\";\n $find1 = (strpos($stream,$one_search) > -1);\n //$find2 = (strpos($stream, $sec_search) > -1);\n if (($find1 == false)) { //} && ($find2 == false)){\n $addField = true;\n }\n if ($addField){\n $criaMigration = true;\n $strFileMigration .= \"\\t\\t\\t\".$migration->getMigrationField($field, @$value->table['index']).\"\\n\";\n }\n }\n unset($field);\n }\n \n if (@sizeof($value->table['foreign']) > 0){\n foreach ($value->table['foreign'] as $chave){\n $one_search = \"'\".$chave->foreign.\"',\";\n $sec_search = \",'\".$chave->foreign.\"'\";\n $find1 = (strpos($stream,$one_search) > -1);\n $find2 = (strpos($stream, $sec_search) > -1);\n if (($find1 == false) && ($find2 == false)){\n $strFileMigration .= $migration->getMigrationForeign($chave);\n }\n unset($chave);\n }\n }\n } \n\n $strFileMigration .= \"\\t\\t});\\n\";\n $strFileMigration .= \"\\t}\\n\";\n if ($generation['head']['connection'] != \"\") {\n $strFileMigration .= \"\\tpublic function down(){Schema::connection('\".$generation['head']['connection'].\"')->drop('\".$nameFile.\"');}\\n\";\n } else {\n $strFileMigration .= \"\\tpublic function down(){Schema::drop('\".$nameFile.\"');}\\n\";\n }\n \n $strFileMigration .= \"\\t}\\n\";\n\n if ($criaMigration){\n $file_name = date('Y').\"_\".date('m').\"_\".date('d').\"_\".date('Hmisu').$sequence.\"_addField\".$nameclass_alter.strtolower($nameClass).\"_table.php\";\n $sequence++;\n if (!file_exists($dir.\"/\".$file_name)){\n $fp4 = fopen($dir. \"/\" . $file_name, \"w+\");\n $escreve2 = fwrite($fp4, $strFileMigration);\n fclose($fp4);\n chmod($dir. \"/\" . $file_name,0777);\n }\n }\n\n }\n\n }\n \n\n }\n \n }\n\n\n }", "protected function writeMigration($name, $table = null, $create = null)\n {\n // @codeCoverageIgnoreStart\n if (! file_exists(database_path('content-migrations'))) {\n mkdir(database_path('content-migrations'), 0755);\n }\n // @codeCoverageIgnoreEnd\n\n $file = $this->creator->create(\n $name,\n $this->laravel->databasePath() . DIRECTORY_SEPARATOR . 'content-migrations'\n );\n\n $fileName = basename($file);\n\n $this->line(\"<info>Created Content Migration:</info> {$fileName}\");\n }", "public function moveMigrationFile()\n {\n $from = base_path('Modules/' . $this->module . '/database/migrations/create_things_table.php.stub');\n $to = getMigrationFileName('create_' . mb_strtolower($this->module) . '_table');\n $this->files->move($from, $to);\n }", "public function create($name)\n {\n $file = $this->createFile($name);\n $this->autoload();\n $this->note(\"<info>Created Data Migration:</info> $file\");\n }", "public function createAction()\n {\n $this->request()->commandProperties([\n 'name',\n ]);\n\n if (!$name = $this->request()->command('name'))\n return $this->_('ERROR: Empty migration name parameter');\n\n if (!$name = preg_replace('~[^0-9A-z_]+~iu', '', $name))\n return $this->_('ERROR: Wrong migration name parameter');\n\n if (!is_dir(MIGRATE_PATH))\n return $this->_('ERROR: Directory is not exist \"' . MIGRATE_PATH . '\"');\n\n $name = 'Migrate_' . time() . \"_$name\";\n\n $content = @file_get_contents(BASE_PATH . 'base/migrate/create.tpl');\n $content = str_replace('{name}', $name, $content);\n\n @file_put_contents(MIGRATE_PATH . $name . '.php', $content);\n\n return $this->_('Migration \"' . $name . '\" created');\n }", "public function createTable()\n {\n $sql = \"\n CREATE TABLE IF NOT EXISTS `\".self::TABLE.\"`(\n `migration` VARCHAR(20) NOT NULL,\n `up` VARCHAR(1000) NOT NULL,\n `down` VARCHAR(1000) NOT NULL\n ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;\n \";\n\n $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n }", "public function generateAction():void{\n new Migration();\n }", "protected function writeMigration( $name )\n\t{\n\t\t$output = pathinfo( $this->migrator->create( $name, $this->getMigrationsPath() ), PATHINFO_FILENAME );\n\n\t\t$this->line( \" <fg=green;options=bold>create</fg=green;options=bold> $output\" );\n\t}", "public function migrate()\n {\n $db = new \\SQLite3(\"ATM.db\");\n\n $query = \"CREATE TABLE IF NOT EXISTS \" . $this->table_name . \" \";\n $fields = array();\n\n foreach($this->fields as $name=>$type) {\n $fields[] = \"$name $type\";\n }\n\n $query .= \"(\" . implode(\", \", $fields) . \")\";\n\n $db->exec($query);\n }", "protected function createMigrationHistoryTable()\n {\n $tableName = $this->db->schema->getRawTableName($this->migrationTable);\n $this->stdout(\"Creating migration history table \\\"$tableName\\\"...\", Console::FG_YELLOW);\n\n $this->db->createCommand()->createTable($this->migrationTable, [\n 'version' => 'String',\n 'apply_time' => 'DateTime',\n ], 'ENGINE = MergeTree() PRIMARY KEY (version) ORDER BY (version)')->execute();\n\n $this->addMigrationHistory(self::BASE_MIGRATION);\n\n $this->stdout(\"Done.\\n\", Console::FG_GREEN);\n }", "public function makeMigration()\n {\n $name = $this->meta['name'];\n if ($this->files->exists($path = $this->getPath($name))) {\n return $this->error($this->type . ' already exists!');\n }\n $this->makeDirectory($path);\n if($this->files->put($path, $this->compileMigrationStub())){\n return true;\n }\n\n return false;\n }", "protected function generateMigration($className, $tableName, $args)\n { list($tableAction, $tableEvent) = $this->parseActionType($className);\n\n // Now, we begin creating the contents of the file.\n Template::newClass($className);\n\n /* The Migration Up Function */\n $up = $this->migrationUp($tableEvent, $tableAction, $tableName, $args);\n \n /* The Migration Down Function */\n $down = $this->migrationDown($tableEvent, $tableAction, $tableName, $args);\n\n // Add both the up and down function to the migration class.\n Content::addAfter('{', $up . $down);\n\n return $this->prettify();\n }", "public function userTableMigrate()\r\n\t{\r\n\t\t$isUserTableExist = $this->schema->tableExist('users');\r\n\t\tif (!$isUserTableExist) {\r\n\r\n\t\t\t$fileName = \"20210408051901_create_users_table.php\";\r\n\t\t\t$dir = $this->migrationFiles . $fileName;\r\n\t\t\t$content = file_get_contents($this->stubsPath . \"user_migration.stubs\");\r\n\r\n\t\t\tif (!file_exists($dir)) {\r\n\t\t\t\t$handle = fopen($dir, 'w+');\r\n\t\t\t\tfwrite($handle, $content);\r\n\t\t\t\tfclose($handle);\r\n\t\t\t\tchmod($dir, 0777);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function migrate()\n {\n /**\n * @var $migrator Migrator\n */\n $migrator = $this->app->make('migrator');\n\n /**\n * @var $migratonRepository DatabaseMigrationRepository\n */\n $migratonRepository = $this->app->make('migration.repository');\n\n $migratonRepository->createRepository();\n\n $migrator->run([__DIR__ . \"/../database/migrations\"]);\n\n }", "private function _populateMigrationTable()\n\t{\n\t\t$migrations = array();\n\n\t\t// Add the base one.\n\t\t$migration = new MigrationRecord();\n\t\t$migration->version = craft()->migrations->getBaseMigration();\n\t\t$migration->applyTime = DateTimeHelper::currentUTCDateTime();\n\t\t$migrations[] = $migration;\n\n\t\t$migrationsFolder = craft()->path->getAppPath().'migrations/';\n\t\t$migrationFiles = IOHelper::getFolderContents($migrationsFolder, false, \"(m(\\d{6}_\\d{6})_.*?)\\.php\");\n\n\t\tif ($migrationFiles)\n\t\t{\n\t\t\tforeach ($migrationFiles as $file)\n\t\t\t{\n\t\t\t\tif (IOHelper::fileExists($file))\n\t\t\t\t{\n\t\t\t\t\t$migration = new MigrationRecord();\n\t\t\t\t\t$migration->version = IOHelper::getFileName($file, false);\n\t\t\t\t\t$migration->applyTime = DateTimeHelper::currentUTCDateTime();\n\n\t\t\t\t\t$migrations[] = $migration;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ($migrations as $migration)\n\t\t\t{\n\t\t\t\tif (!$migration->save())\n\t\t\t\t{\n\t\t\t\t\tCraft::log('Could not populate the migration table.', LogLevel::Error);\n\t\t\t\t\tthrow new Exception(Craft::t('There was a problem saving to the migrations table: ').$this->_getFlattenedErrors($migration->getErrors()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tCraft::log('Migration table populated successfully.');\n\t}", "public function generate()\n {\n $className = 'Version' . date('YmdHis', time());\n $classPath = $this->migrationsDir . DIRECTORY_SEPARATOR . $className . '.php';\n\n if (file_exists($classPath)) {\n throw new MigrationException(sprintf('Migration %s exists!', $className));\n }\n file_put_contents($classPath, $this->getTemplate($className));\n\n return $classPath;\n }", "function migrate_db() {\r\n \r\n // $migrater->create_migrations_table();\r\n // $migrater->build_schema();\r\n }", "public function create($name = NULL, $fields = array(), $writeFile = TRUE)\n\t{\n\t\t// Create filename\n\t\t$fileName = time() . \"_$name.php\";\n\n\t\t// Crate class according to the parameters\n\t\t$codeGenerator = new CodeGenerator($name, array(\"$name Migration\", '', '@author {insert_me}'));\n\n\t\t// Add migration namespace\n\t\t$codeGenerator->addNamespace('app\\\\migrations');\n\n\t\t// Add references\n\t\t$codeGenerator->addReference('app\\\\base\\\\Migrator');\n\t\t$codeGenerator->addReference('app\\\\base\\\\MigratorInterface');\n\t\t$codeGenerator->addReference('RedBeanPHP\\R;');\n\n\t\t// Add interface implementation\n\t\t$codeGenerator->addImplementation('MigratorInterface');\n\n\t\t// Extends base class\n\t\t$codeGenerator->addExtends('Migrator');\n\n\t\t// Create UP method\n\t\t$codeGenerator->addMethod('up',\n\t\t\tarray(CodeGenerator::METHOD_PUBLIC),\n\t\t\tarray(),\n\t\t\t$this->addFields($name, $fields),\n\t\t\tarray('Migrate UP'));\n\n\t\t// Create DOWN method\n\t\t$codeGenerator->addMethod('down',\n\t\t\tarray(CodeGenerator::METHOD_PUBLIC),\n\t\t\tarray(),\n\t\t\t$this->deleteTable($name),\n\t\t\tarray('Migrate DOWN'));\n\n\n\t\t// Generate code and write it at migrations folder\n\t\t$code = $codeGenerator->generate();\n\n\t\t// Write file at the migrations folder\n\t\tif ($writeFile)\n\t\t{\n\t\t\t// And write file\n\t\t\t$path = $this->config->getBasePath() . \"/app/migrations/\" . $fileName;\n\t\t\tfile_put_contents($path, $code);\n\t\t}\n\n\t\treturn $code;\n\t}" ]
[ "0.8154367", "0.78457505", "0.7308281", "0.73058426", "0.7291852", "0.7275333", "0.7198678", "0.71922076", "0.7006299", "0.69888926", "0.6978014", "0.6830445", "0.66938156", "0.66419494", "0.6626336", "0.6571437", "0.6570803", "0.6546038", "0.6533373", "0.6480715", "0.64766645", "0.644285", "0.6434412", "0.6375951", "0.63715047", "0.63604504", "0.6332421", "0.63214767", "0.6312946", "0.6302007" ]
0.8150878
1
Console output sub header message.
private function _subheader($text){ echo '[-] ' . $text . PHP_EOL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function subheader($title)\n\t{\n\t\tstatic::stdout\n\t\t\t(\n\t\t\t\t' === '.$title.' '.\\str_repeat('=', \n\t\t\t\tstatic::$screenwidth-6-\\strlen($title)).PHP_EOL.PHP_EOL\n\t\t\t);\n\t}", "private function printHeader()\n {\n $this->printer->println('Test-Flight %s', Constants::VERSION);\n }", "public function printHeaders() {\n\t}", "function sendHeader() {\n\t\t$this->console_text('###############################################################################');\n\t\t$this->console_text(' Aseco v' . ASECO_VERSION . ' running on {1}:{2}', $this->server->ip, $this->server->port);\n\t\t$this->console_text(' Game : {1} - {2}', $this->server->game, $this->server->gameinfo->getMode());\n\t\t$this->console_text(' Author: Florian Schnell');\n\t\t$this->console_text('###############################################################################');\n\n\t\tif ($this->welcome_msgs) {\n\t\t\tforeach ($this->welcome_msgs as $message) {\n\t\t\t\t$this->console_text('[' . $message['DATE'][0].'] ' . $message['TEXT'][0]);\n\t\t\t}\n\t\t\t$this->console_text('###############################################################################');\n\t\t}\n\n\t\t// format the text of the message ...\n\t\t$startup_msg = formatText($this->getChatMessage('STARTUP'),\n\t\t\tASECO_VERSION,\n\t\t\t$this->server->ip,\n\t\t\t$this->server->port);\n\n\t\t// replace colors ...\n\t\t$startup_msg = $this->formatColors($startup_msg);\n\n\t\t// send the message ...\n\t\t$this->client->addCall('ChatSendServerMessage', array($startup_msg));\n\t\t$this->client->multiquery();\n\t}", "function Header()\n{\n\tglobal $title;\n\t$this->Ln(5);\n}", "function sendHeader() {\n\n\t\t$this->console_text('###############################################################################');\n\t\t$this->console_text(' XASECO2 v' . XASECO2_VERSION . ' running on {1}:{2}', $this->server->ip, $this->server->port);\n\t\t$this->console_text(' Name : {1} - {2}', stripColors($this->server->name, false), $this->server->serverlogin);\n\t\tif ($this->server->isrelay)\n\t\t\t$this->console_text(' Relays : {1} - {2}', stripColors($this->server->relaymaster['NickName'], false), $this->server->relaymaster['Login']);\n\t\t$this->console_text(' Game : {1} - {2} - {3}', $this->server->game,\n\t\t $this->server->packmask, $this->server->gameinfo->getMode());\n\t\t$this->console_text(' Version: {1} / {2}', $this->server->version, $this->server->build);\n\t\t$this->console_text(' Author : Xymph');\n\t\t$this->console_text('###############################################################################');\n\n\t\t// format the text of the message\n\t\t$startup_msg = formatText($this->getChatMessage('STARTUP'),\n\t\t XASECO2_VERSION,\n\t\t $this->server->ip, $this->server->port);\n\t\t// show startup message\n\t\t$this->client->query('ChatSendServerMessage', $this->formatColors($startup_msg));\n\t}", "function Header()\n\t{\n\t\t$this->cabecera_esp();\n\t\t$this->Ln();\n\t}", "private function _header($text){\n echo '[*] ' . $text . PHP_EOL;\n }", "function display_header() {}", "function Header() {\r\n // print the title\r\n $this->SetTitleFont();\r\n $this->Cell(100, 8, $this->title, 0, 0, \"L\");\r\n\r\n // print the author\r\n $this->SetAuthorFont();\r\n $this->Cell(0, 8, $this->author, 0, 0, \"R\");\r\n\r\n // header line\r\n $this->SetFillColor(0, 0, 0);\r\n $this->Rect(10, 17, 190, 0.2, \"F\");\r\n $this->Rect(10, 17.5, 190, 0.2, \"F\");\r\n $this->Ln(14);\r\n }", "function display_header_text()\n {\n }", "public function print_header() {\n return $this->header();\n }", "abstract public function header();", "public function Header(){\n\t\t$this->lineFeed(10);\n\t}", "public function printHeader() {\n\t\t$template = self::$templates[$this->templateName];\n\t\trequire_once $template['path'] . $template['file-header'];\n\t}", "public function __Header(){\n $this->Ln(5);\n $this->SetDrawColor(160,160,160);\n $this->SetFillColor(230,230,230);\n $this->SetTextColor(100);\n $this->SetFont('Arial','B',7);\n $this->SetX(($this->w - $this->_tWidth)/2);\n foreach($this->_fields as $field)\n $this->Cell($field[\"size\"],5,$field[\"header\"],1,0,\"C\",true);\n $this->Ln();\n }", "function header (){\n\t\t$this->setfont('Arial','B', 16);\n\t\t$this->settextcolor(0, 0, 0);\n\t\t$this->cell(0, 10, 'WANANCHI', 0, 0, 'C');\n\t\t$this->Ln(10);\n\t\t$this->setfont('Arial','',12);\n\t\t$this->settextcolor(0, 0, 0);\n\t\t$this->cell(0, 10, 'INFORMATION',0, 0, 'C');\n\t\t$this->Ln(30);\n\t}", "public function header()\n {\n }", "function printHeader($text) {\n \treturn \"<h2>\".$text.\"</h2>\";\n }", "abstract protected function header();", "function header() {\n }", "protected function showHeader($header)\n {\n $names = count($header);\n\n for ($i = 0; $i < $names; $i++) {\n echo ucfirst($header[$i]);\n\n if ($i < $names-1) echo self::SEPARATOR;\n }\n\n echo PHP_EOL;\n }", "function displayHeader($title = '',\n $subtitle = '',\n $status = ''){\n global $DOPBSP;\n \n $complete_title = ($title != '' ? '<span class=\"dopbsp-phone-hidden\">'.$title:'').\n ($subtitle != '' ? ' - </span>'.$subtitle:'</span>').\n ($status != '' ? '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$status:'');\n?>\n <h2></h2>\n <div class=\"dopbsp-header\">\n <h3><?php echo $complete_title?></h3>\n<?php\n echo $this->getLanguages();\n \n if (DOPBSP_CONFIG_VIEW_DOCUMENTATION){\n?>\n <a href=\"<?php echo DOPBSP_CONFIG_HELP_DOCUMENTATION_URL; ?>\" target=\"_blank\" class=\"dopbsp-tablet-hidden dopbsp-phone-hidden\"><?php echo $DOPBSP->text('HELP_DOCUMENTATION'); ?></a>\n<?php\n }\n?>\n <br class=\"dopbsp-clear\" />\n </div>\n <?php $this->displayBoxes(); ?>\n<?php \n }", "function Header(){\n\t\t}", "function create_subheader_for_answers ( $question_id ) {\n /* $result_answers array\n * $number_of_answers integer\n */\n $result_answers = fetch_answers ( $question_id );\n // to print subheader for Answers\n $number_of_answers = pg_num_rows ( $result_answers );\n\n if ( $number_of_answers == 1 ) \n {\n subheader( $number_of_answers \n . \" Answer\" );\n }\n // to have the underline\n else if ( $number_of_answers == 0 ) {\n subheader( \"Be the first answerer\" );\n }\n else\n {\n echo (\"<div id='subheader'>\"\n . \"<h2>\"\n . $number_of_answers . \" Answers\"\n . \"</h2>\" );\n create_tab_box_thread( $question_id );\n echo ( \"</div>\" );\n }\n}", "public function header() {\n\t}", "public static function renderHeaders()\n {\n echo self::$headers;\n }", "function printOutputHeader() {\n echo \"Title|Code|Duration|Inclusions|MinPrice\\n\";\n}", "public static function header_output() {\n\t\tob_start();\n\n\t\tif ( self::options( 'header_type' ) == 'navbar-fixed-top' ) {\n\t\t\techo 'body{padding-top: 50px;}';\n\t\t}\n\n\t\tif ( ! display_header_text() ) {\n\t\t\techo '#site-title,.site-description{position: absolute;clip: rect(1px, 1px, 1px, 1px);}';\n\t\t} else {\n\t\t\tself::generate_css( '#site-title', 'color', 'header_textcolor', '#' );\n\t\t}\n\t\t$extra_css = apply_filters( 'maketador_header_output', ob_get_clean() );\n\t\tif ( ! empty( $extra_css ) ) {\n\t\t\techo '<style type=\"text/css\">' . $extra_css . '</style>';\n\t\t}\n\t\t?>\n\t\t<?php\n\t}", "private function writePrintHeaders(): void\n {\n $record = 0x002a; // Record identifier\n $length = 0x0002; // Bytes to follow\n\n $fPrintRwCol = $this->printHeaders; // Boolean flag\n\n $header = pack('vv', $record, $length);\n $data = pack('v', $fPrintRwCol);\n $this->append($header . $data);\n }" ]
[ "0.6983904", "0.69063276", "0.678193", "0.67444533", "0.6739505", "0.67330635", "0.66642505", "0.6622341", "0.6617553", "0.6534072", "0.64677656", "0.64366525", "0.6414801", "0.63901216", "0.6290614", "0.6288626", "0.62877136", "0.6283677", "0.627967", "0.62146926", "0.61994517", "0.61687773", "0.61515534", "0.6130472", "0.61227745", "0.6117059", "0.6113648", "0.608092", "0.60630065", "0.6044013" ]
0.7573624
0
Console output warning message. (You don't want to see these!)
private function _warning($text){ echo '[# WARNING] ' . $text . PHP_EOL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function warning()\n {\n return $this->warn(\"You have no commands to run !\");\n }", "public static function warning()\n {\n static::returnCode(static::CODE_WARNING);\n }", "public function showWarnings(): void\n {\n $this->executeLog('show warnings');\n }", "function Print_Warning($message)\r\n{\r\n print (\"<b>\" . $message . \"</b>\\n<br>\");\r\n}", "function warning($message);", "public function warning($message) {}", "public function showWarning($msg)\n {\n print \"\\tWARNING: \" . $msg . \"\\n\";\n }", "function display_warning_message($message)\r\n {\r\n Display :: warning_message($message);\r\n }", "public function warning($msg) {\n $this->writeLine($msg, 'warning');\n }", "function atkwarning($txt)\n{\n\tatkdebug($txt,DEBUG_WARNING);\n}", "public static function warningHandler()\n {\n }", "public function warning(string $text);", "public static function warning() {\n\t\t# Get arguments to this function:\n\t\t$args = func_get_args();\n\n\t\t# Add message to log:\n\t\treturn self::add(LOG_WARNING, $args);\n\t}", "function warning($message, array $context = array());", "protected function warning(string $message)\n {\n if (FLOW_SAPITYPE === 'CLI') {\n echo \"\\033[33m\" . $message . \"\\033[0m\" . PHP_EOL;\n }\n }", "function warning($output)\n{\n dd('<fg=red>'.$output.'</>');\n}", "function worldlogger_admin_warnings() {\n\tglobal $wpcom_api_key;\n\tif ( !get_option('worldlogger_hash') && !isset($_POST['submit']) ) {\n\t\tfunction worldlogger_warning() {\n\t\t\techo \"\n\t\t\t<div id='worldlogger-warning' class='updated fade'><p><strong>\".__('Worldlogger is almost ready.').\"</strong> \".sprintf('You must <a href=\"%1$s\">enter a Worldlogger API key</a> for it to work.', \"options-general.php?page=worldlogger-options\").\"</p></div>\n\t\t\t\";\n\t\t}\n\t\tadd_action('admin_notices', 'worldlogger_warning');\n\t\treturn;\n\t}\n}", "protected function warning()\n\t{\n\t\t\\IPS\\Output::i()->output = \\IPS\\Theme::i()->getTemplate( 'store' )->productOptionsChanged(\n\t\t\tnew \\IPS\\Patterns\\ActiveRecordIterator(\n\t\t\t\t\\IPS\\Db::i()->select( '*', 'nexus_packages', \\IPS\\Db::i()->in( 'p_id', explode( ',', \\IPS\\Request::i()->ids ) ) ),\n\t\t\t\t'IPS\\nexus\\Package'\n\t\t\t)\n\t\t);\n\t}", "function clear_warning_message()\n {\n $this->_warning_message = \"\";\n }", "public function warn($msg);", "public static function write_debug_warning(){\n\t\t\tif(str_replace('none','',CFG::get('DEBUG_MODE'))!='' && !Ajax::is_on()){\n\t\t\t\t$ie6h=(stripos(str_replace(' ','',$_SERVER['HTTP_USER_AGENT']),'MSIE6')!==false); // ie6 hotfix\n\t\t\t\t?><div style=\"-moz-border-radius:8px; -webkit-border-radius:8px; border-radius:8px;\n\t\t\t\t\t-moz-box-shadow:0 0 8px #000; -webkit-box-shadow:0 0 8px #000; box-shadow:0 0 8px #000;\n\t\t\t\t\tbackground:#FEE; border:2px solid #F00; font-family:arial; font-size:12px; font-weight:bold;\n\t\t\t\t\tmargin:2px; padding:0 4px; position:fixed; right:4px; text-shadow:0 0 10px #A00; z-index:10;\n\t\t\t\t\ttop:4px; position:<?php echo $ie6h?'absolute':'fixed'; ?>;\">DEBUG MODE</div><?php\n\t\t\t}\n\t\t}", "function FMWarning($message)\n\t{\n\t\t$trace = \"\";\n\n\t\tforeach ($this->FMDebug as $level) {\n\t\t\t$trace .= \" > \" . $level;\n\t\t}\n\n\t\terror_log (\"freemoviecompiler warning: $trace --> $message\");\n\t}", "public function warning() {\r\n echo \"<div id='wpGoogleMaps_warning' class='updated fade-ff0000'><p><strong>\"\r\n .__('Google Maps for WordPress is almost ready.').\"</strong> \"\r\n .sprintf(__('You must <a href=\"%1$s\">enter your Google API key</a> for it to work.'), \"plugins.php?page=wpGoogleMaps-config\")\r\n .\"</p></div>\";\r\n }", "function sf_warn($data, $force = false, $block_header_on_echo = false)\n {\n IOFunctions::out(\n LogLevel::WARN,\n $data,\n $force,\n $block_header_on_echo\n );\n }", "private static function warn(string $message): void\n {\n echo \"\\033[43m\\033[30m\" . $message . \"\\033[0m\" . PHP_EOL;\n }", "public function debugWarnings()\n\t{\n\t\t$stmt = $this->_query('SHOW WARNINGS', true);\n\n\t\t$warnings = array();\n\t\twhile ($warning = $stmt->fetch_assoc())\n\t\t{\n\t\t\t$warnings[] = $warning;\n\t\t}\n\n\t\tforeach ($warnings as $warning)\n\t\t{\n\t\t\tatkwarning(\"MYSQL warning '{$warning['Level']}' (Code: {$warning['Code']}): {$warning['Message']}\");\n\t\t}\n\t}", "public function testWarning(\\unittest\\TestWarning $warning) {\n $this->status= false;\n $this->stats['warned']++;\n $this->writeFailure($warning);\n }", "protected function warn()\r\n {\r\n// header('Location: '.$this->warning_url);\r\n $this->send_header($this->warning_url);\r\n exit;\r\n }", "public function testWarningMessage()\n {\n $this->throwWarningException();\n\n // test if code actually gets here\n $this->assertTrue(true);\n }", "private function printWarn(string $msg, bool $forceOutput = false): void\n {\n $msg = \"\\e[93m>>> [WARN]: {$msg}\\e[0m\";\n\n if ($forceOutput) {\n print $msg . PHP_EOL;\n } else {\n $this->bufferOutput[] = $msg;\n }\n }" ]
[ "0.7784434", "0.77052283", "0.7610558", "0.7465206", "0.7375183", "0.732393", "0.7212717", "0.7126498", "0.70685446", "0.7015538", "0.69874", "0.6972942", "0.6902763", "0.6889078", "0.6865816", "0.6825296", "0.6824176", "0.67983", "0.6726387", "0.67246574", "0.67184603", "0.6702089", "0.66965497", "0.66865164", "0.6683938", "0.6676281", "0.6663516", "0.6652749", "0.66485953", "0.66375124" ]
0.77359724
1
Parses yaml file with caching. Uses if available
public static function parse ( $file ) { $file_path = XT_PROJECT_DIR .'/'. $file; $cached_path = XT_PROJECT_DIR .'/cache/'. $file; // Check if YAML file was updated since the last caching if ( !file_exists ( $cached_path ) || filemtime ( $file_path ) > filemtime ( $cached_path ) ) { // Generate a new cache $cached_dir = dirname ( $cached_path ); if ( !is_dir ( $cached_dir ) ) { mkdir ( $cached_dir, 0777, true ); chmod ( $cached_dir, 0777 ); } // Parse, cache & return if ( extension_loaded ( 'yaml' ) ) { $parsed = yaml_parse_file ( $file_path ); } else { $parsed = yaml::load ( $file_path ); } file_put_contents ( $cached_path, serialize ( $parsed ) ); // Chmod file if it isn't already world-writeable $perms = substr ( decoct ( fileperms ( $cached_path ) ), -3 ); if ( $perms != 777 ) chmod ( $cached_path, 0777 ); return $parsed; } // Return cached file return unserialize ( file_get_contents ( $cached_path ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function load()\n {\n if ($this->sites) {\n return;\n }\n $data = Yaml::parse(file_get_contents($this->file));\n $this->sites = $data['sites'];\n }", "protected function pull()\n {\n $this->definition = array();\n \n if (file_exists(\\sfConfig::get('sf_cache_dir') . DIRECTORY_SEPARATOR . $this->file_name)) {\n $this->definition = \\sfYaml::load(\\sfConfig::get('sf_cache_dir') . DIRECTORY_SEPARATOR . $this->file_name);\n }\n }", "public function loadYamlConfig($filepath);", "function yml_parse_file($ymlFile)\n {\n return yml::parseFile($ymlFile);\n }", "private function load($file) {\n $yml = new \\Yaml($file);\n $data = $yml->parse();\n\n $this->name = \\a::get($data, 'name', NULL);\n $this->theme = \\a::get($data, 'theme', \\c::get('theme', 'grass'));\n $this->eventdate = \\a::get($data, 'eventdate', NULL);\n $this->intro = \\a::get($data, 'intro', NULL);\n $this->storeFields(\\a::get($data, 'fields', FALSE));\n $this->action = \\a::get($data, 'action', NULL);\n }", "protected static function parseYaml($filename) {\n if (!file_exists($filename)) {\n throw new \\Exception('A config.yml file must exist in the project root.');\n }\n return Yaml::parse(file_get_contents($filename));\n }", "public function parseYaml()\n {\n if ($this->getMimeType() == 'application/x-yaml' || $this->getMimeType() == 'text/yaml') {\n return yaml_parse($this->getContents());\n }\n }", "function yml_parse($yml)\n {\n return yml::parse($yml);\n }", "protected function loadMappingFile($file)\n {\n return Yaml::parse(file_get_contents($file));\n }", "public function loadFromFile()\n {\n $this->getLogger()->debug('Reading metadata from ' . $this->defFile);\n $fields = Yaml::parse($this->defFile);\n if (!is_array($fields)) {\n $fields = array();\n $this->getLogger()->warning('No definition found in metadata file.');\n }\n $res = array();\n foreach ($fields as $field_data) {\n $res[$field_data['id']] = $field_data;\n }\n ksort($res);\n return $res;\n }", "function load($input) {\n\t// See what type of input we're talking about\n\t// If it's not a file, assume it's a string\n\tif (!empty($input) && (strpos($input, \"\\n\") === false)\n\t\t&& file_exists($input)) {\n\t\t$yaml = file($input);\n\t} else {\n\t\t$yaml = explode(\"\\n\",$input);\n\t}\n\t// Initiate some objects and values\n\t$base = new YAMLNode (1);\n\t$base->indent = 0;\n\t$this->_lastIndent = 0;\n\t$this->_lastNode = $base->id;\n\t$this->_inBlock = false;\n\t$this->_isInline = false;\n\t$this->_nodeId = 2;\n\n\tforeach ($yaml as $linenum => $line) {\n\t\t$ifchk = trim($line);\n\n\t\t// If the line starts with a tab (instead of a space), throw a fit.\n\t\tif (preg_match('/^(\\t)+(\\w+)/', $line)) {\n\t\t$err = 'ERROR: Line '. ($linenum + 1) .' in your input YAML begins'.\n\t\t\t\t' with a tab. YAML only recognizes spaces. Please reformat.';\n\t\tdie($err);\n\t\t}\n\n\t\tif ($this->_inBlock === false && empty($ifchk)) {\n\t\tcontinue;\n\t\t} elseif ($this->_inBlock == true && empty($ifchk)) {\n\t\t$last =& $this->_allNodes[$this->_lastNode];\n\t\t$last->data[key($last->data)] .= \"\\n\";\n\t\t} elseif ($ifchk{0} != '#' && substr($ifchk,0,3) != '---') {\n\t\t// Create a new node and get its indent\n\t\t$node = new YAMLNode ($this->_nodeId);\n\t\t$this->_nodeId++;\n\n\t\t$node->indent = $this->_getIndent($line);\n\n\t\t// Check where the node lies in the hierarchy\n\t\tif ($this->_lastIndent == $node->indent) {\n\t\t\t// If we're in a block, add the text to the parent's data\n\t\t\tif ($this->_inBlock === true) {\n\t\t\t$parent =& $this->_allNodes[$this->_lastNode];\n\t\t\t$parent->data[key($parent->data)] .= trim($line).$this->_blockEnd;\n\t\t\t} else {\n\t\t\t// The current node's parent is the same as the previous node's\n\t\t\tif (isset($this->_allNodes[$this->_lastNode])) {\n\t\t\t\t$node->parent = $this->_allNodes[$this->_lastNode]->parent;\n\t\t\t}\n\t\t\t}\n\t\t} elseif ($this->_lastIndent < $node->indent) {\n\t\t\tif ($this->_inBlock === true) {\n\t\t\t$parent =& $this->_allNodes[$this->_lastNode];\n\t\t\t$parent->data[key($parent->data)] .= trim($line).$this->_blockEnd;\n\t\t\t} elseif ($this->_inBlock === false) {\n\t\t\t// The current node's parent is the previous node\n\t\t\t$node->parent = $this->_lastNode;\n\n\t\t\t// If the value of the last node's data was > or | we need to\n\t\t\t// start blocking i.e. taking in all lines as a text value until\n\t\t\t// we drop our indent.\n\t\t\t$parent =& $this->_allNodes[$node->parent];\n\t\t\t$this->_allNodes[$node->parent]->children = true;\n\t\t\tif (is_array($parent->data)) {\n\t\t\t\t$chk = '';\n\t\t\t\tif (isset ($parent->data[key($parent->data)]))\n\t\t\t\t\t$chk = $parent->data[key($parent->data)];\n\t\t\t\tif ($chk === '>') {\n\t\t\t\t$this->_inBlock = true;\n\t\t\t\t$this->_blockEnd = ' ';\n\t\t\t\t$parent->data[key($parent->data)] =\n\t\t\t\t\t\tstr_replace('>','',$parent->data[key($parent->data)]);\n\t\t\t\t$parent->data[key($parent->data)] .= trim($line).' ';\n\t\t\t\t$this->_allNodes[$node->parent]->children = false;\n\t\t\t\t$this->_lastIndent = $node->indent;\n\t\t\t\t} elseif ($chk === '|') {\n\t\t\t\t$this->_inBlock = true;\n\t\t\t\t$this->_blockEnd = \"\\n\";\n\t\t\t\t$parent->data[key($parent->data)] =\n\t\t\t\t\t\tstr_replace('|','',$parent->data[key($parent->data)]);\n\t\t\t\t$parent->data[key($parent->data)] .= trim($line).\"\\n\";\n\t\t\t\t$this->_allNodes[$node->parent]->children = false;\n\t\t\t\t$this->_lastIndent = $node->indent;\n\t\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t} elseif ($this->_lastIndent > $node->indent) {\n\t\t\t// Any block we had going is dead now\n\t\t\tif ($this->_inBlock === true) {\n\t\t\t$this->_inBlock = false;\n\t\t\tif ($this->_blockEnd = \"\\n\") {\n\t\t\t\t$last =& $this->_allNodes[$this->_lastNode];\n\t\t\t\t$last->data[key($last->data)] =\n\t\t\t\t\ttrim($last->data[key($last->data)]);\n\t\t\t}\n\t\t\t}\n\n\t\t\t// We don't know the parent of the node so we have to find it\n\t\t\t// foreach ($this->_allNodes as $n) {\n\t\t\tforeach ($this->_indentSort[$node->indent] as $n) {\n\t\t\tif ($n->indent == $node->indent) {\n\t\t\t\t$node->parent = $n->parent;\n\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($this->_inBlock === false) {\n\t\t\t// Set these properties with information from our current node\n\t\t\t$this->_lastIndent = $node->indent;\n\t\t\t// Set the last node\n\t\t\t$this->_lastNode = $node->id;\n\t\t\t// Parse the YAML line and return its data\n\t\t\t$node->data = $this->_parseLine($line);\n\t\t\t// Add the node to the master list\n\t\t\t$this->_allNodes[$node->id] = $node;\n\t\t\t// Add a reference to the parent list\n\t\t\t$this->_allParent[intval($node->parent)][] = $node->id;\n\t\t\t// Add a reference to the node in an indent array\n\t\t\t$this->_indentSort[$node->indent][] =& $this->_allNodes[$node->id];\n\t\t\t// Add a reference to the node in a References array if this node\n\t\t\t// has a YAML reference in it.\n\t\t\tif (\n\t\t\t( (is_array($node->data)) &&\n\t\t\t\tisset($node->data[key($node->data)]) &&\n\t\t\t\t(!is_array($node->data[key($node->data)])) )\n\t\t\t&&\n\t\t\t( (preg_match('/^&([^ ]+)/',$node->data[key($node->data)]))\n\t\t\t\t||\n\t\t\t\t(preg_match('/^\\*([^ ]+)/',$node->data[key($node->data)])) )\n\t\t\t) {\n\t\t\t\t$this->_haveRefs[] =& $this->_allNodes[$node->id];\n\t\t\t} elseif (\n\t\t\t( (is_array($node->data)) &&\n\t\t\t\tisset($node->data[key($node->data)]) &&\n\t\t\t\t(is_array($node->data[key($node->data)])) )\n\t\t\t) {\n\t\t\t// Incomplete reference making code. Ugly, needs cleaned up.\n\t\t\tforeach ($node->data[key($node->data)] as $d) {\n\t\t\t\tif ( !is_array($d) &&\n\t\t\t\t( (preg_match('/^&([^ ]+)/',$d))\n\t\t\t\t\t||\n\t\t\t\t\t(preg_match('/^\\*([^ ]+)/',$d)) )\n\t\t\t\t) {\n\t\t\t\t\t$this->_haveRefs[] =& $this->_allNodes[$node->id];\n\t\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\t}\n\t}\n\tunset($node);\n\n\t// Here we travel through node-space and pick out references (& and *)\n\t$this->_linkReferences();\n\n\t// Build the PHP array out of node-space\n\t$trunk = $this->_buildArray();\n\treturn $trunk;\n\t}", "public function parse($input) {\r\n try {\r\n $output = sfYaml::load($input);\r\n }\r\n catch(InvalidArgumentException $ex) {\r\n self::_throwException($ex->getMessage());\r\n } \r\n return $output; \r\n }", "public static function getYamlContents(string $filename)\n {\n $result = null;\n if (file_exists($filename)) {\n $result = Yaml::parse(file_get_contents($filename));\n }\n return $result;\n }", "function YAMLLoad($input) {\n\t\t$spyc = new Spyc;\n\t\treturn $spyc->load($input);\n\t}", "private function loadConfigYamlFile($filepath)\n {\n if (!file_exists($filepath)) {\n throw new \\Exception('Project config file could not be loaded! \"'.$filepath.'\"');\n }\n return YamlHelper::parse(file_get_contents($filepath));\n }", "public static function load($path, $cache = false)\r\n {\r\n\r\n $hash = md5(filemtime($path) . $path);\r\n if ($cache && file_exists(Config::path('cache') . '/' . $hash . '.php')) {\r\n include(Config::path('cache') . '/' . $hash . '.php');\r\n } else {\r\n $yml = self::parse(file_get_contents($path));\r\n Cache::saveOutput($hash . '.php', self::createCache($yml));\r\n }\r\n\r\n return $yml;\r\n }", "private function parseYaml($yaml)\n {\n $parser = new Parser();\n return $parser->parse($yaml);\n }", "private function parseYaml($contents)\n {\n $result = Yaml::parse($contents);\n return $result;\n }", "protected function loadYml($path)\n {\n if (empty($path)) {\n return [];\n }\n // TODO: Perhaps cache these alias files, as they may be read multiple times.\n return (array) Yaml::parse(file_get_contents($path));\n }", "public function loadYamlFile($fullFileName)\n {\n $data = false;\n if ($fullFileName && file_exists($fullFileName)) {\n $data = sfYaml::load($fullFileName);\n }\n return $data;\n }", "public static function parseYamlConfigFile($filename = null)\n {\n try {\n return Yaml::parse(file_get_contents($filename));\n } catch (ParseException $p) {\n throw $p;\n } catch (\\Exception $e) {\n return null;\n }\n }", "private function get($file, $format = null, $path=null)\n {\n $result = null;\n $this->format = $this->validateFormat($format);\n\n $this->setFile($file);\n $this->setPath($path);\n\n $checksum = md5($this->path.$this->file);\n if (!in_array($checksum, $this->cache['files']))\n {\n $this->cache['files'][] = $checksum;\n }\n else\n {\n // abort processing\n return;\n }\n\n $locator = new FileLocator($this->path);\n $location = $locator->locate($this->file);\n $contents = file_get_contents($location);\n\n if (!$contents) {\n return;\n }\n\n $this->parser = str_replace('yml', 'yaml', $this->format);\n $config = call_user_func_array(array($this, 'parse'.ucfirst($this->parser)), array($contents, $location));\n\n $this->validateConfig($config);\n $this->importResources($config);\n\n $result = $config ?: $result;\n return $result;\n }", "protected function loadData($file)\n {\n $path = realpath(dirname(__FILE__) . '/../fixtures/');\n\n return Yaml::parse(file_get_contents($path . '/' . $file . '.yml'));\n }", "protected function loadFile($file)\n {\n if (!stream_is_local($file)) {\n throw new InvalidArgumentException(sprintf('This is not a local file \"%s\".', $file));\n }\n\n if (!file_exists($file)) {\n throw new InvalidArgumentException(sprintf('The service file \"%s\" is not valid.', $file));\n }\n\n return Yaml::parse(file_get_contents($file));\n }", "public static function fromYaml($file)\n {\n if (! file_exists($file)) {\n return new self();\n }\n\n $values = Yaml::parse(file_get_contents($file));\n\n $config = new self();\n\n if (! is_array($values)) {\n return $config;\n }\n\n if (array_key_exists('exclude', $values)) {\n $config->exclude = (array) $values['exclude'];\n }\n if (array_key_exists('directory', $values)) {\n $config->directory = trim($values['directory']);\n }\n if (array_key_exists('baseUrl', $values)) {\n $config->baseUrl = rtrim(trim($values['baseUrl']), '/');\n }\n if (array_key_exists('before', $values)) {\n $config->before = (array) $values['before'];\n }\n if (array_key_exists('after', $values)) {\n $config->after = (array) $values['after'];\n }\n\n return $config;\n }", "static protected function _setYamlConfig($file)\n {\n if (file_exists($file)) {\n self::_setConfig(Yaml::parse($file));\n return true;\n }\n \n return false;\n }", "private function parseFile($filename) {\n if (is_null($filename) || !file_exists($filename)) {\n throw new MultidomainException('Missing config.yml file.');\n }\n $this->configFile = $filename;\n\n // get configuration values\n $this->config = json_decode(json_encode(\n Yaml::parseFile($filename)\n ));\n }", "public function parseConfig()\n {\n $fileContents = file_get_contents($this->filename);\n if (!$fileContents) {\n $this->error = 'Failed to read file contents';\n\n return false;\n }\n\n $config = json_decode($fileContents, true);\n if (json_last_error()) {\n $this->error = json_last_error_msg();\n\n return false;\n }\n\n $this->config = new Data(array_replace_recursive($config, $this->overrides));\n\n return true;\n }", "public function load()\n\t{\n\t\tif (file_exists(self::$configPath))\n\t\t{\n\t\t\t$this->config = json_decode(file_get_contents(self::$configPath), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->config = array();\n\t\t}\n\t}", "private function loadConfig() {\n if (file_exists($this->_data['cache_config_file'])) {\n $data = unserialize(file_get_contents($this->_data['cache_config_file']));\n \n self::$_configInstance = (object)$data; //instance of stdClass with all the properties public\n //$this->_data = (array)$data; \n return true;\n } \n return false;\n }" ]
[ "0.663372", "0.6606961", "0.65717536", "0.6263219", "0.6199485", "0.6124811", "0.6055848", "0.593784", "0.5917581", "0.5903929", "0.5881257", "0.58606184", "0.58503187", "0.58020586", "0.57767034", "0.5773183", "0.5748266", "0.57258004", "0.5694039", "0.5685027", "0.5669432", "0.5634761", "0.5616643", "0.5529986", "0.55177265", "0.5480237", "0.5476376", "0.5450669", "0.54257447", "0.5419831" ]
0.7357435
0
Save an entity to repository.
public function save($entity);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saveEntity($entity)\n\t{\n\t\t$entityManager = $this->getDoctrine()->getManager();\n\t $entityManager->persist($entity);\n\t $entityManager->flush();\n\t}", "protected function saveEntity($entity)\n {\n $this->om->persist($entity);\n $this->om->flush($entity);\n }", "public function saveModel($entity){\n $this->entityManager->persist($entity);\n $this->entityManager->flush();\n }", "public function save()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n if ($entity->getMarkedAsDeleted())\n {\n $entity->delete();\n } \n else if ($entity->getMarkedAsUpdated())\n {\n $entity->saveWithDetails();\n }\n }\n }\n );\n }", "public function save($entity) : bool;", "public function save($entity) {\n throw new NotImplementedException;\n }", "public function save(Entity $entity): void\n {\n $this->db->save($entity);\n }", "public function save() {\n return $this->entity->save();\n }", "public function save($entity)\n {\n $this->model->save($entity);\n return $this->findOne($entity->id);\n }", "public function persist($entity)\n {\n }", "public function save( LogEntity $logEntity );", "public function saveHokodoEntity(HokodoEntityInterface $hokodoEntity): void;", "public function save(): void\n {\n $this->em->persist($this->model);\n $this->em->flush();\n }", "protected function saveNew($entity)\n {\n $this->em->persist($entity);\n $this->update();\n }", "public function save(GameLocation $entity)\n {\n $em = $this->getEntityManager();\n\n $em->persist($entity);\n $em->flush();\n }", "protected function persist($entity)\n {\n if (!$this->em()->isOpen()) {\n $this->getDoctrine()->resetManager();\n }\n\n $this->em()->persist($entity);\n $this->em()->flush();\n\n }", "public static function save($entity, $data)\n {\n return static::mapper()->save($entity, $data);\n }", "public function postPersist($entity);", "function save(iEntityComment $entity);", "public function save(EntityInterface $entity, array $options = []): EntityInterface|false;", "public function persist($entity)\n {\n $visited = [];\n $this->doPersist($entity, $visited);\n }", "public function save()\n {\n $this->checkForNecessaryProperties();\n\n $this->update($this->getCurrentId(), $this->data);\n }", "public function update($entity)\n {\n $this->getObjectManager()->persist($entity);\n $this->getObjectManager()->flush();\n }", "public function save(AbstractEntity $entity)\n {\n // Execute an update if ID is present in data\n if ($entity->getData($this->entityIdColumnName) != null) {\n // If ID is present, run an update statement and check if one record is updated\n return $this->adapter->update($entity->getData());\n }\n // Otherwise, run an insert statement and check if one record is added\n return $this->adapter->insert($entity->getData());\n }", "public function persist(IEntity $entity): void\n\t{\n\t\t$this->beginTransaction();\n\t\t$data = $this->entityToArray($entity);\n\t\t$data = $this->getConventions()->convertEntityToStorage($data);\n\n\t\tif (!$entity->isPersisted()) {\n\t\t\t$this->processInsert($entity, $data);\n\n\t\t} else {\n\t\t\t$primary = [];\n\t\t\t$id = (array) $entity->getPersistedId();\n\t\t\tforeach ($entity->getMetadata()->getPrimaryKey() as $key) {\n\t\t\t\t$primary[$key] = array_shift($id);\n\t\t\t}\n\t\t\t$primary = $this->getConventions()->convertEntityToStorage($primary);\n\n\t\t\t$this->processUpdate($entity, $data, $primary);\n\t\t}\n\t}", "protected function persistAndFlush($entity)\n\t{\n\t\t$this->em->persist($entity);\n\t\t$this->em->flush();\n\t}", "protected function persist(EntityInterface $entity, Model $model) {\n $this->save();\n\n $entity->fromArray($model->toArray());\n }", "public function save()\n {\n return $this->address_srl ? $this->repo->update($this) : $this->repo->insert($this);\n }", "public function save( EntityInterface $entity )\n {\n $this->validateEntity( $entity );\n\n $mapper = $this->getMapper();\n\n return $mapper->save( $entity );\n }", "public function save($object)\n {\n $this->entityManager->persist($object);\n $this->entityManager->flush();\n }" ]
[ "0.7579266", "0.73962927", "0.727839", "0.7157777", "0.71353596", "0.7115545", "0.70606893", "0.70390826", "0.70053864", "0.6863863", "0.6776856", "0.67650044", "0.673296", "0.6628384", "0.65823925", "0.6521103", "0.65112805", "0.6454482", "0.6411596", "0.640052", "0.63952583", "0.6390214", "0.6373335", "0.6373282", "0.63620627", "0.63296735", "0.63275963", "0.6325683", "0.6315324", "0.6311616" ]
0.7868986
1
return field from the author
function hc_get_author_field($field , $gravatarSize = ''){ $info = hc_get_the_author($gravatarSize, $field); $author = $info[0]; $field = $author->$field; return $field; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAuthor() {}", "public function getAuthor();", "public function getAuthor();", "public function getAuthor();", "public function getAuthor() \r\n { \r\n return $this->_author; \r\n }", "public function getAuthor(): string\n {\n return $this->_author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthorname() {}", "abstract public function getAuthor();", "function hc_author_field($field , $gravatarSize = ''){\n\t\t$info = hc_get_author_field($field , $gravatarSize);\n\t\techo $info;\n\t}", "public function getAuthor() {\n return $this->author;\n }", "public function getAuthor() {\n return $this->author;\n }", "public function getAuthor() {\n return $this->author;\n }", "public function getAuthor() {\n\t\treturn $this->author;\n\t}", "function nb_get_author_name( $object, $field_name, $request ) {\n return get_the_author_meta( 'display_name', $object['author'] );\n}", "public function get_author() {\n\t\treturn $this->author();\n\t}", "function get_the_author_meta($field = '', $user_id = \\false)\n {\n }", "function GetAuthor()\n {\n return 'calguy1000';\n }", "public function author()\n {\n return optional($this->author);\n }", "public function getAuthor() {\n return $this->_author;\n }", "public function getAuthor()\n {\n return $this->author = get_userdata($this->get()->post_author);\n }", "public function getAuthorID();", "public function author()\n {\n if ($this->user_id) {\n $field = config(\"binshopsblog.comments.user_field_for_author_name\",\"name\");\n return optional($this->user)->$field;\n }\n\n return $this->author_name;\n }" ]
[ "0.7781827", "0.77806413", "0.77806413", "0.77806413", "0.7651809", "0.7600425", "0.75850916", "0.75850916", "0.75850916", "0.75850916", "0.75850916", "0.75850916", "0.75850916", "0.75850916", "0.7561902", "0.75602776", "0.75276774", "0.7515637", "0.7515637", "0.7515637", "0.74920243", "0.7438321", "0.74202955", "0.73782516", "0.7330071", "0.73298764", "0.7278764", "0.7251384", "0.722304", "0.72226983" ]
0.8280632
0
display field from the author
function hc_author_field($field , $gravatarSize = ''){ $info = hc_get_author_field($field , $gravatarSize); echo $info; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAuthorname() {}", "public function getAuthor() {}", "public function getAuthor();", "public function getAuthor();", "public function getAuthor();", "public function get_author()\n\t{\n\t\treturn '';\n\t}", "function hc_get_author_field($field , $gravatarSize = ''){\n\t\t$info = hc_get_the_author($gravatarSize, $field);\n\t\t$author = $info[0];\n\t\t$field = $author->$field;\n\t\treturn $field;\n\t}", "function nb_get_author_name( $object, $field_name, $request ) {\n return get_the_author_meta( 'display_name', $object['author'] );\n}", "public function get_author()\n {\n return 'Kamen Blaginov';\n }", "public function get_author()\n {\n return 'Kamen Blaginov';\n }", "public function getAuthor() \r\n { \r\n return $this->_author; \r\n }", "function GetAuthor()\n {\n return 'calguy1000';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function author();", "public function get_author_permastruct()\n {\n }", "public function getAuthorName()\n {\n return 'Fightmaster.publication.author.name';\n }", "function print_author_tag() {\n\t\t\n\t\techo \"<meta name='author' content='{$this->options->site_author}' />\\r\\n\";\n\t}", "public function getAuthor(): string\n {\n return $this->_author;\n }", "public function authors_tab_content() {\n\t\techo '<h2>Authors</h2>';\n\t\t$content = get_post_meta( get_the_ID(), 'authordesc', true );\n\t\t$content = htmlspecialchars_decode( $content );\n\t\t$content = wpautop( $content );\n\t\techo $content;\n\t}", "public function author() : string\n {\n if (isset($this->entity->author)) {\n return $this->entity->author->name;\n }\n\n return 'Sin autor';\n }", "function get_the_author_aim()\n {\n }", "function get_the_author_description()\n {\n }", "abstract public function getAuthor();", "public function getAuthorLabel()\n {\n return (string) $this->_theme->themeAuthor->authorLabel;\n }", "function showAuthor()\n {\n $this->out->elementStart('div', 'author');\n\n $this->out->elementStart('span', 'vcard author');\n\n $attrs = array('href' => $this->profile->profileurl,\n 'class' => 'url',\n 'title' => $this->profile->nickname);\n\n $this->out->elementStart('a', $attrs);\n $this->showAvatar();\n $this->out->text(' ');\n $user = common_current_user();\n if (!empty($user) && $user->streamNicknames()) {\n $this->out->element('span',array('class' => 'fn'),\n $this->profile->nickname);\n } else {\n $this->out->element('span',array('class' => 'fn'),\n $this->profile->getBestName());\n }\n $this->out->elementEnd('a');\n\n $this->out->elementEnd('span');\n\n $this->showAddressees();\n\n $this->out->elementEnd('div');\n }" ]
[ "0.76121664", "0.74682343", "0.7414243", "0.7414243", "0.7414243", "0.7344687", "0.72971785", "0.7285783", "0.7276654", "0.7276654", "0.7262898", "0.7222383", "0.718863", "0.718863", "0.718863", "0.718863", "0.718863", "0.718863", "0.71846473", "0.7177265", "0.71614164", "0.7140701", "0.71381646", "0.7137517", "0.7128854", "0.7113129", "0.7096315", "0.7082922", "0.7059985", "0.70364" ]
0.77923477
0
Display field name for a field
function hc_field_name($field){ echo hc_get_field_name($field); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_field_name();", "public function get_field_label() {\n\t\treturn $this->get_field_attr( 'name' );\n\t}", "public function getFieldName() {}", "public function name($field) {\n\t\treturn $field;\n\t}", "public function getFieldName($field) {\n return $field['name'];\n }", "public function get_field_name($field_name)\n {\n }", "function getLabelField()\n {\n return 'person_fname';\n }", "public function getFieldName()\r\n\t{\r\n\t\treturn $this->name;\r\n\t}", "public function getName(){ return $this->getField('name'); }", "function get_fields_name()\n\t{\n\t\treturn $this->db->list_fields( $this->table );\n\t}", "public function getName()\n {\n return $this->__get(self::FIELD_NAME);\n }", "public function getFieldName() {\n return $this->fieldName;\n }", "function getName () {return $this->getFieldValue ('name');}", "function getFieldLabel($fieldName){\n\n\t\tif( isset($this->labels[$fieldName]) ) return $this->labels[$fieldName];\n\t\telse return ucwords( str_replace(\"_\", \" \", $fieldName) );\n\n\t}", "public function getFieldName()\n {\n return $this->fieldName;\n }", "public function getFieldName()\n {\n return $this->fieldName;\n }", "public function getFieldName()\n {\n return $this->fieldName;\n }", "public function getField(): string\n {\n return $this->field;\n }", "public function getFieldName() {\r\n return $this->_fieldName;\r\n }", "public function get_field_name($name)\n {\n if( ! $this->_model)\n {\n return $name;\n }\n return $this->get_model()->get_field_name($name);\n }", "public function get_field_name($field_name) {\n\t\treturn 'widget-' . $this->id_base . '[' . $this->number . '][' . $field_name . ']';\n\t}", "function fieldLabel($field, $option = [])\n{\n if (!empty($option['label'])) {\n return $option['label'];\n }\n\n return ucfirst($field);\n}", "public function getDbFieldName($field_name);", "public function getField($field_name);", "function graphql_format_field_name($field_name)\n {\n }", "function acf_get_field_label($field, $context = '')\n{\n}", "public function getFieldTitle() {\r\n return $this->_fieldTitle;\r\n }", "public function fieldName($name) {\n\t\treturn self::FORM_NAME.'['.$name.']';\n\t}", "public function field_name( $qHanle, $offset )\r\n\t{\r\n\t\treturn $qHanle->Fields( $offset )->Name;\r\n\t}", "function acf_render_field_label($field)\n{\n}" ]
[ "0.85888934", "0.8006008", "0.7874715", "0.7757387", "0.7756327", "0.7720972", "0.7611952", "0.7594246", "0.75942224", "0.75537986", "0.7534981", "0.7510652", "0.74924153", "0.7444177", "0.7436201", "0.7436201", "0.7436201", "0.73844594", "0.73829764", "0.7267953", "0.72235864", "0.7219606", "0.71852875", "0.71551186", "0.7130789", "0.71188706", "0.7113209", "0.71080416", "0.70989734", "0.70892805" ]
0.815123
1
Get the object to request.
private function getObject() { return $this->object; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getObject() {}", "public function getObject() {}", "public function getObject();", "public function getObject();", "public function getObject() {\n return $this->object;\n }", "public function getObject(): object;", "public function getObject()\n {\n return $this->object;\n }", "public function getObject()\n {\n return $this->object;\n }", "public function getObject()\n {\n return $this->_object;\n }", "public function getObject()\n {\n return $this->forgeObject();\n }", "public function get_object()\n {\n return $this->object;\n }", "public function get()\n {\n $object = $this->_object;\n $this->_object = $this->_form;\n return $object;\n }", "public function getObject()\n {\n return $this;\n }", "protected function getObject()\n {\n return $this;\n }", "public function GetObj()\n {\n try\n {\n return $this->oRequestObj;\n }\n catch( Exception $oException )\n {\n throw cAnomaly::BubbleException( $oException );\n }\n }", "public function getObj();", "public function getObject() {\n return $this->form->getObject();\n }", "public static function getHttp()\n : \\stdClass\n {\n return static::$_request;\n }", "public function GetObject()\n\t{\n\t\tif (!$this->dataRead)\n\t\t\t$this->ReadData();\n\n\t\tif (!$this->object)\n\t\t\t$this->object = $this->project->GetObject($this->objectHash);\n\n\t\treturn $this->object;\n\t}", "function getObject();", "function getObject();", "function request()\n {\n return Request::get();\n }", "public function get_object()\n {\n return $this->_object;\n }", "protected function getObject()\n {\n return $this->parentContext->getObject();\n }", "public function object()\n {\n return $this->object;\n }", "public function get()\n {\n return $this->object = get_post($this->id);\n }", "function _wp_http_get_object()\n {\n }", "public function get()\n {\n return $this->setMethod(__FUNCTION__)\n ->makeRequest();\n }", "protected function _getRequest() {\n\t\treturn new Request;\n\t}", "public function getObject(){\n return $this->getCourier();\n }" ]
[ "0.73799545", "0.73799545", "0.73257434", "0.73257434", "0.719861", "0.7152944", "0.71492344", "0.71492344", "0.7092992", "0.6953768", "0.6926222", "0.69201267", "0.68532425", "0.68305796", "0.67796487", "0.6763178", "0.6754883", "0.67487836", "0.674861", "0.6742828", "0.6742828", "0.6717234", "0.66613805", "0.66314906", "0.66273564", "0.6575826", "0.6542146", "0.6532556", "0.64691406", "0.64267653" ]
0.7435714
0
Get _function variable. This is to set the function to call.
private function getFuction() { return $this->_function; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFunction()\n {\n return $this->function;\n }", "public function get_function() {\n\t\tif ( ! $this->is_function_set ) {\n\t\t\t$this->set_function( $this->derive_function() );\n\t\t}\n\t\treturn $this->function;\n\t}", "private function setFuction($function) {\n $this->_function = $function;\n }", "protected function set_function( $function ) {\n\t\t$this->function = $function;\n\t\t$this->is_function_set = true;\n\t}", "function setFunction(string $function)\n {\n $this->function = $function;\n return $this;\n }", "public function getFunction ()\n\t{\n\t\treturn $this->_strFunction;\n\t}", "public function setFunction($function)\n {\n $this->function = (string)$function;\n return $this;\n }", "public function getFunction(): string;", "public function getFunction()\n {\n return $this->metaRefreshValues['function'];\n }", "protected function derive_function() {\n\t\t$callable_reference = $this->get_callable_reference();\n\t\treturn is_string( $callable_reference ) && function_exists( $callable_reference ) ? $callable_reference : null;\n\t}", "public function setFunction($function)\n {\n $this->function = $function;\n\n return $this;\n }", "protected function func() { return $this->f; }", "public function getFunctionName()\n {\n return $this->function;\n }", "public function getUseFuncID() \n \t{\n \t\treturn $this->use_funcid;\n \t}", "public function getFunctionCode()\n {\n return $this->functionCode;\n }", "public static function set(\\Closure $func): void\n {\n self::$func = $func;\n }", "public function getUseFuncName() \n \t{\n \t\treturn $this->use_funcname;\n \t}", "function GetRJSfp( $function ) {\r\n $name = $this->_params['id'];\r\n $type = $this->_type;\r\n $needfkl = $this->_needfkl;\r\n\t\t$function = $this->_prefix . '_' . $this->_type . '_' .$function;\r\n return \"xajax_ZariliaControlHandler('$name','$type','$function',$needfkl\";\r\n }", "public function getFunctionName()\n {\n return $this->functionName;\n }", "public function getFunction() {\n $functions = [ 'require', 'include', 'require_once', 'include_once' ];\n $func = $this->getHooks()->filter( 'cortex.template_include_function', $this->function );\n return ( in_array( $func, $functions, TRUE ) ) ? $func : 'require_once';\n }", "final public function get_idle_function(/* ... */)\n {\n return $this->_idle_function;\n }", "function setHook($hookPoint, $function) {\n\t\t\t$this->hooks[$hookPoint] = $function;\n\t\t}", "public function __construct($fun) {\n $this->f = $fun;\n }", "public static function set($route,$function) {\n self::$validRoute[] = $route;\n \n if ($_GET['url'] == $route) {\n $function->__invoke();\n } \n }", "public function getter_event_callback()\n\t{\n\t\treturn $this->event_callback = \"on\".$this->qualified_name;\n\t}", "public function setUseFuncID($use_funcid) \n \t{\n \t\t$this->use_funcid = $use_funcid;\n \t}", "public function getIdFunction()\n {\n return $this->idFunction;\n }", "public function getCallable()\n {\n return function () {\n return $this->value;\n };\n }", "public function setUseFuncName($use_funcname) \n \t{\n \t\t$this->use_funcname = $use_funcname;\n \t}", "public function get_callback()\n\t{\n\t\treturn $this->callback;\n\t}" ]
[ "0.7382957", "0.72181535", "0.7177902", "0.6936956", "0.6734655", "0.6726698", "0.6678767", "0.6674748", "0.6649321", "0.6415708", "0.64097846", "0.60925364", "0.6068881", "0.6007994", "0.5961791", "0.5899766", "0.580004", "0.57506675", "0.5744072", "0.5679977", "0.5663876", "0.5602455", "0.5601727", "0.55913615", "0.5536665", "0.5535361", "0.55244666", "0.55241466", "0.55234826", "0.5516216" ]
0.7324036
1
Set _function variable. This is to set the function to call.
private function setFuction($function) { $this->_function = $function; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function set_function( $function ) {\n\t\t$this->function = $function;\n\t\t$this->is_function_set = true;\n\t}", "function setFunction(string $function)\n {\n $this->function = $function;\n return $this;\n }", "public function setFunction($function)\n {\n $this->function = (string)$function;\n return $this;\n }", "public static function set(\\Closure $func): void\n {\n self::$func = $func;\n }", "public function setFunction($function)\n {\n $this->function = $function;\n\n return $this;\n }", "function setHook($hookPoint, $function) {\n\t\t\t$this->hooks[$hookPoint] = $function;\n\t\t}", "public function setFunction( $func ) {\n $funcs = [ 'require', 'include', 'require_once', 'include_once' ];\n if ( in_array( $func, $funcs, TRUE ) ) {\n $this->function = $func;\n } else {\n throw new \\InvalidArgumentException;\n }\n }", "public static function set($route,$function) {\n self::$validRoute[] = $route;\n \n if ($_GET['url'] == $route) {\n $function->__invoke();\n } \n }", "final public function set_idle_function($function)\n {\n $this->_idle_function = $function;\n }", "public function setFunctionName($func_name) \n\t{\n\t\t$this->function_name = $func_name;\n\t}", "public function setFunctionToken($func_token) \n\t{\n\t\t$this->function_token = $func_token;\n\t}", "public function setUseFuncID($use_funcid) \n \t{\n \t\t$this->use_funcid = $use_funcid;\n \t}", "public function setUseFuncName($use_funcname) \n \t{\n \t\t$this->use_funcname = $use_funcname;\n \t}", "public function __construct($fun) {\n $this->f = $fun;\n }", "function setFunction($name, $code)\n {\n $head = $this->getFunctionHead($name);\n\n if (!$head) { \n return PEAR::raiseError(\"'$name' is not a valid handler function\");\n }\n\n if (isset($this->functions[$name])) {\n return PEAR::raiseError(\"'$name' function declared twice\");\n }\n \n $this->functions[$name] = array(\"head\" => $head, \"body\" => $code);\n\n return true; \n }", "protected function set_function_reflector( $function_reflector ) {\n\t\t$this->function_reflector = $function_reflector;\n\t\t$this->is_function_reflector_set = true;\n\t}", "public function setLinkFun(ModuleFunction $linkFun) {}", "public function setFunctionPrimary($func_primary) \n\t{\n\t\t$this->function_primary = $func_primary;\n\t}", "public function setHandler(callable $func): self{\n $this->_handler = $func;\n\n return $this;\n }", "public function __construct($fun=null) {\n $this->f = $fun;\n }", "public function addFunction($function)\n {\n $this->functions[] = $function;\n }", "function setUrlGenerator(\\Closure $func)\n {\n $this->urlFunc = $func;\n }", "public function setFunction(string $function)\n {\n $function = 'pub\\\\Classes\\\\' . $function;\n return $this->probFunction = new $function($this->inputs);\n }", "public function setLoopCallbackFunction(callable $function);", "abstract protected function setMethod();", "public function SetDebugFn($fn)\n {\n $this->debugFn = $fn;\n }", "function RegisterFunction( $function, $params = array() )\r\n {\r\n $this->_functions[$function] = $params;\r\n }", "function setResult($function, $result)\n {\n $this->m_results[$function] = $result;\n }", "public function setFunction($strNameFunction, $params, $jsCode) {\n\n\t\t$this->response->setFunction($strNameFunction, $params, $jsCode);\n\t}", "public function changeFunc() {}" ]
[ "0.82132185", "0.73930293", "0.71710855", "0.71512157", "0.6802688", "0.6759857", "0.673544", "0.65446764", "0.64444196", "0.64161927", "0.63199854", "0.6224588", "0.620609", "0.61369747", "0.6000557", "0.59729016", "0.59697825", "0.59564114", "0.5947657", "0.58996874", "0.58968765", "0.58554244", "0.5846851", "0.5815324", "0.5682991", "0.56559396", "0.56305367", "0.56291324", "0.562722", "0.560006" ]
0.82827353
0
Send query by curl.
private function sendQueryByCurl() { $this->curl = curl_init(); // JSON data request $jsonData = $this->getJsonData(); // some params $urlParams = $this->getParamsUrlFormat(); $this->setCurlOpts($this->curl, $jsonData, $urlParams); $this->setResult(curl_exec($this->curl)); $this->setHttpCode(curl_getinfo($this->curl, CURLINFO_HTTP_CODE)); curl_close($this->curl); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sendCurl() {\n\t\t$this->curlResponse = $this->curl->exec();\n\t}", "public function execQuery()\n{\n\n $url = $this->getURL();\n // create curl resource \n $ch = curl_init(); \n\n //return the transfer as a string \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n curl_setopt( $ch, CURLOPT_USERAGENT, \"MyUserAgent\" );\n\n // set url \n curl_setopt($ch, CURLOPT_URL, $url);\n\n // $output contains the output string \n $result = curl_exec($ch); \n\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); \n\n // Check if any error occurred\n if(curl_errno($ch))\n {\n echo 'Curl error: ' . curl_error($ch);\n }\n // close curl resource to free up system resources \n curl_close($ch); \n\n return $result;\n}", "function curl_query($curl) {\n $response = curl_exec($curl);\n\n if (!is_string($response)) {\n error('Failed to execute cURL query for ' . spy($curl) . '.');\n }\n\n return $response;\n}", "public function _curl_query ( $method, $url, $parameters = array() , $data = NULL ) {\n// \t\techo \"_curl_query : $method $url \".print_r($parameters,true).\" , \".print_r($data,true);\n\t\tif ( !in_array($method, $this->HTTP_METHODS ) )\n\t\t\tthrow new Exception(\"Bad HTTP method: $method\");\n\n\t\t$url = $this->dsn.$url;\n\t\tif ( is_array($parameters) AND count($parameters) )\n\t\t\t$url = $url.'?'.http_build_query($parameters);\n// \t\techo $url;\n\t\t$http = $this->_curl_buildRequest($method,$url,$data);\n\t\tcurl_setopt($http,CURLOPT_HEADER, true);\n\t\tcurl_setopt($http,CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($http,CURLOPT_FOLLOWLOCATION, true);\n\n\t\t$response = curl_exec($http);\n\t\tcurl_close($http);\n// \t\techo $response;\n\n\t\treturn $response;\n //log_message('debug',\"COUCH : Executed query $method $url\");\n //log_message('debug',\"COUCH : \".$raw_response);\n\n\t}", "public function send(object $query);", "public function sendQuery($query)\n\t{\n\t\t$this->database->execQuery($query, false);\n\t}", "private function sendCurl($url) {\n $handle = curl_init();\n $opts = curl_setopt_array($handle, array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => 'https://' . $url . \"&method=CURL\",\n CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'],\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => $this->payload\n ));\n // Send the request & save response to $resp\n $exec = curl_exec($handle);\n // Close request to clear up some resources\n $close = curl_close($handle);\n\n //$json_array = json_decode($exec, TRUE);\n\n if($this->testing) echo \"<hr /><h1>JSON RESPONSE:</h1><br />$exec <hr />\";\n }", "function query( $params ) {\n\t$ch = initCurl();\t\t\t\t//Why open and close here? Well there's hardly any load when opening and closing\n\t\t\t\t\t\t\t\t\t//handles and this provides cleaner and more maintainable code\n\tcurl_setopt( $ch, CURLOPT_POSTFIELDS, $params );\n\t$res = curl_exec( $ch );\n\tcurl_close( $ch );\n\tif( !$res ) return false;\n\t$res = unserialize( $res );\t\t//I use unserialize because I'm used to doing it. I can easily use JSON if you wanted me to.\n\treturn $res;\n}", "public function execQuery ( $queryUrl )\n {\n // var_dump($this->baseUrl.'/'.$queryUrl);\n\n $process = curl_init ( $this->baseUrl . '/' . $queryUrl );\n\n curl_setopt ( $process, CURLOPT_HEADER, 0 );\n curl_setopt ( $process, CURLOPT_USERPWD, $this->username . \":\" . $this->password );\n curl_setopt ( $process, CURLOPT_TIMEOUT, 180 );\n curl_setopt ( $process, CURLOPT_RETURNTRANSFER, TRUE );\n\n $this->response = curl_exec ( $process );\n $this->info = curl_getinfo ( $process );\n\n curl_close ( $process );\n\n if ( $this->info[ 'http_code' ] != '200' )\n {\n return false;\n }\n else\n {\n return true;\n }\n }", "function query($param) {\n $curl = curl_init();\n $userName = $param;\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://develop.datacrm.la/datacrm/pruebatecnica/webservice.php?operation=query&sessionName=\" . $userName . \"&query=select%20%2A%20from%20Contacts;\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => array(\n \"Accept: */*\",\n \"Accept-Encoding: gzip, deflate\",\n \"Cache-Control: no-cache\",\n \"Connection: keep-alive\",\n \"Host: develop.datacrm.la\",\n \"Postman-Token: 438973a9-ec4c-4c01-bc55-71ad624b746d,206316aa-adaa-4963-b5c6-bdacd9e13eb0\",\n \"User-Agent: PostmanRuntime/7.19.0\",\n \"cache-control: no-cache\"\n ),\n ));\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n if ($err) {\n echo \"cURL Error #:\" . $err;\n } else {\n echo $response;\n }\n }", "private function sendQuery ($query) {\n\t\t$res = $this->_db->query($query);\n\t\tif (!$res) {\n\t\t\t//echo $this->_db->error.\"\\n\";\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn $res;\n\t\t}\n\t}", "public function send() {\n\t\t$result = null;\n\n\t\t$queryUrl = $this->urlRaw;\n\n\t\t$curl = new Net_Curl($queryUrl);\n\t\tif (!is_object($curl)) {\n\t\t\tthrow new NetworkException(\"Failed to initialize Net_Curl\");\n\t\t}\n\n\t\t// Curl settings\n\t\t$curl->timeout = $this->settings['timeout'];\n\n\t\t$curl_result = $curl->create();\n\t\tif (PEAR::isError($curl_result)) {\n\t\t\tthrow new NetworkException(\"Failed to create Curl request\");\n\t\t}\n\n\t\t// Fetch\n\t\t$response = trim($curl->execute());\n\t\tif (PEAR::isError($response)) {\n\t\t\tthrow new NetworkException(\"Failed to execute Curl request\");\n\t\t}\n\n\t\t$this->response = $response;\n\t\t$result = $this;\n\n\t\treturn $result;\n\t}", "function Send($url, $POST){ //работа с CURL'ом\n\t$ch = curl_init();// Устанавливаем соединение\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $POST);\n\tcurl_setopt($ch, CURLOPT_TIMEOUT, 10);\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\n\t$result = curl_exec($ch);\n\n\tif($result === false) print $err = curl_error($ch);\n\n\treturn $result;\n}", "private function postHop () {\n\t\t$this->result = curl_exec ( $this->ch );\n\t\tcurl_close ( $this->ch );\n\t}", "public function send_post_request(){\n $url = \\Request::get('url');\n $post_array = \\Request::all();\n\n//\t\t$url = 'http://localhost/_websites/ahmed-badawy.com/site/json-test';\n//\t\t$post_array = array('type' => 'scss', 'source' => '.pre{color:red;background-color:green;}', 'compress'=>true);\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_array);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $query = curl_exec($ch);\n curl_close($ch);\n\n return $query;\n }", "protected function sendQuery($query) {\n if (!$this->servicesHealthStatus->getFetcherState()) {\n $this->messenger->addError(t('The fetcher services does not responding'));\n return [];\n }\n\n $fetcher_address = $this->servicesAddresses->getFetcherAddress();\n $response = $this->httpClient->post($fetcher_address . '/graphql', [\n 'headers' => [\n 'Content-Type' => 'application/json',\n ],\n 'body' => json_encode([\n 'query' => $query,\n ]),\n ]);\n\n return $response->getBody()->getContents();\n }", "protected function _execute(){\n\t\t\t$this->_getUrl();\n\n\t\t\t$c = curl_init($this->_url);\n\t\t\tob_start();\n\t\t\tif(!empty($this->_postFields)) {\n\t\t\t\tcurl_setopt($c, CURLOPT_POST, 1);\n\t\t\t\tcurl_setopt($c, CURLOPT_POSTFIELDS, json_encode($this->_postFields));\n\t\t\t}\n\n\t\t\tcurl_exec($c);\n\t\t\tcurl_close($c);\n\t\t\t$this->_result = trim(ob_get_contents());\n\t\t\tob_end_clean();\n\t\t}", "function post_query_slack($url,$opts) {\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($opts));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n $data = curl_exec($curl);\n curl_close($curl);\n return $data;\n}", "private function sendREST($fp, $q, $debug = false)\n {\n if ($debug) echo \"\\nQUERY<<{$q}>>\\n\";\n\n fwrite($fp, $q);\n $r = '';\n $check_header = true;\n while (!feof($fp)) {\n $tr = fgets($fp, 256);\n if ($debug) echo \"\\nRESPONSE<<{$tr}>>\"; \n $r .= $tr;\n\n if (($check_header)&&(strpos($r, \"\\r\\n\\r\\n\") !== false))\n {\n // if content-length == 0, return query result\n if (strpos($r, 'Content-Length: 0') !== false)\n return $r;\n }\n\n // Keep-alive responses does not return EOF\n // they end with \\r\\n0\\r\\n\\r\\n string\n if (substr($r, -7) == \"\\r\\n0\\r\\n\\r\\n\")\n return $r;\n }\n return $r;\n }", "protected function send($url)\n {\n $response = new GraphQLResponse(\n $this->client->request('POST', $url, [\n 'headers' => $this->headers\n ]),\n $this->queryName);\n\n return $response->getBody();\n }", "protected function send()\n {\n $this->addAuthorization();\n\n $response = $this->client->post(\n $this->apiUrl,\n array(\n 'json' => array(\n 'query' => $this->getQuery(),\n 'variables' => $this->variables,\n ),\n 'headers' => $this->headers,\n )\n );\n\n $responseBody = json_decode($response->getBody(), true);\n if ($responseBody === null) {\n throw new \\RuntimeException('Invalid api call: '.json_encode($this->getQuery()));\n }\n\n $this->body = $responseBody;\n if (isset($responseBody['errors'])) {\n $this->errors = $responseBody['errors'];\n } else {\n $this->response = $responseBody['data'];\n }\n }", "public static function sendCurl($_url, $_params)\n {\n $Curl = curl_init();\n $_params[CURLOPT_URL] = $_url;\n curl_setopt_array($Curl, $_params);\n\n $CurlOutput = curl_exec($Curl);\n\n if (curl_errno($Curl)) {\n echo(\"Remote service error: \".curl_error($Curl).\".\");\n }\n\n curl_close($Curl);\n\n return $CurlOutput;\n }", "private function sendCurl($url,$data,$headers_array)\r\n {\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_POST, true);\r\n curl_setopt($ch,CURLOPT_POSTFIELDS, $data);\r\n curl_setopt($ch,CURLOPT_HTTPHEADER, $headers_array);\r\n $response = trim(curl_exec($ch));\r\n curl_close($ch);\r\n return $response;\r\n }", "private function executeGet(Visio\\Http\\CurlRequest $curl) {\n $this->doExecute($curl);\n }", "function updateQuestion($qid,$status,$exam) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"http://afsaccess2.njit.edu/~ls339/cs490/back/beta/model.php\");\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"cmd=updateQuestion&exam=\" . $exam . \"&qid=\" . $qid.\"&status=\".$status);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $ch_output = curl_exec($ch);\n \n echo $ch_output;\n}", "public function sendRequest()\n\t{\n\t\tphpCAS::traceBegin();\n\t\t$ch = curl_init($this->url);\n\t\tif(is_null($this->url) || ! $this->url)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t/**\n\t\t * *******************************************************\n\t\t * Set SSL configuration\n\t\t * *******************************************************\n\t\t */\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\tcurl_setopt($ch, CURLOPT_USERAGENT,'casUA_wa67h28m_alliance');\n\t\tif($this->caCertPath)\n\t\t{\n\t\t\tcurl_setopt($ch, CURLOPT_CAINFO, $this->caCertPath['pem']);\n\t\t\tcurl_setopt($ch, CURLOPT_SSLCERT, $this->caCertPath['crt']);\n\t\t\tcurl_setopt($ch, CURLOPT_SSLKEY, $this->caCertPath['key']);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\tphpCAS::trace('CURL: Set CURLOPT_CAINFO');\n\t\t}\n\t\t\n\t\t// return the CURL output into a variable\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t/**\n\t\t * *******************************************************\n\t\t * Perform the query\n\t\t * *******************************************************\n\t\t */\n\t\t$buf = curl_exec($ch);\n\t\tif($buf === false)\n\t\t{\n\t\t\tphpCAS::trace('curl_exec() failed');\n\t\t\t$this->storeErrorMessage('CURL error #' . curl_errno($ch) . ': ' . curl_error($ch));\n\t\t\t$res = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->storeResponseBody($buf);\n\t\t\tphpCAS::trace(\"Response Body: \\n\" . $buf . \"\\n\");\n\t\t\t$res = true;\n\t\t}\n\t\t// close the CURL session\n\t\tcurl_close($ch);\n\t\t\n\t\tphpCAS::traceEnd($res);\n\t\treturn $res;\n\t}", "private function _sendQuery ($sql) {\n\n\t// connect to database\n\tif (!$this->doConnect()) return false;\n\n\t// send query\n\t$result = @mysql_query($sql);\n\n\treturn $result;\n }", "function query() {}", "public function send()\n {\n return curl_exec($this->curl);\n }", "protected function sendRequest($cmd, $method, $body = null)\r\n\t{\r\n\t\tcurl_setopt($this->ch, CURLOPT_URL, $cmd);\r\n\t\tcurl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true); //TRUE to return the transfer as a string of the return value of curl_exec() instead of outputting it out directly\r\n\t\tcurl_setopt($this->ch, CURLOPT_CUSTOMREQUEST, $method); // PUT/GET/POST/DELETE\r\n\t\tif($body)\r\n\t\t\tcurl_setopt($this->ch, CURLOPT_POSTFIELDS, json_encode($body));\r\n\r\n\t\t$response = curl_exec($this->ch);\r\n\t\tif (!$response)\r\n\t\t{\r\n\t\t\t$code = $this->getErrorNumber();\r\n\t\t\t$message = $this->getError();\r\n\t\t\tfail(\"Elastic client curl error code[\".$code.\"] message[\".$message.\"]\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//return the response as associative array\r\n\t\t\t$response = json_decode($response, true);\r\n\t\t}\r\n\r\n\t\treturn $response;\r\n\t}" ]
[ "0.6474419", "0.6389883", "0.62338114", "0.61014014", "0.6081204", "0.59998935", "0.59769356", "0.5898234", "0.58894", "0.58357185", "0.5740103", "0.5735197", "0.56887364", "0.5680275", "0.5678873", "0.56678957", "0.56444895", "0.5614562", "0.5563711", "0.54918087", "0.5488163", "0.54799294", "0.5461322", "0.54488325", "0.54409784", "0.5428257", "0.53956884", "0.5387609", "0.53725", "0.53709775" ]
0.82177544
0
Build a new calendar object string
public function build() { $this->validate_attributes(); $attributes = []; foreach (static::$object_attributes as $key => $value) { $attributes[$key] = $this->{$key}; } // Construct a vcalendar object based on the templated return (new Build( static::VTEMPLATE ))->build( $attributes ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function build_calendar()\n\t{\n\t\t//ee()->TMPL->log_item('Calendar: Building calendar output');\n\n\t\t$disable\t= array(\n\t\t\t'categories',\n\t\t\t'category_fields',\n\t\t\t'custom_fields',\n\t\t\t'member_data',\n\t\t\t'pagination',\n\t\t\t'trackbacks'\n\t\t);\n\n\t\t$this->CDT->reset();\n\t\t$today_ymd\t= $this->CDT->ymd;\n\n\t\t// -------------------------------------\n\t\t// Set dynamic=\"off\", lest Channel get uppity and try\n\t\t// to think that it's in charge here.\n\t\t// -------------------------------------\n\n\t\t//default off.\n\t\tif ( $this->check_yes( ee()->TMPL->fetch_param('dynamic') ) )\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t= 'yes';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t= 'no';\n\t\t}\n\n\t\tif (isset(ee()->TMPL->tagparams['category']))\n\t\t{\n\t\t\t$this->convert_category_titles();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Collect important bits of tagdata\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Collecting tagdata');\n\n\t\t$output_at\t= '';\n\t\t$tagdata\t= ee()->TMPL->tagdata;\n\t\t$each_year\t= $each_month = $each_week = $each_day = $each_hour = $each_event = '';\n\t\t$hash_event\t= 'd38bf16a9a74c63fa5eb6d1ac082d539'.\"\\n\";\n\t\t$hash_hour\t= 'fe16402ccfad7e120a7ca3a31df3a019'.\"\\n\";\n\t\t$hash_day\t= '2aa2a1a0724182b1d876232c137a6d4f'.\"\\n\";\n\t\t$hash_week\t= 'b657210371b3e2a6f955ef6a404689de'.\"\\n\";\n\t\t$hash_month\t= 'd03207661c36a3bfd43b9dd239e41676'.\"\\n\";\n\t\t$hash_year\t= '97a92770ab082652cf662bdacc311dff'.\"\\n\";\n\n\t\t//--------------------------------------------\n\t\t//\tremove pagination before we start\n\t\t//--------------------------------------------\n\n\t\t//has tags?\n\t\tif (preg_match(\n\t\t\t\t\"/\" . LD . \"calendar_paginate\" . RD .\n\t\t\t\t\t\"(.+?)\" .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . \"calendar_paginate\" . RD . \"/s\",\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\t$tagdata \t\t\t\t\t\t= str_replace( $match[0], '', $tagdata );\n\t\t}\n\t\t//prefix comes first\n\t\telse if (preg_match(\n\t\t\t\t\"/\" . LD . \"paginate\" . RD .\n\t\t\t\t\t\"(.+?)\" .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . \"paginate\" . RD . \"/s\",\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\t$tagdata \t\t\t\t\t\t= str_replace( $match[0], '', $tagdata );\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Replace days of the week first, cuz they're easy\n\t\t// -------------------------------------\n\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_day_of_week']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/' . LD . 'display_each_day_of_week' . RD .\n\t\t\t\t\t'(.*?)' .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . 'display_each_day_of_week' . RD . '/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$dow_output\t\t= '';\n\t\t\t\t$vars\t\t\t= array();\n\t\t\t\t$current_dow\t= $this->CDT->day_of_week;\n\n\t\t\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\n\t\t\t\tif ($this->CDT->day_of_week != $this->first_day_of_week)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_day(\n\t\t\t\t\t\t$this->first_day_of_week - $this->CDT->day_of_week\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tfor ($i = 0; $i < 7; $i++)\n\t\t\t\t{\n\t\t\t\t\tif ($i > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->CDT->add_day();\n\t\t\t\t\t}\n\n\t\t\t\t\t$vars['conditional'] = array(\n\t\t\t\t\t\t'day_of_week_is_weekend'\t=> (\n\t\t\t\t\t\t\t$this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t$this->CDT->day_of_week == 6\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'day_of_week_is_current'\t=> (\n\t\t\t\t\t\t\t$this->CDT->day_of_week == $current_dow\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t'day_of_week'\t\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'l'),\n\t\t\t\t\t\t'day_of_week_one'\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'b'),\n\t\t\t\t\t\t'day_of_week_short'\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'D'),\n\t\t\t\t\t\t'day_of_week_N'\t\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'N'),\n\t\t\t\t\t\t'day_of_week_number'\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'w')\n\t\t\t\t\t);\n\n\t\t\t\t\t$dow_output .= $this->swap_vars($vars, $match[1]);\n\t\t\t\t}\n\t\t\t\t$tagdata = str_replace($match[0], $dow_output, $tagdata);\n\t\t\t}\n\t\t}\n\n\t\t$tagdata = trim($tagdata).\"\\n\";\n\n\t\t// -------------------------------------\n\t\t// Now the rest\n\t\t// -------------------------------------\n\n\t\tif (isset(ee()->TMPL->var_pair['events']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'events'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'events'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_event \t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_event, $tagdata);\n\t\t\t\tee()->TMPL->tagdata = $each_event;\n\t\t\t\t$output_at \t\t\t= 'event';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_hour']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_hour'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_hour'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_hour \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_hour, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'hour';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_day']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_day'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_day'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_day \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_day, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'day';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_week']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_week'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_week'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_week \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_week, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'week';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_month']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_month'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_month'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_month \t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_month, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'month';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_year']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_year'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_year'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_year \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_year, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'year';\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// If there aren't any display_each_X var pairs, default to event\n\t\t// -------------------------------------\n\n\t\tif ($output_at == '')\n\t\t{\n\t\t\t$each_event \t= $tagdata;\n\t\t\t$tagdata \t\t= $hash_event;\n\t\t\t$output_at \t\t= 'event';\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Set the default date to the start of our range\n\t\t// -------------------------------------\n\n\t\t$start_blank = (\n\t\t\t$this->P->value('date_range_start') === FALSE AND\n\t\t\t$this->P->value('date_range_end') === FALSE\n\t\t);\n\n\t\t$start\t= $this->CDT->change_datetime(\n\t\t\t$this->P->value('date_range_start', 'year'),\n\t\t\t$this->P->value('date_range_start', 'month'),\n\t\t\t$this->P->value('date_range_start', 'day'),\n\t\t\t$this->P->value('date_range_start', 'hour'),\n\t\t\t$this->P->value('date_range_start', 'minute')\n\t\t);\n\n\t\t$end\t= $this->CDT->change_datetime(\n\t\t\t$this->P->value('date_range_end', 'year'),\n\t\t\t$this->P->value('date_range_end', 'month'),\n\t\t\t$this->P->value('date_range_end', 'day'),\n\t\t\t($start_blank ? '23' : $this->P->value('date_range_end', 'hour')),\n\t\t\t($start_blank ? '59' : $this->P->value('date_range_end', 'minute'))\n\t\t);\n\n\t\t$current_period_start\t= $start;\n\t\t$current_period_end\t\t= $end;\n\n\t\t$this->CDT->set_default($start);\n\t\t$this->CDT->reset();\n\n\t\t// -------------------------------------\n\t\t// If we are \"padding\" short weeks, modify our dates\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('pad_short_weeks') === TRUE)\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// Adjust the start date backward to the first day of the week, if necessary\n\t\t\t// -------------------------------------\n\n\t\t\t$old_end = $end;\n\n\t\t\tif ($start['day_of_week'] != $this->first_day_of_week)\n\t\t\t{\n\t\t\t\t$offset = ($start['day_of_week'] > $this->first_day_of_week) ?\n\t\t\t\t\t$start['day_of_week'] - $this->first_day_of_week :\n\t\t\t\t\t7 - ($this->first_day_of_week - $start['day_of_week']);\n\n\t\t\t\t$start \t= $this->CDT->add_day(-$offset);\n\t\t\t\t$this->CDT->reset();\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Adjust the end date forward to the last day of the week, if necessary\n\t\t\t// -------------------------------------\n\n\t\t\t$last_dow = ($this->first_day_of_week > 0) ? $this->first_day_of_week - 1 : 6;\n\n\t\t\tif ($end['day_of_week'] != $last_dow)\n\t\t\t{\n\t\t\t\t$this->CDT->change_ymd($end['ymd']);\n\t\t\t\t$offset = ($end['day_of_week'] > $last_dow) ?\n\t\t\t\t\t7 - ($end['day_of_week'] - $last_dow) :\n\t\t\t\t\t$last_dow - $end['day_of_week'];\n\n\t\t\t\t$end \t= $this->CDT->add_day($offset);\n\t\t\t\t$this->CDT->reset();\n\t\t\t}\n\n\t\t\t$end['time']\t= $old_end['time'];\n\t\t\t$end['hour']\t= $old_end['hour'];\n\t\t\t$end['minute']\t= $old_end['minute'];\n\n\t\t\t$this->CDT->set_default($start);\n\t\t\t$this->P->set('date_range_start', $start);\n\t\t\t$this->P->set('date_range_end', $end);\n\t\t}\n\n\t\t//ee()->TMPL->log_item('Calendar: Date range start: '. $this->P->value('date_range_start', 'ymd'));\n\n\t\t//ee()->TMPL->log_item('Calendar: Date range end: '. $this->P->value('date_range_end', 'ymd'));\n\n\t\t// -------------------------------------\n\t\t// Let's go fetch some events\n\t\t// -------------------------------------\n\n\t\t/*$category = FALSE;\n\n\t\tif (isset(ee()->TMPL) AND\n\t\t\t is_object(ee()->TMPL) AND\n\t\t\t ee()->TMPL->fetch_param('category') !== FALSE AND\n\t\t\t ee()->TMPL->fetch_param('category') != ''\n\t\t)\n\t\t{\n\t\t\t$category = ee()->TMPL->fetch_param('category');\n\n\t\t\tunset(ee()->TMPL->tagparams['category']);\n\t\t}*/\n\n\t\t$ids \t\t\t= $this->data->fetch_event_ids($this->P /*, $category*/);\n\n\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Fetching events. ' . count( $ids ) . ' events were found.');\n\n\t\t$entry_data \t= array();\n\t\t$events \t\t= array();\n\n\t\t// -------------------------------------\n\t\t// No events? You really need to work on your social calendar...\n\t\t// -------------------------------------\n\n\t\tif (empty($ids))\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// If they used a no_results tag, let 'em have it\n\t\t\t// -------------------------------------\n\n\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t{\n\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() No results, going home');\n\t\t\t\treturn $this->no_results();\n\t\t\t}\n\n\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() No results, but staying around for the show');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// We only care about this stuff if:\n\t\t\t// \t* there's an {event}{/event} tag pair\n\t\t\t// \t* thar be one or more xxx_has_events variables\n\t\t\t// -------------------------------------\n\n\t\t\tif ($each_event != '' OR strpos(ee()->TMPL->tagdata, '_event_total') !== FALSE)\n\t\t\t{\n\t\t\t\twhile (TRUE)\n\t\t\t\t{\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Firing up the ol Channel Module to try and process ' . count( $ids ) . ' events.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Fetch occurrence info\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$occurrence_ids = $this->data->fetch_occurrence_entry_ids($ids);\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() ' . count( $occurrence_ids ) . ' occurrences were found.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If the entry_id of the occurrence doesn't match the entry_id\n\t\t\t\t\t// of the entry, we need to fetch the occurrence data separately\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($occurrence_ids as $id => $data)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($data as $oid => $o_entry_id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($id != $o_entry_id)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$ids[$o_entry_id] = $id; //$o_entry_id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare tagdata for Calendar-specific variable pairs, which\n\t\t\t\t\t// we will process later.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->var_single['entry_id'] = 'entry_id';\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare tagdata for Calendar-specific date variables, which\n\t\t\t\t\t// we will process later.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$var_dates = array(\n\t\t\t\t\t\t'event_start_date' \t=> FALSE,\n\t\t\t\t\t\t'event_start_time' \t=> FALSE,\n\t\t\t\t\t\t'event_end_date' \t=> FALSE,\n\t\t\t\t\t\t'event_end_time' \t=> FALSE\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach (ee()->TMPL->var_single as $k => $v)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (($pos = strpos($k, ' format')) !== FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$name = substr($k, 0, $pos);\n\n\t\t\t\t\t\t\tif (array_key_exists($name, $var_dates))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$var_dates[$name][$k] \t\t= $v;\n\t\t\t\t\t\t\t\tee()->TMPL->var_single[$k] \t= $k;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tInvoke Channel class\n\t\t\t\t\t//\t----------------------------------------\n\n\t\t\t\t\tif ( ! class_exists('Channel') )\n\t\t\t\t\t{\n\t\t\t\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel = new Channel();\n\n\t\t\t\t\t//need to remove limit here so huge amounts of events work\n\t\t\t\t\t$channel->limit = 1000000;\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare parameters\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagparams['entry_id'] = implode('|', array_keys($ids));\n\n\t\t\t\t\tif ($this->P->value('enable') != FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (is_array($this->P->value('enable')))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tee()->TMPL->tagparams['disable'] = implode('|', array_diff($disable, $this->P->value('enable')));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tee()->TMPL->tagparams['disable'] = implode('|', array_diff($disable, array($this->P->value('enable'))));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tee()->TMPL->tagparams['disable'] = implode('|', $disable);\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Pre-process related data\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data( ee()->TMPL->tagdata );\n\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t\t\t\t{\n\t\t\t\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\t\t\t\t$each_event\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tee()->TMPL->var_single \t= array_merge( ee()->TMPL->var_single, ee()->TMPL->related_markers );\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Execute needed methods\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$channel->fetch_custom_channel_fields();\n\n\t\t\t\t\t$channel->fetch_custom_member_fields();\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Pagination Tags Parsed Out\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\t$channel = $this->fetch_pagination_data($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Querification\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//for some reason without this in EE 2.8.x\n\t\t\t\t\t//pagination has some sort of dynamic detection\n\t\t\t\t\t//that it didn't in EE 2.7 and below and hoses our\n\t\t\t\t\t//pagination setup because we are doing it\n\t\t\t\t\t//manually later as this is just data gathering\n\t\t\t\t\t//for events.\n\t\t\t\t\tif (\n\t\t\t\t\t\tversion_compare($this->ee_version, '2.8.0', '>=') &&\n\t\t\t\t\t\tisset($channel->pagination)\n\t\t\t\t\t)\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->pagination->paginate = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->build_sql_query();\n\n\t\t\t\t\tif ($channel->sql == '')\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Channel query empty');\n\n\t\t\t\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $this->no_results();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\t\t\t\tif ($channel->query->num_rows == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Channel Module returned no results');\n\n\t\t\t\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $this->no_results();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Channel module found ' . $channel->query->num_rows . ' results.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Trim IDs and build events\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$new_ids = array();\n\n\t\t\t\t\tforeach ($channel->query->result as $k => $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$new_ids[$row['entry_id']] = $ids[$row['entry_id']];\n\t\t\t\t\t}\n\n\t\t\t\t\t$event_data = $this->data->fetch_all_event_data($new_ids);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Turn these IDs into events\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$events = array();\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Beginning event creation process.');\n\n\t\t\t\t\tif ( ! class_exists('Calendar_event'))\n\t\t\t\t\t{\n\t\t\t\t\t\trequire_once CALENDAR_PATH.'calendar.event.php';\n\t\t\t\t\t}\n\n\t\t\t\t\t$calendars = array();\n\n\t\t\t\t\tforeach ($event_data as $k => $edata)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp = new Calendar_event(\n\t\t\t\t\t\t\t$edata,\n\t\t\t\t\t\t\t$this->P->params['date_range_start']['value'],\n\t\t\t\t\t\t\t$this->P->params['date_range_end']['value']\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( ! empty($temp->dates))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp->prepare_for_output();\n\t\t\t\t\t\t\t$events[$edata['entry_id']] = $temp;\n\t\t\t\t\t\t\t$calendars[$events[$edata['entry_id']]->default_data['calendar_id']] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Event creation resulted in the creation of ' . count( $events ) . ' events.');\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Event creation process finished.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Leaving so soon?\n\t\t\t\t\t// There's no point in continuing if we're just interested\n\t\t\t\t\t// in whether or not there are events on this day.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event == '')\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (array_keys($events) as $id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$entry_data[$id] = $id;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Skipping further channel module processing because $each_event variable was empty string. ' . count( $entry_data ) . ' events were found and logged into the $entry_data array.');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Nor should we stay around if there's nothing to process\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\telseif (empty($calendars))\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Skipping further channel module processing because there were no calendars connected to the events found.');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Fetch information about the calendars\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$calendars = $this->data->fetch_calendar_data_by_id(array_keys($calendars));\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare the tagdata that will be parsed by the channel module\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$blargle = '3138ad2081984be5dea40e593fd61f87';\n\t\t\t\t\t$bleegle = '6f8de301e6e6f2cd80ad99aa3a765b31';\n\t\t\t\t\t//ee()->TMPL->tagdata = $blargle . '[' . LD . \"entry_id\" . RD . ']' . $each_event . $bleegle;\n\t\t\t\t\tee()->TMPL->tagdata = $blargle .\n\t\t\t\t\t\t'[' . LD . \"entry_id\" . RD . ']' .\n\t\t\t\t\t\tee()->TMPL->tagdata .\n\t\t\t\t\t\t$bleegle;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prep variable aliases\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$variables = array(\n\t\t\t\t\t\t'title'\t\t\t=> 'event_title',\n\t\t\t\t\t\t'url_title'\t\t=> 'event_url_title',\n\t\t\t\t\t\t'entry_id'\t\t=> 'event_id',\n\t\t\t\t\t\t'author_id'\t\t=> 'event_author_id',\n\t\t\t\t\t\t'author'\t\t=> 'event_author',\n\t\t\t\t\t\t'status'\t\t=> 'event_status'\n\t\t\t\t\t);\n\n\t\t\t\t\t//custom variables with the letters 'url' are borked in\n\t\t\t\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t\t\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t\t\t\t{\n\t\t\t\t\t\t$variables['url_title'] = 'event_borked_title';\n\n\t\t\t\t\t\tee()->TMPL->var_single['event_borked_title'] = 'event_borked_title';\n\n\t\t\t\t\t\tunset(ee()->TMPL->var_single['event_url_title']);\n\n\t\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tee()->TMPL->var_single['event_calendar_borked_title'] = 'event_calendar_borked_title';\n\n\t\t\t\t\t\tunset(ee()->TMPL->var_single['event_calendar_url_title']);\n\n\t\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Typography\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\tee()->load->library('typography');\n\t\t\t\t\tee()->typography->initialize();\n\t\t\t\t\tee()->typography->convert_curly = FALSE;\n\n\t\t\t\t\t$channel->fetch_categories();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Add variables to the query result\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($channel->query->result as $k => $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$entry_id = $row['entry_id'];\n\n\t\t\t\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ? $row['screen_name'] : $row['username'];\n\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() We\\'re in the channel query result loop. Entry id is ' . $entry_id );\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Skip this result if the event data doesn't exist\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif (! isset($events[$ids[$entry_id]]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($channel->query->result[$k]);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$channel->query->result[$k]['edited_occurrence'] \t= FALSE;\n\t\t\t\t\t\t$channel->query->result[$k]['event_parent_id']\t\t= ($ids[$entry_id] == $entry_id) ? 0 : $ids[$entry_id];\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// If this entry_id is not in the $events array, this is an edited occurrence\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif (! isset($events[$entry_id]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Add this info to the $events array\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$events[$entry_id] = clone $events[$ids[$entry_id]];\n\n\t\t\t\t\t\t\t$channel->query->result[$k]['edited_occurrence'] = TRUE;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Correct the info\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\tforeach ($events[$entry_id]->occurrences as $ymd => $times)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($times as $time => $data)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($data['entry_id'] != $entry_id)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tunset($events[$entry_id]->occurrences[$ymd][$time], $events[$entry_id]->dates[$ymd][$time]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tunset($events[$data['event_id']]->occurrences[$ymd][$time], $events[$data['event_id']]->dates[$ymd][$time]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// NOTE: Requires PHP >= 5.1.0\n\t\t\t\t\t\t\t$events[$entry_id]->dates = array_intersect_key($events[$entry_id]->dates, $events[$entry_id]->occurrences);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Alias\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tforeach ($variables as $old => $new)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($old == 'title')\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$old]\t= ee()->typography->parse_type(\n\t\t\t\t\t\t\t\t\t$channel->query->result[$k][$old],\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'text_format' \t=> 'lite',\n\t\t\t\t\t\t\t\t\t\t'html_format' \t=> 'none',\n\t\t\t\t\t\t\t\t\t\t'auto_links' \t=> 'n',\n\t\t\t\t\t\t\t\t\t\t'allow_img_url' => 'no'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$new]\t= $channel->query->result[$k][$old];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$new]\t= $channel->query->result[$k][$old];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Calendar variables\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tforeach ($calendars[$events[$entry_id]->default_data['calendar_id']] as $key => $val)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->query->result[$k][$key] = $val;\n\n\t\t\t\t\t\t\tif ($key == 'calendar_url_title' AND\n\t\t\t\t\t\t\t\tversion_compare($this->ee_version, '2.6.0', '>='))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k]['event_calendar_borked_title'] = $val;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k]['event_'.$key] = $val;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tRedeclare\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tWe will reassign the $channel->query->result with our\n\t\t\t\t\t//\treordered array of values. Thank you PHP for being so fast with array loops.\n\t\t\t\t\t//\t----------------------------------------\n\n\t\t\t\t\t$super_temp_fake = $channel->query->result_array = $channel->query->result;\n\n\t\t\t\t\t$channel->fetch_categories();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Handle {title} and {event_title} differently\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagdata\t= str_replace(\n\t\t\t\t\t\tLD . 'title' . RD,\n\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . LD . 'entry_id' . RD,\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\tee()->TMPL->tagdata\t= str_replace(\n\t\t\t\t\t\tLD . 'event_title' . RD,\n\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . LD . 'entry_id' . RD,\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Remove \"ignore\" prefixes\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t'calendar_ignore_',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Parse Weblog stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Parsing Weblog stuff');\n\n\t\t\t\t\t$channel->parse_channel_entries();\n\n\t\t\t\t\tforeach ($super_temp_fake as $k => $data)\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->return_data = str_replace(\n\t\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . $data['entry_id'],\n\t\t\t\t\t\t\t$super_temp_fake[$k]['title'],\n\t\t\t\t\t\t\t$channel->return_data\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Related entries\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries');\n\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->parse_related_entries();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Collect the parsed data for use later\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tpreg_match_all('/' . $blargle . '\\[(\\d+)\\](.*?)' . $bleegle . '/s', $channel->return_data, $matches);\n\t\t\t\t\tforeach ($matches[0] as $k => $match)\n\t\t\t\t\t{\n\t\t\t\t\t\t$entry_data[$matches[1][$k]] = $matches[2][$k];\n\t\t\t\t\t}\n\n\t\t\t\t\tunset($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Stop the insanity!\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Channel module stuff done');\n\n\t\t// -------------------------------------\n\t\t// Build the calendar\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Starting to build the calendar');\n\n\t\t$start_year\t\t= $start['year'];\n\t\t$start_month\t= $start['month'];\n\t\t$start_day\t\t= $start['day'];\n\t\t$end_year\t\t= $end['year'];\n\t\t$end_month\t\t= $end['month'];\n\t\t$end_day\t\t= $end['day'];\n\t\t$w\t\t\t\t= 0;\n\n\t\t$this->CDT->reset();\n\n\t\tif ($this->P->value('pad_short_weeks') === TRUE)\n\t\t{\n\t\t\t$week_counter = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$week_counter = ($this->CDT->day_of_week >= $this->first_day_of_week) ?\n\t\t\t\t\t\t\t\t$this->CDT->day_of_week - $this->first_day_of_week :\n\t\t\t\t\t\t\t\t7 + $this->CDT->day_of_week - $this->first_day_of_week;\n\t\t}\n\n\t\t$output = '';\n\t\t$week_temp = $month_temp = $year_temp = '';\n\t\t$day_count = 0;\n\n\t\t$next_CDT = $prev_CDT = $start;\n\n\t\t$all_day = array();\n\t\t$event_array = array();\n\n\t\t// -------------------------------------\n\t\t// Prepare the events\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Preparing events');\n\n\t\tforeach ($events as $id => $event)\n\t\t{\n\t\t\t//prevent missing entry data from attempting to display and causing errors\n\t\t\tif ( ! isset($entry_data[$event->default_data['entry_id']]))\n\t\t\t{\n\t\t\t\tunset($events[$id]);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (empty($event->dates))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ($event->dates as $ymd => $items)\n\t\t\t{\n\t\t\t\tforeach ($items as $time => $ddata)\n\t\t\t\t{\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// It was over before it started\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['end_date']['ymd'].$ddata['end_date']['time'] <\n\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') .\n\t\t\t\t\t\t$this->P->value('date_range_start', 'time'))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// ...or the inverse\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['date']['ymd'].$ddata['date']['time'] >\n\t\t\t\t\t\t $this->P->value('date_range_end', 'ymd') .\n\t\t\t\t\t\t $this->P->value('time_range_end', 'time'))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If the start date of the event is less than the first\n\t\t\t\t\t// day of the calendar, we've got ourselves a hangover.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['date']['ymd'] < $this->P->value('date_range_start', 'ymd'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_array[$this->P->value('date_range_start', 'ymd')]['all_day'][$id]\t= $id;\n\t\t\t\t\t\t$events[$id]->dates[$this->P->value('date_range_start', 'ymd')]\t\t\t\t= $events[$id]->dates[$ymd];\n\t\t\t\t\t}\n\t\t\t\t\telseif ($ddata['all_day'] === TRUE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_array[$ymd]['all_day'][$id] = $id;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($ddata['multi_day'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$event_array[$ymd]['all_day'][$id] = $id;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$start_hour\t= str_pad($ddata['date']['hour'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$start_min\t= str_pad($ddata['date']['minute'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$end_hour\t= str_pad($ddata['end_date']['hour'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$end_min\t= str_pad($ddata['end_date']['minute'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$event_array[$ymd][$start_hour][$start_min][$end_hour][$end_min][$id] = $id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\n\t\t\t// -------------------------------------\n\t\t\t// Aliases\n\t\t\t// -------------------------------------\n\n\t\t\t$events[$id]->default_data['first_date']\t= $events[$id]->default_data['start_date'];\n\t\t}\n\n\t\t$this->CDT->reset();\n\n\t\t// -------------------------------------\n\t\t// Prune the event array, if there's an event limit.\n\t\t// NOTE: apply_event_limit() also sorts the array for us.\n\t\t// -------------------------------------\n\n\t\t//--------------------------------------------\n\t\t//\tcount all events for tag and pagination\n\t\t//--------------------------------------------\n\n\t\t$this->event_timeframe_total = $this->count_event_results($event_array);\n\n\t\t//--------------------------------------------\n\t\t//\tpagination\n\t\t//--------------------------------------------\n\n\t\t$this->paginate = FALSE;\n\n\t\tif ($this->P->value('event_limit') > 0 AND\n\t\t\t$this->event_timeframe_total > $this->P->value('event_limit'))\n\t\t{\n\t\t\t//get pagination info\n\t\t\t$pagination_data = $this->universal_pagination(array(\n\t\t\t\t'total_results'\t\t\t=> $this->event_timeframe_total,\n\t\t\t\t//had to remove this jazz before so it didn't get iterated over\n\t\t\t\t'tagdata'\t\t\t\t=> $tagdata . $this->paginate_tagpair_data,\n\t\t\t\t'limit'\t\t\t\t\t=> $this->P->value('event_limit'),\n\t\t\t\t'uri_string'\t\t\t=> ee()->uri->uri_string,\n\t\t\t\t'paginate_prefix'\t\t=> 'calendar_'\n\t\t\t));\n\n\t\t\t// -------------------------------------------\n\t\t\t// 'calendar_events_create_pagination' hook.\n\t\t\t// - Let devs maniuplate the pagination display\n\n\t\t\tif (ee()->extensions->active_hook('calendar_build_calendar_create_pagination') === TRUE)\n\t\t\t{\n\t\t\t\t$pagination_data = ee()->extensions->call(\n\t\t\t\t\t'calendar_build_calendar_create_pagination',\n\t\t\t\t\t$this,\n\t\t\t\t\t$pagination_data\n\t\t\t\t);\n\t\t\t}\n\t\t\t//\n\t\t\t// -------------------------------------------\n\n\t\t\t//if we paginated, sort the data\n\t\t\tif ($pagination_data['paginate'] === TRUE)\n\t\t\t{\n\t\t\t\t$this->paginate\t\t\t= $pagination_data['paginate'];\n\t\t\t\t$this->page_next\t\t= $pagination_data['page_next'];\n\t\t\t\t$this->page_previous\t= $pagination_data['page_previous'];\n\t\t\t\t$this->p_page\t\t\t= $pagination_data['pagination_page'];\n\t\t\t\t$this->current_page \t= $pagination_data['current_page'];\n\t\t\t\t$this->pager \t\t\t= $pagination_data['pagination_links'];\n\t\t\t\t$this->basepath\t\t\t= $pagination_data['base_url'];\n\t\t\t\t$this->total_pages\t\t= $pagination_data['total_pages'];\n\t\t\t\t$this->paginate_data\t= $pagination_data['paginate_tagpair_data'];\n\t\t\t\t$this->page_count\t\t= $pagination_data['page_count'];\n\t\t\t\t//$tagdata\t\t\t\t= $pagination_data['tagdata'];\n\t\t\t}\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tevent limiter\n\t\t//--------------------------------------------\n\n\t\t$offset = (\n\t\t\tee()->TMPL->fetch_param('event_offset') ?\n\t\t\t\tee()->TMPL->fetch_param('event_offset') :\n\t\t\t\t0\n\t\t);\n\n\t\t$page \t= (($this->current_page -1) * $this->P->value('event_limit'));\n\n\t\tif ($page > 0)\n\t\t{\n\t\t\t$offset += $page;\n\t\t}\n\n\t\t$event_array = $this->apply_event_limit(\n\t\t\t$event_array,\n\t\t\t$this->P->value('event_limit'),\n\t\t\t$offset\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// Loopage\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Beginning date loops');\n\n\t\t$week_event_count\t= 0;\n\t\t$event_count\t\t= 0;\n\t\t$year_tick\t\t\t= 0;\n\t\t$month_tick\t\t\t= 0;\n\n\t\tfor ($y = $start_year; $y <= $end_year; $y++)\n\t\t{\n\t\t\t$year_event_count = 0;\n\n\t\t\t//blank out\n\t\t\t$this->counted['year'] = array();\n\n\t\t\t$mx = ($y == $start_year) ? $start_month : 1;\n\t\t\t$my = ($y == $end_year) ? $end_month : 12;\n\n\t\t\t$year_ymd_cache = $this->CDT->ymd;\n\n\n\t\t\tfor ($m = $mx; $m <= $my; $m++)\n\t\t\t{\n\t\t\t\t$month_ymd_cache \t= $this->CDT->ymd;\n\n\n\t\t\t\t$month_event_count = 0;\n\n\t\t\t\t//blank out\n\t\t\t\t$this->counted['month'] = array();\n\n\t\t\t\t$dx = ($y == $start_year AND $m == $start_month) ?\n\t\t\t\t\t\t$start_day :\n\t\t\t\t\t\t1;\n\n\t\t\t\t$dy = ($y == $end_year AND $m == $end_month) ?\n\t\t\t\t\t\t$end_day :\n\t\t\t\t\t\t$this->CDT->days_in_month($m, $y);\n\n\t\t\t\tfor ($d = $dx; $d <= $dy; $d++)\n\t\t\t\t{\n\t\t\t\t\t$day_ymd_cache \t= $this->CDT->ymd;\n\t\t\t\t\t$day_tick\t\t= 0;\n\n\t\t\t\t\t$this->CDT->change_date($y, $m, $d);\n\t\t\t\t\t$this->CDT->set_default($this->CDT->date_array());\n\n\t\t\t\t\t$ymd = $this->CDT->ymd;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare counts and totals, also\n\t\t\t\t\t// altered later in the loop in some cases\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$day_event_count = 0;\n\t\t\t\t\t$day_event_total = 0;\n\n\t\t\t\t\t//blank out\n\t\t\t\t\t$this->counted['day'] = array();\n\n\t\t\t\t\tif (! isset($event_array[$ymd])) $event_array[$ymd] = array();\n\n\t\t\t\t\t$day_event_total\t= $this->count_events(\n\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t$event_array,\n\t\t\t\t\t\t$all_day,\n\t\t\t\t\t\t'day',\n\t\t\t\t\t\t$events\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Start events for the day\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Beginning ' . $ymd . count( $event_array[$ymd] ) . ' events for this day.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// This looks a little goofy, but it\n\t\t\t\t\t// prevents extra years/months\n\t\t\t\t\t// showing up thanks to padded weeks\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$day_count++;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Week stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($week_counter % 7 == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//blank out\n\t\t\t\t\t\t$this->counted['week'] = array();\n\n\t\t\t\t\t\t$w = str_pad($this->CDT->week_number, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t}\n\n\t\t\t\t\t$week_counter++;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \"next\" stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$next_y = ($m == 12 AND $d == 31) ? $y+1 : $y;\n\t\t\t\t\t$next_m = ($d == $this->CDT->days_in_month()) ? $m + 1 : $m;\n\t\t\t\t\t$next_w = ($week_counter % 7 == 0) ? $w + 1 : $w;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Yodelers of Mass Destruction\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$find\t\t\t= '';\n\t\t\t\t\t$replace\t\t= '';\n\t\t\t\t\t$hour_events\t= array();\n\t\t\t\t\t$last_day\t\t= (\n\t\t\t\t\t\t$y == $end_year AND\n\t\t\t\t\t\t$m == $end_month AND\n\t\t\t\t\t\t$d == $end_day\n\t\t\t\t\t) ? TRUE : FALSE;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Remove \"all day\" stragglers\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($all_day as $i => $stuff)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($ymd > $stuff['end_ymd'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($all_day[$i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each event\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \t$each_event contains the formatting\n\t\t\t\t\t// \tto use for displaying the contents\n\t\t\t\t\t// \tof an event on a given day in the calendar.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_output = '';\n\n\t\t\t\t\t\tif ( ! empty($event_array[$ymd]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($event_array[$ymd] as $start_hour => $sh_data)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hour_event_count\t= 0;\n\t\t\t\t\t\t\t\t$hour_event_total\t= count($sh_data);\n\n\t\t\t\t\t\t\t\tif ($start_hour == 'all_day')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$prev_index = 0;\n\t\t\t\t\t\t\t\t\t$index = 0;\n\n\t\t\t\t\t\t\t\t\tforeach ($sh_data as $i => $id)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t// Multi-day events get one time key, regular\n\t\t\t\t\t\t\t\t\t\t// all day events get another\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\t$time_key = '00002400';\n\n\t\t\t\t\t\t\t\t\t\tif ( ! isset( $events[$id]->dates[$ymd][$time_key]))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//so in some rare situations this\n\t\t\t\t\t\t\t\t\t\t\t//can come to us without being reset?\n\t\t\t\t\t\t\t\t\t\t\t//I hate moving pointers :p\n\t\t\t\t\t\t\t\t\t\t\treset($events[$id]->dates[$ymd]);\n\n\t\t\t\t\t\t\t\t\t\t\t$time_key = key($events[$id]->dates[$ymd]);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars($id, $events[$id], $ymd, $time_key);\n\n\t\t\t\t\t\t\t\t\t\t$vars['conditional']['event_all_day']\t= TRUE;\n\n\t\t\t\t\t\t\t\t\t\t$vars['single']\t+= array(\n\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t\t=> $this->create_count_hash('event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t\t=> $this->create_count_hash('year_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t\t=> $this->create_count_hash('month_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t\t=> $this->create_count_hash('week_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t\t=> $this->create_count_hash('day_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t\t=> $this->create_count_hash('hour_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'all_day_event_index_difference' => $index - $prev_index,\n\t\t\t\t\t\t\t\t\t\t\t'all_day_event_index'\t\t=> $index++,\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_minutes'\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['minutes'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['minutes'],\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_hours'\t\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['hours'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['hours'],\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_days'\t\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['days'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['days']\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t'event_count'\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'month_event_count' \t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t// If we're outputting at the event level, then we have\n\t\t\t\t\t\t\t\t\t\t// to spit out the all day stuff here.\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\tif ($output_at == 'event')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$event_output .= $this->swap_vars($vars, $output_data);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t//shortcut\n\t\t\t\t\t\t\t\t\t\t$evtk =& $events[$id]->dates[$ymd][$time_key];\n\n\t\t\t\t\t\t\t\t\t\t$array = array(\n\t\t\t\t\t\t\t\t\t\t\t'output'\t\t\t\t\t=> $output_data,\n\t\t\t\t\t\t\t\t\t\t\t'vars'\t\t\t\t\t\t=> $vars,\n\t\t\t\t\t\t\t\t\t\t\t'first_day'\t\t\t\t\t=> $evtk['date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'last_day'\t\t\t\t\t=> $evtk['end_date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'start_ymd'\t\t\t\t\t=> $evtk['date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'end_ymd'\t\t\t\t\t=> $evtk['end_date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'time'\t\t\t\t\t\t=> $time_key,\n\t\t\t\t\t\t\t\t\t\t\t'id'\t\t\t\t\t\t=> $id,\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_minutes'\t=> $evtk['duration']['minutes'],\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_hours'\t\t=> $evtk['duration']['hours'],\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_days'\t\t=> $evtk['duration']['days']\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t//unset($event_array[$ymd]['all_day'][$id]);\n\n\t\t\t\t\t\t\t\t\t\t$count\t\t= (empty($all_day)) ? 0 : max(array_keys($all_day));\n\t\t\t\t\t\t\t\t\t\t$inserted\t= FALSE;\n\t\t\t\t\t\t\t\t\t\t$prev_index\t= $index + 1;\n\n\t\t\t\t\t\t\t\t\t\tif (! in_array($array, $all_day))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tfor ($i = 0; $i <= $count; $i++)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t\t\t// Find a spot for this event\n\t\t\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (! isset($all_day[$i]))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$all_day[$i] = $array;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$inserted = TRUE;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tif ($inserted === FALSE)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$all_day[$i] = $array;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tksort($all_day);\n\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ($each_hour != '')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$hour_events[$start_hour] = $sh_data;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach ($sh_data as $start_minute => $sm_data)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($sm_data as $end_hour => $eh_data)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tforeach ($eh_data as $end_minute => $event_ids)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ($event_ids as $id)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (isset($entry_data[$id]))\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_hour\t= str_pad($start_hour, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_min\t= str_pad($start_min, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$end_hour\t= str_pad($end_hour, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$end_min\t= str_pad($end_min, 2, 0, STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$time_key = $start_hour.$start_minute.$end_hour.$end_minute;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( ! isset($events[$id]->dates[$ymd][$time_key]))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_hour . $start_minute . $end_hour . $end_minute\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_minutes']\t= $events[$id]->dates[$ymd][$time_key]['duration']['minutes'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_hours']\t\t= $events[$id]->dates[$ymd][$time_key]['duration']['hours'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_days']\t\t= $events[$id]->dates[$ymd][$time_key]['duration']['days'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_count']\t\t\t\t= $this->create_count_hash('event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['year_event_count']\t\t\t= $this->create_count_hash('year_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['month_event_count']\t\t= $this->create_count_hash('month_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['week_event_count']\t\t\t= $this->create_count_hash('week_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_count']\t\t\t= $this->create_count_hash('day_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_count']\t\t\t= $this->create_count_hash('hour_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_total']\t\t\t= $day_event_total;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_total']\t\t\t= $hour_event_total;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['all_day_event_index']\t\t= 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['all_day_event_index_difference'] = 0;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$event_output .= $this->swap_vars($vars, $output_data);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//parse day event counts\n\t\t\t\t\t\t\t$event_output = $this->parse_count_hashes('hour_event_count', $event_output);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$find = $hash_event;\n\t\t\t\t\t\t$replace = $event_output;\n\n\t\t\t\t\t\tif ($output_at == 'event')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If $each_event is empty, $all_day never gets filled. Let's fix that.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event == '' AND isset($event_array[$ymd]['all_day']))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($event_array[$ymd]['all_day'] as $id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$time_key\t\t\t= (! isset( $events[$id]->dates[$ymd]['00002400'])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey($events[$id]->dates[$ymd]) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t'00002400';\n\n\t\t\t\t\t\t\t$data['end_ymd']\t= $events[$id]->dates[$ymd][$time_key]['end_date']['ymd'];\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// This stuff can be gibberish since it'll never show, but we\n\t\t\t\t\t\t\t// provide it because other parts of the code expect it to exist\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$data['time']\t\t= '';\n\t\t\t\t\t\t\t$data['vars']\t\t= array();\n\t\t\t\t\t\t\t$data['first_day']\t= FALSE;\n\t\t\t\t\t\t\t$data['last_day']\t= FALSE;\n\t\t\t\t\t\t\t$data['output']\t\t= '';\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Add the all day event\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$all_day[]\t\t\t= $data;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$all_day_event_total\t= count($all_day);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \"All day\" output\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$all_day_output = '';\n\n\t\t\t\t\tif ( ! empty($all_day))\n\t\t\t\t\t{\n\t\t\t\t\t\t$prev_index = 0;\n\t\t\t\t\t\t$hour_event_count = 0;\n\n\t\t\t\t\t\tforeach ($all_day as $all_day_data)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$time_key\t= $all_day_data['time'];\n\t\t\t\t\t\t\t$vars\t\t= $all_day_data['vars'];\n\t\t\t\t\t\t\t$vars['single']['event_first_day']\t= ($ymd == $all_day_data['first_day']) ? TRUE : FALSE;\n\t\t\t\t\t\t\t$vars['single']['event_last_day']\t= ($ymd == $all_day_data['last_day']) ? TRUE : FALSE;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Process all day variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$all_day_output\t.= $this->swap_vars($vars, $all_day_data['output']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each hour\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_hour != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$hour_output = '';\n\t\t\t\t\t\t$hour_temp = '';\n\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$hour_output = $all_day_output;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor ($i = 0; $i < 24; $i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$hour_temp\t\t\t= '';\n\t\t\t\t\t\t\t$hour_count\t\t\t= 0;\n\t\t\t\t\t\t\t$hour_event_count\t= 0;\n\t\t\t\t\t\t\t$h\t\t\t\t\t= str_pad($i, 2, '0', STR_PAD_LEFT);\n\t\t\t\t\t\t\t//$this->cdt_format_date_string($this->CDT->datetime_array(), 'H');\n\t\t\t\t\t\t\t$minute\t\t\t\t= '00';\n\t\t\t\t\t\t\t//$this->cdt_format_date_string($this->CDT->datetime_array(), 'i');\n\n\t\t\t\t\t\t\tif (isset($hour_events[$h]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($hour_events[$h] as $start_minute => $sm_data)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach ($sm_data as $end_hour => $eh_data)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($eh_data as $end_minute => $event_ids)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$hour_count += count($event_ids);\n\n\t\t\t\t\t\t\t\t\t\t\tforeach ($event_ids as $id)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif (isset($entry_data[$id]))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$h . $start_minute . $end_hour . $end_minute\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_count']\t\t\t= $this->create_count_hash('event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_count']\t\t= $this->create_count_hash('hour_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['year_event_count']\t\t= $this->create_count_hash('year_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['month_event_count']\t= $this->create_count_hash('month_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['week_event_count']\t\t= $this->create_count_hash('week_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_count']\t\t= $this->create_count_hash('day_event_count');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_temp .= $this->swap_vars($vars, $output_data);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$hour_temp = str_replace($find, $hour_temp, $each_hour);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hour_temp = str_replace($find, $replace, $each_hour);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$vars = array();\n\t\t\t\t\t\t\t$total_events = $hour_count;\n\t\t\t\t\t\t\t$this->CDT->change_time($i, 0);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'time'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t=> $this->CDT->datetime_array()\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'hour'\t\t\t\t=> $h,\n\t\t\t\t\t\t\t\t'minute'\t\t\t=> $minute,\n\t\t\t\t\t\t\t\t'time'\t\t\t\t=> $h.':'.$minute,\n\t\t\t\t\t\t\t\t'hour_event_total' \t=> $total_events\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$hour_output .= $this->swap_vars($vars, $hour_temp);\n\n\t\t\t\t\t\t\t//parse day event counts\n\t\t\t\t\t\t\t$hour_output = $this->parse_count_hashes('hour_event_count', $hour_output);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$find = $hash_hour;\n\t\t\t\t\t\t$replace = $hour_output;\n\n\t\t\t\t\t\tif ($output_at == 'hour')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\n\t\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Outputting hour data for '.$ymd);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each day\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//var_dump($this->CDT->ymd . ' OUTSIDE DAY');\n\n\t\t\t\t\tif ($each_day != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$prefix = $suffix = '';\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Prep day variables\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY');\n\n\t\t\t\t\t\t$day_output = str_replace($find, $replace, $each_day);\n\n\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(1);\n\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-2);\n\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY 2');\n\n\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t$vars['conditional'] = array(\n\t\t\t\t\t\t\t'day_is_today'\t\t\t=> ($today_ymd == $ymd) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_is_weekend'\t\t=> ($this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week == 6) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_is_weekday'\t\t=> ($this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week == 6) ? FALSE : TRUE,\n\t\t\t\t\t\t\t'day_in_current_month'\t=> ($this->CDT->month == $current_period_start['month']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_in_previous_month'\t=> ($this->CDT->month < $current_period_start['month'] OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->year < $current_period_start['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_in_next_month'\t\t=> ($this->CDT->month > $current_period_start['month'] OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->year > $current_period_start['year']) ? TRUE : FALSE\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t'day'\t\t\t\t\t=> $d,\n\t\t\t\t\t\t\t'prev_day'\t\t\t\t=> $prev_CDT['day'],\n\t\t\t\t\t\t\t'next_day'\t\t\t\t=> $next_CDT['day'],\n\t\t\t\t\t\t\t'day_event_total'\t\t=> $day_event_total,\n\t\t\t\t\t\t\t'all_day_event_total'\t=> $all_day_event_total\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t'day' \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t'prev_day' \t=> $prev_CDT,\n\t\t\t\t\t\t\t'next_day'\t=> $next_CDT\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$day_output = $this->parse_count_hashes('day_event_count', $this->swap_vars($vars, $day_output));\n\n\n\t\t\t\t\t\t$find = $hash_day;\n\t\t\t\t\t\t$replace = $prefix.$day_output.$suffix;\n\n\t\t\t\t\t\tif ($output_at == 'day')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting day data for '.$ymd);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY 3');\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each week\n\t\t\t\t\t// -------------------------------------\n\n//var_dump($this->CDT->ymd . ' OUTSIDE WEEK');\n\n\t\t\t\t\tif ($each_week != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($w != $next_w OR\n\t\t\t\t\t\t\t($each_month != '' AND\n\t\t\t\t\t\t\t\t(($m != $next_m OR $last_day === TRUE) AND\n\t\t\t\t\t\t\t\t\t($ymd >= $current_period_start['ymd'] AND\n\t\t\t\t\t\t\t\t\t\t(\t($last_day === TRUE AND $ymd == $current_period_end['ymd']) OR\n\t\t\t\t\t\t\t\t\t\t($ymd != $current_period_end['ymd']))))) OR\n\t\t\t\t\t\t\t$last_day === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' WEEK');\n\n\t\t\t\t\t\t\t$week_temp .= $replace;\n\t\t\t\t\t\t\t$week_output = str_replace($find, $week_temp, $each_week);\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep week variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$offset = ($this->CDT->day_of_week > $this->first_day_of_week) ?\n\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week - $this->first_day_of_week :\n\t\t\t\t\t\t\t\t\t\t7 - ($this->first_day_of_week - $this->CDT->day_of_week);\n\n\t\t\t\t\t\t\t$this->CDT->add_day(-$offset);\n\t\t\t\t\t\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(7);\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-14);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' WEEK 2');\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this week\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$week_event_total \t= 0;\n\n\t\t\t\t\t\t\t//$week_count_id\t\t= 'week_event_total_' . uniqid();\n\n\t\t\t\t\t\t\tif (strpos($each_week, 'week_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->add_day(6);\n\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$week_event_total += $this->count_events($k, $event_array, $all_day, 'week', $events);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'week'\t\t\t\t=> $w,\n\t\t\t\t\t\t\t\t'prev_week'\t\t\t=> $prev_CDT['week_number'],\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT['week_number'],\n\t\t\t\t\t\t\t\t'week_event_total' \t=> $week_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'week' \t\t \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date' \t\t \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_week' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_week'\t \t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$week_output = $this->parse_count_hashes('week_event_count', $this->swap_vars($vars, $week_output));\n\n\t\t\t\t\t\t\t$find = $hash_week;\n\t\t\t\t\t\t\t$replace = $week_output;\n\t\t\t\t\t\t\t$week_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'week')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t$week_event_count = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($end['day'] == $d AND\n\t\t\t\t\t\t\t\t$end['month'] == $m AND\n\t\t\t\t\t\t\t\t$d == $this->CDT->days_in_month($m, $y) AND\n\t\t\t\t\t\t\t\t$this->P->value('pad_short_weeks') === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$week_temp .= $replace;\n\t\t\t\t\t\t\t$week_output = str_replace($find, $week_temp, $each_week);\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep week variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$this->CDT->add_day(-6);\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(7);\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-14);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this week\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$week_event_total = 0;\n\n\t\t\t\t\t\t\tif (strpos($each_week, 'week_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->add_day(6);\n\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$week_event_total += $this->count_events($k, $event_array, $all_day, 'week', $events);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'week'\t\t\t\t=> $w,\n\t\t\t\t\t\t\t\t'prev_week'\t\t\t=> $prev_CDT['week_number'],\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT['week_number'],\n\t\t\t\t\t\t\t\t'week_event_total' \t=> $week_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'week' \t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_week' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$week_output = $this->parse_count_hashes('week_event_count', $this->swap_vars($vars, $week_output));\n\n\t\t\t\t\t\t\t$find \t\t= $hash_week;\n\t\t\t\t\t\t\t$replace \t= $week_output;\n\t\t\t\t\t\t\t$week_temp \t= '';\n\n\t\t\t\t\t\t\tif ($output_at == 'week')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting week data for '.$ymd);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t$week_event_count = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$week_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each month\n\t\t\t\t\t// -------------------------------------\n\n//var_dump($this->CDT->ymd . ' OUTSIDE MONTH');\n\n\t\t\t\t\tif ($each_month != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (($m != $next_m OR $last_day === TRUE) AND\n\t\t\t\t\t\t\t(\t$ymd >= $current_period_start['ymd'] AND\n\t\t\t\t\t\t\t\t(\t($last_day === TRUE AND $ymd == $current_period_end['ymd']) OR\n\t\t\t\t\t\t\t\t\t($ymd != $current_period_end['ymd'])\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$month_temp .= $replace;\n\t\t\t\t\t\t\t$month_output = str_replace($find, $month_temp, $each_month);\n\n\t\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t\t//\treset and add month because\n\t\t\t\t\t\t\t//\tthis gets 'off' some places\n\t\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t\t$this->CDT->set_default($current_period_start);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t//first month is correct\n\t\t\t\t\t\t\tif ($month_tick > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->CDT->add_month($month_tick);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$month_tick++;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep month variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t//add a month\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_month();\n\n\t\t\t\t\t\t\t//subtract 2\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_month(-2);\n\n\t\t\t\t\t\t\t//add 1, now we are back where we started!\n\t\t\t\t\t\t\t$this->CDT->add_month();\n\t\t\t\t\t\t\t$this->CDT->change_date($this->CDT->year, $this->CDT->month, 1);\n\n\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' MONTH 2');\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this month\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$month_event_total = 0;\n\n\t\t\t\t\t\t\tif (strpos($each_month, 'month_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year.str_pad($this->CDT->month, 2, '0', STR_PAD_LEFT).'01';\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year.str_pad($this->CDT->month, 2, '0', STR_PAD_LEFT).$this->CDT->days_in_month();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$month_event_total += $this->count_events($k, $event_array, $all_day, 'month', $events);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//$vars['conditional'] = array( 'day_in_current_month' => TRUE );\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'month'\t\t\t\t=> $m,\n\t\t\t\t\t\t\t\t'prev_month'\t\t=> $prev_CDT['month'],\n\t\t\t\t\t\t\t\t'next_month'\t\t=> $next_CDT['month'],\n\t\t\t\t\t\t\t\t'month_event_total' => $month_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'month' \t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_month' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_month'\t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$month_output \t= $this->parse_count_hashes(\n\t\t\t\t\t\t\t\t'month_event_count',\n\t\t\t\t\t\t\t\t$this->swap_vars($vars, $month_output)\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$replace \t\t= $month_output;\n\n\t\t\t\t\t\t\t$find = $hash_month;\n\t\t\t\t\t\t\t$month_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'month')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting month data for '.$ymd);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$month_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each year\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_year != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($y != $next_y OR $last_day === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if ($last_day !== TRUE)\n\t\t\t\t\t\t\tif ($last_day == TRUE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$year_temp .= $replace;\n\n\t\t\t\t\t\t\t\t$year_output = str_replace($find, $year_temp, $each_year);\n\n\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t// Calculate the number of events this year\n\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t$year_event_total = 0;\n\n\t\t\t\t\t\t\t\tif (strpos(ee()->TMPL->tagdata, 'year_event_total') !== FALSE)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$low\t= $this->CDT->year.'0101';\n\t\t\t\t\t\t\t\t\t$high\t= $this->CDT->year.'1231';\n\t\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t$year_event_total += $this->count_events($k, $event_array, array(), 'year', $events);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t// Prep year variables\n\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t$this->CDT->set_default($current_period_start);\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t\tif ($year_tick > 1)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->CDT->add_year($year_tick);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$year_tick++;\n\n\t\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_year(1);\n\t\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_year(-2);\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t\t$vars['conditional']\t\t= array(\n\t\t\t\t\t\t\t\t\t'year_is_leap_year'\t=> $this->CDT->is_leap_year()\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$vars['single']\t\t\t\t= array(\n\t\t\t\t\t\t\t\t\t'year'\t\t\t\t=> $y,\n\t\t\t\t\t\t\t\t\t'prev_year'\t\t\t=> $prev_CDT['year'],\n\t\t\t\t\t\t\t\t\t'next_year'\t\t\t=> $next_CDT['year'],\n\t\t\t\t\t\t\t\t\t'year_event_total'\t=> $year_event_total\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$vars['date']\t\t\t\t= array(\n\t\t\t\t\t\t\t\t\t'year' \t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t\t'prev_year' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t\t'next_year' \t\t=> $next_CDT\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$year_output = $this->parse_count_hashes(\n\t\t\t\t\t\t\t\t\t'year_event_count',\n\t\t\t\t\t\t\t\t\t$this->swap_vars($vars, $year_output)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$replace = $year_output;\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//$replace = '';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$find = $hash_year;\n\t\t\t\t\t\t\t$year_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'year')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting year data for '.$ymd);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$year_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//parse day event counts\n\t\t\t\t\t//$output = $this->parse_count_hashes('day_event_count', $output);\n\n\t\t\t\t\t//parse week event counts\n\t\t\t\t\t//$output = $this->parse_count_hashes('week_event_count', $output);\n\t\t\t\t}\n\n\t\t\t\t//parse month event counts\n\t\t\t\t//$output = $this->parse_count_hashes('month_event_count', $output);\n\t\t\t}\n\n\t\t\t//parse year event count\n\t\t\t//$output = $this->parse_count_hashes('year_event_count', $output);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\trunning all of these again in case\n\t\t//\tthe didn't fire. This means we\n\t\t//\tare in a straight event loop in\n\t\t//\tcal and it's probably errorsome :/\n\t\t// -------------------------------------\n\n\t\t//parse hour event counts\n\t\t$output = $this->parse_count_hashes('hour_event_count', $output);\n\n\t\t//parse day event counts\n\t\t$output = $this->parse_count_hashes('day_event_count', $output);\n\n\t\t//parse week event counts\n\t\t$output = $this->parse_count_hashes('week_event_count', $output);\n\n\t\t//parse month event counts\n\t\t$output = $this->parse_count_hashes('month_event_count', $output);\n\n\t\t//parse year event count\n\t\t$output = $this->parse_count_hashes('year_event_count', $output);\n\n\t\t//parse year event count\n\t\t$output = $this->parse_count_hashes('event_count', $output);\n\n\t\t$output = $this->swap_vars(array('single'=>array('event_total' => $event_count)), $output);\n\n\t\t$hash = 'hash_'.$output_at;\n\n\t\t$tagdata = isset($$hash) ? str_replace($$hash, $output, $tagdata) : $output;\n\n\t\t$tagdata = $this->parse_pagination($tagdata);\n\n\t\t//ee()->TMPL->log_item('Calendar: All done!');\n\n\t\t// -------------------------------------\n\t\t//\tsetting everything back thats not parsed\n\t\t//\tin case people were writing it in plain text\n\t\t// -------------------------------------\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\n\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tthis shouldn't ever be needed, but here we are\n\t\t//--------------------------------------------\n\n\t\tif (trim($tagdata) === '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\treturn $tagdata;\n\t}", "public function toVObject(){\n\n\t\t//$stmt = $this->events(\\GO\\Base\\Db\\FindParams::newInstance()->select(\"t.*\"));\n\t\t$findParams = \\GO\\Base\\Db\\FindParams::newInstance()->select(\"t.*\");\n\t\t$findParams->getCriteria()->addCondition(\"calendar_id\", $this->id);\n\t\n\t\t$stmt = Event::model()->findForPeriod($findParams, \\GO\\Base\\Util\\Date::date_add(time(), 0, -1));\n\t\t\n\t\t$string = \"BEGIN:VCALENDAR\\r\\nVERSION:2.0\\r\\nPRODID:-//Intermesh//NONSGML \".\\GO::config()->product_name.\" \".\\GO::config()->version.\"//EN\\r\\n\";\n\n\t\t\t$t = new \\GO\\Base\\VObject\\VTimezone();\n\t\t\t$string .= $t->serialize();\n\n\t\t\twhile($event = $stmt->fetch()){\n\t\t\t\t$v = $event->toVObject();\n\t\t\t\t$string .= $v->serialize();\n\t\t\t}\n\n\t\t\t$string .= \"END:VCALENDAR\\r\\n\";\n\t\t\t\n\t\t\treturn $string;\n\t}", "function iCal2XML(& $calendar) {\n\t/** fix an SimpleXMLElement instance and create root element */\n\t$xmlstr = '<?xml version=\"1.0\" encoding=\"utf-8\"?><icalendar xmlns=\"urn:ietf:params:xml:ns:icalendar-2.0\">';\n\t$xmlstr .= '<!-- created utilizing kigkonsult.se ' . ICALCREATOR_VERSION . ' iCal2XMl (rfc6321) -->';\n\t$xmlstr .= '</icalendar>';\n\t$xml = new SimpleXMLElement($xmlstr);\n\t$vcalendar = $xml->addChild('vcalendar');\n\t/** fix calendar properties */\n\t$properties = $vcalendar->addChild('properties');\n\t$calProps = array('prodid', 'version', 'calscale', 'method');\n\tforeach ($calProps as $calProp) {\n\t\tif (FALSE !== ( $content = $calendar->getProperty($calProp)))\n\t\t\t_addXMLchild($properties, $calProp, 'text', $content);\n\t}\n\twhile (FALSE !== ( $content = $calendar->getProperty(FALSE, FALSE, TRUE)))\n\t\t_addXMLchild($properties, $content[0], 'unknown', $content[1]['value'], $content[1]['params']);\n\t$langCal = $calendar->getConfig('language');\n\t/** prepare to fix components with properties */\n\t$components = $vcalendar->addChild('components');\n\t$comps = array('vtimezone', 'vevent', 'vtodo', 'vjournal', 'vfreebusy');\n\t$eventProps = array('dtstamp', 'dtstart', 'uid',\n\t\t'class', 'created', 'description', 'geo', 'last-modified', 'location', 'organizer', 'priority',\n\t\t'sequence', 'status', 'summary', 'transp', 'url', 'recurrence-id', 'rrule', 'dtend', 'duration',\n\t\t'attach', 'attendee', 'categories', 'comment', 'contact', 'exdate', 'request-status', 'related-to', 'resources', 'rdate',\n\t\t'x-prop');\n\t$todoProps = array('dtstamp', 'uid',\n\t\t'class', 'completed', 'created', 'description', 'geo', 'last-modified', 'location', 'organizer', 'percent-complete', 'priority',\n\t\t'recurrence-id', 'sequence', 'status', 'summary', 'url', 'rrule', 'dtstart', 'due', 'duration',\n\t\t'attach', 'attendee', 'categories', 'comment', 'contact', 'exdate', 'request-status', 'related-to', 'resources', 'rdate',\n\t\t'x-prop');\n\t$journalProps = array('dtstamp', 'uid',\n\t\t'class', 'created', 'dtstart', 'last-modified', 'organizer', 'recurrence-id', 'sequence', 'status', 'summary', 'url', 'rrule',\n\t\t'attach', 'attendee', 'categories', 'comment', 'contact',\n\t\t'description',\n\t\t'exdate', 'related-to', 'rdate', 'request-status',\n\t\t'x-prop');\n\t$freebusyProps = array('dtstamp', 'uid',\n\t\t'contact', 'dtstart', 'dtend', 'duration', 'organizer', 'url',\n\t\t'attendee', 'comment', 'freebusy', 'request-status',\n\t\t'x-prop');\n\t$timezoneProps = array('tzid',\n\t\t'last-modified', 'tzurl',\n\t\t'x-prop');\n\t$alarmProps = array('action', 'description', 'trigger', 'summary',\n\t\t'attendee',\n\t\t'duration', 'repeat', 'attach',\n\t\t'x-prop');\n\t$stddghtProps = array('dtstart', 'tzoffsetto', 'tzoffsetfrom',\n\t\t'rrule',\n\t\t'comment', 'rdate', 'tzname',\n\t\t'x-prop');\n\tforeach ($comps as $compName) {\n\t\tswitch ($compName) {\n\t\t\tcase 'vevent':\n\t\t\t\t$props = & $eventProps;\n\t\t\t\t$subComps = array('valarm');\n\t\t\t\t$subCompProps = & $alarmProps;\n\t\t\t\tbreak;\n\t\t\tcase 'vtodo':\n\t\t\t\t$props = & $todoProps;\n\t\t\t\t$subComps = array('valarm');\n\t\t\t\t$subCompProps = & $alarmProps;\n\t\t\t\tbreak;\n\t\t\tcase 'vjournal':\n\t\t\t\t$props = & $journalProps;\n\t\t\t\t$subComps = array();\n\t\t\t\t$subCompProps = array();\n\t\t\t\tbreak;\n\t\t\tcase 'vfreebusy':\n\t\t\t\t$props = & $freebusyProps;\n\t\t\t\t$subComps = array();\n\t\t\t\t$subCompProps = array();\n\t\t\t\tbreak;\n\t\t\tcase 'vtimezone':\n\t\t\t\t$props = & $timezoneProps;\n\t\t\t\t$subComps = array('standard', 'daylight');\n\t\t\t\t$subCompProps = & $stddghtProps;\n\t\t\t\tbreak;\n\t\t} // end switch( $compName )\n\t\t/** fix component properties */\n\t\twhile (FALSE !== ( $component = $calendar->getComponent($compName))) {\n\t\t\t$child = $components->addChild($compName);\n\t\t\t$properties = $child->addChild('properties');\n\t\t\t$langComp = $component->getConfig('language');\n\t\t\tforeach ($props as $prop) {\n\t\t\t\tswitch ($prop) {\n\t\t\t\t\tcase 'attach': // may occur multiple times, below\n\t\t\t\t\t\twhile (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t$type = ( isset($content['params']['VALUE']) && ( 'BINARY' == $content['params']['VALUE'] )) ? 'binary' : 'uri';\n\t\t\t\t\t\t\tunset($content['params']['VALUE']);\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, $type, $content['value'], $content['params']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'attendee':\n\t\t\t\t\t\twhile (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\tif (isset($content['params']['CN']) && !isset($content['params']['LANGUAGE'])) {\n\t\t\t\t\t\t\t\tif ($langComp)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langComp;\n\t\t\t\t\t\t\t\telseif ($langCal)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langCal;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'cal-address', $content['value'], $content['params']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'exdate':\n\t\t\t\t\t\twhile (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t$type = ( isset($content['params']['VALUE']) && ( 'DATE' == $content['params']['VALUE'] )) ? 'date' : 'date-time';\n\t\t\t\t\t\t\tunset($content['params']['VALUE']);\n\t\t\t\t\t\t\tforeach ($content['value'] as & $exDate) {\n\t\t\t\t\t\t\t\tif (( isset($exDate['tz']) && // fix UTC-date if offset set\n\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($exDate['tz']) &&\n\t\t\t\t\t\t\t\t\t\t( 'Z' != $exDate['tz'] ))\n\t\t\t\t\t\t\t\t\t\t|| ( isset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['params']['TZID'] ))) {\n\t\t\t\t\t\t\t\t\t$offset = isset($exDate['tz']) ? $exDate['tz'] : $content['params']['TZID'];\n\t\t\t\t\t\t\t\t\t$date = mktime((int) $exDate['hour'], (int) $exDate['min'], (int) ($exDate['sec'] + iCalUtilityFunctions::_tz2offset($offset)), (int) $exDate['month'], (int) $exDate['day'], (int) $exDate['year']);\n\t\t\t\t\t\t\t\t\tunset($exDate['tz']);\n\t\t\t\t\t\t\t\t\t$exDate = iCalUtilityFunctions::_date_time_string(date('YmdTHis\\Z', $date), 6);\n\t\t\t\t\t\t\t\t\tunset($exDate['unparsedtext']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, $type, $content['value'], $content['params']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'freebusy':\n\t\t\t\t\t\twhile (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'period', $content['value'], $content['params']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'request-status':\n\t\t\t\t\t\twhile (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\tif (!isset($content['params']['LANGUAGE'])) {\n\t\t\t\t\t\t\t\tif ($langComp)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langComp;\n\t\t\t\t\t\t\t\telseif ($langCal)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langCal;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'rstatus', $content['value'], $content['params']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'rdate':\n\t\t\t\t\t\twhile (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t$type = 'date-time';\n\t\t\t\t\t\t\tif (isset($content['params']['VALUE'])) {\n\t\t\t\t\t\t\t\tif ('DATE' == $content['params']['VALUE'])\n\t\t\t\t\t\t\t\t\t$type = 'date';\n\t\t\t\t\t\t\t\telseif ('PERIOD' == $content['params']['VALUE'])\n\t\t\t\t\t\t\t\t\t$type = 'period';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ('period' == $type) {\n\t\t\t\t\t\t\t\tforeach ($content['value'] as & $rDates) {\n\t\t\t\t\t\t\t\t\tif (( isset($rDates[0]['tz']) && // fix UTC-date if offset set\n\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($rDates[0]['tz']) &&\n\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $rDates[0]['tz'] ))\n\t\t\t\t\t\t\t\t\t\t\t|| ( isset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['params']['TZID'] ))) {\n\t\t\t\t\t\t\t\t\t\t$offset = isset($rDates[0]['tz']) ? $rDates[0]['tz'] : $content['params']['TZID'];\n\t\t\t\t\t\t\t\t\t\t$date = mktime((int) $rDates[0]['hour'], (int) $rDates[0]['min'], (int) ($rDates[0]['sec'] + iCalUtilityFunctions::_tz2offset($offset)), (int) $rDates[0]['month'], (int) $rDates[0]['day'], (int) $rDates[0]['year']);\n\t\t\t\t\t\t\t\t\t\tunset($rDates[0]['tz']);\n\t\t\t\t\t\t\t\t\t\t$rDates[0] = iCalUtilityFunctions::_date_time_string(date('YmdTHis\\Z', $date), 6);\n\t\t\t\t\t\t\t\t\t\tunset($rDates[0]['unparsedtext']);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (isset($rDates[1]['year'])) {\n\t\t\t\t\t\t\t\t\t\tif (( isset($rDates[1]['tz']) && // fix UTC-date if offset set\n\t\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($rDates[1]['tz']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $rDates[1]['tz'] ))\n\t\t\t\t\t\t\t\t\t\t\t\t|| ( isset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['params']['TZID'] ))) {\n\t\t\t\t\t\t\t\t\t\t\t$offset = isset($rDates[1]['tz']) ? $rDates[1]['tz'] : $content['params']['TZID'];\n\t\t\t\t\t\t\t\t\t\t\t$date = mktime((int) $rDates[1]['hour'], (int) $rDates[1]['min'], (int) ($rDates[1]['sec'] + iCalUtilityFunctions::_tz2offset($offset)), (int) $rDates[1]['month'], (int) $rDates[1]['day'], (int) $rDates[1]['year']);\n\t\t\t\t\t\t\t\t\t\t\tunset($rDates[1]['tz']);\n\t\t\t\t\t\t\t\t\t\t\t$rDates[1] = iCalUtilityFunctions::_date_time_string(date('YmdTHis\\Z', $date), 6);\n\t\t\t\t\t\t\t\t\t\t\tunset($rDates[1]['unparsedtext']);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} elseif ('date-time' == $type) {\n\t\t\t\t\t\t\t\tforeach ($content['value'] as & $rDate) {\n\t\t\t\t\t\t\t\t\tif (( isset($rDate['tz']) && // fix UTC-date if offset set\n\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($rDate['tz']) &&\n\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $rDate['tz'] ))\n\t\t\t\t\t\t\t\t\t\t\t|| ( isset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['params']['TZID'] ))) {\n\t\t\t\t\t\t\t\t\t\t$offset = isset($rDate['tz']) ? $rDate['tz'] : $content['params']['TZID'];\n\t\t\t\t\t\t\t\t\t\t$date = mktime((int) $rDate['hour'], (int) $rDate['min'], (int) ($rDate['sec'] + iCalUtilityFunctions::_tz2offset($offset)), (int) $rDate['month'], (int) $rDate['day'], (int) $rDate['year']);\n\t\t\t\t\t\t\t\t\t\tunset($rDate['tz']);\n\t\t\t\t\t\t\t\t\t\t$rDate = iCalUtilityFunctions::_date_time_string(date('YmdTHis\\Z', $date), 6);\n\t\t\t\t\t\t\t\t\t\tunset($rDate['unparsedtext']);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tunset($content['params']['VALUE']);\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, $type, $content['value'], $content['params']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'categories':\n\t\t\t\t\tcase 'comment':\n\t\t\t\t\tcase 'contact':\n\t\t\t\t\tcase 'description':\n\t\t\t\t\tcase 'related-to':\n\t\t\t\t\tcase 'resources':\n\t\t\t\t\t\twhile (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\tif (( 'related-to' != $prop ) && !isset($content['params']['LANGUAGE'])) {\n\t\t\t\t\t\t\t\tif ($langComp)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langComp;\n\t\t\t\t\t\t\t\telseif ($langCal)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langCal;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'text', $content['value'], $content['params']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'x-prop':\n\t\t\t\t\t\twhile (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t_addXMLchild($properties, $content[0], 'unknown', $content[1]['value'], $content[1]['params']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'created': // single occurence below, if set\n\t\t\t\t\tcase 'completed':\n\t\t\t\t\tcase 'dtstamp':\n\t\t\t\t\tcase 'last-modified':\n\t\t\t\t\t\t$utcDate = TRUE;\n\t\t\t\t\tcase 'dtstart':\n\t\t\t\t\tcase 'dtend':\n\t\t\t\t\tcase 'due':\n\t\t\t\t\tcase 'recurrence-id':\n\t\t\t\t\t\tif (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\tif (isset($content['params']['VALUE']) && ( 'DATE' == $content['params']['VALUE'] )) {\n\t\t\t\t\t\t\t\t$type = 'date';\n\t\t\t\t\t\t\t\tunset($content['value']['hour'], $content['value']['min'], $content['value']['sec']);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$type = 'date-time';\n\t\t\t\t\t\t\t\tif (isset($utcDate) && !isset($content['value']['tz']))\n\t\t\t\t\t\t\t\t\t$content['value']['tz'] = 'Z';\n\t\t\t\t\t\t\t\tif (( isset($content['value']['tz']) && // fix UTC-date if offset set\n\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($content['value']['tz']) &&\n\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['value']['tz'] ))\n\t\t\t\t\t\t\t\t\t\t|| ( isset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['params']['TZID'] ))) {\n\t\t\t\t\t\t\t\t\t$offset = isset($content['value']['tz']) ? $content['value']['tz'] : $content['params']['TZID'];\n\t\t\t\t\t\t\t\t\t$date = mktime((int) $content['value']['hour'], (int) $content['value']['min'], (int) ($content['value']['sec'] + iCalUtilityFunctions::_tz2offset($offset)), (int) $content['value']['month'], (int) $content['value']['day'], (int) $content['value']['year']);\n\t\t\t\t\t\t\t\t\tunset($content['value']['tz'], $content['params']['TZID']);\n\t\t\t\t\t\t\t\t\t$content['value'] = iCalUtilityFunctions::_date_time_string(date('YmdTHis\\Z', $date), 6);\n\t\t\t\t\t\t\t\t\tunset($content['value']['unparsedtext']);\n\t\t\t\t\t\t\t\t} elseif (isset($content['value']['tz']) && !empty($content['value']['tz']) &&\n\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['value']['tz'] ) && !isset($content['params']['TZID'])) {\n\t\t\t\t\t\t\t\t\t$content['params']['TZID'] = $content['value']['tz'];\n\t\t\t\t\t\t\t\t\tunset($content['value']['tz']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tunset($content['params']['VALUE']);\n\t\t\t\t\t\t\tif (( isset($content['params']['TZID']) && empty($content['params']['TZID'])) || @is_null($content['params']['TZID']))\n\t\t\t\t\t\t\t\tunset($content['params']['TZID']);\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, $type, $content['value'], $content['params']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunset($utcDate);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'duration':\n\t\t\t\t\t\tif (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'duration', $content['value'], $content['params']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'rrule':\n\t\t\t\t\t\twhile (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'recur', $content['value'], $content['params']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'class':\n\t\t\t\t\tcase 'location':\n\t\t\t\t\tcase 'status':\n\t\t\t\t\tcase 'summary':\n\t\t\t\t\tcase 'transp':\n\t\t\t\t\tcase 'tzid':\n\t\t\t\t\tcase 'uid':\n\t\t\t\t\t\tif (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\tif ((( 'location' == $prop ) || ( 'summary' == $prop )) && !isset($content['params']['LANGUAGE'])) {\n\t\t\t\t\t\t\t\tif ($langComp)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langComp;\n\t\t\t\t\t\t\t\telseif ($langCal)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langCal;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'text', $content['value'], $content['params']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'geo':\n\t\t\t\t\t\tif (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'geo', $content['value'], $content['params']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'organizer':\n\t\t\t\t\t\tif (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\tif (isset($content['params']['CN']) && !isset($content['params']['LANGUAGE'])) {\n\t\t\t\t\t\t\t\tif ($langComp)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langComp;\n\t\t\t\t\t\t\t\telseif ($langCal)\n\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langCal;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'cal-address', $content['value'], $content['params']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'percent-complete':\n\t\t\t\t\tcase 'priority':\n\t\t\t\t\tcase 'sequence':\n\t\t\t\t\t\tif (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'integer', $content['value'], $content['params']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'tzurl':\n\t\t\t\t\tcase 'url':\n\t\t\t\t\t\tif (FALSE !== ( $content = $component->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'uri', $content['value'], $content['params']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t} // end switch( $prop )\n\t\t\t} // end foreach( $props as $prop )\n\t\t\t/** fix subComponent properties, if any */\n\t\t\tforeach ($subComps as $subCompName) {\n\t\t\t\twhile (FALSE !== ( $subcomp = $component->getComponent($subCompName))) {\n\t\t\t\t\t$child2 = $child->addChild($subCompName);\n\t\t\t\t\t$properties = $child2->addChild('properties');\n\t\t\t\t\t$langComp = $subcomp->getConfig('language');\n\t\t\t\t\tforeach ($subCompProps as $prop) {\n\t\t\t\t\t\tswitch ($prop) {\n\t\t\t\t\t\t\tcase 'attach': // may occur multiple times, below\n\t\t\t\t\t\t\t\twhile (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t\t\t$type = ( isset($content['params']['VALUE']) && ( 'BINARY' == $content['params']['VALUE'] )) ? 'binary' : 'uri';\n\t\t\t\t\t\t\t\t\tunset($content['params']['VALUE']);\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, $type, $content['value'], $content['params']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'attendee':\n\t\t\t\t\t\t\t\twhile (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t\t\tif (isset($content['params']['CN']) && !isset($content['params']['LANGUAGE'])) {\n\t\t\t\t\t\t\t\t\t\tif ($langComp)\n\t\t\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langComp;\n\t\t\t\t\t\t\t\t\t\telseif ($langCal)\n\t\t\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langCal;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'cal-address', $content['value'], $content['params']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'comment':\n\t\t\t\t\t\t\tcase 'tzname':\n\t\t\t\t\t\t\t\twhile (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t\t\tif (!isset($content['params']['LANGUAGE'])) {\n\t\t\t\t\t\t\t\t\t\tif ($langComp)\n\t\t\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langComp;\n\t\t\t\t\t\t\t\t\t\telseif ($langCal)\n\t\t\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langCal;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'text', $content['value'], $content['params']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'rdate':\n\t\t\t\t\t\t\t\twhile (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t\t\t$type = 'date-time';\n\t\t\t\t\t\t\t\t\tif (isset($content['params']['VALUE'])) {\n\t\t\t\t\t\t\t\t\t\tif ('DATE' == $content['params']['VALUE'])\n\t\t\t\t\t\t\t\t\t\t\t$type = 'date';\n\t\t\t\t\t\t\t\t\t\telseif ('PERIOD' == $content['params']['VALUE'])\n\t\t\t\t\t\t\t\t\t\t\t$type = 'period';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ('period' == $type) {\n\t\t\t\t\t\t\t\t\t\tforeach ($content['value'] as & $rDates) {\n\t\t\t\t\t\t\t\t\t\t\tif (( isset($rDates[0]['tz']) && // fix UTC-date if offset set\n\t\t\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($rDates[0]['tz']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $rDates[0]['tz'] ))\n\t\t\t\t\t\t\t\t\t\t\t\t\t|| ( isset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['params']['TZID'] ))) {\n\t\t\t\t\t\t\t\t\t\t\t\t$offset = isset($rDates[0]['tz']) ? $rDates[0]['tz'] : $content['params']['TZID'];\n\t\t\t\t\t\t\t\t\t\t\t\t$date = mktime((int) $rDates[0]['hour'], (int) $rDates[0]['min'], (int) ($rDates[0]['sec'] + iCalUtilityFunctions::_tz2offset($offset)), (int) $rDates[0]['month'], (int) $rDates[0]['day'], (int) $rDates[0]['year']);\n\t\t\t\t\t\t\t\t\t\t\t\tunset($rDates[0]['tz']);\n\t\t\t\t\t\t\t\t\t\t\t\t$rDates[0] = iCalUtilityFunctions::_date_time_string(date('YmdTHis\\Z', $date), 6);\n\t\t\t\t\t\t\t\t\t\t\t\tunset($rDates[0]['unparsedtext']);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tif (isset($rDates[1]['year'])) {\n\t\t\t\t\t\t\t\t\t\t\t\tif (( isset($rDates[1]['tz']) && // fix UTC-date if offset set\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($rDates[1]['tz']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $rDates[1]['tz'] ))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t|| ( isset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['params']['TZID'] ))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$offset = isset($rDates[1]['tz']) ? $rDates[1]['tz'] : $content['params']['TZID'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$date = mktime((int) $rDates[1]['hour'], (int) $rDates[1]['min'], (int) ($rDates[1]['sec'] + iCalUtilityFunctions::_tz2offset($offset)), (int) $rDates[1]['month'], (int) $rDates[1]['day'], (int) $rDates[1]['year']);\n\t\t\t\t\t\t\t\t\t\t\t\t\tunset($rDates[1]['tz']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$rDates[1] = iCalUtilityFunctions::_date_time_string(date('YmdTHis\\Z', $date), 6);\n\t\t\t\t\t\t\t\t\t\t\t\t\tunset($rDates[1]['unparsedtext']);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} elseif ('date-time' == $type) {\n\t\t\t\t\t\t\t\t\t\tforeach ($content['value'] as & $rDate) {\n\t\t\t\t\t\t\t\t\t\t\tif (( isset($rDate['tz']) && // fix UTC-date if offset set\n\t\t\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($rDate['tz']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $rDate['tz'] ))\n\t\t\t\t\t\t\t\t\t\t\t\t\t|| ( isset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tiCalUtilityFunctions::_isOffset($content['params']['TZID']) &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t( 'Z' != $content['params']['TZID'] ))) {\n\t\t\t\t\t\t\t\t\t\t\t\t$offset = isset($rDate['tz']) ? $rDate['tz'] : $content['params']['TZID'];\n\t\t\t\t\t\t\t\t\t\t\t\t$date = mktime((int) $rDate['hour'], (int) $rDate['min'], (int) ($rDate['sec'] + iCalUtilityFunctions::_tz2offset($offset)), (int) $rDate['month'], (int) $rDate['day'], (int) $rDate['year']);\n\t\t\t\t\t\t\t\t\t\t\t\tunset($rDate['tz']);\n\t\t\t\t\t\t\t\t\t\t\t\t$rDate = iCalUtilityFunctions::_date_time_string(date('YmdTHis\\Z', $date), 6);\n\t\t\t\t\t\t\t\t\t\t\t\tunset($rDate['unparsedtext']);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tunset($content['params']['VALUE']);\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, $type, $content['value'], $content['params']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'x-prop':\n\t\t\t\t\t\t\t\twhile (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $content[0], 'unknown', $content[1]['value'], $content[1]['params']);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'action': // single occurence below, if set\n\t\t\t\t\t\t\tcase 'description':\n\t\t\t\t\t\t\tcase 'summary':\n\t\t\t\t\t\t\t\tif (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t\t\tif (( 'action' != $prop ) && !isset($content['params']['LANGUAGE'])) {\n\t\t\t\t\t\t\t\t\t\tif ($langComp)\n\t\t\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langComp;\n\t\t\t\t\t\t\t\t\t\telseif ($langCal)\n\t\t\t\t\t\t\t\t\t\t\t$content['params']['LANGUAGE'] = $langCal;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'text', $content['value'], $content['params']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'dtstart':\n\t\t\t\t\t\t\t\tif (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t\t\tunset($content['value']['tz'], $content['params']['VALUE']); // always local time\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'date-time', $content['value'], $content['params']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'duration':\n\t\t\t\t\t\t\t\tif (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'duration', $content['value'], $content['params']);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'repeat':\n\t\t\t\t\t\t\t\tif (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'integer', $content['value'], $content['params']);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'trigger':\n\t\t\t\t\t\t\t\tif (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE))) {\n\t\t\t\t\t\t\t\t\tif (isset($content['value']['year']) &&\n\t\t\t\t\t\t\t\t\t\t\tisset($content['value']['month']) &&\n\t\t\t\t\t\t\t\t\t\t\tisset($content['value']['day']))\n\t\t\t\t\t\t\t\t\t\t$type = 'date-time';\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t$type = 'duration';\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, $type, $content['value'], $content['params']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'tzoffsetto':\n\t\t\t\t\t\t\tcase 'tzoffsetfrom':\n\t\t\t\t\t\t\t\tif (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'utc-offset', $content['value'], $content['params']);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'rrule':\n\t\t\t\t\t\t\t\twhile (FALSE !== ( $content = $subcomp->getProperty($prop, FALSE, TRUE)))\n\t\t\t\t\t\t\t\t\t_addXMLchild($properties, $prop, 'recur', $content['value'], $content['params']);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} // switch( $prop )\n\t\t\t\t\t} // end foreach( $subCompProps as $prop )\n\t\t\t\t} // end while( FALSE !== ( $subcomp = $component->getComponent( subCompName )))\n\t\t\t} // end foreach( $subCombs as $subCompName )\n\t\t} // end while( FALSE !== ( $component = $calendar->getComponent( $compName )))\n\t} // end foreach( $comps as $compName)\n\treturn $xml->asXML();\n}", "public function generate() {\n\t\tif(!isset($this->year)) {\n\t\t\t$this->year = date(\"Y\");\n\t\t}\n\t\tif(!isset($this->month)) {\n\t\t\t$this->month = date(\"m\");\n\t\t}\n\t\treturn $this->generate_calendar($this->year, $this->month);\n\t}", "private function buildCalendar($opt)\n {\n $day_names = $this->getLang('yearbox_days');\n $cal = '';\n\n list($years, $first_weekday, $table_cols, $today) = $this->defineCalendar($opt);\n end($years);\n $last_year = key($years);\n\n // initial CSS\n $font_css = ($opt['size'] != 0) ? ' style=\"font-size:' . $opt['size'] . 'px;\"' : '';\n if ($opt['align'] == 'left') {\n $align = ' class=left';\n } elseif ($opt['align'] == 'right') {\n $align = ' class=right';\n } else {\n $align = '';\n }\n $cal .= '<div class=\"yearbox\"' . $font_css . '><table' . $align . '><tbody>';\n\n foreach ($years as $year_num => $year) {\n // display the year and day-of-week header\n $cal .= '<tr class=\"yr-header\">';\n for ($col = 0; $col < $table_cols; $col++) {\n $weekday_num = ($col + $first_weekday) % 7; // current day of week as a number\n if ($col == 0) {\n $cal .= '<th class=\"plain\">' . $year_num . '</th>';\n }\n $h = $day_names[$weekday_num];\n $cal .= '<th>' . $h . '</th>';\n }\n $cal .= '</tr>';\n\n foreach ($year as $mth_num => $month) {\n $cal .= $this->getMonthHTML(\n $month,\n $mth_num,\n $opt,\n $year_num,\n $table_cols,\n $first_weekday,\n $today\n );\n }\n // separator between years in a range\n if ($year_num != $last_year) {\n $cal .= '<tr class=\"blank\"><td></td></tr>';\n }\n }\n\n $cal .= '</tbody></table></div><div class=\"clearer\"></div>';\n return $cal;\n }", "function makeTXT()\n {\n $calendar_text = \"No calendar information available.\";\n if (isset($this->calendar->events)) {\n $calendar_text = \"\";\n foreach ($this->calendar->events as $event) {\n $description_seperator = \" - \";\n $description = \"description\";\n if ($this->description_flag != \"on\") {\n $description_seperator = \"\";\n $description = \"\";\n }\n\n $t =\n $this->textCalendar($event, [\n \"timestamp Y-m-d H:i\",\n \" \",\n // 'timezone',\n // ' ',\n \"summary\",\n \" [\",\n \"runtime\",\n \"]\",\n $description_seperator,\n $description,\n ]) . \"\\n\";\n\n $calendar_text .= $t;\n }\n }\n\n $txt =\n \"CALENDAR \" .\n $this->time_zone .\n \"\\n\\n\" .\n $calendar_text .\n \"\\n\\n\" .\n $this->response;\n\n $this->txt = $txt;\n $this->thing_report[\"txt\"] = $txt;\n }", "public static function icalendar() {\r\n $ical = \"BEGIN:VCALENDAR\".PHP_EOL;\r\n $ical .= \"VERSION:2.0\".PHP_EOL;\r\n\r\n $show_personal_bak = Calendar_Events::$calsettings->show_personal;\r\n $show_course_bak = Calendar_Events::$calsettings->show_course;\r\n $show_deadline_bak = Calendar_Events::$calsettings->show_deadline;\r\n $show_admin_bak = Calendar_Events::$calsettings->show_admin;\r\n Calendar_Events::set_calendar_settings(1,1,1,1);\r\n Calendar_Events::get_calendar_settings();\r\n $eventlist = Calendar_Events::get_calendar_events();\r\n Calendar_Events::set_calendar_settings($show_personal_bak,$show_course_bak,$show_deadline_bak,$show_admin_bak);\r\n Calendar_Events::get_calendar_settings();\r\n\r\n $events = array();\r\n foreach ($eventlist as $event) {\r\n $ical .= \"BEGIN:VEVENT\".PHP_EOL;\r\n $startdatetime = new DateTime($event->start);\r\n $ical .= \"DTSTART:\".$startdatetime->format(\"Ymd\\THis\").PHP_EOL;\r\n $duration = new DateTime($event->duration);\r\n $ical .= \"DURATION:\".$duration->format(\"\\P\\TH\\Hi\\Ms\\S\").PHP_EOL;\r\n $ical .= \"SUMMARY:[\".strtoupper($event->event_group).\"] \".$event->title.PHP_EOL;\r\n $ical .= \"DESCRIPTION:\".canonicalize_whitespace(strip_tags($event->content)).PHP_EOL;\r\n if ($event->event_group == 'deadline')\r\n {\r\n $ical .= \"BEGIN:VALARM\".PHP_EOL;\r\n $ical .= \"TRIGGER:-PT24H\".PHP_EOL;\r\n $ical .= \"DURATION:PT10H\".PHP_EOL;\r\n $ical .= \"ACTION:DISPLAY\".PHP_EOL;\r\n $ical .= \"DESCRIPTION:DEADLINE REMINDER for \".canonicalize_whitespace(strip_tags($event->title)).PHP_EOL;\r\n $ical .= \"END:VALARM\".PHP_EOL;\r\n }\r\n $ical .= \"END:VEVENT\".PHP_EOL;\r\n }\r\n $ical .= \"END:VCALENDAR\".PHP_EOL;\r\n return $ical;\r\n }", "public function toVCalendar($calid, $obj)\n\t{\n\t\t/*$categ = array();\n\t\tif($obj->soc_client)\n\t\t{\n\t\t\t$nick[] = $obj->soc_code_client;\n\t\t\t$categ[] = $this->langs->transnoentitiesnoconv('Customer');\n\t\t}*/\n\n\t\t$location=$obj->location;\n\n\t\t// contact address\n\t\tif(empty($location) && !empty($obj->address))\n\t\t{\n\t\t\t$location = trim(str_replace(array(\"\\r\",\"\\t\",\"\\n\"), ' ', $obj->address));\n\t\t\t$location = trim($location.', '.$obj->zip);\n\t\t\t$location = trim($location.' '.$obj->town);\n\t\t\t$location = trim($location.', '.$obj->country_label);\n\t\t}\n\n\t\t// contact address\n\t\tif(empty($location) && !empty($obj->soc_address))\n\t\t{\n\t\t\t$location = trim(str_replace(array(\"\\r\",\"\\t\",\"\\n\"), ' ', $obj->soc_address));\n\t\t\t$location = trim($location.', '.$obj->soc_zip);\n\t\t\t$location = trim($location.' '.$obj->soc_town);\n\t\t\t$location = trim($location.', '.$obj->soc_country_label);\n\t\t}\n\n\t\t$address=explode(\"\\n\", $obj->address, 2);\n\t\tforeach($address as $kAddr => $vAddr)\n\t\t{\n\t\t\t$address[$kAddr] = trim(str_replace(array(\"\\r\",\"\\t\"), ' ', str_replace(\"\\n\", ' | ', trim($vAddr))));\n\t\t}\n\t\t$address[]='';\n\t\t$address[]='';\n\n\t\tif($obj->percent==-1 && trim($obj->datep)!='')\n\t\t\t$type='VEVENT';\n\t\telse\n\t\t\t$type='VTODO';\n\n\t\t$timezone = date_default_timezone_get();\n\n\t\t$caldata =\"BEGIN:VCALENDAR\\n\";\n\t\t$caldata.=\"VERSION:2.0\\n\";\n\t\t$caldata.=\"METHOD:PUBLISH\\n\";\n\t\t$caldata.=\"PRODID:-//ERP CDav//FR\\n\";\n\t\t$caldata.=\"BEGIN:\".$type.\"\\n\";\n\t\t$caldata.=\"CREATED:\".gmdate('Ymd\\THis', strtotime($obj->datec)).\"Z\\n\";\n\t\t$caldata.=\"LAST-MODIFIED:\".gmdate('Ymd\\THis', strtotime($obj->lastupd)).\"Z\\n\";\n\t\t$caldata.=\"DTSTAMP:\".gmdate('Ymd\\THis', strtotime($obj->lastupd)).\"Z\\n\";\n\t\tif($obj->sourceuid=='')\n\t\t\t$caldata.=\"UID:\".$obj->id.'-ev-'.$calid.'-cal-'.CDAV_URI_KEY.\"\\n\";\n\t\telse\n\t\t\t$caldata.=\"UID:\".$obj->sourceuid.\"\\n\";\n\t\t$caldata.=\"SUMMARY:\".$obj->label.\"\\n\";\n\t\t$caldata.=\"LOCATION:\".$location.\"\\n\";\n\t\t$caldata.=\"PRIORITY:\".$obj->priority.\"\\n\";\n\t\tif($obj->fulldayevent)\n\t\t{\n\t\t\t$caldata.=\"DTSTART;VALUE=DATE:\".date('Ymd', strtotime($obj->datep)).\"\\n\";\n\t\t\tif($type=='VEVENT')\n\t\t\t{\n\t\t\t\tif(trim($obj->datep2)!='')\n\t\t\t\t\t$caldata.=\"DTEND;VALUE=DATE:\".date('Ymd', strtotime($obj->datep2)+1).\"\\n\";\n\t\t\t\telse\n\t\t\t\t\t$caldata.=\"DTEND;VALUE=DATE:\".date('Ymd', strtotime($obj->datep)+(25*3600)).\"\\n\";\n\t\t\t}\n\t\t\telseif(trim($obj->datep2)!='')\n\t\t\t\t$caldata.=\"DUE;VALUE=DATE:\".date('Ymd', strtotime($obj->datep2)+1).\"\\n\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$caldata.=\"DTSTART;TZID=\".$timezone.\":\".strtr($obj->datep, array(\" \"=>\"T\", \":\"=>\"\", \"-\"=>\"\")).\"\\n\";\n\t\t\tif($type=='VEVENT')\n\t\t\t{\n\t\t\t\tif(trim($obj->datep2)!='')\n\t\t\t\t\t$caldata.=\"DTEND;TZID=\".$timezone.\":\".strtr($obj->datep2, array(\" \"=>\"T\", \":\"=>\"\", \"-\"=>\"\")).\"\\n\";\n\t\t\t\telse\n\t\t\t\t\t$caldata.=\"DTEND;TZID=\".$timezone.\":\".strtr($obj->datep, array(\" \"=>\"T\", \":\"=>\"\", \"-\"=>\"\")).\"\\n\";\n\t\t\t}\n\t\t\telseif(trim($obj->datep2)!='')\n\t\t\t\t$caldata.=\"DUE;TZID=\".$timezone.\":\".strtr($obj->datep2, array(\" \"=>\"T\", \":\"=>\"\", \"-\"=>\"\")).\"\\n\";\n\t\t}\n\t\t$caldata.=\"CLASS:PUBLIC\\n\";\n\t\tif($obj->transparency==1)\n\t\t\t$caldata.=\"TRANSP:TRANSPARENT\\n\";\n\t\telse\n\t\t\t$caldata.=\"TRANSP:OPAQUE\\n\";\n\n\t\tif($type=='VEVENT')\n\t\t\t$caldata.=\"STATUS:CONFIRMED\\n\";\n\t\telseif($obj->percent==0)\n\t\t\t$caldata.=\"STATUS:NEEDS-ACTION\\n\";\n\t\telseif($obj->percent==100)\n\t\t\t$caldata.=\"STATUS:COMPLETED\\n\";\n\t\telse\n\t\t{\n\t\t\t$caldata.=\"STATUS:IN-PROCESS\\n\";\n\t\t\t$caldata.=\"PERCENT-COMPLETE:\".$obj->percent.\"\\n\";\n\t\t}\n\n\t\t$caldata.=\"DESCRIPTION:\";\n\t\t$caldata.=strtr($obj->note, array(\"\\n\"=>\"\\\\n\", \"\\r\"=>\"\"));\n\t\tif(!empty($obj->soc_nom))\n\t\t\t$caldata.=\"\\\\n*MOUNIR-SOC: \".$obj->soc_nom;\n\t\tif(!empty($obj->soc_phone))\n\t\t\t$caldata.=\"\\\\n*MOUNIR-SOC-TEL: \".$obj->soc_phone;\n\t\tif(!empty($obj->firstname) || !empty($obj->lastname))\n\t\t\t$caldata.=\"\\\\n*MOUNIR-CTC: \".trim($obj->firstname.' '.$obj->lastname);\n\t\tif(!empty($obj->phone) || !empty($obj->phone_perso) || !empty($obj->phone_mobile))\n\t\t\t$caldata.=\"\\\\n*MOUNIR-CTC-TEL: \".trim($obj->phone.' '.$obj->phone_perso.' '.$obj->phone_mobile);\n\t\tif(strpos($obj->other_users, ',')) // several\n\t\t\t$caldata.=\"\\\\n*MOUNIR-USR: \".$obj->other_users;\n\t\t$caldata.=\"\\n\";\n\n\t\t$caldata.=\"END:\".$type.\"\\n\";\n\t\t$caldata.=\"END:VCALENDAR\\n\";\n\n\t\treturn $caldata;\n\t}", "public function __toString()\n {\n // Can this set of dates be rendered?\n if (!$this->bOneFullMonth) {\n throw new \\Exception(\n __METHOD__ . ' - Only one full month can be rendered (end date must be \"true\").'\n );\n }\n\n $i = 0;\n $strHtml = '<h3 class=\"sked-cal-title\">' . date('F', strtotime($this->strStart))\n . '</h3><table class=\"sked-cal\"><thead>';\n\n // Day headers\n foreach (SkeVent::WEEKDAYS as $strDay)\n $strHtml .= '<th><center>' . $strDay . '</center></th>';\n\n $strHtml .= '</thead><tr>';\n for ($j = 0; $j < $this->monthPadDates(); $j++) {\n $i++;\n $strHtml .= '<td></td>';\n }\n\n foreach ($this as $skeDate) {\n $i++;\n $strHtml .= '<td class=\"sked-cal-date' . (date('Y-m-d') !== $skeDate->format('Y-m-d') ? '' : ' sked-cal-date-current') . '\">';\n $strHtml .= '<span class=\"sked-cal-date-num\">' . $skeDate->format('j') . '</span>';\n $strHtml .= '<ul class=\"sked-cal-date-list\">';\n foreach ($skeDate->events() as $skeVent) {\n $strHtml .= '<li class=\"sked-cal-date-event\">'\n . '<a href=\"#\" class=\"sked-cal-event-link\" id=\"skevent-'\n . $skeVent->id . '\" data-owner-id=\"' . $skeVent->owner()\n . '\">'\n . $skeVent->label\n . '</a><span>' . $skeVent->time('g:ia', $this->strTimezone) . '</span>'\n . '</li>';\n }\n $strHtml .= '</ul>';\n $strHtml .= '</td>';\n if (7 === $i) {\n $i = 0;\n $strHtml .= '</tr><tr>';\n }\n }\n\n if ($i) {\n for ($j = $i; $j < 7; $j++) {\n $strHtml .= '<td></td>';\n }\n }\n\n return $strHtml . '</tr></table>';\n }", "public function icalendar()\n\t{\n\t\t$s = 'EJURI3ia8aj#912IKa';\n\t\t$r = '#';\n\t\t$e = 'aAEah38a;a33';\n\n\t\t// -------------------------------------\n\t\t// Some dummy tagdata we'll hand off to events()\n\t\t// -------------------------------------\n\n\t\t$vars = array(\n\t\t\t'event_title'\t\t\t\t\t=> 'title',\n\t\t\t'event_id'\t\t\t\t\t\t=> 'id',\n\t\t\t'event_summary'\t\t\t\t\t=> 'summary',\n\t\t\t'event_location'\t\t\t\t=> 'location',\n\t\t\t'event_start_date format=\"%Y\"'\t=> 'start_year',\n\t\t\t'event_start_date format=\"%m\"'\t=> 'start_month',\n\t\t\t'event_start_date format=\"%d\"'\t=> 'start_day',\n\t\t\t'event_start_date format=\"%H\"'\t=> 'start_hour',\n\t\t\t'event_start_date format=\"%i\"'\t=> 'start_minute',\n\t\t\t'event_end_date format=\"%Y\"'\t=> 'end_year',\n\t\t\t'event_end_date format=\"%m\"'\t=> 'end_month',\n\t\t\t'event_end_date format=\"%d\"'\t=> 'end_day',\n\t\t\t'event_end_date format=\"%H\"'\t=> 'end_hour',\n\t\t\t'event_end_date format=\"%i\"'\t=> 'end_minute',\n\t\t\t'event_calendar_tz_offset'\t\t=> 'tz_offset',\n\t\t\t'event_calendar_timezone'\t\t=> 'timezone'\n\t\t);\n\n\t\t$rvars = array(\n\t\t\t'rule_type',\n\t\t\t'rule_start_date',\n\t\t\t'rule_repeat_years',\n\t\t\t'rule_repeat_months',\n\t\t\t'rule_repeat_days',\n\t\t\t'rule_repeat_weeks',\n\t\t\t'rule_days_of_week',\n\t\t\t'rule_relative_dow',\n\t\t\t'rule_days_of_month',\n\t\t\t'rule_months_of_year',\n\t\t\t'rule_stop_by',\n\t\t\t'rule_stop_after'\n\t\t);\n\n\t\t$evars = array(\n\t\t\t'exception_start_date format=\"%Y%m%dT%H%i00\"'\n\t\t);\n\n\t\t$ovars = array(\n\t\t\t'occurrence_start_date format=\"%Y%m%dT%H%i00\"',\n\t\t\t'occurrence_end_date format=\"%Y%m%dT%H%i00\"'\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Preparing tagdata');\n\n\t\t$summary_field = ee()->TMPL->fetch_param('summary_field', 'event_title');\n\n\t\tee()->TMPL->tagdata =\timplode($s, array(\n\t\t\tLD . $summary_field . RD,\n\t\t\tLD . 'event_id' . RD,\n\t\t\tLD . 'if event_summary' . RD .\n\t\t\t\tLD . 'event_summary' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\tLD . 'if event_location' . RD .\n\t\t\t\tLD . 'event_location' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\tLD . 'event_start_date format=\"%Y\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%m\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%d\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%H\"' . RD,\n\t\t\tLD . 'event_start_date format=\"%i\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%Y\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%m\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%d\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%H\"' . RD,\n\t\t\tLD . 'event_end_date format=\"%i\"' . RD,\n\t\t\tLD . 'event_calendar_tz_offset' . RD,\n\t\t\tLD . 'event_calendar_timezone' . RD,\n\t\t\t'RULES' .\n\t\t\t\tLD . 'if event_has_rules' . RD .\n\t\t\t\tLD . 'rules' . RD .\n\t\t\t\tLD . implode(RD . $r . LD, $rvars) . RD . '|' .\n\t\t\t\tLD . T_SLASH . 'rules' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\t'OCCURRENCES'.\n\t\t\t\tLD . 'if event_has_occurrences' . RD .\n\t\t\t\tLD . 'occurrences' . RD .\n\t\t\t\tLD . implode(RD . $r . LD, $ovars) . RD . '|' .\n\t\t\t\tLD . T_SLASH . 'occurrences' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\t'EXCEPTIONS'.\n\t\t\t\tLD . 'if event_has_exceptions' . RD .\n\t\t\t\tLD . 'exceptions' . RD .\n\t\t\t\tLD . implode(RD . $r . LD, $evars) . RD . '|' .\n\t\t\t\tLD . T_SLASH . 'exceptions' . RD .\n\t\t\t\tLD . '/if' . RD,\n\t\t\t$e\n\t\t));\n\n\t\t$tvars \t\t\t\t\t= ee()->functions->assign_variables(\n\t\t\tee()->TMPL->tagdata\n\t\t);\n\t\tee()->TMPL->var_single \t= $tvars['var_single'];\n\t\tee()->TMPL->var_pair \t= $tvars['var_pair'];\n\t\tee()->TMPL->tagdata \t= ee()->functions->prep_conditionals(\n\t\t\tee()->TMPL->tagdata,\n\t\t\tarray_keys($vars)\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// Fire up events()\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Firing up Events()');\n\n\t\t$tagdata = ee()->TMPL->advanced_conditionals($this->events());\n\n\t\t// -------------------------------------\n\t\t// Collect the events\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Collecting events');\n\n\t\t$events = explode($e, $tagdata);\n\n\t\t// -------------------------------------\n\t\t// Fire up iCalCreator\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Starting iCalCreator');\n\n\t\tif ( ! class_exists('vcalendar'))\n\t\t{\n\t\t\trequire_once 'libraries/icalcreator/iCalcreator.class.php';\n\t\t}\n\n\t\t$ICAL = new vcalendar();\n\n\t\t//we are setting this manually because we need individual ones for each event for this to work\n\t\t//$ICAL->setConfig('unique_id', parse_url(ee()->config->item('site_url'), PHP_URL_HOST));\n\t\t$host = parse_url(ee()->config->item('site_url'), PHP_URL_HOST);\n\n\n\t\t$vars = array_values($vars);\n\n\t\t//ee()->TMPL->log_item('Calendar: Iterating through the events');\n\n\t\tforeach ($events as $key => $event)\n\t\t{\n\t\t\tif (trim($event) == '') continue;\n\n\t\t\t$E \t\t\t\t= new vevent();\n\n\t\t\t$event \t\t\t= explode($s, $event);\n\t\t\t$rules \t\t\t= '';\n\t\t\t$occurrences \t= '';\n\t\t\t$exceptions \t= '';\n\n\t\t\tforeach ($event as $k => $v)\n\t\t\t{\n\t\t\t\tif (isset($vars[$k]))\n\t\t\t\t{\n\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t//\tMakes the local vars from above, if available:\n\t\t\t\t\t// \t$title, $summary, $location,\n\t\t\t\t\t// $start_year, $start_month, $start_day,\n\t\t\t\t\t// $start_hour, $start_minute, $end_year,\n\t\t\t\t\t// $end_month, $end_day, $end_hour,\n\t\t\t\t\t// \t$end_minute, $tz_offset, $timezone\n\t\t\t\t\t//--------------------------------------------\n\n\t\t\t\t\t$$vars[$k] = $v;\n\t\t\t\t}\n\t\t\t\telseif (substr($v, 0, 5) == 'RULES')\n\t\t\t\t{\n\t\t\t\t\t$rules = substr($v, 5);\n\t\t\t\t}\n\t\t\t\telseif (substr($v, 0, 11) == 'OCCURRENCES')\n\t\t\t\t{\n\t\t\t\t\t$occurrences = substr($v, 11);\n\t\t\t\t}\n\t\t\t\telseif (substr($v, 0, 10) == 'EXCEPTIONS')\n\t\t\t\t{\n\t\t\t\t\t$exceptions = substr($v, 10);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Set the timezone for this calendar based on the first event's info\n\t\t\t// -------------------------------------\n\n\t\t\tif ($key == 0)\n\t\t\t{\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Convert calendar_name to calendar_id\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tif ($this->P->value('calendar_id') == '' AND\n\t\t\t\t\t$this->P->value('calendar_name') != '')\n\t\t\t\t{\n\t\t\t\t\t$ids = $this->data->get_calendar_id_from_name(\n\t\t\t\t\t\t$this->P->value('calendar_name'),\n\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t$this->P->params['calendar_name']['details']['not']\n\t\t\t\t\t);\n\n\t\t\t\t\t$this->P->set('calendar_id', implode('|', $ids));\n\t\t\t\t}\n\n\t\t\t\t//--------------------------------------------\n\t\t\t\t//\tlets try to get the timezone from the\n\t\t\t\t//\tpassed calendar ID if there is one\n\t\t\t\t//--------------------------------------------\n\n\t\t\t\t$cal_timezone \t= FALSE;\n\t\t\t\t$cal_tz_offset \t= FALSE;\n\n\t\t\t\tif ($this->P->value('calendar_id') != '')\n\t\t\t\t{\n\t\t\t\t\t$sql = \"SELECT \ttz_offset, timezone\n\t\t\t\t\t\t\tFROM\texp_calendar_calendars\n\t\t\t\t\t\t\tWHERE \tcalendar_id\n\t\t\t\t\t\t\tIN \t\t(\" . ee()->db->escape_str(\n\t\t\t\t\t\t\t\t\t\t\timplode(',',\n\t\t\t\t\t\t\t\t\t\t\t\texplode('|',\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->P->value('calendar_id')\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t) .\n\t\t\t\t\t\t\t\t\t\")\n\t\t\t\t\t\t\tLIMIT\t1\";\n\n\t\t\t\t\t$cal_tz_query = ee()->db->query($sql);\n\n\t\t\t\t\tif ($cal_tz_query->num_rows() > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$cal_timezone \t= $cal_tz_query->row('timezone');\n\t\t\t\t\t\t$cal_tz_offset \t= $cal_tz_query->row('tz_offset');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//last resort, we get it from the current event\n\n\t\t\t\t$T = new vtimezone();\n\t\t\t\t$T->setProperty('tzid', ($cal_timezone ? $cal_timezone : $timezone));\n\t\t\t\t$T->setProperty('tzoffsetfrom', '+0000');\n\n\t\t\t\t$tzoffsetto = ($cal_tz_offset ? $cal_tz_offset : $tz_offset);\n\n\t\t\t\tif ($tzoffsetto === '0000')\n\t\t\t\t{\n\t\t\t\t\t$tzoffsetto = '+0000';\n\t\t\t\t}\n\n\t\t\t\t$T->setProperty('tzoffsetto', $tzoffsetto);\n\t\t\t\t$ICAL->setComponent($T);\n\t\t\t}\n\n\t\t\t$title\t\t\t= strip_tags($title);\n\t\t\t$description\t= strip_tags(trim($summary));\n\t\t\t$location\t\t= strip_tags(trim($location));\n\n\t\t\t// -------------------------------------\n\t\t\t// Occurrences?\n\t\t\t// -------------------------------------\n\n\t\t\t$occurrences\t= explode('|', rtrim($occurrences, '|'));\n\t\t\t$odata\t\t\t= array();\n\n\t\t\tforeach ($occurrences as $k => $occ)\n\t\t\t{\n\t\t\t\t$occ = trim($occ);\n\t\t\t\tif ($occ == '') continue;\n\n\t\t\t\t$occ = explode($r, $occ);\n\t\t\t\t$odata[$k][] = $occ[0];\n\t\t\t\t$odata[$k][] = $occ[1];\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Exceptions?\n\t\t\t// -------------------------------------\n\n\t\t\t$exceptions\t= explode('|', rtrim($exceptions, '|'));\n\t\t\t$exdata\t\t= array();\n\n\t\t\tforeach ($exceptions as $k => $exc)\n\t\t\t{\n\t\t\t\t$exc = trim($exc);\n\n\t\t\t\tif ($exc == '') continue;\n\n\t\t\t\t$exdata[] = $exc;\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Rules?\n\t\t\t// -------------------------------------\n\n\t\t\t$add_rules \t= FALSE;\n\t\t\t$erules \t= array();\n\t\t\t$rules \t\t= explode('|', rtrim($rules, '|'));\n\n\t\t\tforeach ($rules as $rule)\n\t\t\t{\n\t\t\t\t$temp = explode($r, $rule);\n\t\t\t\t$rule = array();\n\n\t\t\t\tforeach ($temp as $k => $v)\n\t\t\t\t{\n\t\t\t\t\tif ($v != FALSE) $add_rules = TRUE;\n\t\t\t\t\t$rule[substr($rvars[$k], 5)] = $v;\n\t\t\t\t}\n\n\t\t\t\tif ($add_rules === TRUE)\n\t\t\t\t{\n\t\t\t\t\t$temp = array();\n\n\t\t\t\t\tif ($rule['repeat_years'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'YEARLY';\n\n\t\t\t\t\t\tif ($rule['repeat_years'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_years'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['repeat_months'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'MONTHLY';\n\n\t\t\t\t\t\tif ($rule['repeat_months'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_months'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['repeat_weeks'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'WEEKLY';\n\n\t\t\t\t\t\tif ($rule['repeat_weeks'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_weeks'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['repeat_days'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['FREQ'] = 'DAILY';\n\n\t\t\t\t\t\tif ($rule['repeat_days'] > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['INTERVAL'] = $rule['repeat_days'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['months_of_year'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//this flips keys to make 'c' => 12, etc\n\t\t\t\t\t\t$m = array_flip(array(\n\t\t\t\t\t\t\t1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C'\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\tif (strlen($rule['months_of_year'] > 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$months = str_split($rule['months_of_year']);\n\t\t\t\t\t\t\tforeach ($months as $month)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$temp['BYMONTH'][] = $m[$month] + 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['BYMONTH'] = $m[$month] + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['days_of_month'] > '')\n\t\t\t\t\t{\n\t\t\t\t\t\t//this flips keys to make 'v' => 30, etc\n\t\t\t\t\t\t$d = array_flip(array(\n\t\t\t\t\t\t\t1, 2, 3, 4, 5, 6, 7, 8, 9,\n\t\t\t\t\t\t\t'A', 'B', 'C', 'D', 'E', 'F',\n\t\t\t\t\t\t\t'G', 'H', 'I', 'J', 'K', 'L',\n\t\t\t\t\t\t\t'M', 'N', 'O', 'P', 'Q', 'R',\n\t\t\t\t\t\t\t'S', 'T', 'U', 'V'\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\tif (strlen($rule['days_of_month']) > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$days = str_split($rule['days_of_month']);\n\t\t\t\t\t\t\tforeach ($days as $day)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$temp['BYMONTHDAY'][] = $d[$day] + 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp['BYMONTHDAY'] = $d[$rule['days_of_month']] + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['days_of_week'] != '' OR $rule['days_of_week'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$d \t\t\t= array('SU','MO','TU','WE','TH','FR','SA');\n\t\t\t\t\t\t$d_letter \t= array('U','M','T','W','R','F','S');\n\n\t\t\t\t\t\t$dows \t\t= str_split($rule['days_of_week']);\n\n\t\t\t\t\t\tif ($rule['relative_dow'] > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$rels = str_split($rule['relative_dow']);\n\t\t\t\t\t\t\tforeach ($dows as $dow)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($rels as $rel)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($rel == 6) $rel = -1;\n\t\t\t\t\t\t\t\t\t$temp['BYDAY'][] = $rel.$d[array_search($dow, $d_letter)];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($dows as $dow)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$temp['BYDAY'][] = $d[array_search($dow, $d_letter)];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($rule['stop_after'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['COUNT'] = $rule['stop_after'];\n\t\t\t\t\t}\n\t\t\t\t\telseif ($rule['stop_by'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t// TODO: Add time\n\t\t\t\t\t\t// TODO: The \"+1\" below is because the ical standard treats\n\t\t\t\t\t\t// \tUNTIL as \"less than\", not \"less than or equal to\" (which\n\t\t\t\t\t\t// \tis how Calendar treats stop_by). Double check that a simple\n\t\t\t\t\t\t// \t\"+1\" accurately addresses this difference.\n\t\t\t\t\t\t$temp['UNTIL'] = $rule['stop_by'] + 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t$erules[] = $temp;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Put it together\n\t\t\t// -------------------------------------\n\n\t\t\t//if this is all day we need to add the dates as params to the dstart and end items\n\t\t\tif ($this->_is_all_day($start_hour, $start_minute, $end_hour, $end_minute))\n\t\t\t{\n\t\t\t\t$E->setProperty(\n\t\t\t\t\t\"dtstart\" ,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'year' \t=> $start_year,\n\t\t\t\t\t\t'month' => $start_month,\n\t\t\t\t\t\t'day'\t=> $start_day\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t//--------------------------------------------\n\t\t\t\t//\twe need CDT so we can add a day\n\t\t\t\t//\tgcal, and ical are ok with this being the same day\n\t\t\t\t//\tstupid damned outlook barfs, hence the +1\n\t\t\t\t//\tthe +1 doesnt affect g/ical\n\t\t\t\t//--------------------------------------------\n\n\t\t\t\tif ( ! isset($this->CDT) OR ! is_object($this->CDT) )\n\t\t\t\t{\n\t\t\t\t\t$this->load_calendar_datetime();\n\t\t\t\t}\n\n\t\t\t\t$this->CDT->change_date(\n\t\t\t\t\t$end_year,\n\t\t\t\t\t$end_month,\n\t\t\t\t\t$end_day\n\t\t\t\t);\n\n\t\t\t\t$this->CDT->add_day();\n\n\t\t\t\t$E->setProperty(\n\t\t\t\t\t\"dtend\" ,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'year' \t=> $this->CDT->year,\n\t\t\t\t\t\t'month' => $this->CDT->month,\n\t\t\t\t\t\t'day'\t=> $this->CDT->day\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$E->setProperty('dtstart', $start_year, $start_month, $start_day, $start_hour, $start_minute, 00);\n\t\t\t\t$E->setProperty('dtend', $end_year, $end_month, $end_day, $end_hour, $end_minute, 00);\n\t\t\t}\n\n\t\t\t$E->setProperty('summary', $title);\n\n\t\t\tif ( ! empty($erules))\n\t\t\t{\n\t\t\t\tforeach ($erules as $rule)\n\t\t\t\t{\n\t\t\t\t\t$E->setProperty('rrule', $rule);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$extras = array();\n\t\t\t$edits\t= array();\n\n\t\t\tif ( ! empty($odata))\n\t\t\t{\n\t\t\t\t$query = ee()->db->query(\n\t\t\t\t\t\"SELECT *\n\t\t\t\t\t FROM\texp_calendar_events_occurrences\n\t\t\t\t\t WHERE\tevent_id = \" . ee()->db->escape_str($id)\n\t\t\t\t);\n\n\t\t\t\tforeach ($query->result_array() as $row)\n\t\t\t\t{\n\t\t\t\t\t//fix blank times\n\t\t\t\t\t$row['start_time'] \t= ($row['start_time'] == 0) ? '0000' \t: $row['start_time'];\n\t\t\t\t\t$row['end_time'] \t= ($row['end_time'] == 0) ? '2400' \t\t: $row['end_time'];\n\n\t\t\t\t\t//looks like an edited occurrence\n\t\t\t\t\t//edits without rules arent really edits.\n\t\t\t\t\tif ($row['event_id'] != $row['entry_id'] AND empty($rules))\n\t\t\t\t\t{\n\t\t\t\t\t\t$edits[] = $row;\n\t\t\t\t\t}\n\t\t\t\t\t//probably entered with the date picker or something\n\t\t\t\t\t//these loose occurences\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$extras[] = $row;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! empty($exdata))\n\t\t\t{\n\t\t\t\t$E->setProperty('exdate', $exdata);\n\t\t\t}\n\n\t\t\tif ($description != '') $E->setProperty('description', $description);\n\t\t\tif ($location != '') $E->setProperty('location', $location);\n\n\n\t\t\t$E->setProperty( \"uid\", $this->make_uid() . '@' . $host);\n\t\t\t$ICAL->setComponent($E);\n\n\t\t\t//--------------------------------------------\n\t\t\t//\tremove rules for subsequent items\n\t\t\t//--------------------------------------------\n\n\t\t\twhile( $E->deleteProperty( \"RRULE\" )) continue;\n\n\t\t\t//edits must come right after\n\t\t\tif ( ! empty($edits))\n\t\t\t{\n\t\t\t\tforeach ($edits as $edit)\n\t\t\t\t{\n\t\t\t\t\t$edit_date = array(\n\t\t\t\t\t\t\"year\" \t=> $edit['start_year'],\n\t\t\t\t\t\t\"month\" => $edit['start_month'],\n\t\t\t\t\t\t\"day\" \t=> $edit['start_day'] ,\n\t\t\t\t\t\t\"hour\" \t=> substr($edit['start_time'], 0, 2) ,\n\t\t\t\t\t\t\"min\" \t=> substr($edit['start_time'], 2, 2)\n\t\t\t\t\t);\n\n\t\t\t\t\t//if this is all day we need to add the dates as params to the dstart and end items\n\t\t\t\t\tif ($this->_is_all_day(\n\t\t\t\t\t\tsubstr($edit['start_time'], 0, 2),\n\t\t\t\t\t\tsubstr($edit['start_time'], 2, 2),\n\t\t\t\t\t\tsubstr($edit['end_time'], 0, 2),\n\t\t\t\t\t\tsubstr($edit['end_time'], 2, 2)\n\t\t\t\t\t ))\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtstart\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $edit['start_year'],\n\t\t\t\t\t\t\t\t'month' => $edit['start_month'],\n\t\t\t\t\t\t\t\t'day'\t=> $edit['start_day']\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t//\twe need CDT so we can add a day\n\t\t\t\t\t\t//\tgcal, and ical are ok with this being the same day\n\t\t\t\t\t\t//\tstupid damned outlook barfs, hence the +1\n\t\t\t\t\t\t//\tthe +1 doesnt affect g/ical\n\t\t\t\t\t\t//--------------------------------------------\n\n\t\t\t\t\t\tif ( ! isset($this->CDT) OR ! is_object($this->CDT) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->load_calendar_datetime();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->CDT->change_date(\n\t\t\t\t\t\t\t$edit['end_year'],\n\t\t\t\t\t\t\t$edit['end_month'],\n\t\t\t\t\t\t\t$edit['end_day']\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$this->CDT->add_day();\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtend\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $this->CDT->year,\n\t\t\t\t\t\t\t\t'month' => $this->CDT->month,\n\t\t\t\t\t\t\t\t'day'\t=> $this->CDT->day\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtstart',\n\t\t\t\t\t\t\t$edit_date['year'],\n\t\t\t\t\t\t\t$edit_date['month'],\n\t\t\t\t\t\t\t$edit_date['day'],\n\t\t\t\t\t\t\t$edit_date['hour'],\n\t\t\t\t\t\t\t$edit_date['min'],\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtend',\n\t\t\t\t\t\t\t$edit['end_year'],\n\t\t\t\t\t\t\t$edit['end_month'],\n\t\t\t\t\t\t\t$edit['end_day'] ,\n\t\t\t\t\t\t\tsubstr($edit['end_time'], 0, 2),\n\t\t\t\t\t\t\tsubstr($edit['end_time'], 2, 2),\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$E->setProperty( \"RECURRENCE-ID\", $edit_date);\n\t\t\t\t\t$E->setProperty( \"uid\", $this->make_uid() . '@' . $host);\n\n\t\t\t\t\t$ICAL->setComponent($E);\n\t\t\t\t}\n\n\t\t\t\t//cleanup\n\t\t\t\t$E->deleteProperty(\"RECURRENCE-ID\");\n\n\t\t\t\t$E->setProperty('dtstart', $start_year, $start_month, $start_day, $start_hour, $start_minute, 00);\n\t\t\t\t$E->setProperty('dtend', $end_year, $end_month, $end_day, $end_hour, $end_minute, 00);\n\t\t\t}\n\n\t\t\t// these random ass add-in dates are non-standard to most cal creation\n\t\t\t// and need to be treated seperately as lumping don't work, dog\n\t\t\tif ( ! empty($extras))\n\t\t\t{\n\t\t\t\tforeach ($extras as $extra)\n\t\t\t\t{\n\n\t\t\t\t\t//if this is all day we need to add the dates as params to the dstart and end items\n\t\t\t\t\tif ($this->_is_all_day(\n\t\t\t\t\t\tsubstr($extra['start_time'], 0, 2),\n\t\t\t\t\t\tsubstr($extra['start_time'], 2, 2),\n\t\t\t\t\t\tsubstr($extra['end_time'], 0, 2),\n\t\t\t\t\t\tsubstr($extra['end_time'], 2, 2)\n\t\t\t\t\t ))\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtstart\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $extra['start_year'],\n\t\t\t\t\t\t\t\t'month' => $extra['start_month'],\n\t\t\t\t\t\t\t\t'day'\t=> $extra['start_day']\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t//\twe need CDT so we can add a day\n\t\t\t\t\t\t//\tgcal, and ical are ok with this being the same day\n\t\t\t\t\t\t//\tstupid damned outlook barfs, hence the +1\n\t\t\t\t\t\t//\tthe +1 doesnt affect g/ical\n\t\t\t\t\t\t//--------------------------------------------\n\n\t\t\t\t\t\tif ( ! isset($this->CDT) OR ! is_object($this->CDT) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->load_calendar_datetime();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->CDT->change_date(\n\t\t\t\t\t\t\t$extra['end_year'],\n\t\t\t\t\t\t\t$extra['end_month'],\n\t\t\t\t\t\t\t$extra['end_day']\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$this->CDT->add_day();\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t\"dtend\" ,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'year' \t=> $this->CDT->year,\n\t\t\t\t\t\t\t\t'month' => $this->CDT->month,\n\t\t\t\t\t\t\t\t'day'\t=> $this->CDT->day\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'VALUE' => 'DATE'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtstart',\n\t\t\t\t\t\t\t$extra['start_year'],\n\t\t\t\t\t\t\t$extra['start_month'],\n\t\t\t\t\t\t\t$extra['start_day'] ,\n\t\t\t\t\t\t\tsubstr($extra['start_time'], 0, 2),\n\t\t\t\t\t\t\tsubstr($extra['start_time'], 2, 2),\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$E->setProperty(\n\t\t\t\t\t\t\t'dtend',\n\t\t\t\t\t\t\t$extra['end_year'],\n\t\t\t\t\t\t\t$extra['end_month'],\n\t\t\t\t\t\t\t$extra['end_day'] ,\n\t\t\t\t\t\t\tsubstr($extra['end_time'], 0, 2),\n\t\t\t\t\t\t\tsubstr($extra['end_time'], 2, 2),\n\t\t\t\t\t\t\t00\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$E->setProperty( \"uid\", $this->make_uid() . '@' . $host);\n\t\t\t\t\t$ICAL->setComponent($E);\n\t\t\t\t}\n\n\t\t\t\t//clean in case we need to add more later\n\t\t\t\t$E->setProperty('dtstart', $start_year, $start_month, $start_day, $start_hour, $start_minute, 00);\n\t\t\t\t$E->setProperty('dtend', $end_year, $end_month, $end_day, $end_hour, $end_minute, 00);\n\t\t\t}\n\t\t}\n\t\t//return $ICAL->createCalendar();\n\t\treturn $ICAL->returnCalendar();\n\t}", "private function makeCalendarHead()\n\t{\n\t\tif(strlen($this->headerStr) < 1) {\n\t\t\t$head = \"\\t<tr>\\n\\t\\t<th colspan=\\\"7\\\" class=\\\"headerString\\\">\";\n\t\t\tif(!is_null($this->curDay)) {\n\t\t\t\t$head .= $this->curDayName.' the '.$this->curDayS.' of '.$this->curMonthName.', '.$this->curYear;\n\t\t\t} else {\n\t\t\t\t$head .= $this->curMonthName.', '.$this->curYear;\n\t\t\t}\n\t\t\t$head .= \"</th>\\n\\t</tr>\\n\";\n\t\t} else {\n\t\t\t$head = $this->headerStr;\n\t\t}\n\t\t\n\t\t$this->calWeekDays .= $head;\n\t\t$this->outArray['head'] = $head;\n\t}", "function render_icalendar($name, $objects, $include_project_name = false) {\n \trequire_once ANGIE_PATH . '/classes/icalendar/iCalCreator.class.php';\n\n $calendar = new vcalendar();\n //$calendar->setProperty('VERSION', '1.0');\n $calendar->setProperty('X-WR-CALNAME', $name);\n $calendar->setProperty('METHOD', 'PUBLISH');\n\n $projects = array();\n foreach($objects as $object) {\n $summary = $object->getName();\n if($include_project_name) {\n $project_id = $object->getProjectId();\n if(isset($projects[$project_id])) {\n $summary .= ' | ' . $projects[$project_id]->getName();\n } else {\n $project = $object->getProject();\n if(instance_of($project, 'Project')) {\n $projects[$project_id] = $project;\n $summary .= ' | ' . $projects[$project_id]->getName();\n } // if\n } // if\n } // if\n\n \tswitch(strtolower($object->getType())) {\n \t\tcase 'milestone':\n \t\t\t$start_on = $object->getStartOn();\n \t\t $due_on = $object->getDueOn();\n\n \t\t $due_on->advance(24 * 60 * 60, true); // One day shift because iCal and Windows Calendar don't include last day\n\n \t\t $start_on_year = $start_on->getYear();\n \t\t$start_on_month = $start_on->getMonth() < 10 ? '0' . $start_on->getMonth() : $start_on->getMonth();\n \t\t$start_on_day = $start_on->getDay() < 10 ? '0' . $start_on->getDay() : $start_on->getDay();\n\n \t\t$due_on_year = $due_on->getYear();\n \t\t$due_on_month = $due_on->getMonth() < 10 ? '0' . $due_on->getMonth() : $due_on->getMonth();\n \t\t$due_on_day = $due_on->getDay() < 10 ? '0' . $due_on->getDay() : $due_on->getDay();\n\n \t\t$event = new vevent();\n\n $event->setProperty('dtstart', array($start_on_year, $start_on_month, $start_on_day), array('VALUE'=>'DATE'));\n $event->setProperty('dtend', array($due_on_year, $due_on_month, $due_on_day), array('VALUE'=>'DATE'));\n\n $event->setProperty('dtstamp', date('Ymd'));\n $event->setProperty('summary', $summary);\n\n if($object->getBody()) {\n $event->setProperty('description', html_to_text($object->getFormattedBody()) . \"\\n\\n\" . lang('Details: ') . $object->getViewUrl());\n } else {\n $event->setProperty('description', lang('Details') . ': ' . $object->getViewUrl());\n } // if\n\n switch($object->getPriority()) {\n \t\t case PRIORITY_HIGHEST:\n \t\t $event->setProperty('priority', 1);\n \t\t break;\n \t\t case PRIORITY_HIGH:\n \t\t $event->setProperty('priority', 3);\n \t\t break;\n \t\t case PRIORITY_LOW:\n \t\t $event->setProperty('priority', 7);\n \t\t break;\n \t\t case PRIORITY_LOWEST:\n \t\t $event->setProperty('priority', 9);\n \t\t break;\n \t\t default:\n \t\t $event->setProperty('priority', 5);\n \t\t} // switch\n\n \t\t\t$calendar->addComponent($event);\n \t\t break;\n \t\tcase 'ticket':\n \t\tcase 'task':\n \t\t $start_on = $object->getCreatedOn();\n \t\t $due_on = $object->getDueOn();\n\n \t\t$todo = new vtodo();\n\n \t\t$todo->setProperty('summary', $summary);\n \t\t$todo->setProperty('description', $object->getName() . \"\\n\\n\" . lang('Details') . ': ' . $object->getViewUrl());\n\n \t\tswitch($object->getPriority()) {\n \t\t case PRIORITY_HIGHEST:\n \t\t $todo->setProperty('priority', 1);\n \t\t break;\n \t\t case PRIORITY_HIGH:\n \t\t $todo->setProperty('priority', 3);\n \t\t break;\n \t\t case PRIORITY_LOW:\n \t\t $todo->setProperty('priority', 7);\n \t\t break;\n \t\t case PRIORITY_LOWEST:\n \t\t $todo->setProperty('priority', 9);\n \t\t break;\n \t\t default:\n \t\t $todo->setProperty('priority', 5);\n \t\t} // switch\n\n \t\tif(instance_of($due_on, 'DateValue')) {\n \t\t$due_on_year = $due_on->getYear();\n \t\t$due_on_month = $due_on->getMonth() < 10 ? '0' . $due_on->getMonth() : $due_on->getMonth();\n \t\t$due_on_day = $due_on->getDay() < 10 ? '0' . $due_on->getDay() : $due_on->getDay();\n\n \t\t$todo->setProperty('due', $due_on_year, $due_on_month, $due_on_day);\n \t\t} // if\n\n $calendar->addComponent($todo);\n \t\t break;\n \t\tdefault:\n \t\t\t break;\n \t}\n } // foreach\n\n $cal = $calendar->createCalendar();\n\n header('Content-Type: text/calendar; charset=UTF-8');\n header('Content-Disposition: attachment; filename=\"' . $name .'.ics\"');\n header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');\n header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');\n header('Pragma: no-cache');\n\n print $cal;\n die();\n }", "function icsAJson($temp){\n\t$original = array(\"BEGIN:VCALENDAR\", \"END:VCALENDAR\", \"PRODID:\", \"BEGIN:VEVENT\", \"END:VEVENT\", \"VERSION:\", \"CALSCALE:\",\n\t\"METHOD:\", \"X-WR-CALNAME:\", \"X-WR-TIMEZONE:\", \"X-WR-CALDESC:\", \"DTSTART:\", \"DTEND:\", \"DTSTAMP:\", \"UID:\", \"CREATED:\", \"DESCRIPTION:\",\n\t\"LAST-MODIFIED:\", \"LOCATION:\", \"SEQUENCE:\", \"STATUS:\", \"SUMMARY:\", \"TRANSP:TRANSPARENT\", \"TRANSP:OPAQUE\", \"X-GOOGLE-HANGOUT:\" , \"DTSTART;VALUE=DATE:\", \"DTEND;VALUE=DATE:\",\n\t'\\n', '\\r', '<br />', '<br \\/>', '\\/', '\"{\"VCALENDAR');\n\t$cambiadas = array('{\"VCALENDAR\":[{', '}]}', '\"PRODID\":\"', ', \"VEVENT\":[', ']', '\", \"VERSION\": \"', '\", \"CALSCALE\": \"', '\", \"METHOD\":\"',\n\t'\", \"X-WR-CALNAME\":\"', '\", \"X-WR-TIMEZONE\":\"' , '\", \"X-WR-CALDESC\":\"\"', '{\"DTSTART\":\"', '\", \"DTEND\":\"', '\", \"DTSTAMP\":\"', '\", \"UID\":\"',\n\t'\", \"CREATED\":\"', '\", \"DESCRIPTION\":\"', '\", \"LAST-MODIFIED\":\"', '\", \"LOCATION\":\"', '\", \"SEQUENCE\":\"', '\", \"STATUS\":\"', '\", \"SUMMARY\":\"',\n\t'\", \"TRANSP\":\"TRANSPARENT\"}', '\", \"TRANSP\":\"OPAQUE\"}', '\", \"X-GOOGLE-HANGOUT\":\"' , '{\"DTSTART\":\"', '\", \"DTEND\":\"',\n\t'', '', '', '', '/', '{\"VCALENDAR');\n\t$newphrase = trim(str_replace($original, $cambiadas, $temp));\n\t//Busco los Eventos del calendario\n\t$busco = '\"VEVENT\"';\n\t$pos = strpos($newphrase, $busco);\n\t$primerParte = \"\";\n\t$segundaParte = \"\";\n\t$terceraParte = \"]}]}\";\n\t$salida = \"\";\n\tif ($pos !== false) {\n\t\t//Al encontrar al primer Evento separo el texto en 2 partes, la primera con lo anterior a este\n\t\t$primerParte = (substr($newphrase, 0, $pos)) . '\"VEVENT\":[';\n\t\t//La segunda parte contendra los Eventos a medio camino de estar en formato JSON\n\t\t$temp = substr($newphrase, $pos, ((strlen($newphrase)-5) - $pos));\n\t\t//Cambio esta segunda parte para darle el formato que corresponde\n\t\t$original = array('\"VEVENT\":[', \"]\");\n\t\t$cambiadas = array('', '');\n\t\t$segundaParte = trim(str_replace($original, $cambiadas, $temp));\n\t\t//Uno las 3, Inicio, Eventos y el Final que contiene los cierres de llaves necesarios\n\t\t$salida = $primerParte . $segundaParte . $terceraParte;\t\t\n\t}\n\treturn ($salida);\n}", "function build_calendar_url($cal, $start, $end) {\n return GOOGLE_CALENDAR_URL_BASE\n . $cal\n . \"/events?\"\n . (defined(\"CALENDAR_FIELDS\") ? \"fields=\" . CALENDAR_FIELDS : \"\")\n . \"&singleEvents=true\"\n\n // timeMin needs to start at 3a (maybe 4a?) instead of 00:00:00 because\n // otherwise it'll grab the sunday prior b/c of it ending at 1a\n . \"&timeMin=\" . date(\"Y-m-d\\T03:00:00P\", $start)\n . \"&timeMax=\" . date(\"Y-m-d\\T23:59:59P\", $end)\n . \"&key=\" . GOOGLE_API_KEY\n ;\n}", "public function getCalendar() {\n\t\t$this->setDate();\n\t\t$this->getLinks();\n\t\t $this->di->logger->stamp(__CLASS__, __METHOD__, '');\n\n\n\t\t// Get new date array\n\t\t$newDate = getdate(mktime(0,0,0,$this->newMonth, 1, $this->newYear));\n\t\t// Calculate rest days in previous and next month\n\t\t$firstDay = $newDate['wday'];\n\t\t$firstDay = ($firstDay == 0) ? 7: $firstDay;\n\t\t$daysInMonth = cal_days_in_month ( CAL_GREGORIAN , $this->newMonth , $this->newYear );\n\t\tif($this->newMonth != 1){\n\t\t\t$daysInPrevMonth = cal_days_in_month ( CAL_GREGORIAN , $this->newMonth-1 , $this->newYear );\n\t\t}\n\t\telse if($this->newMonth == 1) {\n\t\t\t$daysInPrevMonth = cal_days_in_month ( CAL_GREGORIAN , 12 , $this->newYear-1 );\n\t\t}\n\n\t\t$lastDates = $daysInPrevMonth - $firstDay +1;\n\n\t\t// Start building table\n\t\t$table =\"<section class='calendar'><header>\" . $this->prevLink . \"<h3>\" . $newDate['month'] . \" - \" . $newDate['year'] . \"</h3>\" . $this->nextLink;\n\t\t$table .= \"</header><table><thead>\\n\";\n\t\t$table .= \"<th>Mon</th><th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th><th>Sun</th>\\n\";\n\t\t$table .= \"</thead>\\n\";\n\t\t$table .= \"<tr>\";\n\t\t\n\t\tfor ($a=1; $a < $firstDay ; $a++) { \n\t\t\t$lastDates++;\n\t\t\t$table .= \"<td class='lighter'>\" . $lastDates . \"</td>\";\n\t\t}\n\n\t\t$d = 0;\n\t\tfor ($b=0; $b < $daysInMonth ; $b++) { \n\t\t\t\n\t\t\t$d++;\n\t\t\t$DATE = date('N',mktime(0,0,0, $this->newMonth, $d, $this->newYear));\n\t\t\t\n\t\t\tif ($DATE == 1) {\n\t\t\t\t$table .= \"</tr>\\n<tr>\";\n\t\t\t}\n\n\t\t\tif (($this->newMonth == $this->currentMonth && $d == $this->currentDate && $this->newYear == $this->currentYear)) {\n\t\t\t\t$table .= \"<td><strong>\" . $d . \"</strong></td>\";\n\t\t\t}\n\t\t\telse if ($DATE == 7) {\n\t\t\t\t$table .= \"<td class='red'>\" . $d . \"</td>\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$table .= \"<td>\" . $d . \"</td>\";\n\t\t\t}\n\t\t}\n\t\t\tif ($DATE != 7) {\n\t\t\t\t$nextMonthDays = 7 - $DATE;\n\t\t\t\tfor ($c=1; $c <= $nextMonthDays ; $c++) { \n\t\t\t\t\t$table .= \"<td class='lighter'>\" . $c . \"</td>\";\n\t\t\t}\n\t}\n\t\t$table .= \"</tr></table></section>\";\n\n\t\treturn $table;\n\t}", "public function __toString()\n {\n $utc = new DateTimeZone('UTC');\n\n return $this->startDate->setTimeZone($utc)->format(static::DATE_ISO8601)\n .'/'.$this->endDate->setTimeZone($utc)->format(static::DATE_ISO8601);\n }", "public function __toString()\n {\n $s = \"ScheduleExpression[\";\n $s .= \"second=\";\n $s .= $this->second;\n $s .= \" minute=\";\n $s .= $this->minute;\n $s .= \" hour=\";\n $s .= $this->hour;\n $s .= \" dayOfWeek=\";\n $s .= $this->dayOfWeek;\n $s .= \" dayOfMonth=\";\n $s .= $this->dayOfMonth;\n $s .= \" month=\";\n $s .= $this->month;\n $s .= \" year=\";\n $s .= $this->year;\n $s .= \" start=\";\n $s .= (string)$this->start;\n $s .= \" end=\";\n $s .= (string)$this->end;\n $s .= \" timezone=\";\n $s .= $this->timezone;\n $s .= \"]\";\n\n return $s;\n }", "public function __toString()\r\n {\r\n if($this->start && $this->end) {\r\n return sprintf('%s - %s', PiplApi_Utils::piplapi_date_to_str($this->start),\r\n PiplApi_Utils::piplapi_date_to_str($this->end));\r\n } elseif($this->start) {\r\n return PiplApi_Utils::piplapi_date_to_str($this->start);\r\n }\r\n return PiplApi_Utils::piplapi_date_to_str($this->end);\r\n }", "public function __toString()\n {\n $utc = new DateTimeZone('UTC');\n\n return $this->startDate->setTimeZone($utc)->format(self::DATE_ISO8601)\n .'/'.$this->endDate->setTimeZone($utc)->format(self::DATE_ISO8601);\n }", "public function buildCalendar(){\n\n\t\t$first_day = $this->getFirstDay();\t\t\t\t\t\t//Determine what day of the week the month starts on\n\t\t$current_number_of_days = $this->getNumberOfDays();\t\t//Determine the number of days in the month\n\n\t\t$number_of_previous_days = $first_day;\t\t\t\t\t\t\t\t\t\t//Determine the number of days needed to complete the first week\n\t\t$prev_month_number_of_days = $this->getNumberOfDays($this->getMonth()-1); \t//Determine the number of days in the previous month\n\t\t\n\t\t$_SESSION['month'] = $this->getMonth();\n\t\t$_SESSION['year'] = $this->getYear();\n\t\t$_SESSION['view'] = 'calendar';\n\n\t\tob_start();?>\n <table border=\"0\" id=\"events_calendar\">\n <?php echo $this->buildCalendarHead() ?>\n <tr id=\"events_calendar_weekdays\">\n <th>\n\t\t\t\t\t<div class=\"full_week_name\">Sunday</div>\n\t\t\t\t\t<div class=\"short_week_name\">Sun</div>\n\t\t\t\t\t<div class=\"abrev_week_name\">S</div>\n </th>\n <th>\n\t\t\t\t\t<div class=\"full_week_name\">Monday</div>\n\t\t\t\t\t<div class=\"short_week_name\">Mon</div>\n\t\t\t\t\t<div class=\"abrev_week_name\">M</div>\n </th>\n <th>\n\t\t\t\t\t<div class=\"full_week_name\">Tuesday</div>\n\t\t\t\t\t<div class=\"short_week_name\">Tue</div>\n\t\t\t\t\t<div class=\"abrev_week_name\">T</div>\n </th>\n <th>\n\t\t\t\t\t<div class=\"full_week_name\">Wednesday</div>\n\t\t\t\t\t<div class=\"short_week_name\">Wed</div>\n\t\t\t\t\t<div class=\"abrev_week_name\">W</div>\n </th>\n <th>\n\t\t\t\t\t<div class=\"full_week_name\">Thursday</div>\n\t\t\t\t\t<div class=\"short_week_name\">Thu</div>\n\t\t\t\t\t<div class=\"abrev_week_name\">T</div>\n </th>\n <th>\n\t\t\t\t\t<div class=\"full_week_name\">Friday</div>\n\t\t\t\t\t<div class=\"short_week_name\">Fri</div>\n\t\t\t\t\t<div class=\"abrev_week_name\">F</div>\n </th>\n <th>\n\t\t\t\t\t<div class=\"full_week_name\">Saturday</div>\n\t\t\t\t\t<div class=\"short_week_name\">Sat</div>\n\t\t\t\t\t<div class=\"abrev_week_name\">S</div>\n </th>\n </tr>\n <?php\n $dayCounter = 0;\t\t\t\t\t\t\t\t\t\t\t//Keeps count of the days in a week\n\n /*** PREVIOUS MONTH CELLS ***/\n for($day = $number_of_previous_days; $day >= 1; $day--){\t//For each day in the previous month needed for a full week\n $dayNumber = $prev_month_number_of_days - ($day-1);\t\t\n \n //Get full date (YYYY-MM-DD)\n $year = ($this->getPrevMonth() == 12)? ($this->getYear()-1): $this->getYear();\n $full_date = $year . '-' . $this->getPrevMonth() . '-' . $dayNumber;\n \n $dayCounter ++;\n if($dayCounter == 1){\t\t\t\t\t//Start new row\n echo '<tr>';\n }\n \n echo $this->buildCalendarCell($full_date, $dayNumber, 'prev_month');\t//Create Calendar Cell\n\n if($dayCounter == 7){\t\t\t\t\t//End new row\n echo '</tr>';\n $dayCounter = 0;\n }\n }\n\n /*** CURRENT MONTH CELLS ***/\n for($day = 1; $day <= $current_number_of_days; $day++){\t\t//For each day in the current month\n $full_date = $this->getYear() . '-' . $this->getMonth() . '-' . $day;\n $dayCounter ++;\n if($dayCounter == 1){\t\t\t\t\t//Start new row\n echo '<tr>';\n }\n\n echo $this->buildCalendarCell($full_date, $day, 'current_month');\t//Create Calendar Cell\n\n if($dayCounter == 7){\t\t\t\t\t//End new row\n echo '</tr>';\n $dayCounter = 0;\n }\n }\n\n /*** NEXT MONTH CELLS ***/\n for($day = 1; $day <= $dayCounter; $day++){\t//For each day in the current month\n //Get full date (YYYY-MM-DD)\n $year = ($this->getNextMonth() == 1)? ($this->getYear()+1): $this->getYear();\n $full_date = $year . '-' . $this->getNextMonth() . '-' . $day;\n \n $dayCounter ++;\n if($dayCounter == 1){\t\t\t\t\t//Start new row\n echo '<tr>';\n }\n\n echo $this->buildCalendarCell($full_date, $day, 'next_month');\t//Create Calendar Cell\n\n if($dayCounter == 7){\t\t\t\t\t//End new row\n echo '</tr>';\n $dayCounter = 0;\n }\n }\n ?>\n </table>\n <style>\n\t\t\t<?php \n\t\t\tforeach($this->getCategories() as $c){?>\n\t\t\t#events_calendar .event.category_<?php echo $c->getId(); ?>:before{color: <?php echo $c->getColor(); ?> !important;}\n\t\t\t<?php } ?>\n\t\t</style>\n <?php\n\t\treturn ob_get_clean();\n\t}", "abstract public function calendar($value, $name, $id = null, $format = null, array $attributes = array());", "public function mostrarCalendarioCumpleaños(){\n\t\t$item1 = \"fch_nacimiento\";\n\t\tif($_POST[\"start\"] > $_POST[\"end\"] && $_POST[\"start\"] == 12){\n\t\t\t$inicio = 1;\n\t\t\t$fin = $_POST[\"end\"];\n\t\t}else if($_POST[\"start\"] > $_POST[\"end\"] && $_POST[\"end\"] == 1){\n\t\t\t$inicio = $_POST[\"start\"];\n\t\t\t$fin = 12;\n\t\t}else{\n\t\t\t$inicio = $_POST[\"start\"];\n\t\t\t$fin = $_POST[\"end\"];\n\t\t}\n $valor1 = $inicio.'|'.$fin;\n $item2 = $valor2 = $item3 = $valor3 = null;\n $entrada = \"calendarioCumpleaños\";\n $cumpleaños = ControladorTrabajador::ctrMostrarTrabajador($item1,$valor1,$item2,$valor2,$item3,$valor3,$entrada);\n if(count($cumpleaños) > 0){\n\t $datosJson = '[';\n\t\t\t\t \tfor ($i=0; $i < count($cumpleaños) ; $i++) {\n\t\t\t\t \t\t$fechaNacimiento = dateFormatCumpleanios($cumpleaños[$i][\"fch_nacimiento\"]);\n\t\t\t\t \t\t$datosJson .= '{\n\t\t\t\t\t\t\t\"nombre\" : \"'.$cumpleaños[$i][\"dsc_nombres\"].\" \".$cumpleaños[$i][\"dsc_apellido_paterno\"].\" \".$cumpleaños[$i][\"dsc_apellido_materno\"].'\",\n\t\t\t\t\t\t\t\"fecha\" : \"'.$fechaNacimiento.'\",\n\t\t\t\t\t\t\t\"imagen\" : \"'.$cumpleaños[$i][\"imagen\"].'\",\n\t\t\t\t\t\t\t\"cargo\" : \"'.$cumpleaños[$i][\"dsc_cargo\"].'\"\n\t\t\t\t\t\t},';\n\t\t\t\t\t}\t\t\t \t\n\t\t\t\t\t$datosJson = substr($datosJson, 0, -1);\n\t\t\t\t$datosJson .= ']';\t\n\t\t}else{\n\t\t\t$datosJson = '[\n\t\t\t\t{}\n\t\t\t]';\n\t\t}\n\t\techo $datosJson;\t\n\t}", "public function buildCalendar($month, $year);", "protected function beginVCal()\n {\n return $this->assemble([\n 'BEGIN:VCALENDAR',\n 'VERSION:2.0',\n 'METHOD:PUBLISH',\n 'PRODID:' . $this->string($this->prodId),\n 'X-CALSTART:' . $this->dateStr($this->start),\n 'X-WR-CALNAME:' . $this->string($this->name),\n ]);\n }", "protected function makeDateHeaderString() {\n\t\t$timeZone = date(\"Z\");\n\t\t$op = ($timeZone[0] == '-') ? '-' : '+';\n\t\t$timeZone = abs($timeZone);\n\t\t$timeZone = floor($timeZone / 3600) * 100 + ($timeZone % 3600) / 60;\n\t\t$dateString = sprintf(\"%s %s%04d\", date(\"D, j M Y H:i:s\"), $op, $timeZone);\n\t\treturn \"Date: \" . $dateString . $this->_endString;\n\t}", "public function __toString()\n\t{\n\t\treturn $this->get(IL_CAL_DATETIME).'<br>';\n\t}", "public function buildMonth()\n\t{\n\t\t$this->orderedDays = $this->getDaysInOrder();\n\t\t\n\t\t$this->monthName = $this->months[ ltrim( $this->month, '0') ];\n\t\t\n\t\t// start of whichever month we are building\n\t\t$start_of_month = getdate( mktime(12, 0, 0, $this->month, 1, $this->year ) );\n\t\t\n\t\t$first_day_of_month = $start_of_month['wday'];\n\t\t\n\t\t$days = $this->startDay - $first_day_of_month;\n\t\t\n\t\tif( $days > 1 )\n\t\t{\n\t\t\t// get an offset\n\t\t\t$days -= 7;\n\t\t\t\n\t\t}\n\n\t\t$num_days = $this->daysInMonth($this->month, $this->year);\n\t\t// 42 iterations\n\t\t$start = 0;\n\t\t$cal_dates = array();\n\t\t$cal_dates_style = array();\n\t\t$cal_events = array();\n\t\twhile( $start < 42 )\n\t\t{\n\t\t\t// off set dates\n\t\t\tif( $days < 0 )\n\t\t\t{\n\t\t\t\t$cal_dates[] = '';\n\t\t\t\t$cal_dates_style[] = 'calendar-empty';\n\t\t\t\t$cal_dates_data[] = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif( $days < $num_days )\n\t\t\t\t{\n\t\t\t\t\t// real days\n\t\t\t\t\t$cal_dates[] = $days+1;\n\t\t\t\t\tif( in_array( $days+1, $this->daysWithEvents ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$cal_dates_style[] = 'has-events';\n\t\t\t\t\t\t$cal_dates_data[] = $this->data[ $days+1 ];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$cal_dates_style[] = '';\n\t\t\t\t\t\t$cal_dates_data[] = '';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// surplus\n\t\t\t\t\t$cal_dates[] = '';\n\t\t\t\t\t$cal_dates_style[] = 'calendar-empty';\n\t\t\t\t\t$cal_dates_data[] = '';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t// increment and loop\n\t\t\t$start++;\n\t\t\t$days++;\n\t\t}\n\t\t\n\t\t// done\n\t\t$this->dates = $cal_dates;\n\t\t$this->dateStyles = $cal_dates_style;\n\t\t$this->dateData = $cal_dates_data;\n\t}", "function buildDateString($date_array)\n{\n return $date_array[\"year\"].'-'.$date_array[\"mon\"].'-'.$date_array[\"mday\"];\n}", "public static function initialize_calendar(){\n \n $event_array[] = array();\n $schedules = \\App\\Event::get();\n if(!empty($schedules)){\n foreach($schedules as $schedule){\n $event_array[] = array(\n 'id' => uniqid(),\n 'title' => $schedule->description,\n 'start' => date('Y-m-d', strtotime($schedule->event_date)),\n 'end' => date('Y-m-d', strtotime($schedule->event_date)),\n 'color' => \"lightblue\",\n \"textEscape\"=> 'false' ,\n 'textColor' => 'black',\n );\n }\n return $get_schedule = json_encode($event_array);\n }\n }", "public function __toString()\n {\n return 'Event ' . $this->createCompositeIdentifier() . ': ' . $this->getTitleFromDisplayPattern();\n }" ]
[ "0.6605577", "0.63097054", "0.62160647", "0.60482085", "0.60088766", "0.58616114", "0.5816698", "0.5719844", "0.5700177", "0.5694095", "0.56782883", "0.56463045", "0.564268", "0.56420803", "0.5628636", "0.5597074", "0.55894953", "0.55884564", "0.55707496", "0.55680287", "0.55534434", "0.5547266", "0.5544385", "0.55325216", "0.5532276", "0.5497643", "0.54687214", "0.54459554", "0.5442252", "0.5431294" ]
0.6393743
1
Function to activeinactive record of table
function activeinactive() { $strquery = "UPDATE " . DB_PREFIX . "menu SET menu_active='n' WHERE menu_id in(" . $this->uncheckedids . ")"; $result = mysql_query($strquery) or die(mysql_error()); if($result == false) return ; $strquery = "UPDATE " . DB_PREFIX . "menu SET menu_active='y' WHERE menu_id in(" . $this->checkedids . ")"; return mysql_query($strquery) or die(mysql_error()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setInactive(){\n\t\t\t \t$this->isActive = false;\n\t\t\t \t$this->save();// Make sure the record is saved\n\t\t\t \t\n\t\t\t \t$token = random_text(5);\n\t\t\t \t$query = sprintf('INSERT INTO %sPENDING (USER_ID, TOKEN) VALUES (%d, \"%s\")', DB_TBL_PREFIX, $this->uid, $token);\n\t\t\t \treturn (mysql_query($query, $GLOBALS['DB'])) ? $token : false;\n\t\t\t }", "public function is_inactive(): bool;", "static function inactive($id) {\n $result = false;\n if (self::exists($id)) {\n $result = EmailmarketingCampaign::find($id)->fill(['active'=>0]);\n $result->update();\n }\n return $result;\n }", "function isActive() ;", "function query_finalize($instance){\r\n $instance->db->where(\"row_active\",1); \r\n}", "function getIsActive() ;", "function getActive() {return $this->_active;}", "public function inactiveAction()\n {\n $this->initialize();\n\n $all = $this->users->query()\n ->where('deleted IS NOT NULL')\n ->execute();\n \n $this->theme->setTitle(\"Users that are inactive\");\n $this->views->add('users/list-all', [\n 'users' => $all,\n 'title' => \"Users that are inactive\",\n ]);\n }", "public function userActiveDeactive() {\n if (func_num_args() > 0):\n $uid = func_get_arg(0);\n try {\n $data = array('status' => new Zend_DB_Expr('IF(status=1, 0, 1)'));\n $result = $this->update($data, 'user_id = \"' . $uid . '\"');\n } catch (Exception $e) {\n throw new Exception($e);\n }\n if ($result):\n return $result;\n else:\n return 0;\n endif;\n else:\n throw new Exception('Argument Not Passed');\n endif;\n }", "function getDiaryActive()\n\t{\n\t\t$query = $this->db->get_where('diary', array('activated' => 1 ));\n\t\treturn $query->row();\n\t}", "function toggle_active_site()\n{\n\t$this->db->where('id_table',0 );// there is just one row in table site with id \"0\"\n $query = $this->db->get('site');\n $row = $query->row();\n $active = $row->active;\nif ($active)\n{\n $data = array('active' => 0); \n}\nelse \n{\n $data = array('active' => 1); \n}\n \n\t$this->db->where('id_table',0 );\n\t$this->db->update('site', $data); \n}", "public function isActive($email){\r\n $this->db->query('SELECT * FROM users WHERE email = :email');\r\n $this->db->bind(':email', $email);\r\n \r\n if($row = $this->db->fetcher()){\r\n if($row['active'] == 1){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }\r\n else\r\n return false;\r\n}", "function active($uid,$st)\n {\n if($st==1)\n {\n $st=0;\n }\n else if($st==0)\n {\n $st=1;\n }\n $query=$this->db2->query(\"UPDATE registered_operators SET status='$st' WHERE id='$uid' \");\n if($query)\n {\n \n $query=$this->db2->query(\"select * from registered_operators where id='$uid'\");\n \n if($query->num_rows()>0)\n {\n \t foreach($query->result() as $rows)\n {\n \t //add all data to session\n $name = $rows->name;\n $username = $rows->user_name;\n\t\t $password = $rows->password;\n $emailid = $rows->email_id;\n $status = $rows->status;\n \n }\n $x=$this->mail_send($name,$username,$password,$emailid,$status);\n if($x){\n return 1;\n}\n }\n \n }\n else\n return 0;\n \n }", "public function get_account_active($acc_number)\n\t{\n\t return $this->db->select('active')\n\t\t ->from('pamm_accounts') \n\t\t ->where(\"login\",$acc_number)\n\t\t ->get()->result();\n\t}", "public function getActive(){\n return $this->active;\n }", "public function setInactive()\r\n {\r\n $this->active = false;\r\n }", "function _active($info)\n\t{\n\t // Gan trang thai xac thuc\n\t $data = array();\n\t $data['status'] = mod('order')->status('completed');\n\t\n\t // Cap nhat du lieu vao data\n\t model('user_bank')->update($info->id, $data);\n\t // Gui thong bao\n\t set_message(lang('notice_update_success'));\n\t return TRUE;\n\t}", "public function activeAction()\n {\n $all = $this->users->query()\n ->where('active IS NOT NULL')\n ->andWhere('deleted is NULL')\n ->execute();\n \n $this->theme->setTitle(\"Users that are active\");\n $this->views->add('users/list-all', [\n 'users' => $all,\n 'title' => \"Users that are active\",\n ]);\n }", "public function GetActive ();", "public function getInactive()\n\t{\n\n\t\tself::addArgument('courses', Course::inactives());\n\n\t\treturn self::make('inactive');\n\n\t}", "public static function inactiveMethod($oldID)\r\n\t {\r\n\t\t$sql = 'UPDATE payment_methods_assigned_to_users SET active=1 WHERE id = :id';\r\n\r\n\t\t$db = static::getDB();\r\n\t\t$stmt = $db->prepare($sql);\r\n\r\n\t\t$stmt->bindValue(':id', $oldID, PDO::PARAM_INT);\r\n\r\n $stmt->execute();\r\n\t }", "function update_record_status($id, $status, $table, $key) {\n\t$sql = \"UPDATE \".TB_PREF.$table.\" SET inactive = \"\n\t\t. ((int)$status).\" WHERE $key=\".db_escape($id);\n\t\t\n \tdb_query($sql, \"Can't update record status\");\n}", "public function isActive(){\n\t\treturn (!$this->isnewRecord and Yii::app()->periodo->HoyDentroDe($this->finicio,$this->ffinal));\n\n\t }", "public function notActive()\n {\n return $this->andWhere([User::tableName() . '.status' => User::STATUS_INACTIVE]);\n }", "public function isActive();", "public function isActive();", "public function isActive();", "public function isActive();", "public function getIsActiveAttribute(): bool\n {\n return is_null($this->{$this->getDeactivatedAtColumn()});\n }", "public function getIsActive() {}" ]
[ "0.64813167", "0.64483964", "0.6284378", "0.62711", "0.6210423", "0.6205292", "0.6148314", "0.61450946", "0.61382186", "0.61244506", "0.60486203", "0.60410243", "0.60225576", "0.60079765", "0.60000664", "0.60000163", "0.5987153", "0.5983046", "0.5969126", "0.5954788", "0.59448546", "0.59417814", "0.5935183", "0.5897572", "0.58943987", "0.58943987", "0.58943987", "0.58943987", "0.5894135", "0.58930707" ]
0.666399
0
method to dump the current locale/encoding settings to string
public function __toString () { return (string) $this->getLocaleAndEncoding(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __toString()\n {\n return $this->getLocale();\n }", "protected function setUtf8Context()\n {\n setlocale(LC_ALL, $locale = 'en_US.UTF-8');\n putenv('LC_ALL=' . $locale);\n }", "function __toString(){\n\t\treturn \"UTF-8\";\n\t}", "protected static function encoding()\n {\n return static::$encoding;\n }", "public function getLocale(): string;", "public function getLocale(): string;", "public function getLocale(): string;", "protected function setUtf8Context()\n {\n $locale = 'en_US.UTF-8';\n setlocale(LC_ALL, $locale);\n putenv('LC_ALL=' . $locale);\n }", "public function locale();", "function restore_current_locale()\n {\n }", "public function getLocale() {}", "function default_locale()\n{\n return Config::getDefaultLocale();\n}", "public function getLocale(): string\n {\n return $this['config']->get('app.locale');\n }", "public static function locale(): string\n {\n // in the end to handle that case\n return Arr::get(config('currencies'), strtolower(static::currency()).'.locale', 'en_US') ?? 'en_US';\n }", "public function getLocale(): string\n {\n return (string) $this->locale;\n }", "public function get_switched_locale()\n {\n }", "function getLocale();", "function getEncoding(): string\n {\n return $this->getEncodingInfo()['encoding'];\n }", "protected function getLocale()\n {\n return Mage::getStoreConfig('payment/gene_braintree_paypal/locale');\n }", "function determine_locale()\n {\n }", "public function getLocale();", "public function getLocale();", "public function getLocale() : string\n {\n return $this->locale;\n }", "public function getConfigToString() {\n return serialize($this->_options);\n }", "public function restore_current_locale()\n {\n }", "protected function _writeLocale()\n {\n $text = $this->_tpl['locale'];\n \n $file = $this->_class_dir . DIRECTORY_SEPARATOR . \"/Locale/en_US.php\";\n if (file_exists($file)) {\n $this->_outln('Locale file exists.');\n } else {\n $this->_outln('Writing locale file.');\n file_put_contents($file, $text);\n }\n }", "public function get_encoding()\n {\n }", "public function getEncoding(): string;", "function database_encoding(){\r\n\t$default = \"WIN1252\";\r\n\tif(strlen($_SESSION[\"DATABASE_ENCODING\"]) === 0){\r\n\t\t$file_name = dirname($_SERVER[\"SCRIPT_FILENAME\"]).str_repeat(\"/..\", substr_count($_SERVER[\"SCRIPT_NAME\"], \"/\") - 2).\"/support/config.ini\";\r\n\t\tif(file_exists($file_name)){\r\n\t\t\t$ini = parse_ini_file($file_name);\r\n\t\t\tif(strlen($ini[\"dbenco\"]) > 0){\r\n\t\t\t\t$_SESSION[\"DATABASE_ENCODING\"] = $ini[\"dbenco\"];\r\n\t\t\t}else{\r\n\t\t\t\t$_SESSION[\"DATABASE_ENCODING\"] = $default;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$_SESSION[\"DATABASE_ENCODING\"] = $default;\r\n\t\t}\r\n\t}\r\n\treturn strtoupper($_SESSION[\"DATABASE_ENCODING\"]);\r\n}", "public function getLocale(): string\n {\n return $this->locale;\n }" ]
[ "0.61512303", "0.5964438", "0.59439087", "0.5921155", "0.5865788", "0.5865788", "0.5865788", "0.58548486", "0.58451104", "0.58379936", "0.5772596", "0.57654315", "0.57466245", "0.5735721", "0.57076937", "0.56986123", "0.5679039", "0.56492466", "0.5648888", "0.5609941", "0.5586205", "0.5586205", "0.55784214", "0.55767936", "0.55764157", "0.554395", "0.5518271", "0.5511303", "0.5464853", "0.5462679" ]
0.6692407
0
MakeMsg() End / Make Cancel Msg
function MakeCancelMsg() { $this->log->WriteLog( INFO, "Make Cancel Msg Start" ); if( strcmp( $this->REQUEST["AuthTy"], "card" ) == 0 ) { if( strcmp( $this->REQUEST["SubTy"], "isp" ) == 0 ) { /**************************************************************************** * * [1-1] 신용카드승인취소 - ISP * * -- 이부분은 취소 승인 처리를 위해 PG서버Process와 Socket통신하는 부분이다. * 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다. * -- 데이터 길이는 매뉴얼 참고 * * -- 취소 승인 요청 전문 포멧 * + 데이터길이(6) + 암호화여부(1) + 데이터 * + 데이터 포멧(데이터 구분은 "|"로 한다. * 결제종류(6) | 업체아이디(20) | 승인번호(20) | 승인시간(8) | 거래고유번호(6) | * * -- 취소 승인 응답 전문 포멧 * + 데이터길이(6) + 데이터 * + 데이터 포멧(데이터 구분은 "|"로 한다. * 업체ID(20) | 승인번호(20) | 승인시각(8) | 전문코드(4) | 거래고유번호(6) | 성공여부(1) | * ****************************************************************************/ $this->ENCTYPE = 2; /**************************************************************************** * * 전송 전문 Make * ****************************************************************************/ $this->sDataMsg = $this->ENCTYPE. "cancel"."|". $this->GetResult("StoreId")."|". $this->GetResult("rApprNo")."|". substr($this->GetResult("rApprTm"),0,8)."|". $this->GetResult("rDealNo")."|". $this->GetResult("NetCancID")."|"; $this->sSendMsg = sprintf( "%06d%s", strlen( $this->sDataMsg ), $this->sDataMsg ); $this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]."-".$this->REQUEST["SubTy"]." "."Make Cancel MSG OK " ); } else if( ( strcmp( $this->REQUEST["SubTy"], "visa3d" ) == 0 ) || ( strcmp( $this->REQUEST["SubTy"], "normal" ) == 0 ) ) { /**************************************************************************** * * [1-2] 신용카드승인취소 - VISA3D, 일반 * * -- 이부분은 취소 승인 처리를 위해 암호화Process와 Socket통신하는 부분이다. * 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다. * * -- 취소 승인 요청 전문 포멧 * + 데이터길이(6) + 암호화여부(1) + 데이터 * + 데이터 포멧(데이터 구분은 "|"로 하며 카드번호,유효기간,비밀번호,주민번호는 암호화된다.) * 결제종류(6) | 업체아이디(20) | 승인번호(8) | 승인시간(14) | 카드번호(16) | * * -- 취소 승인 응답 전문 포멧 * + 데이터길이(6) + 데이터 * + 데이터 포멧(데이터 구분은 "|"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다. * 업체ID(20) | 승인번호(8) | 승인시각(14) | 전문코드(4) | 성공여부(1) | * 주문번호(20) | 할부개월(2) | 결제금액(20) | 카드사명(20) | 카드사코드(4) | * 가맹점번호(15) | 매입사코드(4) | 매입사명(20) | 전표번호(6) * ****************************************************************************/ $this->ENCTYPE = 0; /**************************************************************************** * * 전송 전문 Make * ****************************************************************************/ $this->sDataMsg = $this->ENCTYPE. "cancel"."|". $this->GetResult("StoreId")."|". $this->GetResult("rApprNo")."|". substr($this->GetResult("rApprTm"),0,8)."|". $this->GetResult("rDealNo")."|". $this->GetResult("NetCancID")."|"; $this->sSendMsg = sprintf( "%06d%s", strlen( $this->sDataMsg ), $this->sDataMsg ); $this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]."-".$this->REQUEST["SubTy"]." "."Make Cancel MSG OK " ); } }else if( strcmp( $this->REQUEST["AuthTy"], "iche" ) == 0 && strcmp( $this->REQUEST["ICHE_SOCKETYN"], "Y" ) == 0){ /**************************************************************************** * * [2-1] 인터넷뱅킹 계좌이체(소켓) 취소처리 * * -- 이부분은 인터넷뱅킹 결제 취소처리를 위해 암호화Process와 Socket통신하는 부분이다. * 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다. * -- 데이터 길이는 매뉴얼 참고 * * -- 인터넷뱅킹 결제 요청 전문 포멧 * + 데이터길이(6) + 암호화여부(1) + 데이터 * + 데이터 포멧(데이터 구분은 "|"로 한다.) * 결제종류(10) | 업체ID(20) | MTID(계좌이체결제 결과값) | 결제금액(8) | 은행코드(2) * ****************************************************************************/ $this->ENCTYPE = R; /**************************************************************************** * * 전송 전문 Make * ****************************************************************************/ $this->sDataMsg = $this->ENCTYPE. "RB-CanReq"."|". $this->GetResult("StoreId")."|". $this->GetResult("ICHE_POSMTID")."|". $this->GetResult("Amt")."|". $this->GetResult("ICHE_OUTBANKNAME")."|". $this->GetResult("NetCancID")."|"; $this->sSendMsg = sprintf( "%06d%s", strlen( $this->sDataMsg ), $this->sDataMsg ); $this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."Make Cancel MSG OK " ); }else if( strcmp( $this->REQUEST["AuthTy"], "iche" ) == 0 && strcmp( $this->REQUEST["ICHEARS_SOCKETYN"], "Y" ) == 0){ /**************************************************************************** * * [2-1] 텔레뱅킹 계좌이체(소켓) 취소처리 * * -- 이부분은 텔레뱅킹 결제 취소처리를 위해 암호화Process와 Socket통신하는 부분이다. * 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다. * -- 데이터 길이는 매뉴얼 참고 * * -- 텔레뱅킹 결제 요청 전문 포멧 * + 데이터길이(6) + 암호화여부(1) + 데이터 * + 데이터 포멧(데이터 구분은 "|"로 한다.) * 결제종류(10) | 업체ID(20) | MTID(계좌이체결제 결과값) | 결제금액(8) | 은행코드(2) * ****************************************************************************/ $this->ENCTYPE = B; /**************************************************************************** * * 전송 전문 Make * ****************************************************************************/ $this->sDataMsg = $this->ENCTYPE. "TB-CanReq"."|". $this->GetResult("StoreId")."|". ""."|". ""."|". $this->GetResult("NetCancID")."|"; $this->sSendMsg = sprintf( "%06d%s", strlen( $this->sDataMsg ), $this->sDataMsg ); $this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."Make Cancel MSG OK " ); }else if( strcmp( $this->REQUEST["AuthTy"], "hp" ) == 0 ){ /**************************************************************************** * * [3] 핸드폰 취소처리 * * -- 이부분은 핸드폰 결제 취소처리를 위해 암호화Process와 Socket통신하는 부분이다. * 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다. * -- 데이터 길이는 매뉴얼 참고 * * -- 핸드폰 결제 요청 전문 포멧 * + 데이터길이(6) + 암호화여부(1) + 데이터 * + 데이터 포멧(데이터 구분은 "|"로 한다.) * 결제종류(10) | 업체ID(20) | NetCancID | * ****************************************************************************/ $this->ENCTYPE = H; /**************************************************************************** * * 전송 전문 Make * ****************************************************************************/ $this->sDataMsg = $this->ENCTYPE. "MobileCanReq"."|". $this->GetResult("StoreId")."|". $this->GetResult("NetCancID")."|"; $this->sSendMsg = sprintf( "%06d%s", strlen( $this->sDataMsg ), $this->sDataMsg ); $this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."Make Cancel MSG OK " ); }else if( strcmp( $this->REQUEST["AuthTy"], "ars" ) == 0 ){ /**************************************************************************** * * [4] ARS 취소처리 * * -- 이부분은 ARS 결제 취소처리를 위해 암호화Process와 Socket통신하는 부분이다. * 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다. * -- 데이터 길이는 매뉴얼 참고 * * -- ARS 결제 요청 전문 포멧 * + 데이터길이(6) + 암호화여부(1) + 데이터 * + 데이터 포멧(데이터 구분은 "|"로 한다.) * 결제종류(10) | 업체ID(20) | NetCancID | * ****************************************************************************/ $this->ENCTYPE = A; /**************************************************************************** * * 전송 전문 Make * ****************************************************************************/ $this->sDataMsg = $this->ENCTYPE. "ARSCanReq"."|". $this->GetResult("StoreId")."|". $this->GetResult("NetCancID")."|"; $this->sSendMsg = sprintf( "%06d%s", strlen( $this->sDataMsg ), $this->sDataMsg ); $this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."Make Cancel MSG OK " ); }else{ //신용카드,계좌이체 이외의 결제수단은 취소기능 적용되지 않음. $this->log->WriteLog( WARN, "Cancel Passed. AuthTy : [".$this->REQUEST["AuthTy"]."-".$this->REQUEST["SubTy"]."] " ); $this->RESULT["rCancelSuccYn"] = "n"; $this->RESULT["rCancelResMsg"] = "Cannot Cancel AuthTy[".$this->REQUEST["AuthTy"]."]"; return false; } $this->log->WriteLog( INFO, "Make Cancel Msg End" ); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cancel();", "public static function messageBox(string $msg, string $caption = 'Message') : void\n {\n // to show object data, use var_export (similar to var_dump):\n // \\Flexio\\System\\Program::messageBox(var_export($validation_info,true));\n\n if (\\Flexio\\System\\System::isPlatformWindows())\n {\n $wsh_shell = new \\COM('WScript.Shell');\n $wsh_shell->Popup($msg, 0, $caption, 0x1040);\n }\n }", "function smarty_function_wbs_messageBox( $params, &$this )\r\n{\r\n\textract($params);\r\n\r\n\t$mbClass = null;\r\n\r\n\tswitch ( $type ) {\r\n\t\tcase 0 : $mbClass = \"MessageBoxStop\"; break;\r\n\t\tcase 1 : $mbClass = \"MessageBoxInformation\"; break;\r\n\t\tcase 2 : $mbClass = \"MessageBoxExclamation\"; break;\r\n\t}\r\n\r\n\t$result = \"<dl class=\\\"MessageBox $mbClass\\\">\\n\";\r\n\t$result .= \"\t<dt>$message</dt>\\n\";\r\n\t$result .= \"\t<dd>$note</dd>\\n\";\r\n\t$result .= \"</dl>\\n\";\r\n\r\n\treturn $result;\r\n}", "public function actionPrompt($msg=null){\n //$this->prompt('xx'); // biaa enter tanpa masukan variable\n // $this->prompt('xx',['required'=>true]); // harus masukan variable input\n $this->prompt('masukan message : ',['validator'=>function($input, $error){ //echo $input . gettype($input);\n if(strlen($input) >=2 ){\n $this->msg = $input;\n return true;\n }\n else echo 'lenght value must be great than 2 char - ';\n }, 'required'=>true]); // masukan variable input optional, set required for valid.\n \n echo \"message : $this->msg\" .\"(\". gettype($this->msg) .\")\";\n }", "public function cancel()\n {\n $message = new MailMessage;;\n $message->greeting(\"Hi {$this->post->user->name}!\");\n $message->line(\"The post {$this->post->titile} has been cancelled successfully.\"); \n foreach ($this->workflow as $key => $value) {\n if ($key == 0) {\n $message->action($value->action, url('workflows/workflow/' . $value->id));\n continue;\n }\n $message->line('<a href=\"'.url('workflows/workflow/' . $value->id).'\">'.$value->action.'</a>');\n }\n\n return $message;\n }", "public function actionCancel()\n {\n }", "public function cancel(): void;", "function cancelar()\r\n\t{\r\n\t\t$this->_log->debug( $this->get_txt() . \"[ cancelar ]\", 'toba');\r\n\t\t$this->limpiar_memoria();\r\n\t}", "function ParseCancelMsg() \n\t{\n\t\t$this->log->WriteLog( INFO, \"Parse Cancel Msg Start\" );\n\t\tif( strcmp( $this->REQUEST[\"AuthTy\"], \"card\" ) == 0 )\n\t\t{\n\t\t\tif( strcmp( $this->REQUEST[\"SubTy\"], \"isp\" ) == 0 )\n\t\t\t{\n\t\t\t\t/* [1-1] 안전결제ISP 처리 */\t\t\t\t\t\n\n\t\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[0];\n\t\t\t\t$this->RESULT[\"rApprNo\"] = $this->RecvValArray[1];\n\t\t\t\t$this->RESULT[\"rApprTm\"] = $this->RecvValArray[2];\n\t\t\t\t$this->RESULT[\"rBusiCd\"] = $this->RecvValArray[3];\n\t\t\t\t$this->RESULT[\"rDealNo\"] = $this->RecvValArray[4];\n\t\t\t\t$this->RESULT[\"rCancelSuccYn\"] = $this->RecvValArray[5];\n\t\t\t\t$this->RESULT[\"rCancelResMsg\"] = $this->RecvValArray[6];\n\t\t\t\t\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\"-\".$this->REQUEST[\"SubTy\"].\" \".\"RECV MSG Parsing OK \" );\n\t\t\t}\n\t\t\telse if( ( strcmp( $this->REQUEST[\"SubTy\"], \"visa3d\" ) == 0 ) || ( strcmp( $this->REQUEST[\"SubTy\"], \"normal\" ) == 0 ) )\n\t\t\t{\n\t\t\t\t/* [1-2] 안심클릭 or 일반결제 처리 */\t\n\t\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[0];\n\t\t\t\t$this->RESULT[\"rApprNo\"] = $this->RecvValArray[1];\n\t\t\t\t$this->RESULT[\"rApprTm\"] = $this->RecvValArray[2];\n\t\t\t\t$this->RESULT[\"rBusiCd\"] = $this->RecvValArray[3];\n\t\t\t\t$this->RESULT[\"rCancelSuccYn\"] = $this->RecvValArray[4];\n\t\t\t\t$this->RESULT[\"rOrdNo\"] = $this->RecvValArray[5];\n\t\t\t\t$this->RESULT[\"rInstmt\"] = $this->RecvValArray[6];\n\t\t\t\t$this->RESULT[\"rAmt\"] = $this->RecvValArray[7];\n\t\t\t\t$this->RESULT[\"rCardNm\"] = $this->RecvValArray[8];\n\t\t\t\t$this->RESULT[\"rCardCd\"] = $this->RecvValArray[9];\n\t\t\t\t$this->RESULT[\"rMembNo\"] = $this->RecvValArray[10];\n\t\t\t\t$this->RESULT[\"rAquiCd\"] = $this->RecvValArray[11];\n\t\t\t\t$this->RESULT[\"rAquiNm\"] = $this->RecvValArray[12];\n\t\t\t\t$this->RESULT[\"rDealNo\"] = $this->RecvValArray[13];\n\n\t\t\t\tif($this->RESULT[\"rCancelSuccYn\"] == \"y\")\n\t\t\t\t{\n\t\t\t\t\t$this->RESULT[\"rCancelResMsg\"] = \"정상취소\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->RESULT[\"rCancelResMsg\"] = \"취소실패\";\n\t\t\t\t}\n\n\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\"-\".$this->REQUEST[\"SubTy\"].\" \".\"RECV MSG Parsing OK \" );\n\t\t\t}\n\t\t\n\t\t}\n\t\telse if( strcmp( $this->REQUEST[\"AuthTy\"], \"iche\" ) == 0 && strcmp( $this->REQUEST[\"ICHE_SOCKETYN\"], \"Y\" ) == 0)\n\t\t{\n\t\t\t/* [2-1] 계좌이체 인터넷뱅킹 취소*/\t\n\t\t\t/* \t[RB-CanRes|상점ID|posmTid|주문번호|y|취소성공|] */\n\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[1];\n\t\t\t$this->RESULT[\"ICHE_POSMTID\"] = $this->RecvValArray[2];\n\t\t\t$this->RESULT[\"rOrdNo\"] = $this->RecvValArray[3];\n\t\t\t$this->RESULT[\"rCancelSuccYn\"] = $this->RecvValArray[4];\n\t\t\t$this->RESULT[\"rCancelResMsg\"] = $this->RecvValArray[5];\t\t\t\t\n\n\t\t}\n\t\telse if( strcmp( $this->REQUEST[\"AuthTy\"], \"iche\" ) == 0 && strcmp( $this->REQUEST[\"ICHEARS_SOCKETYN\"], \"Y\" ) == 0)\n\t\t{\n\t\t\t/* [2-2] 계좌이체 텔레뱅킹 취소*/\t\n\t\t\t/* \t[TB-CanRes|상점ID|posmTid|주문번호|y|취소성공|] */\n\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[1];\n\t\t\t$this->RESULT[\"rMTid\"] = $this->RecvValArray[2];\n\t\t\t$this->RESULT[\"rCancelSuccYn\"] = $this->RecvValArray[3];\n\t\t\t$this->RESULT[\"rCancelResMsg\"] = $this->RecvValArray[4];\t\t\t\t\t\t\n\t\t\t\n\t\t}\n\t\telse if( strcmp( $this->REQUEST[\"AuthTy\"], \"hp\" ) == 0 )\n\t\t{\n\t\t\t/****************************************************************************\n\t\t\t*\n\t\t\t* [4] 핸드폰 결제 취소\n\t\t\t*\n\t\t\t* -- 취소 응답 전문 포멧\n\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다.\n\t\t\t* |\tMobileCanRes\t|\t업체ID(20)\t| 성공여부(1)\t|\t결과메세지\t|\t취소처리일시\t|\t이용기관주문번호\t|\n\t\t\t*\t\t \n\t\t\t****************************************************************************/\n\t\t\t\n\t\t\t/* \t[MobileCanRes|상점ID|결과(y/n)|결과메세지|취소일시|이용기관주문번호|] */\n\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[1];\n\t\t\t$this->RESULT[\"rCancelSuccYn\"] = $this->RecvValArray[2];\n\t\t\t$this->RESULT[\"rCancelResMsg\"] = $this->RecvValArray[3];\n\t\t\t$this->RESULT[\"rCancelDate\"] = $this->RecvValArray[4];\n\t\t\t$this->RESULT[\"rTid\"] = $this->RecvValArray[5];\t\t\t\t\t\t\n\t\t\t\n\t\t}\n\t\telse if( strcmp( $this->REQUEST[\"AuthTy\"], \"ars\" ) == 0 )\n\t\t{\n\t\t\t/****************************************************************************\n\t\t\t*\n\t\t\t* [5] ARS 결제 취소\n\t\t\t*\n\t\t\t* -- 취소 응답 전문 포멧\n\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다.\n\t\t\t* |\tArsCanRes\t|\t업체ID(20)\t| 성공여부(1)\t|\t결과메세지\t|\t취소처리일시\t|\t이용기관주문번호\t|\n\t\t\t*\t\t \n\t\t\t****************************************************************************/\n\t\t\t\n\t\t\t/* \t[ArsCanRes|상점ID|결과(y/n)|결과메세지|취소일시|이용기관주문번호|] */\n\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[1];\n\t\t\t$this->RESULT[\"rCancelSuccYn\"] = $this->RecvValArray[2];\n\t\t\t$this->RESULT[\"rCancelResMsg\"] = $this->RecvValArray[3];\n\t\t\t$this->RESULT[\"rCancelDate\"] = $this->RecvValArray[4];\n\t\t\t$this->RESULT[\"rTid\"] = $this->RecvValArray[5];\t\t\t\t\t\t\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"Parse CancelMSG Passed \" );\n\t\t\t$this->RESULT[\"rCancelSuccYn\"] = \"n\";\n\t\t\t$this->RESULT[\"rCancelResMsg\"] = \"Cannot Cancel AuthTy[\".$this->REQUEST[\"AuthTy\"].\"]\";\t\n\t\t\treturn false;\n\t\t}\n\t\t$this->log->WriteLog( INFO, \"Parse Cancel Msg End\" );\n\t\treturn true;\n\t}", "public function cancel(): int;", "function refus($msg) {\n echo \"<b><font color=red>$msg</font></b><br>\";\n echo \"Action non commenc�e; rectifier les conditions initiales avant de reprendre<br>\";\n}", "public function cancel()\n {\n }", "public function cancel()\n {\n }", "function kill($msg = NULL, $backtrace = FALSE) {\n\t\tglobal $pommo;\n\t\t\n\t\t// output passed message\n\t\tif ($msg || !ob_get_length()) {\n\t\t\t\n\t\t\tif (empty($pommo->_workDir)) {\n\t\t\t\techo ('<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">');\n\t\t\t\techo ('<title>poMMo - Erreur</title>'); // Very basics added for valid output\n\t\t\t\techo '<div><img src=\"' . $pommo->_baseUrl . 'themes/shared/images/icons/alert.png\" alt=\"alert icon\" style=\"vertical-align: middle; margin-right: 20px;\"/> ' . $msg . '</div>';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$logger =& $pommo->_logger;\n\t\t\t\t$logger->addErr($msg);\n\t\t\t\tPommo::requireOnce($pommo->_baseDir.'inc/classes/template.php');\n\t\t\t\t$smarty = new PommoTemplate();\n\t\t\t\t$smarty->assign('fatalMsg',TRUE);\n\t\t\t\t$smarty->display('message.tpl');\n\t\t\t}\t\n\t\t}\n\t\t\n\t\t// output debugging info if enabled (in config.php)\n\t\tif ($pommo->_debug) {\n\t\t\tif (is_object($pommo)) {\n\t\t\t\tPommo::requireOnce($pommo->_baseDir . 'inc/helpers/debug.php');\n\t\t\t\t$debug = new PommoHelperDebug();\n\t\t\t\t$debug->bmDebug();\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($backtrace) {\n\t\t\t$backtrace = debug_backtrace();\n\t\t\techo @ '<h2>BACKTRACE</h2>'\n\t\t\t\t.'<p>'.@str_ireplace($pommo->_baseDir,'',$backtrace[1]['file']).':'.$backtrace[1]['line'].' '.$backtrace[1]['function'].'()</p>'\n\t\t\t\t.'<p>'.@str_ireplace($pommo->_baseDir,'',$backtrace[2]['file']).' '.$backtrace[2]['function'].'()</p>'\n\t\t\t\t.'<p>'.@str_ireplace($pommo->_baseDir,'',$backtrace[3]['file']).' '.$backtrace[3]['function'].'()</p>';\n\t\t}\n\n\t\t// print and clear output buffer\n\t\tob_end_flush();\n\t\t\n\t\t// kill script\n\t\tdie();\n\t}", "public static function message($title, $msg, $type = 'info', $noClose = false) {\n self::$msgCount++;\n\n if ($noClose) {\n return '<div id=\"EP_message_' . self::$msgCount . '\" class=\"message ' . $type . '\">' .\n '<div class=\"msg\"><h2>' . $title . '</h2><p>' . $msg . '</p></div>' .\n '</div><br clear=\"all\"/>';\n } else {\n return '<div id=\"EP_message_' . self::$msgCount . '\" class=\"message ' . $type . '\">' .\n '<div class=\"msg\"><h2>' . $title . '</h2><p>' . $msg . '</p></div>' .\n '<a href=\"#\" onclick=\"$(\\'EP_message_' . self::$msgCount . '\\').remove(); return false;\"' .\n ' class=\"messageclose\"><span>X</span></a></div><br clear=\"all\"/>';\n }\n }", "protected function creaFeedbackUtente(&$msg, $vd, $okMsg) {\n\n\n //se l'array dei messaggi non è voto quindi c'è qualche errore\n if (!empty($msg)) {\n\n $error = \"Si sono verificati i seguenti errori: <br>\";\n\n foreach ($msg as $m) {\n $error = $error . '- ' . $m . \"<br><br>\";\n }\n\n // imposta il messaggio di errore\n $vd->setMessaggioErrore($error);\n\n } \n // altrimenti non ci sono errori quindi mostro il messaggio \n // di conferma passato alla funzione\n else{\n \n $vd->setMessaggioConferma($okMsg);\n } \n }", "public function cancelled()\n {\n \n $this->alert('info', 'Understood');\n }", "public function cancelled()\n {\n \n $this->alert('info', 'Understood');\n }", "public static function message($sMsg)\n {\n // Inclusion of the HTML Message page\n include PH7_PATH_SYS . 'global/views/' . PH7_DEFAULT_THEME . '/other/msg.html.php';\n\n // Stop script\n exit;\n }", "public function message()\n {\n return 'You can not cancel this session, please check cancellation policy.';\n }", "public function getCancelledMessage(){\n \treturn $this->canc_message;\n }", "public function contactoCancelar( ) {\n $this->setComando(\"CONTACTOS\",\"CANCELAR\");\n }", "function defaultMessage($title, $msg) {\n\n\t\t$r = '\n\t\t<button class=\"btn btn-primary btn-lg\" data-toggle=\"modal\" data-target=\"#myModal\">\n\t\t Launch demo modal\n\t\t</button>\n\t\t<div class=\"modal fade\" id=\"myModal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"false\">\n\t\t\t<div class=\"modal-dialog\">\n\t\t\t\t<div class=\"modal-content\">\n\t\t\t\t\t<div class=\"modal-header\">\n\t\t\t\t\t\t<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"false\">&times;</button>\n\t\t\t\t\t\t<h4 class=\"modal-title\" id=\"myModalLabel\">'.$title.'</h4>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"modal-body\">\n\t\t\t\t\t\t'.$msg.'\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"modal-footer\">\n\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t';\n\n\t\t//echo '<div class=\"defaultMessage\"><p>'.$msg.'</p><input id=\"defaultMessageClose\" type=\"button\" value=\"close\" /></div>';\n\t\techo $r;\n\t}", "private function cancelConfirmation()\n {\n Chat::$bot->editMessageText([\n 'text' => 'channel removing confirmation canceled',\n 'inline_message_id' => Chat::getCallBackQuery()->getInlineMessageId()\n ]);\n }", "function msgbox($caption, $message) {\n\treturn \"<fieldset class=\\\"msgbox\\\"><legend>\" .\n\t\t\"<img src=\\\"../images/huh.png\\\" class=\\\"picto\\\" alt=\\\"?\\\" /> \" .\n\t\t$caption . \"</legend>\\n\" .\n\t\t$message .\n\t\t\"</fieldset>\\n\\n\";\n}", "function taglinMsg()\n\t{\n/*:TODO*/\n\n\t}", "public function actionCancelconvert() {\n if (!empty($_POST['id']))\n {\n\t CConvertQueue::model()->deleteUserQueue($this->user_id, $_POST['id']);\n }\n }", "protected function cancel(): void\n {\n }", "public function msg($msg);", "static public function ctrBorrarMensaje(){\n\n\t\t\tif(isset($_GET[\"idMensaje\"])){\n\n\t\t\t\t$tabla = \"mensajes\";\n\t\t\t\t$datos = $_GET[\"idMensaje\"];\n\n\t\t\t\t$respuesta = ModeloMensajes::mdlBorrarMensaje($tabla, $datos);\n\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo '<script>\n\n\t\t\t\t\t\tswal({\n\n\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\ttitle: \"¡El mensaje se ha borrado correctamente!\",\n\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t\t}).then((result)=>{\n\n\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\twindow.location = \"mensaje\";\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}" ]
[ "0.5731914", "0.5690395", "0.5517218", "0.5479081", "0.5478776", "0.54496837", "0.53853995", "0.53562933", "0.5350993", "0.53453493", "0.531666", "0.52889264", "0.52889264", "0.5254482", "0.5223262", "0.5201813", "0.5188008", "0.5188008", "0.51671016", "0.51656365", "0.5107034", "0.50962615", "0.50744754", "0.50512177", "0.50488245", "0.5028447", "0.4998711", "0.49974036", "0.49870077", "0.4959248" ]
0.62680733
0
ParseMsg() End / RecvCancelMsg Parsing
function ParseCancelMsg() { $this->log->WriteLog( INFO, "Parse Cancel Msg Start" ); if( strcmp( $this->REQUEST["AuthTy"], "card" ) == 0 ) { if( strcmp( $this->REQUEST["SubTy"], "isp" ) == 0 ) { /* [1-1] 안전결제ISP 처리 */ $this->RESULT["rStoreId"] = $this->RecvValArray[0]; $this->RESULT["rApprNo"] = $this->RecvValArray[1]; $this->RESULT["rApprTm"] = $this->RecvValArray[2]; $this->RESULT["rBusiCd"] = $this->RecvValArray[3]; $this->RESULT["rDealNo"] = $this->RecvValArray[4]; $this->RESULT["rCancelSuccYn"] = $this->RecvValArray[5]; $this->RESULT["rCancelResMsg"] = $this->RecvValArray[6]; $this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]."-".$this->REQUEST["SubTy"]." "."RECV MSG Parsing OK " ); } else if( ( strcmp( $this->REQUEST["SubTy"], "visa3d" ) == 0 ) || ( strcmp( $this->REQUEST["SubTy"], "normal" ) == 0 ) ) { /* [1-2] 안심클릭 or 일반결제 처리 */ $this->RESULT["rStoreId"] = $this->RecvValArray[0]; $this->RESULT["rApprNo"] = $this->RecvValArray[1]; $this->RESULT["rApprTm"] = $this->RecvValArray[2]; $this->RESULT["rBusiCd"] = $this->RecvValArray[3]; $this->RESULT["rCancelSuccYn"] = $this->RecvValArray[4]; $this->RESULT["rOrdNo"] = $this->RecvValArray[5]; $this->RESULT["rInstmt"] = $this->RecvValArray[6]; $this->RESULT["rAmt"] = $this->RecvValArray[7]; $this->RESULT["rCardNm"] = $this->RecvValArray[8]; $this->RESULT["rCardCd"] = $this->RecvValArray[9]; $this->RESULT["rMembNo"] = $this->RecvValArray[10]; $this->RESULT["rAquiCd"] = $this->RecvValArray[11]; $this->RESULT["rAquiNm"] = $this->RecvValArray[12]; $this->RESULT["rDealNo"] = $this->RecvValArray[13]; if($this->RESULT["rCancelSuccYn"] == "y") { $this->RESULT["rCancelResMsg"] = "정상취소"; } else { $this->RESULT["rCancelResMsg"] = "취소실패"; } $this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]."-".$this->REQUEST["SubTy"]." "."RECV MSG Parsing OK " ); } } else if( strcmp( $this->REQUEST["AuthTy"], "iche" ) == 0 && strcmp( $this->REQUEST["ICHE_SOCKETYN"], "Y" ) == 0) { /* [2-1] 계좌이체 인터넷뱅킹 취소*/ /* [RB-CanRes|상점ID|posmTid|주문번호|y|취소성공|] */ $this->RESULT["rStoreId"] = $this->RecvValArray[1]; $this->RESULT["ICHE_POSMTID"] = $this->RecvValArray[2]; $this->RESULT["rOrdNo"] = $this->RecvValArray[3]; $this->RESULT["rCancelSuccYn"] = $this->RecvValArray[4]; $this->RESULT["rCancelResMsg"] = $this->RecvValArray[5]; } else if( strcmp( $this->REQUEST["AuthTy"], "iche" ) == 0 && strcmp( $this->REQUEST["ICHEARS_SOCKETYN"], "Y" ) == 0) { /* [2-2] 계좌이체 텔레뱅킹 취소*/ /* [TB-CanRes|상점ID|posmTid|주문번호|y|취소성공|] */ $this->RESULT["rStoreId"] = $this->RecvValArray[1]; $this->RESULT["rMTid"] = $this->RecvValArray[2]; $this->RESULT["rCancelSuccYn"] = $this->RecvValArray[3]; $this->RESULT["rCancelResMsg"] = $this->RecvValArray[4]; } else if( strcmp( $this->REQUEST["AuthTy"], "hp" ) == 0 ) { /**************************************************************************** * * [4] 핸드폰 결제 취소 * * -- 취소 응답 전문 포멧 * + 데이터길이(6) + 데이터 * + 데이터 포멧(데이터 구분은 "|"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다. * | MobileCanRes | 업체ID(20) | 성공여부(1) | 결과메세지 | 취소처리일시 | 이용기관주문번호 | * ****************************************************************************/ /* [MobileCanRes|상점ID|결과(y/n)|결과메세지|취소일시|이용기관주문번호|] */ $this->RESULT["rStoreId"] = $this->RecvValArray[1]; $this->RESULT["rCancelSuccYn"] = $this->RecvValArray[2]; $this->RESULT["rCancelResMsg"] = $this->RecvValArray[3]; $this->RESULT["rCancelDate"] = $this->RecvValArray[4]; $this->RESULT["rTid"] = $this->RecvValArray[5]; } else if( strcmp( $this->REQUEST["AuthTy"], "ars" ) == 0 ) { /**************************************************************************** * * [5] ARS 결제 취소 * * -- 취소 응답 전문 포멧 * + 데이터길이(6) + 데이터 * + 데이터 포멧(데이터 구분은 "|"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다. * | ArsCanRes | 업체ID(20) | 성공여부(1) | 결과메세지 | 취소처리일시 | 이용기관주문번호 | * ****************************************************************************/ /* [ArsCanRes|상점ID|결과(y/n)|결과메세지|취소일시|이용기관주문번호|] */ $this->RESULT["rStoreId"] = $this->RecvValArray[1]; $this->RESULT["rCancelSuccYn"] = $this->RecvValArray[2]; $this->RESULT["rCancelResMsg"] = $this->RecvValArray[3]; $this->RESULT["rCancelDate"] = $this->RecvValArray[4]; $this->RESULT["rTid"] = $this->RecvValArray[5]; } else { $this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."Parse CancelMSG Passed " ); $this->RESULT["rCancelSuccYn"] = "n"; $this->RESULT["rCancelResMsg"] = "Cannot Cancel AuthTy[".$this->REQUEST["AuthTy"]."]"; return false; } $this->log->WriteLog( INFO, "Parse Cancel Msg End" ); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function readMessageEnd();", "public static function decomposeMsg (string $msg) : array {\n\t\tif (($pos = strpos ($msg, ':')) === false || ($command = \\DataLib::isInt (substr ($msg, 0, $pos))) === false || !Command::isCommand ($command)) {\n\t\t\treturn [ Command::INVALID ];\n\t\t}\n\t\treturn [\n\t\t\t$command,\n\t\t\tjson_decode (substr ($msg, $pos + 1), true)\n\t\t];\n\t}", "function ParseMsg() \n\t{\n\t\t$this->log->WriteLog( INFO, \"Parse Msg Start\" );\n\t\t/****************************************************************************\n\t\t* ※ 결제 형태 변수의 값에 따른 결제 구분\n\t\t*\n\t\t* * AuthTy = \"card\"\t\t신용카드결제\n\t\t*\t - SubTy = \"isp\"\t\t안전결제ISP\n\t\t*\t - SubTy = \"visa3d\"\t\t안심클릭\n\t\t*\t - SubTy = \"normal\"\t\t일반결제\n\t\t*\n\t\t* * AuthTy = \"iche\"\t\t일반-계좌이체\n\t\t* \n\t\t* * AuthTy = \"virtual\"\t일반-가상계좌(무통장입금)\n\t\t* \n\t\t* * AuthTy = \"hp\"\t\t\t핸드폰결제\n\t\t*\n\t\t* * AuthTy = \"ars\"\t\tARS결제\n\t\t*\n\t\t****************************************************************************/\n\t\t\n\t\tif( strcmp( $this->REQUEST[\"AuthTy\"], \"card\" ) == 0 )\n\t\t{\n\t\t\tif( strcmp( $this->REQUEST[\"SubTy\"], \"isp\" ) == 0 )\n\t\t\t{\n\t\t\t\t/****************************************************************************\n\t\t\t\t*\n\t\t\t\t* [1-1] 신용카드 안전결제ISP 처리\n\t\t\t\t* \n\t\t\t\t* \n\t\t\t\t* -- 승인 응답 전문 포멧\n\t\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.\n\t\t\t\t* 업체ID(20)\t\t| 전문코드(4)\t\t| 거래고유번호(6)\t\t| 승인번호(8)\t\t| \n\t\t\t\t* 거래금액(12)\t| 성공여부(1)\t \t| 실패사유(20)\t\t| 승인시각(14)\t| \n\t\t\t\t* 카드사코드(4)\t|\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\t\t\t\t\t\t\t\t\n\t\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[0];\n\t\t\t\t$this->RESULT[\"rBusiCd\"] = $this->RecvValArray[1];\n\t\t\t\t$this->RESULT[\"rOrdNo\"] = $this->REQUEST[\"OrdNo\"];\n\t\t\t\t$this->RESULT[\"rDealNo\"] = $this->RecvValArray[2];\n\t\t\t\t$this->RESULT[\"rApprNo\"] = $this->RecvValArray[3];\n\t\t\t\t$this->RESULT[\"rProdNm\"] = $this->REQUEST[\"ProdNm\"];\n\t\t\t\t$this->RESULT[\"rAmt\"] = $this->RecvValArray[4];\n\t\t\t\t$this->RESULT[\"rInstmt\"] = $this->REQUEST[\"KVP_QUOTA\"];\n\t\t\t\t$this->RESULT[\"rSuccYn\"] = $this->RecvValArray[5];\n\t\t\t\t$this->RESULT[\"rResMsg\"] = $this->RecvValArray[6];\n\t\t\t\t$this->RESULT[\"rApprTm\"] = $this->RecvValArray[7];\n\t\t\t\t$this->RESULT[\"rCardCd\"] = $this->RecvValArray[8];\t\n\t\t\t\t\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\"-\".$this->REQUEST[\"SubTy\"].\" \".\"RECV MSG Parsing OK \" );\n\t\t\t}\n\t\t\telse if( ( strcmp( $this->REQUEST[\"SubTy\"], \"visa3d\" ) == 0 ) || ( strcmp( $this->REQUEST[\"SubTy\"], \"normal\" ) == 0 ) )\n\t\t\t{\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* [1-2] 안심클릭 or 일반결제 처리 승인응답 전문포맷\n\t\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다.\n\t\t\t\t* 업체ID(20)\t\t| 전문코드(4)\t\t | 주문번호(40)\t| 승인번호(8)\t\t| 거래금액(12) |\n\t\t\t\t* 성공여부(1)\t\t| 실패사유(20)\t | 카드사명(20) \t| 승인시각(14)\t| 카드사코드(4)\t|\n\t\t\t\t* 가맹점번호(15)\t| 매입사코드(4)\t | 매입사명(20)\t| 전표번호(6)\t\t|\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\t\t\t\t\n\t\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[0];\n\t\t\t\t$this->RESULT[\"rBusiCd\"] = $this->RecvValArray[1];\n\t\t\t\t$this->RESULT[\"rOrdNo\"] = $this->RecvValArray[2];\n\t\t\t\t$this->RESULT[\"rApprNo\"] = $this->RecvValArray[3];\n\t\t\t\t$this->RESULT[\"rInstmt\"] = $this->REQUEST[\"Instmt\"];\n\t\t\t\t$this->RESULT[\"rAmt\"] = $this->RecvValArray[4];\n\t\t\t\t$this->RESULT[\"rSuccYn\"] = $this->RecvValArray[5];\n\t\t\t\t$this->RESULT[\"rResMsg\"] = $this->RecvValArray[6];\n\t\t\t\t$this->RESULT[\"rCardNm\"] = $this->RecvValArray[7];\n\t\t\t\t$this->RESULT[\"rApprTm\"] = $this->RecvValArray[8];\n\t\t\t\t$this->RESULT[\"rCardCd\"] = $this->RecvValArray[9];\n\t\t\t\t$this->RESULT[\"rMembNo\"] = $this->RecvValArray[10];\n\t\t\t\t$this->RESULT[\"rAquiCd\"] = $this->RecvValArray[11];\n\t\t\t\t$this->RESULT[\"rAquiNm\"] = $this->RecvValArray[12];\n\t\t\t\t$this->RESULT[\"rDealNo\"] = $this->RecvValArray[13];\n\t\t\t\t$this->RESULT[\"rProdNm\"] = $this->REQUEST[\"ProdNm\"];\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\"-\".$this->REQUEST[\"SubTy\"].\" \".\"RECV MSG Parsing OK \" );\n\t\t\t}\n\t\t}\n\t\telse if( strcmp( $this->REQUEST[\"AuthTy\"], \"iche\" ) == 0 && strcmp( $this->REQUEST[\"ICHE_SOCKETYN\"], \"Y\" ) == 0)\n\t\t{\n\t\t\t/****************************************************************************\n\t\t\t* \n\t\t\t* [2-1] 계좌이체 소켓방식(인터넷뱅킹) 결제 요청 응답 전문 포멧\n\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다.\n\t\t\t* 결제종류(10)\t\t| 상점아이디(20)\t| 주문번호(40)\t| 이용기관주문번호(50)\t| 결과코드(4) | 결과메시지(300) |\n\t\t\t* \n\t\t\t****************************************************************************/\n\t\t\t\t\n\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[1];\n\t\t\t$this->RESULT[\"rOrdNo\"] = $this->RecvValArray[2];\n\t\t\t$this->RESULT[\"rMTid\"] = $this->RecvValArray[3];\n\t\t\t$this->RESULT[\"ES_SENDNO\"] = $this->RecvValArray[4];\n\t\t\t$this->RESULT[\"rSuccYn\"] = $this->RecvValArray[5];\n\t\t\t$this->RESULT[\"rResMsg\"] = $this->RecvValArray[6];\n\t\t\t$this->RESULT[\"rAmt\"] = $this->REQUEST[\"Amt\"];\n\t\t\t$this->RESULT[\"rProdNm\"] = $this->REQUEST[\"ProdNm\"];\n\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"RECV MSG Parsing OK \" );\n\t\t}\n\t\telse if( strcmp( $this->REQUEST[\"AuthTy\"], \"iche\" ) == 0 && strcmp( $this->REQUEST[\"ICHEARS_SOCKETYN\"], \"Y\" ) == 0)\n\t\t{\n\t\t\t/****************************************************************************\n\t\t\t* \n\t\t\t* [2-2] 계좌이체 텔레뱅킹 처리\n\t\t\t*\n\t\t\t* -- 텔레뱅킹 결제 요청 응답 전문 포멧\n\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다.\n\t\t\t* 결제종류(10)\t| 상점아이디(20)\t| 주문번호(40)\t| 이용기관주문번호(50)\t| 결과코드(4) | 결과메시지(300) |* \n\t\t\t*\n\t\t\t****************************************************************************/\n\t\t\t\n\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[1];\n\t\t\t$this->RESULT[\"rOrdNo\"] = $this->RecvValArray[2];\n\t\t\t$this->RESULT[\"rMTid\"] = $this->RecvValArray[3];\n\t\t\t$this->RESULT[\"rSuccYn\"] = $this->RecvValArray[4];\n\t\t\t$this->RESULT[\"rResMsg\"] = $this->RecvValArray[5];\n\t\t\t$this->RESULT[\"rAmt\"] = $this->REQUEST[\"Amt\"];\n\t\t\t$this->RESULT[\"rProdNm\"] = $this->REQUEST[\"ProdNm\"];\n\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"Parse MSG Passed \" );\n\t\t\t\t\n\t\t\t$pos = strpos($this->RESULT[\"rResMsg\"],':');\n\t\t\tif( $pos !== false ) \n\t\t\t{\n\t\t\t\t$this->RESULT[\"ES_SENDNO\"] = substr($this->RESULT[\"rResMsg\"],$pos+1,6) ;\n\t\t\t\t$this->log->WriteLog( INFO, \"ES_SENDNO : [\".$this->RESULT[\"ES_SENDNO\"].\"] \");\n\t\t\t}\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t}\n\t\telse if( strcmp( $this->REQUEST[\"AuthTy\"], \"virtual\" ) == 0 ) \n\t\t{\n\t\t\t/****************************************************************************\n\t\t\t*\n\t\t\t* [3] 가상계좌(무통장입금) 처리\n\t\t\t* \n\t\t\t* -- 승인 응답 전문 포멧\n\t\t\t* + 데이터길이(6) + 암호화 구분(1) + 데이터\n\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.\n\t\t\t* 결제종류(10)\t| 업체ID(20)\t\t| 승인일자(14)\t| 가상계좌번호(20)\t| 결과코드(1)\t\t| 결과메시지(100)\t | \n\t\t\t*\n\t\t\t****************************************************************************/\n\t\t\t\n\t\t\t$this->RESULT[\"rAuthTy\"] = $this->RecvValArray[0];\n\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[1];\n\t\t\t$this->RESULT[\"rApprTm\"] = $this->RecvValArray[2];\n\t\t\t$this->RESULT[\"rVirNo\"] = $this->RecvValArray[3];\n\t\t\t$this->RESULT[\"rSuccYn\"] = $this->RecvValArray[4];\n\t\t\t$this->RESULT[\"rResMsg\"] = $this->RecvValArray[5];\n\t\t\t\n\t\t\t$this->RESULT[\"rOrdNo\"] = $this->REQUEST[\"OrdNo\"];\n\t\t\t$this->RESULT[\"rProdNm\"] = $this->REQUEST[\"ProdNm\"];\n\t\t\t$this->RESULT[\"rAmt\"] = $this->REQUEST[\"Amt\"];\n\t\t\t\n\t\t\t$pos = strpos($this->RESULT[\"rResMsg\"],':');\n\t\t\tif( $pos !== false ) \n\t\t\t{\n\t\t\t\t$this->RESULT[\"ES_SENDNO\"] = substr($this->RESULT[\"rResMsg\"],$pos+1,6) ;\n\t\t\t\t$this->log->WriteLog( INFO, \"ES_SENDNO : [\".$this->RESULT[\"ES_SENDNO\"].\"] \");\n\t\t\t}\n\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"RECV MSG Parsing OK \" );\n\t\t\t\n\t\t}\n\t\telse if( strcmp( $this->REQUEST[\"AuthTy\"], \"hp\" ) == 0 )\n\t\t{\n\t\t\t/****************************************************************************\n\t\t\t* \n\t\t\t* [4] 핸드폰 결제\n\t\t\t*\n\t\t\t* -- 승인 응답 전문 포멧\n\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.)\n\t\t\t* 업체ID(20)\t| 결과코드(1)\t| 결과메시지(100)\t | 핸드폰결제일(8)\t | 핸드폰결제 TID(12)\t | 거래금액(12)\t | 주문번호(40)\t |\n\t\t\t*\n\t\t\t****************************************************************************/\n\t\t\t\n\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[0];\t\n\t\t\t$this->RESULT[\"rSuccYn\"] = $this->RecvValArray[1];\n\t\t\t$this->RESULT[\"rResMsg\"] = $this->RecvValArray[2];\n\t\t\t$this->RESULT[\"rHP_DATE\"] = $this->RecvValArray[3];\n\t\t\t$this->RESULT[\"rHP_TID\"] = $this->RecvValArray[4];\n\t\t\t$this->RESULT[\"rAmt\"] = $this->REQUEST[\"Amt\"];\n\t\t\t$this->RESULT[\"rOrdNo\"] = $this->REQUEST[\"OrdNo\"];\n\t\t\t$this->RESULT[\"rProdNm\"] = $this->REQUEST[\"ProdNm\"];\n\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"RECV MSG Parsing OK \" );\n\n\t\t}\n\t\telse if( strcmp( $this->REQUEST[\"AuthTy\"], \"ars\" ) == 0 )\n\t\t{\n\t\t\t/****************************************************************************\n\t\t\t* \n\t\t\t* [5] ARS 결제\n\t\t\t*\n\t\t\t* -- 승인 응답 전문 포멧\n\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.)\n\t\t\t* 업체ID(20)\t| 결과코드(1)\t| 결과메시지(100)\t | ARS결제일(8)\t | ARS결제 TID(12)\t | 거래금액(12)\t | 주문번호(40)\t |\n\t\t\t*\n\t\t\t****************************************************************************/\n\t\t\t\n\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[0];\t\n\t\t\t$this->RESULT[\"rSuccYn\"] = $this->RecvValArray[1];\n\t\t\t$this->RESULT[\"rResMsg\"] = $this->RecvValArray[2];\n\t\t\t$this->RESULT[\"rHP_DATE\"] = $this->RecvValArray[3];\n\t\t\t$this->RESULT[\"rHP_TID\"] = $this->RecvValArray[4];\n\t\t\t$this->RESULT[\"rAmt\"] = $this->REQUEST[\"Amt\"];\n\t\t\t$this->RESULT[\"rOrdNo\"] = $this->REQUEST[\"OrdNo\"];\n\t\t\t$this->RESULT[\"rProdNm\"] = $this->REQUEST[\"ProdNm\"];\n\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"RECV MSG Parsing OK \" );\n\t\t}else{\n\t\t\t$this->log->WriteLog( FATAL, \"Unknown AuthTy. AuthTy:[\".$this->REQUEST[\"AuthTy\"].\"],SubTy:[\".$this->REQUEST[\"SubTy\"].\"]\");\n\t\t\treturn false;\n\t\t}\n\t\t$this->log->WriteLog( INFO, \"Parse Msg End\" );\n\t\treturn true;\n\t\t\n\t}", "public function parseRequest($message);", "private function parseMessage() {\n\n\t\t# Regexp to parse a formatted message\n\t\t# The message should come in format of\n\t\t# :(.*)\\!(.*)\\@(.*) PRIVMSG #channelname \\:(.*) for regular chatter\n\t\t# thus returning nickname, realname, hostmask, (command, arguments) || (botname: command (arguments)) || (chatter)\n\t\t$matched = false;\n\n # Try to match against the bots name!\n # This could mean it is a direct message in chan followed by a command request\n if(!$matched) {\n $pattern = '/:(.*)\\!(.*)\\@(.*) PRIVMSG '.$this->config['destinationChannel'].' \\:('.$this->config['username'].')\\:(?: +)?([^\\s]*) (.*)/';\n preg_match($pattern, $this->inbound, $matches);\n if(count($matches) > 1) {\n $matched = true;\n $this->lastMessage = array(\n 'nickname' => $matches[1],\n 'realname' => $matches[2],\n 'hostname' => $matches[3],\n 'command' => $matches[5],\n 'args' => rtrim($matches[6],\"\\n\\r\"),\n 'chatter' => ''\n );\n # Have to match a case whereby a command of 'botname: command' with no args is provided (for help)\n # If this case occurs we have to do some arg movement otherwise the command parser won't get a hit\n if($this->lastMessage['args'] != \"\" && $this->lastMessage['command'] == '') {\n $this->lastMessage['command'] = $this->lastMessage['args'];\n $this->lastMessage['args'] = \"\";\n }\n }\n }\n\n\t\tif(!$matched) {\n\t\t\t$pattern = '/:(.*)\\!(.*)\\@(.*) PRIVMSG '.$this->config['destinationChannel'].' \\:(.*)/';\n\t\t\tpreg_match($pattern, $this->inbound, $matches);\n\t\t\tif(count($matches) > 1) {\n\t\t\t\t$this->lastMessage = array(\n\t\t\t\t\t'nickname' => $matches[1],\n\t\t\t\t\t'realname' => $matches[2],\n\t\t\t\t\t'hostname' => $matches[3],\n\t\t\t\t\t'command' => '',\n\t\t\t\t\t'args' => '',\n\t\t\t\t\t'chatter' => rtrim($matches[4],\"\\n\\r\")\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "private function parse()\r\n\t{\r\n\t\t// Suppress annoying notices/warnings\r\n\t\tset_error_handler(function() { /* Nothing */ }, E_NOTICE|E_WARNING);\r\n\r\n\t\t$structure = mailparse_msg_get_structure($this->resource);\r\n\t\t$this->parts = array();\r\n\t\tforeach ($structure as $part_id) {\r\n\t\t\t$part = mailparse_msg_get_part($this->resource, $part_id);\r\n\t\t\t$this->parts[$part_id] = mailparse_msg_get_part_data($part);\r\n\t\t}\r\n\r\n\t\trestore_error_handler();\r\n\t}", "private function parseMessage(DOMElement $node)\n {\n if ($node->getAttribute('type') == 'error') {\n foreach ($node->childNodes as $_node)\n {\n if ($_node->localName == 'error')\n {\n // todo handle error response\n Log::info(\"===error===\");\n Log::error($_node->textContent);\n }\n }\n }elseif ($node->firstChild->localName == 'gcm' && ($json = $node->firstChild->textContent) && ($data = json_decode($json)) && @$data->message_type && @$data->message_id) {\n\n switch ($data->message_type)\n {\n case 'ack':\n // message acknowledgement received\n $this->events->fire(new MessageAcknowledged($data->message_id));\n break;\n case 'nack':\n switch (strtolower($data->error))\n {\n case 'bad_registration':\n // unregistered/uninstalled app\n $this->events->fire(new InvalidDeviceRegistration($data->from));\n break;\n case 'device_unregistered':\n // unregistered/uninstalled app\n $this->events->fire(new InvalidDeviceRegistration($data->from));\n break;\n case 'device_message_rate_exceeded':\n // device rate exceeded\n $this->events->fire(new DeviceMessageRateExceeded($data->from, null, $data->message_id));\n break;\n case 'invalid_json':\n // invalid json\n $this->events->fire(new InvalidJson($data->from, $data->description));\n break;\n default:\n // unknown error\n $this->events->fire(new AbstractError($data->error, $data->from, $data->description));\n break;\n }\n break;\n case 'control':\n if ($data->control_type == 'CONNECTION_DRAINING')\n {\n // connection server connection drainage\n $this->events->fire(new ConnectionDrainage());\n }\n break;\n case 'receipt':\n // ack for receipt of message receipt before processing receipt\n $this->sendAck($data->message_id, $data->data->device_registration_id);\n\n // message receipt\n $this->events->fire(new MessageReceiptReceived((array)$data));\n break;\n default:\n break;\n }\n\n if (@$data->registration_id) {\n // registration expired for token\n $this->events->fire(new RegistrationExpired($data->from, $data->registration_id));\n }\n\n } elseif (($json = $node->firstChild->textContent) && ($mData = json_decode($json)) && ($client_token = $mData->from) && ($client_message = $mData->data)) {\n // ack for receipt before processing message\n $this->sendAck($mData->message_id, $mData->from);\n\n // message received\n $this->events->fire(new MessageReceived((array)$mData, 'xmpp'));\n }\n }", "function MakeCancelMsg() \n\t{\n\t\t$this->log->WriteLog( INFO, \"Make Cancel Msg Start\" );\n\t\tif( strcmp( $this->REQUEST[\"AuthTy\"], \"card\" ) == 0 )\n\t\t{\n\t\t\tif( strcmp( $this->REQUEST[\"SubTy\"], \"isp\" ) == 0 )\n\t\t\t{\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t*\n\t\t\t\t* [1-1] 신용카드승인취소 - ISP\n\t\t\t\t*\n\t\t\t\t* -- 이부분은 취소 승인 처리를 위해 PG서버Process와 Socket통신하는 부분이다.\n\t\t\t\t* 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다.\n\t\t\t\t* -- 데이터 길이는 매뉴얼 참고\n\t\t\t\t*\t \n\t\t\t\t* -- 취소 승인 요청 전문 포멧\n\t\t\t\t* + 데이터길이(6) + 암호화여부(1) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.\n\t\t\t\t* 결제종류(6)\t| 업체아이디(20) \t| 승인번호(20) \t| 승인시간(8)\t| 거래고유번호(6) |\n\t\t\t\t*\n\t\t\t\t* -- 취소 승인 응답 전문 포멧\n\t\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.\n\t\t\t\t* 업체ID(20)\t| 승인번호(20)\t| 승인시각(8)\t| 전문코드(4)\t| 거래고유번호(6)\t| 성공여부(1)\t|\n\t\t\t\t*\t\t \n\t\t\t\t****************************************************************************/\n\t\t\t\t\n\t\t\t\t$this->ENCTYPE = 2;\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* 전송 전문 Make\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\t\t\t\t\t\t\n\t\t\t\t$this->sDataMsg = $this->ENCTYPE.\n\t\t\t\t\"cancel\".\"|\".\n\t\t\t\t$this->GetResult(\"StoreId\").\"|\".\n\t\t\t\t$this->GetResult(\"rApprNo\").\"|\".\n\t\t\t\tsubstr($this->GetResult(\"rApprTm\"),0,8).\"|\".\n\t\t\t\t$this->GetResult(\"rDealNo\").\"|\".\n\t\t\t\t$this->GetResult(\"NetCancID\").\"|\";\n \n\t\t\t\t$this->sSendMsg = sprintf( \"%06d%s\", strlen( $this->sDataMsg ), $this->sDataMsg );\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\"-\".$this->REQUEST[\"SubTy\"].\" \".\"Make Cancel MSG OK \" );\n\t\t\t}\n\t\t\telse if( ( strcmp( $this->REQUEST[\"SubTy\"], \"visa3d\" ) == 0 ) || ( strcmp( $this->REQUEST[\"SubTy\"], \"normal\" ) == 0 ) )\n\t\t\t{\n\t\t\t\t/****************************************************************************\n\t\t\t\t*\n\t\t\t\t* [1-2] 신용카드승인취소 - VISA3D, 일반\n\t\t\t\t*\n\t\t\t\t* -- 이부분은 취소 승인 처리를 위해 암호화Process와 Socket통신하는 부분이다.\n\t\t\t\t* 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다.\n\t\t\t\t*\n\t\t\t\t* -- 취소 승인 요청 전문 포멧\n\t\t\t\t* + 데이터길이(6) + 암호화여부(1) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 하며 카드번호,유효기간,비밀번호,주민번호는 암호화된다.)\n\t\t\t\t* 결제종류(6)\t| 업체아이디(20) \t| 승인번호(8) \t| 승인시간(14) \t| 카드번호(16) \t|\n\t\t\t\t*\n\t\t\t\t* -- 취소 승인 응답 전문 포멧\n\t\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다.\n\t\t\t\t* 업체ID(20)\t| 승인번호(8)\t| 승인시각(14)\t| 전문코드(4)\t| 성공여부(1)\t|\n\t\t\t\t* 주문번호(20)\t| 할부개월(2)\t| 결제금액(20)\t| 카드사명(20)\t| 카드사코드(4) \t|\n\t\t\t\t* 가맹점번호(15)\t| 매입사코드(4)\t| 매입사명(20)\t| 전표번호(6)\n\t\t\t\t*\t\t \n\t\t\t\t****************************************************************************/\n\t\t\t\t\n\t\t\t\t$this->ENCTYPE = 0;\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* 전송 전문 Make\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\n\t\t\t\t$this->sDataMsg = $this->ENCTYPE.\n\t\t\t\t\"cancel\".\"|\".\n\t\t\t\t$this->GetResult(\"StoreId\").\"|\".\n\t\t\t\t$this->GetResult(\"rApprNo\").\"|\".\n\t\t\t\tsubstr($this->GetResult(\"rApprTm\"),0,8).\"|\".\n\t\t\t\t$this->GetResult(\"rDealNo\").\"|\".\n\t\t\t\t$this->GetResult(\"NetCancID\").\"|\";\n\n\t\t\t\t$this->sSendMsg = sprintf( \"%06d%s\", strlen( $this->sDataMsg ), $this->sDataMsg );\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\"-\".$this->REQUEST[\"SubTy\"].\" \".\"Make Cancel MSG OK \" );\n\t\t\t}\n\t\t}else if( strcmp( $this->REQUEST[\"AuthTy\"], \"iche\" ) == 0 && strcmp( $this->REQUEST[\"ICHE_SOCKETYN\"], \"Y\" ) == 0){\n\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* [2-1] 인터넷뱅킹 계좌이체(소켓) 취소처리\n\t\t\t\t* \n\t\t\t\t* -- 이부분은 인터넷뱅킹 결제 취소처리를 위해 암호화Process와 Socket통신하는 부분이다.\n\t\t\t\t* 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다.\n\t\t\t\t* -- 데이터 길이는 매뉴얼 참고\n\t\t\t\t* \n\t\t\t\t* -- 인터넷뱅킹 결제 요청 전문 포멧\n\t\t\t\t* + 데이터길이(6) + 암호화여부(1) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.)\n\t\t\t\t* 결제종류(10)\t\t| 업체ID(20)\t\t| MTID(계좌이체결제 결과값)\t\t| 결제금액(8)\t\t| 은행코드(2)\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\n\t\t\t\t$this->ENCTYPE = R;\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* 전송 전문 Make\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\n\t\t\t\t$this->sDataMsg = $this->ENCTYPE.\n\t\t\t\t\t\"RB-CanReq\".\"|\".\n\t\t\t\t\t$this->GetResult(\"StoreId\").\"|\".\n\t\t\t\t\t$this->GetResult(\"ICHE_POSMTID\").\"|\".\n\t\t\t\t\t$this->GetResult(\"Amt\").\"|\".\n\t\t\t\t\t$this->GetResult(\"ICHE_OUTBANKNAME\").\"|\".\n\t\t\t\t\t$this->GetResult(\"NetCancID\").\"|\";\n\t\t\t\t\t\n\t\t\t\t$this->sSendMsg = sprintf( \"%06d%s\", strlen( $this->sDataMsg ), $this->sDataMsg );\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"Make Cancel MSG OK \" );\n\t\t\n\t\t}else if( strcmp( $this->REQUEST[\"AuthTy\"], \"iche\" ) == 0 && strcmp( $this->REQUEST[\"ICHEARS_SOCKETYN\"], \"Y\" ) == 0){\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* [2-1] 텔레뱅킹 계좌이체(소켓) 취소처리\n\t\t\t\t* \n\t\t\t\t* -- 이부분은 텔레뱅킹 결제 취소처리를 위해 암호화Process와 Socket통신하는 부분이다.\n\t\t\t\t* 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다.\n\t\t\t\t* -- 데이터 길이는 매뉴얼 참고\n\t\t\t\t* \n\t\t\t\t* -- 텔레뱅킹 결제 요청 전문 포멧\n\t\t\t\t* + 데이터길이(6) + 암호화여부(1) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.)\n\t\t\t\t* 결제종류(10)\t\t| 업체ID(20)\t\t| MTID(계좌이체결제 결과값)\t\t| 결제금액(8)\t\t| 은행코드(2)\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\n\t\t\t\t$this->ENCTYPE = B;\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* 전송 전문 Make\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\n\t\t\t\t$this->sDataMsg = $this->ENCTYPE.\n\t\t\t\t\t\"TB-CanReq\".\"|\".\n\t\t\t\t\t$this->GetResult(\"StoreId\").\"|\".\n\t\t\t\t\t\"\".\"|\".\n\t\t\t\t\t\"\".\"|\".\n\t\t\t\t\t$this->GetResult(\"NetCancID\").\"|\";\n\t\t\t\t\t\n\t\t\t\t$this->sSendMsg = sprintf( \"%06d%s\", strlen( $this->sDataMsg ), $this->sDataMsg );\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"Make Cancel MSG OK \" );\n\t\t\n\t\t}else if( strcmp( $this->REQUEST[\"AuthTy\"], \"hp\" ) == 0 ){\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* [3] 핸드폰 취소처리\n\t\t\t\t* \n\t\t\t\t* -- 이부분은 핸드폰 결제 취소처리를 위해 암호화Process와 Socket통신하는 부분이다.\n\t\t\t\t* 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다.\n\t\t\t\t* -- 데이터 길이는 매뉴얼 참고\n\t\t\t\t* \n\t\t\t\t* -- 핸드폰 결제 요청 전문 포멧\n\t\t\t\t* + 데이터길이(6) + 암호화여부(1) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.)\n\t\t\t\t* 결제종류(10)\t\t| 업체ID(20)\t| NetCancID\t\t|\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\n\t\t\t\t$this->ENCTYPE = H;\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* 전송 전문 Make\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\t\t\t\t$this->sDataMsg = $this->ENCTYPE.\n\t\t\t\t\t\"MobileCanReq\".\"|\".\n\t\t\t\t\t$this->GetResult(\"StoreId\").\"|\".\n\t\t\t\t\t$this->GetResult(\"NetCancID\").\"|\";\n\t\t\t\t\t\n\t\t\t\t$this->sSendMsg = sprintf( \"%06d%s\", strlen( $this->sDataMsg ), $this->sDataMsg );\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"Make Cancel MSG OK \" );\n\t\t\n\t\t}else if( strcmp( $this->REQUEST[\"AuthTy\"], \"ars\" ) == 0 ){\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* [4] ARS 취소처리\n\t\t\t\t* \n\t\t\t\t* -- 이부분은 ARS 결제 취소처리를 위해 암호화Process와 Socket통신하는 부분이다.\n\t\t\t\t* 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다.\n\t\t\t\t* -- 데이터 길이는 매뉴얼 참고\n\t\t\t\t* \n\t\t\t\t* -- ARS 결제 요청 전문 포멧\n\t\t\t\t* + 데이터길이(6) + 암호화여부(1) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.)\n\t\t\t\t* 결제종류(10)\t\t| 업체ID(20)\t| NetCancID\t\t|\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\n\t\t\t\t$this->ENCTYPE = A;\n\t\t\t\t\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* 전송 전문 Make\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\t\t\t\t$this->sDataMsg = $this->ENCTYPE.\n\t\t\t\t\t\"ARSCanReq\".\"|\".\n\t\t\t\t\t$this->GetResult(\"StoreId\").\"|\".\n\t\t\t\t\t$this->GetResult(\"NetCancID\").\"|\";\n\t\t\t\t\t\n\t\t\t\t$this->sSendMsg = sprintf( \"%06d%s\", strlen( $this->sDataMsg ), $this->sDataMsg );\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"Make Cancel MSG OK \" );\n\t\t\n\t\t}else{\n\t\t\t//신용카드,계좌이체 이외의 결제수단은 취소기능 적용되지 않음.\n\t\t\t$this->log->WriteLog( WARN, \"Cancel Passed. AuthTy : [\".$this->REQUEST[\"AuthTy\"].\"-\".$this->REQUEST[\"SubTy\"].\"] \" );\n\t\t\t$this->RESULT[\"rCancelSuccYn\"] = \"n\";\n\t\t\t$this->RESULT[\"rCancelResMsg\"] = \"Cannot Cancel AuthTy[\".$this->REQUEST[\"AuthTy\"].\"]\";\t\t\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\t$this->log->WriteLog( INFO, \"Make Cancel Msg End\" );\n\t\treturn true;\n\t}", "private function parse()\n {\n // form was unsubscribed?\n if ($this->URL->getParameter('unsubscribed') === 'true') {\n // show message\n $this->tpl->assign('mailmotorUnsubscribeIsSuccess', true);\n\n // hide form\n $this->tpl->assign('mailmotorUnsubscribeHideForm', true);\n }\n }", "function ParseMsg($msg) {\n\t$parts = explode(\"&\",$msg);\n\t$result = array();\n\tforeach($parts as $i => $value) {\n\t\t$bits = explode(\"=\", $value, 2);\n\t\t$result[$bits[0]] = urldecode($bits[1]);\n\t}\n\n\treturn $result;\n}", "private function ParseMsg($msg) {\n\t\t$parts = explode(\"&\",$msg);\n\t\t$result = array();\n\t\tforeach($parts as $i => $value) {\n\t\t\t$bits = explode(\"=\", $value, 2);\n\t\t\t$result[$bits[0]] = urldecode($bits[1]);\n\t\t}\n\n\t\treturn $result;\n\t}", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "public function aim_recv()\r\n\t{\r\n\t\t$header = fread($this->resource, 6);\r\n if ($this->user['debug']) $this->aim_debug($header, AIM_RAW);\r\n\r\n\t\t// Need error checking here to prevent bad data\r\n\t\ttry {\r\n\t\t\tif (!$data = @unpack(\"aone/Ctwo/nthree/nfour\", $header)) {\r\n\t\t\t\t// This normally happens if you sign on elsewhere with the same name,\r\n // or, if the TOC server resets (AOL likes to do this alot).\r\n\t\t\t\tthrow new TACException('Connection to TOC server interrupted.');\r\n\t\t\t} \r\n\t\t} catch(TACException $ex) {\r\n\t\t\t$ex->display();\r\n\t\t}\r\n\r\n if ($this->user['debug']) print_r($data);\r\n\t\t$msg = fread($this->resource, $data['four']);\r\n\t\t$msg = implode('', unpack(\"a*done\", $msg));\r\n if ($this->user['debug']) var_dump($msg);\r\n\r\n // match incoming commands\r\n preg_match(\"/^([A-Z0-9_]{4,19})\\:(.*)/s\", $msg, $matches);\r\n @list($orig, $cmd, $args) = $matches;\r\n // send the command and arguments to our parser\r\n $this->parser->aim_parse_command($cmd, $args);\r\n // regain some memory\r\n unset($header, $orig, $data, $matches);\r\n\t}", "protected function processChannelMessages()\n\t{\n\t\tif (preg_match(\n\t\t\t'/^(NEW|UPD|NUK): \\[DT: (?P<time>.+?)\\]\\s?\\[TT: (?P<title>.+?)\\]\\s?\\[SC: (?P<source>.+?)\\]\\s?\\[CT: (?P<category>.+?)\\]\\s?\\[RQ: (?P<req>.+?)\\]' .\n\t\t\t'\\s?\\[SZ: (?P<size>.+?)\\]\\s?\\[FL: (?P<files>.+?)\\]\\s?(\\[FN: (?P<filename>.+?)\\]\\s?)?(\\[(?P<nuked>(UN|MOD|RE|OLD)?NUKED?): (?P<reason>.+?)\\])?$/i',\n\t\t\t$this->_channelData['message'], $matches)) {\n\n\t\t\tif (isset($this->_ignoredChannels[$matches['source']]) && $this->_ignoredChannels[$matches['source']] === true) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ($this->_categoryIgnoreRegex !== false && preg_match((string)$this->_categoryIgnoreRegex, $matches['category'])) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ($this->_titleIgnoreRegex !== false && preg_match((string)$this->_titleIgnoreRegex, $matches['title'])) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$this->_curPre['predate'] = $this->_pdo->from_unixtime(strtotime($matches['time'] . ' UTC'));\n\t\t\t$this->_curPre['title'] = $matches['title'];\n\t\t\t$this->_curPre['source'] = $matches['source'];\n\t\t\tif ($matches['category'] !== 'N/A') {\n\t\t\t\t$this->_curPre['category'] = $matches['category'];\n\t\t\t}\n\t\t\tif ($matches['req'] !== 'N/A' && preg_match('/^(?P<req>\\d+):(?P<group>.+)$/i', $matches['req'], $matches2)) {\n\t\t\t\t$this->_curPre['reqid'] = $matches2['req'];\n\t\t\t\t$this->_curPre['group_id'] = $this->_getGroupID($matches2['group']);\n\t\t\t}\n\t\t\tif ($matches['size'] !== 'N/A') {\n\t\t\t\t$this->_curPre['size'] = $matches['size'];\n\t\t\t}\n\t\t\tif ($matches['files'] !== 'N/A') {\n\t\t\t\t$this->_curPre['files'] = substr($matches['files'], 0, 50);\n\t\t\t}\n\n\t\t\tif (isset($matches['filename']) && $matches['filename'] !== 'N/A') {\n\t\t\t\t$this->_curPre['filename'] = $matches['filename'];\n\t\t\t}\n\n\t\t\tif (isset($matches['nuked'])) {\n\t\t\t\tswitch ($matches['nuked']) {\n\t\t\t\t\tcase 'NUKED':\n\t\t\t\t\t\t$this->_curPre['nuked'] = \\PreDb::PRE_NUKED;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'UNNUKED':\n\t\t\t\t\t\t$this->_curPre['nuked'] = \\PreDb::PRE_UNNUKED;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'MODNUKED':\n\t\t\t\t\t\t$this->_curPre['nuked'] = \\PreDb::PRE_MODNUKE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'RENUKED':\n\t\t\t\t\t\t$this->_curPre['nuked'] = \\PreDb::PRE_RENUKED;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'OLDNUKE':\n\t\t\t\t\t\t$this->_curPre['nuked'] = \\PreDb::PRE_OLDNUKE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$this->_curPre['reason'] = (isset($matches['reason']) ? substr($matches['reason'], 0, 255) : '');\n\t\t\t}\n\t\t\t$this->_checkForDupe();\n\t\t}\n\t}", "static function Parse ($data)\n\t{\n\t\t$irc = \"/^(?:\\:(\\S+)\\s+)(\\w+)(?:\\s+(?!:)(.*?))?(?:\\s+:(.+))?$/\";\n\t\tpreg_match($irc, $data, $matches);\n\t\t$return = array(\n\t\t\t'origin' => (isset($data[1])) ? $data[1] : \"\",\n\t\t\t'command' => $data[2],\n\t\t\t'params' => (isset($data[3])) ? explode(\" \",$data[3]) : array(),\n\t\t);\n\t\tif (isset($data[4]))\n\t\t{\n\t\t\t$return['params'][] = $data[4];\n\t\t\t$return['freeform'] = TRUE;\n\t\t}\n\t\treturn $return;\n\t}", "abstract public function parse ();", "public function parse(): array\n {\n // Text.\n if ($this->type === 'text') {\n return [\n 'text' => $this->message,\n ];\n }\n\n // Template.\n if ($this->type === 'template') {\n $payload = Arr::get($this->message, 'attachments.0.payload');\n\n // Generic template.\n if (Arr::get($payload, 'template_type') === 'generic') {\n return [\n 'generic' => $this->parseGenericTempalte($payload),\n ];\n }\n }\n\n // Image\n if ($this->type === 'image') {\n $payload = Arr::get($this->message, 'attachments.0.payload');\n return [\n 'image' => $this->parseImageAttachment($payload),\n ];\n }\n\n // This for unsupported messages.\n return [];\n }", "public static function extractMsg (string $msg) : string {\n\t\tif (($pos = strpos ($msg, ':')) === false || ($command = \\DataLib::isInt (substr ($msg, 0, $pos))) === false || !Command::isCommand ($command)) {\n\t\t\treturn '';\n\t\t}\n\t\treturn substr ($msg, $pos + 1);\n\t}", "public function readMsg()\n\t{\n\t\tglobal $_THRESH, $_LOCKTHRESH;\n\t\t\n\t\tif($this->_SERIAL->_ckOpened() == false) { return \"fail\";}\n\t\t$this->_SERIAL->serialflush();\n\t\t\n\t\t$result = -5;\n\t\t$data = \"\";\n\t\t$i = 0;\n\t\t\n\t\t//This regex looks for any whitespace characters (\\n, char(10), etc.)\n\t\twhile (!preg_match(\"/[\\s,]+/\", $data))\n\t\t{\n\t\t\tif($i >=75000) {\n\t\t\t\treturn \"failed to read data. Value of loop: \".$i;\n\t\t\t}\n\t\t\n\t\t\t$i++;\n\t\t\t$data .= $this->_SERIAL->readPort();\n\t\t}\n\n\t\t$arr = str_split($data);\n\n\t\t// First byte of incoming message determines what type it is.\n\t\t$resultID = $arr[0];\n\n\t\t// after type is determined these statements extract relevant data from rest of the message.\n\t\tif ($resultID == \"s\")\n\t\t{\n\t\t\t$value = (ord($arr[3])*256)+ord($arr[4]);\n\n\t\t\tif($value > $_THRESH)\n\t\t\t\t$result = 1; // Filled\n\t\t\telse \n\t\t\t\t$result = 0; // UnFilled\n\t\t}\n\t\telseif ($resultID == \"l\")\n\t\t{\n\t\t\t$value = (ord($arr[3])*256)+ord($arr[4]);\n\n\t\t\tif($value < $_LOCKTHRESH) \n\t\t\t\t$result = 1; // UnLocked\n\t\t\telse \n\t\t\t\t$result = 0; // locked\n\t\t}\n\t\telseif ($resultID == \"a\")\n\t\t{\n\t\t\t$result = 1; // message was confirmed\n\t\t}\n\t\telseif ($resultID == \"n\")\n\t\t{\n\t\t\t$iDplusCol = Array(0 => ord($arr[1]), 1 => ord($arr[2]));\n\t\t\treturn $iDplusCol; // new column was found return the number of boxes\n\t\t}\n\t\telseif ($resultID == \"t\")\n\t\t{\n\t\t\t$result= ord($arr[3]); // returns the size of queried box\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "#[Pure]\nfunction http_parse_message($message) {}", "public function parse();", "public function parse();", "public function parse();", "protected function parse() {}", "public function parseResponse($message);", "protected function handleEndBodyCommand()\n {\n if ($this->state === self::STATUS_UNFOLDING) {\n $this->message = $this->message->withAddedHeader($this->foldHeader, $this->foldBuffer);\n }\n\n $this->state = self::STATUS_PROCESSING;\n /**\n * Default action, using timer so that callbacks above can be called asynchronously.\n */\n $this->defaultActionTimer = $this->loop->addTimer($this->defaultActionTimeout, function() {\n if ($this->acceptByDefault) {\n $this->accept();\n } else {\n $this->reject();\n }\n });\n\n\n\n $this->emit('message', [\n 'from' => $this->from,\n 'recipients' => $this->recipients,\n 'message' => $this->message,\n 'connection' => $this,\n ]);\n }", "public function parse($buffer)\n {\n $pos = 1; // The remain length is start from second byte.\n $remainLen = \\Mqtt\\Message\\Util::decodeRemainLength($buffer, $pos);\n $this->header->setRemainLen($remainLen);\n $this->header->parseVarHeader($buffer, $pos);\n $this->parseBody($buffer, $pos);\n }" ]
[ "0.62496626", "0.5553664", "0.55003005", "0.5401865", "0.53614014", "0.53351736", "0.52289736", "0.51861334", "0.51696557", "0.51074755", "0.5017843", "0.50105345", "0.50105345", "0.50105345", "0.50105345", "0.4986406", "0.49645597", "0.49479386", "0.49140695", "0.49042082", "0.48727658", "0.48687214", "0.48668563", "0.48241177", "0.48241177", "0.48241177", "0.48155153", "0.48134568", "0.48039734", "0.47833472" ]
0.74872094
0
Get name of column
public function getName() { return $this['column_name']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function column_name(): mixed\n\t{\n\t\treturn self::$query->column_name;\n\t}", "public function getColumnName();", "public function getNameColumn()\n {\n return $this->nameColumn;\n }", "public function getColumn(): string\n {\n return $this->column;\n }", "public function getColumn(): string\n {\n return $this->_column;\n }", "public function getColumnName()\n {\n return $this->columnName;\n }", "abstract public static function get_column_name(): string;", "public function getColumnName() {\n return $this->columnName;\n }", "private function getColumn(): string\n {\n return $this->getUsernameColumnName();\n }", "public function getName()\n {\n return name_to_id($this->columnName);\n }", "public function getColumn()\n {\n return $this->get('Column');\n }", "public function getConstantColumnName()\n { if ($this->getPeerName()) {\n return strtoupper($this->getPeerName());\n }\n\n return strtoupper($this->getName());\n }", "public function getColumn()\n {\n return $this->column;\n }", "public function getColumn()\n {\n return $this->column;\n }", "public function getColumn(): string;", "public function getColumnName(){\n $sql = 'SELECT * FROM wp_operatore_museale';\n $result = $this->conn->query($sql);\n $column = array();\n $i = 0;\n while($nameColumn = $result->fetch_field()){\n $column[$i] = $nameColumn->name;\n $i++;\n }\n return $column;\n }", "protected function getWhereColumn()\n {\n $table = $this->getDoctrineTable();\n \n if ($this->getOption('column'))\n {\n return $table->getColumnName($this->getOption('column'));\n }\n\n $identifier = (array) $table->getIdentifier();\n $columnName = current($identifier);\n\n return $table->getColumnName($columnName);\n }", "protected function get_column() {\n\n\t\t$column = $this->foreign_column ?: $this->foreign_table->get_primary_key();\n\t\t$columns = $this->foreign_table->get_columns();\n\n\t\treturn $columns[ $column ];\n\t}", "public function getCol()\n {\n return $this->col;\n }", "public function getColumn() { return $this->column; }", "public function getSqlCol()\n {\n return $this->sqlCol;\n }", "public function getVariableColumnName()\r\n\t{\r\n\t\treturn $this->variable_column_name;\r\n\t}", "public function column_name($item)\n {\n }", "public function getColumnId(): string\n {\n return $this->getColumn('id', 'id');\n }", "public function get_column_key() {\n\t\treturn $this->column_key;\n\t}", "public function column() : int\n {\n return $this->column;\n }", "public function getDataColumn()\n {\n return $this->dataColumn;\n }", "public function getColumn($name)\n {\n return $this->columns[$name];\n }", "protected function getUuidColumnName() {\n\n $uuidColumn = null;\n\n if ( ! $this->uuidFieldName ) {\n\n $this->initializeHasUuid();\n }\n\n return $this->uuidFieldName;\n }", "abstract public function getColNames();" ]
[ "0.87750936", "0.8556205", "0.85281396", "0.84585154", "0.84172577", "0.84102434", "0.8409938", "0.8364791", "0.8170897", "0.7926157", "0.7836915", "0.7834179", "0.77914774", "0.77914774", "0.7765352", "0.7706178", "0.765601", "0.75924397", "0.7591639", "0.758055", "0.75043964", "0.743066", "0.73376346", "0.73259133", "0.73191977", "0.7311724", "0.73011255", "0.72947073", "0.72610056", "0.72375405" ]
0.85707176
1
Complete the current file stream (zip64 format).
public function completeFileStream() { $crc = hexdec(hash_final($this->hash_ctx)); // convert the 64 bit ints to 2 32bit ints list($zlen_low, $zlen_high) = $this->int64Split($this->zlen); list($len_low, $len_high) = $this->int64Split($this->len); // build data descriptor $fields = [ // (from V.A of APPNOTE.TXT) ['V', 0x08074b50], // data descriptor ['V', $crc], // crc32 of data ['V', $zlen_low], // compressed data length (low) ['V', $zlen_high], // compressed data length (high) ['V', $len_low], // uncompressed data length (low) ['V', $len_high], // uncompressed data length (high) ]; // pack fields and calculate "total" length $ret = $this->packFields($fields); // print header and filename $this->send($ret); // Update cdr for file record $this->current_file_stream[3] = $crc; $this->current_file_stream[4] = gmp_strval($this->zlen); $this->current_file_stream[5] = gmp_strval($this->len); $this->current_file_stream[6] += gmp_strval(gmp_add(gmp_init(strlen($ret)), $this->zlen)); ksort($this->current_file_stream); // Add to cdr and increment offset - can't call directly because we pass an array of params call_user_func_array([$this, 'addToCdr'], $this->current_file_stream); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function close()\n\t{\n\t\t$this->zip->close();\n\t}", "public function close() {\n\n \tif($this->zip_archive !== NULL) {\n \t\t$this->zip_archive->close();\n \t}\n\n }", "protected function closeArchive() {\n $this->zip->close();\n }", "public function open() {\r\n\t\tif (!$this->opened) {\r\n\t\t\tif ($this->isZipped) $this->file = new ZipFile($this->archiveName, $this->mode);\r\n\t\t\telse {\r\n\t\t\t\t// test compression\r\n\t\t\t\t$this->file = new File($this->archiveName, $this->mode);\r\n\t\t\t\tif ($this->file->read(2) == \"\\37\\213\") {\r\n\t\t\t\t\t$this->file->close();\r\n\t\t\t\t\t$this->isZipped = true;\r\n\t\t\t\t\t$this->file = new ZipFile($this->archiveName, $this->mode);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$this->file->seek(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->opened = true;\r\n\t\t}\r\n\t}", "public function close()\n {\n if ($this->inputStream !== null) {\n $this->inputStream->close();\n $this->inputStream = null;\n $this->zipModel = new ZipModel();\n }\n }", "public function next()\n {\n next($this->zipModel->getEntries());\n }", "public function rewind()\n {\n reset($this->zipModel->getEntries());\n }", "public function zippedFile()\r\n {\r\n $data = implode(\"\", $this->datasec);\r\n $ctrldir = implode(\"\", $this->ctrlDir);\r\n\r\n return $data.\r\n $ctrldir.\r\n $this->eofCtrlDir.\r\n pack(\"v\", sizeof($this->ctrlDir)). // total number of entries \"on this disk\"\r\n pack(\"v\", sizeof($this->ctrlDir)). // total number of entries overall\r\n pack(\"V\", strlen($ctrldir)). // size of central dir\r\n pack(\"V\", strlen($data)). // offset to start of central dir\r\n \"\\x00\\x00\"; // .zip file comment length\r\n }", "private function extract(): void\n {\n if (file_exists($this->tmpDir) && is_dir($this->tmpDir)) {\n $this->rrmdir($this->tmpDir);\n }\n\n mkdir($this->tmpDir);\n\n $this->zipClass->open($this->path);\n $this->zipClass->extractTo($this->tmpDir);\n\n $index = 1;\n while (false !== $this->zipClass->locateName($this->getHeaderName($index))) {\n $this->tempDocumentHeaders[$index] = $this->readPartWithRels($this->getHeaderName($index));\n $index++;\n }\n $index = 1;\n while (false !== $this->zipClass->locateName($this->getFooterName($index))) {\n $this->tempDocumentFooters[$index] = $this->readPartWithRels($this->getFooterName($index));\n $index++;\n }\n\n $this->tempDocumentMainPart = $this->readPartWithRels($this->getMainPartName());\n\n $this->tempDocumentContentTypes = $this->zipClass->getFromName($this->getDocumentContentTypesName());\n\n $this->document = file_get_contents(sprintf('%s%sword%sdocument.xml', $this->tmpDir, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR));\n }", "public function Finish()\r\n {\r\n $bitLength = $this->LeftRotateLong($this->byteCount , 3);\r\n //\r\n // add the pad bytes.\r\n //\r\n $this->Update(128);\r\n\r\n while ($this->xBufOff != 0) $this->Update(0);\r\n $this->ProcessLength($bitLength);\r\n $this->ProcessBlock();\r\n }", "protected function openArchive() {\n $zipname = $this->tempPath() . self::ZIPTEMP_STUB;\n\n // get size of $zipname, save to $this->zip_size\n $this->zip_size = file_exists($zipname) ? filesize($zipname) : 0;\n\n if (class_exists('ZipArchive')) {\n $this->writeLog(true, '<p>Archiving with ZipArchive</p>');\n $this->zip = new ZipArchive();\n if (file_exists($zipname)) {\n $res = $this->zip->open($zipname);\n } else {\n $res = $this->zip->open($zipname, ZipArchive::CREATE | ZipArchive::OVERWRITE);\n }\n\n if ($res !== true) {\n foreach ($this->zip_errors as $const => $message) {\n if (constant('ZipArchive::'.$const) === $res) {\n $this->writeLog('<code>ZipArchive::open()</code> failure:', $this->zip_errors[$const], '<br>');\n return;\n }\n }\n }\n } else {\n $this->writeLog(true, '<p>Archiving with Splitbrain_Zip</p>');\n include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . '_inc' . DIRECTORY_SEPARATOR . 'class.Splitbrain_Zip.php');\n $this->zip = new Splitbrain_Zip();\n\n if (file_exists($zipname)) {\n $this->zip->open($zipname);\n } else {\n $this->zip->create($zipname);\n }\n }\n\n $this->zip_ulimit = 0;\n\n return $zipname;\n }", "function _archiveFile() {\n\t\t$this->_moveFile($this->_processingPath, $this->_archivePath, $this->_claimedFilename);\n\t}", "public function getZippedfile() {\r\n\r\n $data = implode(\"\", $this -> compressedData); \r\n $controlDirectory = implode(\"\", $this -> centralDirectory); \r\n\r\n return \r\n $data. \r\n $controlDirectory. \r\n $this -> endOfCentralDirectory. \r\n pack(\"v\", sizeof($this -> centralDirectory)). \r\n pack(\"v\", sizeof($this -> centralDirectory)). \r\n pack(\"V\", strlen($controlDirectory)). \r\n pack(\"V\", strlen($data)). \r\n \"\\x00\\x00\"; \r\n }", "protected function archive() {\n\n // Instantiating Zip object\n $oZip = new ZipArchive;\n $directory = 'app/' . $this->sDirectory;\n $userId = explode('-', $this->sDirectory);\n $userId = $userId[0];\n\n // Retrieving downloaded files\n $files = File::allFiles(storage_path($directory));\n\n // Archiving logic\n $fileName = $this->sDirectory . '.zip';\n if ($oZip->open(public_path($fileName), ZipArchive::CREATE) == TRUE) {\n foreach ($files as $aFile) {\n $filePath = explode($this->sDirectory, base_path($aFile));\n $sFilePath = substr(str_replace('\\\\', '/', $filePath[1]), 1);\n $oZip->addFile($aFile, $sFilePath);\n }\n $oZip->close();\n\n // Updating download status to READY\n $user = User::find($userId);\n $user->download_status = 'READY';\n $user->save();\n }\n }", "public function close()\n\t{\n\t\treturn $this->zipArchive->close();\n\t}", "public function extract() {\n $this->fileInfo();\n\n $zip = new ZipArchive;\n $res = $zip->open($this->filePath);\n\n if ($res === TRUE) {\n // Extract the file.\n $zip->extractTo($this->extractPath);\n $zip->close();\n $this->path = $this->extractPath;\n }\n else {\n // couldn't extract the zip file, display an error message and watchdog.\n $params = array(\n '@file' => $this->filePath,\n '@path' => $this->extractPath,\n );\n\n $message = t('Unable to extract @file to @path', $params);\n watchdog('subtheme', $message);\n drupal_set_message($message, 'error');\n }\n }", "public function finish()\n {\n return file_get_contents( $this->file_name );\n }", "public function finish(): int\n {\n $centralDirectoryStartOffsetOnDisk = $this->offset;\n $sizeOfCentralDirectory = 0;\n\n // add trailing cdr file records\n foreach ($this->centralDirectoryRecords as $centralDirectoryRecord) {\n $this->send($centralDirectoryRecord);\n $sizeOfCentralDirectory += strlen($centralDirectoryRecord);\n }\n\n // Add 64bit headers (if applicable)\n if (count($this->centralDirectoryRecords) >= 0xFFFF ||\n $centralDirectoryStartOffsetOnDisk > 0xFFFFFFFF ||\n $sizeOfCentralDirectory > 0xFFFFFFFF) {\n if (!$this->enableZip64) {\n throw new OverflowException();\n }\n\n $this->send(Zip64\\EndOfCentralDirectory::generate(\n versionMadeBy: self::ZIP_VERSION_MADE_BY,\n versionNeededToExtract: Version::ZIP64->value,\n numberOfThisDisk: 0,\n numberOfTheDiskWithCentralDirectoryStart: 0,\n numberOfCentralDirectoryEntriesOnThisDisk: count($this->centralDirectoryRecords),\n numberOfCentralDirectoryEntries: count($this->centralDirectoryRecords),\n sizeOfCentralDirectory: $sizeOfCentralDirectory,\n centralDirectoryStartOffsetOnDisk: $centralDirectoryStartOffsetOnDisk,\n extensibleDataSector: '',\n ));\n\n $this->send(Zip64\\EndOfCentralDirectoryLocator::generate(\n numberOfTheDiskWithZip64CentralDirectoryStart: 0x00,\n zip64centralDirectoryStartOffsetOnDisk: $centralDirectoryStartOffsetOnDisk + $sizeOfCentralDirectory,\n totalNumberOfDisks: 1,\n ));\n }\n\n // add trailing cdr eof record\n $numberOfCentralDirectoryEntries = min(count($this->centralDirectoryRecords), 0xFFFF);\n $this->send(EndOfCentralDirectory::generate(\n numberOfThisDisk: 0x00,\n numberOfTheDiskWithCentralDirectoryStart: 0x00,\n numberOfCentralDirectoryEntriesOnThisDisk: $numberOfCentralDirectoryEntries,\n numberOfCentralDirectoryEntries: $numberOfCentralDirectoryEntries,\n sizeOfCentralDirectory: min($sizeOfCentralDirectory, 0xFFFFFFFF),\n centralDirectoryStartOffsetOnDisk: min($centralDirectoryStartOffsetOnDisk, 0xFFFFFFFF),\n zipFileComment: $this->comment,\n ));\n\n $size = $this->offset;\n\n // The End\n $this->clear();\n\n return $size;\n }", "function privReadEndCentralDir(&$p_central_dir)\n {\n $v_result=1;\n\n // ----- Go to the end of the zip file\n $v_size = filesize($this->zipname);\n @fseek($this->zip_fd, $v_size);\n if (@ftell($this->zip_fd) != $v_size)\n {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \\''.$this->zipname.'\\'');\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- First try : look if this is an archive with no commentaries (most of the time)\n // in this case the end of central dir is at 22 bytes of the file end\n $v_found = 0;\n if ($v_size > 26) {\n @fseek($this->zip_fd, $v_size-22);\n if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22))\n {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \\''.$this->zipname.'\\'');\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- Read for bytes\n $v_binary_data = @fread($this->zip_fd, 4);\n $v_data = @unpack('Vid', $v_binary_data);\n\n // ----- Check signature\n if ($v_data['id'] == 0x06054b50) {\n $v_found = 1;\n }\n\n $v_pos = ftell($this->zip_fd);\n }\n\n // ----- Go back to the maximum possible size of the Central Dir End Record\n if (!$v_found) {\n $v_maximum_size = 65557; // 0xFFFF + 22;\n if ($v_maximum_size > $v_size)\n $v_maximum_size = $v_size;\n @fseek($this->zip_fd, $v_size-$v_maximum_size);\n if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size))\n {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \\''.$this->zipname.'\\'');\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- Read byte per byte in order to find the signature\n $v_pos = ftell($this->zip_fd);\n $v_bytes = 0x00000000;\n while ($v_pos < $v_size)\n {\n // ----- Read a byte\n $v_byte = @fread($this->zip_fd, 1);\n\n // ----- Add the byte\n //$v_bytes = ($v_bytes << 8) | Ord($v_byte);\n // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number\n // Otherwise on systems where we have 64bit integers the check below for the magic number will fail.\n $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte);\n\n // ----- Compare the bytes\n if ($v_bytes == 0x504b0506)\n {\n $v_pos++;\n break;\n }\n\n $v_pos++;\n }\n\n // ----- Look if not found end of central dir\n if ($v_pos == $v_size)\n {\n\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, \"Unable to find End of Central Dir Record signature\");\n\n // ----- Return\n return PclZip::errorCode();\n }\n }\n\n // ----- Read the first 18 bytes of the header\n $v_binary_data = fread($this->zip_fd, 18);\n\n // ----- Look for invalid block size\n if (strlen($v_binary_data) != 18)\n {\n\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, \"Invalid End of Central Dir Record size : \".strlen($v_binary_data));\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- Extract the values\n $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data);\n\n // ----- Check the global size\n if (($v_pos + $v_data['comment_size'] + 18) != $v_size) {\n\n\t // ----- Removed in release 2.2 see readme file\n\t // The check of the file size is a little too strict.\n\t // Some bugs where found when a zip is encrypted/decrypted with 'crypt'.\n\t // While decrypted, zip has training 0 bytes\n\t if (0) {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT,\n\t 'The central dir is not at the end of the archive.'\n\t\t\t\t\t\t .' Some trailing bytes exists after the archive.');\n\n // ----- Return\n return PclZip::errorCode();\n\t }\n }\n\n // ----- Get comment\n if ($v_data['comment_size'] != 0) {\n $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']);\n }\n else\n $p_central_dir['comment'] = '';\n\n $p_central_dir['entries'] = $v_data['entries'];\n $p_central_dir['disk_entries'] = $v_data['disk_entries'];\n $p_central_dir['offset'] = $v_data['offset'];\n $p_central_dir['size'] = $v_data['size'];\n $p_central_dir['disk'] = $v_data['disk'];\n $p_central_dir['disk_start'] = $v_data['disk_start'];\n\n // TBC\n //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) {\n //}\n\n // ----- Return\n return $v_result;\n }", "public function stream_eof() {}", "public function getFile()\n {\n header('Content-type: ' . $this->mime_type);\n header('Content-Disposition: attachment; filename=' . $this->original_name);\n \n echo gzuncompress(base64_decode($this->content));\n \n die();\n }", "private function addCdrEofZip64()\n {\n $num = count($this->files);\n \n list($num_low, $num_high) = $this->int64Split($num);\n list($cdr_len_low, $cdr_len_high) = $this->int64Split($this->cdr_len);\n list($cdr_ofs_low, $cdr_ofs_high) = $this->int64Split($this->cdr_ofs);\n \n $fields = [ // (from V,F of APPNOTE.TXT)\n ['V', 0x06064b50], // zip64 end of central directory signature\n ['V', 44], // size of zip64 end of central directory record (low) minus 12 bytes\n ['V', 0], // size of zip64 end of central directory record (high)\n ['v', self::VERSION], // version made by\n ['v', self::VERSION], // version needed to extract\n ['V', 0x0000], // this disk number (only one disk)\n ['V', 0x0000], // number of disk with central dir\n ['V', $num_low], // number of entries in the cdr for this disk (low)\n ['V', $num_high], // number of entries in the cdr for this disk (high)\n ['V', $num_low], // number of entries in the cdr (low)\n ['V', $num_high], // number of entries in the cdr (high)\n ['V', $cdr_len_low], // cdr size (low)\n ['V', $cdr_len_high], // cdr size (high)\n ['V', $cdr_ofs_low], // cdr ofs (low)\n ['V', $cdr_ofs_high], // cdr ofs (high)\n ];\n \n $ret = $this->packFields($fields);\n $this->send($ret);\n }", "public function fileEnd(): void;", "abstract protected function onArchiveReady(InputInterface $input, OutputInterface $output);", "public function reset() {\r\n $this->zip->unchangeAll();\r\n }", "public function complete();", "public function complete();", "public function rewrite()\n {\n if ($this->inputStream === null) {\n throw new ZipException('input stream is null');\n }\n $meta = stream_get_meta_data($this->inputStream->getStream());\n $content = $this->outputAsString();\n $this->close();\n if ($meta['wrapper_type'] === 'plainfile') {\n /**\n * @var resource $uri\n */\n $uri = $meta['uri'];\n if (file_put_contents($uri, $content) === false) {\n throw new ZipException(\"Can not overwrite the zip file in the $uri file.\");\n }\n if (!($handle = @fopen($uri, 'rb'))) {\n throw new ZipException(\"File $uri can't open.\");\n }\n return $this->openFromStream($handle);\n }\n return $this->openFromString($content);\n }", "protected function extractSource(): void\n {\n $uncompressedDir = $this->getUncompressedRoute();\n\n $sourceZip = new ZipArchive();\n $sourceZip->open($this->getHeaderFile());\n $sourceZip->extractTo($uncompressedDir);\n $sourceZip->close();\n }", "public function end_stream(){\r\n\t\t\t$this->stream->endElement(); // program\r\n\t\t\t$this->stream->endDocument();\r\n\t\t\techo $this->stream->outputMemory();\r\n\t\t}" ]
[ "0.6206459", "0.60522884", "0.6006885", "0.59269696", "0.5763847", "0.5577529", "0.5529851", "0.55086654", "0.54959804", "0.5480804", "0.54081136", "0.5371854", "0.53295326", "0.5309901", "0.53073716", "0.5287815", "0.52678114", "0.52616495", "0.5252909", "0.5241365", "0.5231001", "0.5225715", "0.51979566", "0.5194622", "0.5187623", "0.5152069", "0.5152069", "0.51417035", "0.5132826", "0.51325643" ]
0.69746137
0
Split a 64bit integer to two 32bit integers.
protected function int64Split($value) { // gmp if (is_resource($value) || $value instanceof \GMP) { $hex = str_pad(gmp_strval($value, 16), 16, '0', STR_PAD_LEFT); $high = $this->gmpConvert(substr($hex, 0, 8), 16, 10); $low = $this->gmpConvert(substr($hex, 8, 8), 16, 10); } // int else { $left = 0xffffffff00000000; $right = 0x00000000ffffffff; $high = ($value & $left) >> 32; $low = $value & $right; } return [$low, $high]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function snmp_dewrap32bit($value)\n{\n if (is_numeric($value) && $value < 0)\n {\n return ($value + 4294967296);\n } else {\n return $value;\n }\n}", "public static function leftShift32($x, $y) {\n $n = $x << $y;\n if (PHP_INT_MAX != 0x80000000) {\n $n = -(~($n & 0x00000000FFFFFFFF) + 1);\n } return (int)$n;\n }", "public function readInt32LE();", "public function consumeInt64()\n {\n $s = $this->consume(8);\n if (self::$native64BitPack) {\n list(, $ret) = unpack(\"q\", self::$isLittleEndian ? self::swapEndian64($s) : $s);\n } else {\n $d = unpack(\"Lh/Ll\", self::$isLittleEndian ? self::swapHalvedEndian64($s) : $s);\n $ret = $d[\"h\"] << 32 | $d[\"l\"];\n }\n return $ret;\n }", "protected final function _decodeSynchsafe32($val)\n {\n return ($val & 0x7f) | ($val & 0x7f00) >> 1 |\n ($val & 0x7f0000) >> 2 | ($val & 0x7f000000) >> 3;\n }", "static function packInt64($x) {\n if (PHP_INT_SIZE == 8) {\n if (version_compare(PHP_VERSION, '5.6.3', '>=')) {\n return pack('J', $x);\n } else {\n return pack('NN', ($x & 0xFFFFFFFF00000000) >> 32, $x & ($x & 0x00000000FFFFFFFF)); \n }\n } else {\n // 32-bit system\n return \"\\x00\\x00\\x00\\x00\" . pack('N', $x);\n }\n }", "function _Make64 ( $hi, $lo )\n{\n\n // on x64, we can just use int\n if ( ((int)4294967296)!=0 )\n return (((int)$hi)<<32) + ((int)$lo);\n\n // workaround signed/unsigned braindamage on x32\n $hi = sprintf ( \"%u\", $hi );\n $lo = sprintf ( \"%u\", $lo );\n\n // use GMP or bcmath if possible\n if ( function_exists(\"gmp_mul\") )\n return gmp_strval ( gmp_add ( gmp_mul ( $hi, \"4294967296\" ), $lo ) );\n\n if ( function_exists(\"bcmul\") )\n return bcadd ( bcmul ( $hi, \"4294967296\" ), $lo );\n\n // compute everything manually\n $a = substr ( $hi, 0, -5 );\n $b = substr ( $hi, -5 );\n $ac = $a*42949; // hope that float precision is enough\n $bd = $b*67296;\n $adbc = $a*67296+$b*42949;\n $r4 = substr ( $bd, -5 ) + + substr ( $lo, -5 );\n $r3 = substr ( $bd, 0, -5 ) + substr ( $adbc, -5 ) + substr ( $lo, 0, -5 );\n $r2 = substr ( $adbc, 0, -5 ) + substr ( $ac, -5 );\n $r1 = substr ( $ac, 0, -5 );\n while ( $r4>100000 ) { $r4-=100000; $r3++; }\n while ( $r3>100000 ) { $r3-=100000; $r2++; }\n while ( $r2>100000 ) { $r2-=100000; $r1++; }\n\n $r = sprintf ( \"%d%05d%05d%05d\", $r1, $r2, $r3, $r4 );\n $l = strlen($r);\n $i = 0;\n while ( $r[$i]==\"0\" && $i<$l-1 )\n $i++;\n return substr ( $r, $i ); \n}", "public static function ensure32BitInteger($value) {}", "function _twobytes2int_le($s) {\n\treturn (ord(substr($s, 1, 1))<<8) + ord(substr($s, 0, 1));\n}", "function _fourbytes2int_le($s) {\n\treturn (ord($s[3])<<24) + (ord($s[2])<<16) + (ord($s[1])<<8) + ord($s[0]);\n}", "public function testSLongLittle()\n {\n $this->markTestIncomplete('Does not work on 64bit systems!');\n $o = PelConvert::LITTLE_ENDIAN;\n\n /*\n * The easiest way to calculate the numbers to compare with, is to\n * let PHP do the arithmetic for us. When using the bit-wise\n * operators PHP will return a proper signed 32 bit integer.\n */\n\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 0, $o), 0x00 << 24 | 0x00 << 16 | 0x00 << 8 | 0x00);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 1, $o), 0x01 << 24 | 0x00 << 16 | 0x00 << 8 | 0x00);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 2, $o), 0x23 << 24 | 0x01 << 16 | 0x00 << 8 | 0x00);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 3, $o), 0x45 << 24 | 0x23 << 16 | 0x01 << 8 | 0x00);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 4, $o), 0x67 << 24 | 0x45 << 16 | 0x23 << 8 | 0x01);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 5, $o), 0x89 << 24 | 0x67 << 16 | 0x45 << 8 | 0x23);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 6, $o), 0xAB << 24 | 0x89 << 16 | 0x67 << 8 | 0x45);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 7, $o), 0xCD << 24 | 0xAB << 16 | 0x89 << 8 | 0x67);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 8, $o), 0xEF << 24 | 0xCD << 16 | 0xAB << 8 | 0x89);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 9, $o), 0xFF << 24 | 0xEF << 16 | 0xCD << 8 | 0xAB);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 10, $o), 0xFF << 24 | 0xFF << 16 | 0xEF << 8 | 0xCD);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 11, $o), 0xFF << 24 | 0xFF << 16 | 0xFF << 8 | 0xEF);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 12, $o), 0xFF << 24 | 0xFF << 16 | 0xFF << 8 | 0xFF);\n }", "public function readInt32BE();", "function bigendian_int($str){\n\t$bits = array_map(\"intval\",str_split($str,1));\n\t$v = 0;\n\t$x = 0;\n\tfor($i = strlen($str) - 1; $i >= 0; --$i){\n\t\t$v += pow(2, $i) * $bits[$x];\n\t\t++$x;\n\t}\n\treturn $v;\n\n}", "public static function unpackInt64Hex($data) {\n\t\t//return hex number string\n\t\t$tokens = unpack(\"H*\", strrev($data));\n\t\treturn $tokens[1];\n\t}", "public static function divide(IInt32\\Type $x, IInt32\\Type $y) : IInt32\\Type {\n\t\t\treturn IInt32\\Type::box(intdiv($x->unbox(), $y->unbox()));\n\t\t}", "public function readInt32();", "public function readUInt32LE();", "function int_to_dword($n)\r\n\t{\r\n\t\treturn chr($n & 255).chr(($n >> 8) & 255).chr(($n >> 16) & 255).chr(($n >> 24) & 255);\r\n\t}", "function pack_p($value) {\n $first_half = pack('V', $value & 0xffffffff);\n $second_half = pack('V', ($value >> 32) & 0xffffffff);\n\n return $first_half . $second_half;\n}", "public static function modulo(IInt32\\Type $x, IInt32\\Type $y) : IInt32\\Type {\n\t\t\treturn IInt32\\Type::box($x->unbox() % $y->unbox());\n\t\t}", "public function testSLongBig()\n {\n $this->markTestIncomplete('Does not work on 64bit systems!');\n\n $o = PelConvert::BIG_ENDIAN;\n\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 0, $o), 0x00 << 24 | 0x00 << 16 | 0x00 << 8 | 0x00);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 1, $o), 0x00 << 24 | 0x00 << 16 | 0x00 << 8 | 0x01);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 2, $o), 0x00 << 24 | 0x00 << 16 | 0x01 << 8 | 0x23);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 3, $o), 0x00 << 24 | 0x01 << 16 | 0x23 << 8 | 0x45);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 4, $o), 0x01 << 24 | 0x23 << 16 | 0x45 << 8 | 0x67);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 5, $o), 0x23 << 24 | 0x45 << 16 | 0x67 << 8 | 0x89);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 6, $o), 0x45 << 24 | 0x67 << 16 | 0x89 << 8 | 0xAB);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 7, $o), 0x67 << 24 | 0x89 << 16 | 0xAB << 8 | 0xCD);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 8, $o), 0x89 << 24 | 0xAB << 16 | 0xCD << 8 | 0xEF);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 9, $o), 0xAB << 24 | 0xCD << 16 | 0xEF << 8 | 0xFF);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 10, $o), 0xCD << 24 | 0xEF << 16 | 0xFF << 8 | 0xFF);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 11, $o), 0xEF << 24 | 0xFF << 16 | 0xFF << 8 | 0xFF);\n $this->assertEquals(PelConvert::bytesToSLong($this->bytes, 12, $o), 0xFF << 24 | 0xFF << 16 | 0xFF << 8 | 0xFF);\n }", "public function consumeUint64()\n {\n $s = $this->consume(8);\n if (self::$native64BitPack) {\n list(, $ret) = unpack(\"Q\", self::$isLittleEndian ? self::swapEndian64($s) : $s);\n } else {\n $d = unpack(\"Lh/Ll\", self::$isLittleEndian ? self::swapHalvedEndian64($s) : $s);\n $ret = $d[\"h\"] << 32 | $d[\"l\"];\n }\n return $ret;\n }", "function ADD64AA(&$v, $a, $b) {\n\t\t$o0 = $v[$a] + $v[$b];\n\t\t$o1 = $v[$a + 1] + $v[$b + 1];\n\t\tif ($o0 >= 4294967296) {\n\t\t\t$o1++;\n\t\t}\n\t\t$v[$a] = $o0 & 0xffffffff;\n\t\t$v[$a + 1] = $o1 & 0xffffffff;\n\t}", "static public function intToMBUInt32(&$out, $i)\n {\n if ($i > 268435455) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n $bytes2 = 128 | Horde_Xml_Wbxml::getBits(2, $i);\n $bytes3 = 128 | Horde_Xml_Wbxml::getBits(3, $i);\n $bytes4 = 128 | Horde_Xml_Wbxml::getBits(4, $i);\n\n $out .= chr($bytes4) . chr($bytes3) . chr($bytes2) . chr($bytes1) . chr($bytes0);\n } elseif ($i > 2097151) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n $bytes2 = 128 | Horde_Xml_Wbxml::getBits(2, $i);\n $bytes3 = 128 | Horde_Xml_Wbxml::getBits(3, $i);\n\n $out .= chr($bytes3) . chr($bytes2) . chr($bytes1) . chr($bytes0);\n } elseif ($i > 16383) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n $bytes2 = 128 | Horde_Xml_Wbxml::getBits(2, $i);\n\n $out .= chr($bytes2) . chr($bytes1) . chr($bytes0);\n } elseif ($i > 127) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n\n $out .= chr($bytes1) . chr($bytes0);\n } else {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n\n $out .= chr($bytes0);\n }\n }", "function inet6_to_int64($addr)\r\n{\r\n /* Expand the address if necessary */\r\n if (strlen($addr) != 39) {\r\n $addr = inet6_expand($addr);\r\n if ($addr == false) return false;\r\n } // if\r\n $addr = str_replace(':', '', $addr);\r\n $p1 = '0x' . substr($addr, 0, 16);\r\n $p2 = '0x' . substr($addr, 16);\r\n $p1 = gmp_init($p1);\r\n $p2 = gmp_init($p2);\r\n $result = array(gmp_strval($p1), gmp_strval($p2));\r\n return $result;\r\n}", "public function consumeInt32()\n {\n $s = $this->consume(4);\n list(, $ret) = unpack(\"l\", self::$isLittleEndian ? self::swapEndian32($s) : $s);\n return $ret;\n }", "function gen_subnet_mask_long($bits) {\n\t$sm = 0;\n\tfor ($i = 0; $i < $bits; $i++) {\n\t\t$sm >>= 1;\n\t\t$sm |= 0x80000000;\n\t}\n\treturn $sm;\n}", "function long2base32($long, $pad=0)\r\n{\r\n global $base_charset;\r\n\r\n $num = floatval($long);\r\n if ($num < 1) return $base_charset[32][0];\r\n if (empty($pad)) $pad = 1;\r\n\r\n $s_out = '';\r\n while ($num >= 1) {\r\n $n32 = intval($num % 32);\r\n $num = floor(($num - $n32) / 32);\r\n $s_out = $base_charset[32][$n32].$s_out;\r\n }\r\n while (strlen($s_out)<$pad) $s_out = $base_charset[32][0].$s_out;\r\n\r\n return $s_out;\r\n}", "public static function sid32($i64friendID)\n\t{\n\t\t$tmpfriendID = $i64friendID;\n\t\t$iServer = \"1\";\n\t\tif(bcmod($i64friendID, \"2\") == \"0\")\n\t\t{\n\t\t\t$iServer = \"0\";\n\t\t}\n\t\t$tmpfriendID = bcsub($tmpfriendID,$iServer);\n\t\tif(bccomp(\"76561197960265728\",$tmpfriendID) == -1)\n\t\t\t$tmpfriendID = bcsub($tmpfriendID,\"76561197960265728\");\n\t\t$tmpfriendID = bcdiv($tmpfriendID, \"2\");\n\t\treturn (\"STEAM_0:\" . $iServer . \":\" . $tmpfriendID);\n\t}", "public static function mask32($a) {\n if (PHP_INT_MAX != 0x0000000080000000) { # 2147483647\n $a = -(~($a & 0x00000000FFFFFFFF) + 1);\n } return (int)$a;\n }" ]
[ "0.6214209", "0.6066999", "0.5998854", "0.5849224", "0.58448803", "0.5796384", "0.57775843", "0.5649391", "0.5552255", "0.55408096", "0.5500989", "0.5476111", "0.5473092", "0.538279", "0.538074", "0.5332792", "0.52913016", "0.5266705", "0.5251856", "0.52393824", "0.51899266", "0.51696247", "0.51543474", "0.50545514", "0.5050233", "0.5037614", "0.5005736", "0.5003394", "0.49901542", "0.49575135" ]
0.7171849
0
Send CDR EOF (Central Directory Record EndofFile) record. Most values point to the corresponding values in the ZIP64 CDR. The optional comment still goes in this CDR however.
private function addCdrEof(array $opt = null) { // grab comment (if specified) $comment = ''; if ($opt && isset($opt['comment'])) { $comment = $opt['comment']; } $fields = [ // (from V,F of APPNOTE.TXT) ['V', 0x06054b50], // end of central file header signature ['v', 0xFFFF], // this disk number (0xFFFF to look in zip64 cdr) ['v', 0xFFFF], // number of disk with cdr (0xFFFF to look in zip64 cdr) ['v', 0xFFFF], // number of entries in the cdr on this disk (0xFFFF to look in zip64 cdr)) ['v', 0xFFFF], // number of entries in the cdr (0xFFFF to look in zip64 cdr) ['V', 0xFFFFFFFF], // cdr size (0xFFFFFFFF to look in zip64 cdr) ['V', 0xFFFFFFFF], // cdr offset (0xFFFFFFFF to look in zip64 cdr) ['v', strlen($comment)], // zip file comment length ]; $ret = $this->packFields($fields) . $comment; $this->send($ret); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function addCdrEofZip64()\n {\n $num = count($this->files);\n \n list($num_low, $num_high) = $this->int64Split($num);\n list($cdr_len_low, $cdr_len_high) = $this->int64Split($this->cdr_len);\n list($cdr_ofs_low, $cdr_ofs_high) = $this->int64Split($this->cdr_ofs);\n \n $fields = [ // (from V,F of APPNOTE.TXT)\n ['V', 0x06064b50], // zip64 end of central directory signature\n ['V', 44], // size of zip64 end of central directory record (low) minus 12 bytes\n ['V', 0], // size of zip64 end of central directory record (high)\n ['v', self::VERSION], // version made by\n ['v', self::VERSION], // version needed to extract\n ['V', 0x0000], // this disk number (only one disk)\n ['V', 0x0000], // number of disk with central dir\n ['V', $num_low], // number of entries in the cdr for this disk (low)\n ['V', $num_high], // number of entries in the cdr for this disk (high)\n ['V', $num_low], // number of entries in the cdr (low)\n ['V', $num_high], // number of entries in the cdr (high)\n ['V', $cdr_len_low], // cdr size (low)\n ['V', $cdr_len_high], // cdr size (high)\n ['V', $cdr_ofs_low], // cdr ofs (low)\n ['V', $cdr_ofs_high], // cdr ofs (high)\n ];\n \n $ret = $this->packFields($fields);\n $this->send($ret);\n }", "protected function readEndOfCentralDirectory(): EndOfCentralDirectory\n {\n if (!$this->findEndOfCentralDirectory()) {\n throw new ZipException('Invalid zip file. The end of the central directory could not be found.');\n }\n\n $positionECD = ftell($this->inStream) - 4;\n $sizeECD = $this->size - ftell($this->inStream);\n $buffer = fread($this->inStream, $sizeECD);\n\n [\n 'diskNo' => $diskNo,\n 'cdDiskNo' => $cdDiskNo,\n 'cdEntriesDisk' => $cdEntriesDisk,\n 'cdEntries' => $cdEntries,\n 'cdSize' => $cdSize,\n 'cdPos' => $cdPos,\n 'commentLength' => $commentLength,\n ] = unpack(\n 'vdiskNo/vcdDiskNo/vcdEntriesDisk/'\n . 'vcdEntries/VcdSize/VcdPos/vcommentLength',\n substr($buffer, 0, 18)\n );\n\n if (\n $diskNo !== 0\n || $cdDiskNo !== 0\n || $cdEntriesDisk !== $cdEntries\n ) {\n throw new ZipException(\n 'ZIP file spanning/splitting is not supported!'\n );\n }\n $comment = null;\n\n if ($commentLength > 0) {\n // .ZIP file comment (variable sizeECD)\n $comment = substr($buffer, 18, $commentLength);\n }\n\n // Check for ZIP64 End Of Central Directory Locator exists.\n $zip64ECDLocatorPosition = $positionECD - ZipConstants::ZIP64_END_CD_LOC_LEN;\n fseek($this->inStream, $zip64ECDLocatorPosition);\n // zip64 end of central dir locator\n // signature 4 bytes (0x07064b50)\n if (\n $zip64ECDLocatorPosition > 0\n && unpack('V', fread($this->inStream, 4))[1] === ZipConstants::ZIP64_END_CD_LOC\n ) {\n if (!$this->isZip64Support()) {\n throw new ZipException('ZIP64 not supported this archive.');\n }\n\n $positionECD = $this->findZip64ECDPosition();\n $endCentralDirectory = $this->readZip64EndOfCentralDirectory($positionECD);\n $endCentralDirectory->setComment($comment);\n } else {\n $endCentralDirectory = new EndOfCentralDirectory(\n $cdEntries,\n $cdPos,\n $cdSize,\n false,\n $comment\n );\n }\n\n return $endCentralDirectory;\n }", "function privReadEndCentralDir(&$p_central_dir)\n {\n $v_result=1;\n\n // ----- Go to the end of the zip file\n $v_size = filesize($this->zipname);\n @fseek($this->zip_fd, $v_size);\n if (@ftell($this->zip_fd) != $v_size)\n {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \\''.$this->zipname.'\\'');\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- First try : look if this is an archive with no commentaries (most of the time)\n // in this case the end of central dir is at 22 bytes of the file end\n $v_found = 0;\n if ($v_size > 26) {\n @fseek($this->zip_fd, $v_size-22);\n if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22))\n {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \\''.$this->zipname.'\\'');\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- Read for bytes\n $v_binary_data = @fread($this->zip_fd, 4);\n $v_data = @unpack('Vid', $v_binary_data);\n\n // ----- Check signature\n if ($v_data['id'] == 0x06054b50) {\n $v_found = 1;\n }\n\n $v_pos = ftell($this->zip_fd);\n }\n\n // ----- Go back to the maximum possible size of the Central Dir End Record\n if (!$v_found) {\n $v_maximum_size = 65557; // 0xFFFF + 22;\n if ($v_maximum_size > $v_size)\n $v_maximum_size = $v_size;\n @fseek($this->zip_fd, $v_size-$v_maximum_size);\n if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size))\n {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \\''.$this->zipname.'\\'');\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- Read byte per byte in order to find the signature\n $v_pos = ftell($this->zip_fd);\n $v_bytes = 0x00000000;\n while ($v_pos < $v_size)\n {\n // ----- Read a byte\n $v_byte = @fread($this->zip_fd, 1);\n\n // ----- Add the byte\n //$v_bytes = ($v_bytes << 8) | Ord($v_byte);\n // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number\n // Otherwise on systems where we have 64bit integers the check below for the magic number will fail.\n $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte);\n\n // ----- Compare the bytes\n if ($v_bytes == 0x504b0506)\n {\n $v_pos++;\n break;\n }\n\n $v_pos++;\n }\n\n // ----- Look if not found end of central dir\n if ($v_pos == $v_size)\n {\n\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, \"Unable to find End of Central Dir Record signature\");\n\n // ----- Return\n return PclZip::errorCode();\n }\n }\n\n // ----- Read the first 18 bytes of the header\n $v_binary_data = fread($this->zip_fd, 18);\n\n // ----- Look for invalid block size\n if (strlen($v_binary_data) != 18)\n {\n\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, \"Invalid End of Central Dir Record size : \".strlen($v_binary_data));\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- Extract the values\n $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data);\n\n // ----- Check the global size\n if (($v_pos + $v_data['comment_size'] + 18) != $v_size) {\n\n\t // ----- Removed in release 2.2 see readme file\n\t // The check of the file size is a little too strict.\n\t // Some bugs where found when a zip is encrypted/decrypted with 'crypt'.\n\t // While decrypted, zip has training 0 bytes\n\t if (0) {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT,\n\t 'The central dir is not at the end of the archive.'\n\t\t\t\t\t\t .' Some trailing bytes exists after the archive.');\n\n // ----- Return\n return PclZip::errorCode();\n\t }\n }\n\n // ----- Get comment\n if ($v_data['comment_size'] != 0) {\n $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']);\n }\n else\n $p_central_dir['comment'] = '';\n\n $p_central_dir['entries'] = $v_data['entries'];\n $p_central_dir['disk_entries'] = $v_data['disk_entries'];\n $p_central_dir['offset'] = $v_data['offset'];\n $p_central_dir['size'] = $v_data['size'];\n $p_central_dir['disk'] = $v_data['disk'];\n $p_central_dir['disk_start'] = $v_data['disk_start'];\n\n // TBC\n //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) {\n //}\n\n // ----- Return\n return $v_result;\n }", "protected function readZip64EndOfCentralDirectory(int $zip64ECDPosition): EndOfCentralDirectory\n {\n fseek($this->inStream, $zip64ECDPosition);\n\n $buffer = fread($this->inStream, ZipConstants::ZIP64_END_OF_CD_LEN);\n\n if (unpack('V', $buffer)[1] !== ZipConstants::ZIP64_END_CD) {\n throw new ZipException('Expected ZIP64 End Of Central Directory Record!');\n }\n\n [\n// 'size' => $size,\n// 'versionMadeBy' => $versionMadeBy,\n// 'extractVersion' => $extractVersion,\n 'diskNo' => $diskNo,\n 'cdDiskNo' => $cdDiskNo,\n 'cdEntriesDisk' => $cdEntriesDisk,\n 'entryCount' => $entryCount,\n 'cdSize' => $cdSize,\n 'cdPos' => $cdPos,\n ] = unpack(\n// 'Psize/vversionMadeBy/vextractVersion/'.\n 'VdiskNo/VcdDiskNo/PcdEntriesDisk/PentryCount/PcdSize/PcdPos',\n substr($buffer, 16, 40)\n );\n\n// $platform = ZipPlatform::fromValue(($versionMadeBy & 0xFF00) >> 8);\n// $softwareVersion = $versionMadeBy & 0x00FF;\n\n if ($diskNo !== 0 || $cdDiskNo !== 0 || $entryCount !== $cdEntriesDisk) {\n throw new ZipException('ZIP file spanning/splitting is not supported!');\n }\n\n if ($entryCount < 0 || $entryCount > 0x7FFFFFFF) {\n throw new ZipException('Total Number Of Entries In The Central Directory out of range!');\n }\n\n // skip zip64 extensible data sector (variable sizeEndCD)\n\n return new EndOfCentralDirectory(\n $entryCount,\n $cdPos,\n $cdSize,\n true\n );\n }", "private function addCdrEofLocatorZip64()\n {\n list($cdr_ofs_low, $cdr_ofs_high) = $this->int64Split($this->cdr_len + $this->cdr_ofs);\n \n $fields = [ // (from V,F of APPNOTE.TXT)\n ['V', 0x07064b50], // zip64 end of central dir locator signature\n ['V', 0], // this disk number\n ['V', $cdr_ofs_low], // cdr ofs (low)\n ['V', $cdr_ofs_high], // cdr ofs (high)\n ['V', 1], // total number of disks\n ];\n \n $ret = $this->packFields($fields);\n $this->send($ret);\n }", "public function finish(): int\n {\n $centralDirectoryStartOffsetOnDisk = $this->offset;\n $sizeOfCentralDirectory = 0;\n\n // add trailing cdr file records\n foreach ($this->centralDirectoryRecords as $centralDirectoryRecord) {\n $this->send($centralDirectoryRecord);\n $sizeOfCentralDirectory += strlen($centralDirectoryRecord);\n }\n\n // Add 64bit headers (if applicable)\n if (count($this->centralDirectoryRecords) >= 0xFFFF ||\n $centralDirectoryStartOffsetOnDisk > 0xFFFFFFFF ||\n $sizeOfCentralDirectory > 0xFFFFFFFF) {\n if (!$this->enableZip64) {\n throw new OverflowException();\n }\n\n $this->send(Zip64\\EndOfCentralDirectory::generate(\n versionMadeBy: self::ZIP_VERSION_MADE_BY,\n versionNeededToExtract: Version::ZIP64->value,\n numberOfThisDisk: 0,\n numberOfTheDiskWithCentralDirectoryStart: 0,\n numberOfCentralDirectoryEntriesOnThisDisk: count($this->centralDirectoryRecords),\n numberOfCentralDirectoryEntries: count($this->centralDirectoryRecords),\n sizeOfCentralDirectory: $sizeOfCentralDirectory,\n centralDirectoryStartOffsetOnDisk: $centralDirectoryStartOffsetOnDisk,\n extensibleDataSector: '',\n ));\n\n $this->send(Zip64\\EndOfCentralDirectoryLocator::generate(\n numberOfTheDiskWithZip64CentralDirectoryStart: 0x00,\n zip64centralDirectoryStartOffsetOnDisk: $centralDirectoryStartOffsetOnDisk + $sizeOfCentralDirectory,\n totalNumberOfDisks: 1,\n ));\n }\n\n // add trailing cdr eof record\n $numberOfCentralDirectoryEntries = min(count($this->centralDirectoryRecords), 0xFFFF);\n $this->send(EndOfCentralDirectory::generate(\n numberOfThisDisk: 0x00,\n numberOfTheDiskWithCentralDirectoryStart: 0x00,\n numberOfCentralDirectoryEntriesOnThisDisk: $numberOfCentralDirectoryEntries,\n numberOfCentralDirectoryEntries: $numberOfCentralDirectoryEntries,\n sizeOfCentralDirectory: min($sizeOfCentralDirectory, 0xFFFFFFFF),\n centralDirectoryStartOffsetOnDisk: min($centralDirectoryStartOffsetOnDisk, 0xFFFFFFFF),\n zipFileComment: $this->comment,\n ));\n\n $size = $this->offset;\n\n // The End\n $this->clear();\n\n return $size;\n }", "public function completeFileStream()\n {\n $crc = hexdec(hash_final($this->hash_ctx));\n \n // convert the 64 bit ints to 2 32bit ints\n list($zlen_low, $zlen_high) = $this->int64Split($this->zlen);\n list($len_low, $len_high) = $this->int64Split($this->len);\n \n // build data descriptor\n $fields = [ // (from V.A of APPNOTE.TXT)\n ['V', 0x08074b50], // data descriptor\n ['V', $crc], // crc32 of data\n ['V', $zlen_low], // compressed data length (low)\n ['V', $zlen_high], // compressed data length (high)\n ['V', $len_low], // uncompressed data length (low)\n ['V', $len_high], // uncompressed data length (high)\n ];\n \n // pack fields and calculate \"total\" length\n $ret = $this->packFields($fields);\n \n // print header and filename\n $this->send($ret);\n \n // Update cdr for file record\n $this->current_file_stream[3] = $crc;\n $this->current_file_stream[4] = gmp_strval($this->zlen);\n $this->current_file_stream[5] = gmp_strval($this->len);\n $this->current_file_stream[6] += gmp_strval(gmp_add(gmp_init(strlen($ret)), $this->zlen));\n ksort($this->current_file_stream);\n \n // Add to cdr and increment offset - can't call directly because we pass an array of params\n call_user_func_array([$this, 'addToCdr'], $this->current_file_stream);\n }", "private function receiveCentralDirectoryEnd($ch, $data) {\n\t\t$this->info->centralDirectoryEnd .= $data;\n\t\treturn strlen($data);\n\t}", "function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment)\n {\n $v_result=1;\n\n // ----- Packed data\n $v_binary_data = pack(\"VvvvvVVv\", 0x06054b50, 0, 0, $p_nb_entries,\n\t $p_nb_entries, $p_size,\n\t\t\t\t\t\t $p_offset, strlen($p_comment));\n\n // ----- Write the 22 bytes of the header in the zip file\n fputs($this->zip_fd, $v_binary_data, 22);\n\n // ----- Write the variable fields\n if (strlen($p_comment) != 0)\n {\n fputs($this->zip_fd, $p_comment, strlen($p_comment));\n }\n\n // ----- Return\n return $v_result;\n }", "public function eof() {}", "private function writeFooter(): void\n {\n $record = 0x0015; // Record identifier\n\n /* removing for now\n // need to fix character count (multibyte!)\n if (strlen($this->phpSheet->getHeaderFooter()->getOddFooter()) <= 255) {\n $str = $this->phpSheet->getHeaderFooter()->getOddFooter();\n } else {\n $str = '';\n }\n */\n\n $recordData = StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddFooter());\n $length = strlen($recordData);\n\n $header = pack('vv', $record, $length);\n\n $this->append($header . $recordData);\n }", "function privReadEndCentralDir(&$p_central_dir)\n {\n }", "public function zippedFile()\r\n {\r\n $data = implode(\"\", $this->datasec);\r\n $ctrldir = implode(\"\", $this->ctrlDir);\r\n\r\n return $data.\r\n $ctrldir.\r\n $this->eofCtrlDir.\r\n pack(\"v\", sizeof($this->ctrlDir)). // total number of entries \"on this disk\"\r\n pack(\"v\", sizeof($this->ctrlDir)). // total number of entries overall\r\n pack(\"V\", strlen($ctrldir)). // size of central dir\r\n pack(\"V\", strlen($data)). // offset to start of central dir\r\n \"\\x00\\x00\"; // .zip file comment length\r\n }", "private function _load_file_list_by_eof(&$fh, $stop_on_file = FALSE)\n {\n // Let's consider a file comment smaller than 1024 characters...\n // Actually, it length can be 65536.. But we're not going to support it.\n\n for ($x = 0; $x < 1024; $x++)\n {\n fseek($fh, -22 - $x, SEEK_END);\n\n $signature = fread($fh, 4);\n\n if ($signature == $this->central_signature_end)\n {\n // If found EOF Central Dir\n $eodir['disk_number_this'] = unpack(\"v\", fread($fh, 2)); // number of this disk\n $eodir['disk_number'] = unpack(\"v\", fread($fh, 2)); // number of the disk with the start of the central directory\n $eodir['total_entries_this'] = unpack(\"v\", fread($fh, 2)); // total number of entries in the central dir on this disk\n $eodir['total_entries'] = unpack(\"v\", fread($fh, 2)); // total number of entries in\n $eodir['size_of_cd'] = unpack(\"V\", fread($fh, 4)); // size of the central directory\n $eodir['offset_start_cd'] = unpack(\"V\", fread($fh, 4)); // offset of start of central directory with respect to the starting disk number\n $zip_comment_lenght = unpack(\"v\", fread($fh, 2)); // zipfile comment length\n $eodir['zipfile_comment'] = $zip_comment_lenght[1] ? fread($fh, $zip_comment_lenght[1]) : ''; // zipfile comment\n\n $this->end_of_central = array(\n 'disk_number_this' => $eodir['disk_number_this'][1],\n 'disk_number' => $eodir['disk_number'][1],\n 'total_entries_this' => $eodir['total_entries_this'][1],\n 'total_entries' => $eodir['total_entries'][1],\n 'size_of_cd' => $eodir['size_of_cd'][1],\n 'offset_start_cd' => $eodir['offset_start_cd'][1],\n 'zipfile_comment' => $eodir['zipfile_comment'],\n );\n\n // Then, load file list\n fseek($fh, $this->end_of_central['offset_start_cd']);\n $signature = fread($fh, 4);\n\n while ($signature == $this->dir_signature)\n {\n $dir['version_madeby'] = unpack(\"v\", fread($fh, 2)); // version made by\n $dir['version_needed'] = unpack(\"v\", fread($fh, 2)); // version needed to extract\n $dir['general_bit_flag'] = unpack(\"v\", fread($fh, 2)); // general purpose bit flag\n $dir['compression_method'] = unpack(\"v\", fread($fh, 2)); // compression method\n $dir['lastmod_time'] = unpack(\"v\", fread($fh, 2)); // last mod file time\n $dir['lastmod_date'] = unpack(\"v\", fread($fh, 2)); // last mod file date\n $dir['crc-32'] = fread($fh, 4);\t\t\t // crc-32\n $dir['compressed_size'] = unpack(\"V\", fread($fh, 4)); // compressed size\n $dir['uncompressed_size'] = unpack(\"V\", fread($fh, 4)); // uncompressed size\n $zip_file_length = unpack(\"v\", fread($fh, 2)); // filename length\n $extra_field_length = unpack(\"v\", fread($fh, 2)); // extra field length\n $fileCommentLength = unpack(\"v\", fread($fh, 2)); // file comment length\n $dir['disk_number_start'] = unpack(\"v\", fread($fh, 2)); // disk number start\n $dir['internal_attributes'] = unpack(\"v\", fread($fh, 2)); // internal file attributes-byte1\n $dir['external_attributes1'] = unpack(\"v\", fread($fh, 2)); // external file attributes-byte2\n $dir['external_attributes2'] = unpack(\"v\", fread($fh, 2)); // external file attributes\n $dir['relative_offset'] = unpack(\"V\", fread($fh, 4)); // relative offset of local header\n $dir['file_name'] = fread($fh, $zip_file_length[1]);\t\t\t\t\t\t\t // filename\n $dir['extra_field'] = $extra_field_length[1] ? fread($fh, $extra_field_length[1]) : ''; // extra field\n $dir['file_comment'] = $fileCommentLength[1] ? fread($fh, $fileCommentLength[1]) : ''; // file comment\n\n // Convert the date and time, from MS-DOS format to UNIX Timestamp\n $binary_mod_date = str_pad(decbin($dir['lastmod_date'][1]), 16, '0', STR_PAD_LEFT);\n $binary_mod_time = str_pad(decbin($dir['lastmod_time'][1]), 16, '0', STR_PAD_LEFT);\n $last_mod_year = bindec(substr($binary_mod_date, 0, 7)) + 1980;\n $last_mod_month = bindec(substr($binary_mod_date, 7, 4));\n $last_mod_day = bindec(substr($binary_mod_date, 11, 5));\n $last_mod_hour = bindec(substr($binary_mod_time, 0, 5));\n $last_mod_minute = bindec(substr($binary_mod_time, 5, 6));\n $last_mod_second = bindec(substr($binary_mod_time, 11, 5));\n\n $this->central_dir_list[$dir['file_name']] = array(\n 'version_madeby' => $dir['version_madeby'][1],\n 'version_needed' => $dir['version_needed'][1],\n 'general_bit_flag' => str_pad(decbin($dir['general_bit_flag'][1]), 8, '0', STR_PAD_LEFT),\n 'compression_method' => $dir['compression_method'][1],\n 'lastmod_datetime' => mktime($last_mod_hour, $last_mod_minute, $last_mod_second, $last_mod_month, $last_mod_day, $last_mod_year),\n 'crc-32' => str_pad(dechex(ord($dir['crc-32'][3])), 2, '0', STR_PAD_LEFT) .\n str_pad(dechex(ord($dir['crc-32'][2])), 2, '0', STR_PAD_LEFT) .\n str_pad(dechex(ord($dir['crc-32'][1])), 2, '0', STR_PAD_LEFT) .\n str_pad(dechex(ord($dir['crc-32'][0])), 2, '0', STR_PAD_LEFT),\n 'compressed_size' => $dir['compressed_size'][1],\n 'uncompressed_size' => $dir['uncompressed_size'][1],\n 'disk_number_start' => $dir['disk_number_start'][1],\n 'internal_attributes' => $dir['internal_attributes'][1],\n 'external_attributes1' => $dir['external_attributes1'][1],\n 'external_attributes2' => $dir['external_attributes2'][1],\n 'relative_offset' => $dir['relative_offset'][1],\n 'file_name' => $dir['file_name'],\n 'extra_field' => $dir['extra_field'],\n 'file_comment' => $dir['file_comment'],\n );\n\n $signature = fread($fh, 4);\n }\n\n // If loaded centralDirs, then try to identify the offsetPosition of the compressed data.\n if ($this->central_dir_list)\n {\n foreach ($this->central_dir_list as $filename => $details)\n {\n $i = $this->_get_file_header($fh, $details['relative_offset']);\n\n $this->compressed_list[$filename]['file_name'] = $filename;\n $this->compressed_list[$filename]['compression_method'] = $details['compression_method'];\n $this->compressed_list[$filename]['version_needed'] = $details['version_needed'];\n $this->compressed_list[$filename]['lastmod_datetime'] = $details['lastmod_datetime'];\n $this->compressed_list[$filename]['crc-32'] = $details['crc-32'];\n $this->compressed_list[$filename]['compressed_size'] = $details['compressed_size'];\n $this->compressed_list[$filename]['uncompressed_size'] = $details['uncompressed_size'];\n $this->compressed_list[$filename]['lastmod_datetime'] = $details['lastmod_datetime'];\n $this->compressed_list[$filename]['extra_field'] = $i['extra_field'];\n $this->compressed_list[$filename]['contents_start_offset'] = $i['contents_start_offset'];\n\n if (strtolower($stop_on_file) == strtolower($filename))\n {\n break;\n }\n }\n }\n\n return TRUE;\n }\n }\n return FALSE;\n }", "public function fileEnd(): void;", "private function addCdr(array $opt = null)\n {\n foreach ($this->files as $file) {\n $this->addCdrFile($file);\n }\n \n $this->addCdrEofZip64();\n $this->addCdrEofLocatorZip64();\n \n $this->addCdrEof($opt);\n }", "public function stream_eof() {}", "public function eof();", "public function eof();", "function privWriteCentralFileHeader(&$p_header)\n {\n $v_result=1;\n\n // TBC\n //for(reset($p_header); $key = key($p_header); next($p_header)) {\n //}\n\n // ----- Transform UNIX mtime to DOS format mdate/mtime\n $v_date = getdate($p_header['mtime']);\n $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2;\n $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday'];\n\n\n // ----- Packed data\n $v_binary_data = pack(\"VvvvvvvVVVvvvvvVV\", 0x02014b50,\n\t $p_header['version'], $p_header['version_extracted'],\n $p_header['flag'], $p_header['compression'],\n\t\t\t\t\t\t $v_mtime, $v_mdate, $p_header['crc'],\n $p_header['compressed_size'], $p_header['size'],\n strlen($p_header['stored_filename']),\n\t\t\t\t\t\t $p_header['extra_len'], $p_header['comment_len'],\n $p_header['disk'], $p_header['internal'],\n\t\t\t\t\t\t $p_header['external'], $p_header['offset']);\n\n // ----- Write the 42 bytes of the header in the zip file\n fputs($this->zip_fd, $v_binary_data, 46);\n\n // ----- Write the variable fields\n if (strlen($p_header['stored_filename']) != 0)\n {\n fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename']));\n }\n if ($p_header['extra_len'] != 0)\n {\n fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']);\n }\n if ($p_header['comment_len'] != 0)\n {\n fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']);\n }\n\n // ----- Return\n return $v_result;\n }", "public function testReadIncompleteFile()\n {\n $input = <<<ICS\nBEGIN:VCALENDAR\nVERSION:1.0\nBEGIN:VEVENT\nX-FUNAMBOL-FOLDER:DEFAULT_FOLDER\nX-FUNAMBOL-ALLDAY:0\nDTSTART:20111017T110000Z\nDTEND:20111017T123000Z\nX-MICROSOFT-CDO-BUSYSTATUS:BUSY\nCATEGORIES:\nLOCATION;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:Netviewer Meeting\nPRIORITY:1\nSTATUS:3\nX-MICROSOFT-CDO-REPLYTIME:20111017T064200Z\nSUMMARY;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:Kopieren: test\nCLASS:PUBLIC\nAALARM:\nRRULE:\nX-FUNAMBOL-BILLINGINFO:\nX-FUNAMBOL-COMPANIES:\nX-FUNAMBOL-MILEAGE:\nX-FUNAMBOL-NOAGING:0\nATTENDEE;STATUS=NEEDS ACTION;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:'Heino' [email protected]\nATTENDEE;STATUS=NEEDS ACTION;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:'Markus' [email protected]\nATTENDEE;STATUS=NEEDS AC\nICS;\n\n Reader::read($input);\n }", "protected function makeEndFileBoundaryString() {\n\t\treturn '--' . $this->_mailFileBoundary . '--' . $this->_endString;\n\t}", "public function eof()\n {\n }", "protected function getEOFKey() {\n return null;\n }", "private function eof()\n {\n $this->dataOutput .= pack('ss', 0x0A, 0x00);\n\n return $this;\n }", "private function addCdrFile(array $args)\n {\n list($name, $opt, $meth, $crc, $zlen, $len, $ofs, $genb, $file_attribute) = $args;\n \n // convert the 64 bit ints to 2 32bit ints\n list($zlen_low, $zlen_high) = $this->int64Split($zlen);\n list($len_low, $len_high) = $this->int64Split($len);\n list($ofs_low, $ofs_high) = $this->int64Split($ofs);\n \n // ZIP64, necessary for files over 4GB (incl. entire archive size)\n $extra_zip64 = '';\n $extra_zip64 .= pack('VV', $len_low, $len_high);\n $extra_zip64 .= pack('VV', $zlen_low, $zlen_high);\n $extra_zip64 .= pack('VV', $ofs_low, $ofs_high);\n \n $extra = pack('vv', 1, strlen($extra_zip64)) . $extra_zip64;\n \n // get attributes\n $comment = isset($opt['comment']) ? $opt['comment'] : '';\n \n // get dos timestamp\n $dts = $this->dostime($opt['time']);\n \n $fields = [ // (from V,F of APPNOTE.TXT)\n ['V', 0x02014b50], // central file header signature\n ['v', self::VERSION], // version made by\n ['v', self::VERSION], // version needed to extract\n ['v', $genb], // general purpose bit flag\n ['v', $meth], // compresion method (deflate or store)\n ['V', $dts], // dos timestamp\n ['V', $crc], // crc32 of data\n ['V', 0xFFFFFFFF], // compressed data length (zip64 - look in extra)\n ['V', 0xFFFFFFFF], // uncompressed data length (zip64 - look in extra)\n ['v', strlen($name)], // filename length\n ['v', strlen($extra)], // extra data len\n ['v', strlen($comment)], // file comment length\n ['v', 0], // disk number start\n ['v', 0], // internal file attributes\n ['V', $file_attribute], // external file attributes, 0x10 for dir, 0x20 for file\n ['V', 0xFFFFFFFF], // relative offset of local header (zip64 - look in extra)\n ];\n \n // pack fields, then append name and comment\n $ret = $this->packFields($fields) . $name . $extra . $comment;\n \n $this->send($ret);\n \n // increment cdr length\n $this->cdr_len += strlen($ret);\n }", "protected function readCentralDirectory(EndOfCentralDirectory $endCD): array\n {\n $entries = [];\n\n $cdOffset = $endCD->getCdOffset();\n fseek($this->inStream, $cdOffset);\n\n if (!($cdStream = fopen('php://temp', 'w+b'))) {\n // @codeCoverageIgnoreStart\n throw new ZipException('A temporary resource cannot be opened for writing.');\n // @codeCoverageIgnoreEnd\n }\n stream_copy_to_stream($this->inStream, $cdStream, $endCD->getCdSize());\n rewind($cdStream);\n for ($numEntries = $endCD->getEntryCount(); $numEntries > 0; $numEntries--) {\n $zipEntry = $this->readZipEntry($cdStream);\n\n $entryName = $zipEntry->getName();\n\n /** @var UnicodePathExtraField|null $unicodePathExtraField */\n $unicodePathExtraField = $zipEntry->getExtraField(UnicodePathExtraField::HEADER_ID);\n\n if ($unicodePathExtraField !== null && $unicodePathExtraField->getCrc32() === crc32($entryName)) {\n $unicodePath = $unicodePathExtraField->getUnicodeValue();\n\n if ($unicodePath !== '') {\n $unicodePath = str_replace('\\\\', '/', $unicodePath);\n\n if (substr_count($entryName, '/') === substr_count($unicodePath, '/')) {\n $entryName = $unicodePath;\n }\n }\n }\n\n $entries[$entryName] = $zipEntry;\n }\n\n return $entries;\n }", "function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment)\n {\n }", "public function EOF()\n {\n return $this->EOF;\n }", "public function last(): ?\\StructType\\EwsCDRDataType\n {\n return parent::last();\n }" ]
[ "0.73256916", "0.6821208", "0.63606286", "0.6299368", "0.62877023", "0.62016475", "0.5796436", "0.56094223", "0.5364684", "0.50191504", "0.50002766", "0.49926051", "0.4984768", "0.49741292", "0.49507093", "0.49125916", "0.491014", "0.48984468", "0.48984468", "0.48909894", "0.47546545", "0.47367775", "0.4722848", "0.46945697", "0.4683547", "0.46701878", "0.46538943", "0.4619034", "0.46168506", "0.4553852" ]
0.6919642
1
Add location record for ZIP64 central directory
private function addCdrEofLocatorZip64() { list($cdr_ofs_low, $cdr_ofs_high) = $this->int64Split($this->cdr_len + $this->cdr_ofs); $fields = [ // (from V,F of APPNOTE.TXT) ['V', 0x07064b50], // zip64 end of central dir locator signature ['V', 0], // this disk number ['V', $cdr_ofs_low], // cdr ofs (low) ['V', $cdr_ofs_high], // cdr ofs (high) ['V', 1], // total number of disks ]; $ret = $this->packFields($fields); $this->send($ret); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function addCdrEofZip64()\n {\n $num = count($this->files);\n \n list($num_low, $num_high) = $this->int64Split($num);\n list($cdr_len_low, $cdr_len_high) = $this->int64Split($this->cdr_len);\n list($cdr_ofs_low, $cdr_ofs_high) = $this->int64Split($this->cdr_ofs);\n \n $fields = [ // (from V,F of APPNOTE.TXT)\n ['V', 0x06064b50], // zip64 end of central directory signature\n ['V', 44], // size of zip64 end of central directory record (low) minus 12 bytes\n ['V', 0], // size of zip64 end of central directory record (high)\n ['v', self::VERSION], // version made by\n ['v', self::VERSION], // version needed to extract\n ['V', 0x0000], // this disk number (only one disk)\n ['V', 0x0000], // number of disk with central dir\n ['V', $num_low], // number of entries in the cdr for this disk (low)\n ['V', $num_high], // number of entries in the cdr for this disk (high)\n ['V', $num_low], // number of entries in the cdr (low)\n ['V', $num_high], // number of entries in the cdr (high)\n ['V', $cdr_len_low], // cdr size (low)\n ['V', $cdr_len_high], // cdr size (high)\n ['V', $cdr_ofs_low], // cdr ofs (low)\n ['V', $cdr_ofs_high], // cdr ofs (high)\n ];\n \n $ret = $this->packFields($fields);\n $this->send($ret);\n }", "function _addToZIPFile(& $file, & $contents, & $ctrldir) \n {\n $data = & $file['data'];\n $name = str_replace('\\\\', '/', $file['name']);\n \n $ftime = null;\n if (isset ($file['time'])) {\n $ftime = $file['time'];\n }\n \n $dtime = dechex($this->_unix2DosTime($ftime));\n $hexdtime = chr(hexdec($dtime[6] . $dtime[7])) .\n chr(hexdec($dtime[4] . $dtime[5])) .\n chr(hexdec($dtime[2] . $dtime[3])) .\n chr(hexdec($dtime[0] . $dtime[1]));\n\n /* Begin creating the ZIP data. */\n \n $fr = $this->_fileHeader; \n $fr .= \"\\x14\\x00\"; /* Version needed to extract. */\n $fr .= \"\\x00\\x00\"; /* General purpose bit flag. */\n $fr .= \"\\x08\\x00\"; /* Compression method. */\n $fr .= $hexdtime; /* Last modification time/date. */\n \n /* \"Local file header\" segment. */\n \n $unc_len = strlen($data);\n $crc = crc32($data);\n $zdata = gzcompress($data);\n $zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2);\n $c_len = strlen($zdata);\n $fr .= pack('V', $crc); /* CRC 32 information. */\n $fr .= pack('V', $c_len); /* Compressed filesize. */\n $fr .= pack('V', $unc_len); /* Uncompressed filesize. */\n $fr .= pack('v', strlen($name)); /* Length of filename. */\n $fr .= pack('v', 0); /* Extra field length. */\n $fr .= $name; /* File name. */\n \n /* \"File data\" segment. */\n $fr .= $zdata;\n\n /* Add this entry to array. */\n $old_offset = strlen(implode('', $contents));\n $contents[] = & $fr;\n\n /* Add to central directory record. */\n $cdrec = $this->_ctrlDirHeader;\n $cdrec .= \"\\x00\\x00\"; /* Version made by. */\n $cdrec .= \"\\x14\\x00\"; /* Version needed to extract */\n $cdrec .= \"\\x00\\x00\"; /* General purpose bit flag */\n $cdrec .= \"\\x08\\x00\"; /* Compression method */\n $cdrec .= $hexdtime; /* Last mod time/date. */\n $cdrec .= pack('V', $crc); /* CRC 32 information. */\n $cdrec .= pack('V', $c_len); /* Compressed filesize. */\n $cdrec .= pack('V', $unc_len); /* Uncompressed filesize. */\n $cdrec .= pack('v', strlen($name)); /* Length of filename. */\n $cdrec .= pack('v', 0); /* Extra field length. */\n $cdrec .= pack('v', 0); /* File comment length. */\n $cdrec .= pack('v', 0); /* Disk number start. */\n $cdrec .= pack('v', 0); /* Internal file attributes. */\n $cdrec .= pack('V', 32); /* External file attributes - 'archive' bit set. */\n $cdrec .= pack('V', $old_offset); /* Relative offset of local header. */\n $cdrec .= $name; /* File name. */\n /* Optional extra field, file comment goes here. */\n\n // Save to central directory array. */\n $ctrldir[] = & $cdrec;\n }", "public function add_location($rec){\n\t\t$doc = json_encode($this->_location($rec));\n\t\treturn $this->update($doc);\n\t}", "public function addLocation(string $location);", "public function addDirectory($directoryName) {\r\n $directoryName = str_replace(\"\\\\\", \"/\", $directoryName); \r\n\r\n $feedArrayRow = \"\\x50\\x4b\\x03\\x04\";\r\n $feedArrayRow .= \"\\x0a\\x00\"; \r\n $feedArrayRow .= \"\\x00\\x00\"; \r\n $feedArrayRow .= \"\\x00\\x00\"; \r\n $feedArrayRow .= \"\\x00\\x00\\x00\\x00\";\r\n\r\n $feedArrayRow .= pack(\"V\",0);\r\n $feedArrayRow .= pack(\"V\",0);\r\n $feedArrayRow .= pack(\"V\",0);\r\n $feedArrayRow .= pack(\"v\", strlen($directoryName) );\r\n $feedArrayRow .= pack(\"v\", 0 );\r\n $feedArrayRow .= $directoryName; \r\n\r\n $feedArrayRow .= pack(\"V\",0);\r\n $feedArrayRow .= pack(\"V\",0);\r\n $feedArrayRow .= pack(\"V\",0);\r\n\r\n $this -> compressedData[] = $feedArrayRow;\r\n \r\n $newOffset = strlen(implode(\"\", $this->compressedData));\r\n\r\n $addCentralRecord = \"\\x50\\x4b\\x01\\x02\";\r\n $addCentralRecord .=\"\\x00\\x00\"; \r\n $addCentralRecord .=\"\\x0a\\x00\"; \r\n $addCentralRecord .=\"\\x00\\x00\"; \r\n $addCentralRecord .=\"\\x00\\x00\"; \r\n $addCentralRecord .=\"\\x00\\x00\\x00\\x00\";\r\n $addCentralRecord .= pack(\"V\",0);\r\n $addCentralRecord .= pack(\"V\",0);\r\n $addCentralRecord .= pack(\"V\",0);\r\n $addCentralRecord .= pack(\"v\", strlen($directoryName) );\r\n $addCentralRecord .= pack(\"v\", 0 );\r\n $addCentralRecord .= pack(\"v\", 0 );\r\n $addCentralRecord .= pack(\"v\", 0 );\r\n $addCentralRecord .= pack(\"v\", 0 );\r\n $ext = \"\\x00\\x00\\x10\\x00\";\r\n $ext = \"\\xff\\xff\\xff\\xff\"; \r\n $addCentralRecord .= pack(\"V\", 16 );\r\n\r\n $addCentralRecord .= pack(\"V\", $this -> oldOffset );\r\n $this -> oldOffset = $newOffset;\r\n\r\n $addCentralRecord .= $directoryName; \r\n\r\n $this -> centralDirectory[] = $addCentralRecord; \r\n }", "public function addDirectory($directoryName) {\n $directoryName = str_replace(\"\\\\\", \"/\", $directoryName);\n $feedArrayRow = \"\\x50\\x4b\\x03\\x04\";\n $feedArrayRow .= \"\\x0a\\x00\";\n $feedArrayRow .= \"\\x00\\x00\";\n $feedArrayRow .= \"\\x00\\x00\";\n $feedArrayRow .= \"\\x00\\x00\\x00\\x00\";\n $feedArrayRow .= pack(\"V\",0);\n $feedArrayRow .= pack(\"V\",0);\n $feedArrayRow .= pack(\"V\",0);\n $feedArrayRow .= pack(\"v\", strlen($directoryName) );\n $feedArrayRow .= pack(\"v\", 0 );\n $feedArrayRow .= $directoryName;\n $feedArrayRow .= pack(\"V\",0);\n $feedArrayRow .= pack(\"V\",0);\n $feedArrayRow .= pack(\"V\",0);\n $this->compressedData[] = $feedArrayRow;\n $newOffset = strlen(implode(\"\", $this->compressedData));\n $addCentralRecord = \"\\x50\\x4b\\x01\\x02\";\n $addCentralRecord .=\"\\x00\\x00\";\n $addCentralRecord .=\"\\x0a\\x00\";\n $addCentralRecord .=\"\\x00\\x00\";\n $addCentralRecord .=\"\\x00\\x00\";\n $addCentralRecord .=\"\\x00\\x00\\x00\\x00\";\n $addCentralRecord .= pack(\"V\",0);\n $addCentralRecord .= pack(\"V\",0);\n $addCentralRecord .= pack(\"V\",0);\n $addCentralRecord .= pack(\"v\", strlen($directoryName) );\n $addCentralRecord .= pack(\"v\", 0 );\n $addCentralRecord .= pack(\"v\", 0 );\n $addCentralRecord .= pack(\"v\", 0 );\n $addCentralRecord .= pack(\"v\", 0 );\n $addCentralRecord .= pack(\"V\", 16 );\n $addCentralRecord .= pack(\"V\", $this->oldOffset );\n $this->oldOffset = $newOffset;\n $addCentralRecord .= $directoryName;\n $this->centralDirectory[] = $addCentralRecord;\n }", "function privAdd($p_filedescr_list, &$p_result_list, &$p_options)\n {\n $v_result=1;\n $v_list_detail = array();\n\n // ----- Look if the archive exists or is empty\n if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0))\n {\n\n // ----- Do a create\n $v_result = $this->privCreate($p_filedescr_list, $p_result_list, $p_options);\n\n // ----- Return\n return $v_result;\n }\n // ----- Magic quotes trick\n $this->privDisableMagicQuotes();\n\n // ----- Open the zip file\n if (($v_result=$this->privOpenFd('rb')) != 1)\n {\n // ----- Magic quotes trick\n $this->privSwapBackMagicQuotes();\n\n // ----- Return\n return $v_result;\n }\n\n // ----- Read the central directory informations\n $v_central_dir = array();\n if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)\n {\n $this->privCloseFd();\n $this->privSwapBackMagicQuotes();\n return $v_result;\n }\n\n // ----- Go to beginning of File\n @rewind($this->zip_fd);\n\n // ----- Creates a temporay file\n $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';\n\n // ----- Open the temporary file in write mode\n if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0)\n {\n $this->privCloseFd();\n $this->privSwapBackMagicQuotes();\n\n PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \\''.$v_zip_temp_name.'\\' in binary write mode');\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- Copy the files from the archive to the temporary file\n // TBC : Here I should better append the file and go back to erase the central dir\n $v_size = $v_central_dir['offset'];\n while ($v_size != 0)\n {\n $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n $v_buffer = fread($this->zip_fd, $v_read_size);\n @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);\n $v_size -= $v_read_size;\n }\n\n // ----- Swap the file descriptor\n // Here is a trick : I swap the temporary fd with the zip fd, in order to use\n // the following methods on the temporary fil and not the real archive\n $v_swap = $this->zip_fd;\n $this->zip_fd = $v_zip_temp_fd;\n $v_zip_temp_fd = $v_swap;\n\n // ----- Add the files\n $v_header_list = array();\n if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1)\n {\n fclose($v_zip_temp_fd);\n $this->privCloseFd();\n @unlink($v_zip_temp_name);\n $this->privSwapBackMagicQuotes();\n\n // ----- Return\n return $v_result;\n }\n\n // ----- Store the offset of the central dir\n $v_offset = @ftell($this->zip_fd);\n\n // ----- Copy the block of file headers from the old archive\n $v_size = $v_central_dir['size'];\n while ($v_size != 0)\n {\n $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n $v_buffer = @fread($v_zip_temp_fd, $v_read_size);\n @fwrite($this->zip_fd, $v_buffer, $v_read_size);\n $v_size -= $v_read_size;\n }\n\n // ----- Create the Central Dir files header\n for ($i=0, $v_count=0; $i<sizeof($v_header_list); $i++)\n {\n // ----- Create the file header\n if ($v_header_list[$i]['status'] == 'ok') {\n if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) {\n fclose($v_zip_temp_fd);\n $this->privCloseFd();\n @unlink($v_zip_temp_name);\n $this->privSwapBackMagicQuotes();\n\n // ----- Return\n return $v_result;\n }\n $v_count++;\n }\n\n // ----- Transform the header to a 'usable' info\n $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);\n }\n\n // ----- Zip file comment\n $v_comment = $v_central_dir['comment'];\n if (isset($p_options[PCLZIP_OPT_COMMENT])) {\n $v_comment = $p_options[PCLZIP_OPT_COMMENT];\n }\n if (isset($p_options[PCLZIP_OPT_ADD_COMMENT])) {\n $v_comment = $v_comment.$p_options[PCLZIP_OPT_ADD_COMMENT];\n }\n if (isset($p_options[PCLZIP_OPT_PREPEND_COMMENT])) {\n $v_comment = $p_options[PCLZIP_OPT_PREPEND_COMMENT].$v_comment;\n }\n\n // ----- Calculate the size of the central header\n $v_size = @ftell($this->zip_fd)-$v_offset;\n\n // ----- Create the central dir footer\n if (($v_result = $this->privWriteCentralHeader($v_count+$v_central_dir['entries'], $v_size, $v_offset, $v_comment)) != 1)\n {\n // ----- Reset the file list\n unset($v_header_list);\n $this->privSwapBackMagicQuotes();\n\n // ----- Return\n return $v_result;\n }\n\n // ----- Swap back the file descriptor\n $v_swap = $this->zip_fd;\n $this->zip_fd = $v_zip_temp_fd;\n $v_zip_temp_fd = $v_swap;\n\n // ----- Close\n $this->privCloseFd();\n\n // ----- Close the temporary file\n @fclose($v_zip_temp_fd);\n\n // ----- Magic quotes trick\n $this->privSwapBackMagicQuotes();\n\n // ----- Delete the zip file\n // TBC : I should test the result ...\n @unlink($this->zipname);\n\n // ----- Rename the temporary file\n // TBC : I should test the result ...\n //@rename($v_zip_temp_name, $this->zipname);\n PclZipUtilRename($v_zip_temp_name, $this->zipname);\n\n // ----- Return\n return $v_result;\n }", "public function addDir($name) {\r\n\r\n $name = str_replace(\"\\\\\", \"/\", $name);\r\n $fr = \"\\x50\\x4b\\x03\\x04\";\r\n $fr .= \"\\x0a\\x00\"; // version needed to extract\r\n $fr .= \"\\x00\\x00\"; // general purpose bit flag\r\n $fr .= \"\\x00\\x00\"; // compression method\r\n $fr .= \"\\x00\\x00\\x00\\x00\"; // last mod time and date\r\n $fr .= pack(\"V\",0); // crc32\r\n $fr .= pack(\"V\",0); //compressed filesize\r\n $fr .= pack(\"V\",0); //uncompressed filesize\r\n $fr .= pack(\"v\",strlen($name)); //length of pathname\r\n $fr .= pack(\"v\", 0); //extra field length\r\n $fr .= $name;\r\n // end of \"local file header\" segment\r\n\r\n // no \"file data\" segment for path\r\n\r\n // \"data descriptor\" segment (optional but necessary if archive is not served as file)\r\n $fr .= pack(\"V\",0); //crc32\r\n $fr .= pack(\"V\",0); //compressed filesize\r\n $fr .= pack(\"V\",0); //uncompressed filesize\r\n\r\n // add this entry to array\r\n $this->datasec[] = $fr;\r\n\r\n $newOffset = strlen(implode(\"\", $this->datasec));\r\n\r\n // ext. file attributes mirrors MS-DOS directory attr byte, detailed\r\n // at http://support.microsoft.com/support/kb/articles/Q125/0/19.asp\r\n\r\n // now add to central record\r\n $cdrec = \"\\x50\\x4b\\x01\\x02\";\r\n $cdrec .=\"\\x00\\x00\"; // version made by\r\n $cdrec .=\"\\x0a\\x00\"; // version needed to extract\r\n $cdrec .=\"\\x00\\x00\"; // general purpose bit flag\r\n $cdrec .=\"\\x00\\x00\"; // compression method\r\n $cdrec .=\"\\x00\\x00\\x00\\x00\"; // last mod time and date\r\n $cdrec .= pack(\"V\",0); // crc32\r\n $cdrec .= pack(\"V\",0); //compressed filesize\r\n $cdrec .= pack(\"V\",0); //uncompressed filesize\r\n $cdrec .= pack(\"v\", strlen($name) ); //length of filename\r\n $cdrec .= pack(\"v\", 0 ); //extra field length\r\n $cdrec .= pack(\"v\", 0 ); //file comment length\r\n $cdrec .= pack(\"v\", 0 ); //disk number start\r\n $cdrec .= pack(\"v\", 0 ); //internal file attributes\r\n $cdrec .= pack(\"V\", 16 ); //external file attributes - 'directory' bit set\r\n\r\n $cdrec .= pack(\"V\", $this->oldOffset); //relative offset of local header\r\n $this->oldOffset = $newOffset;\r\n\r\n $cdrec .= $name;\r\n // optional extra field, file comment goes here\r\n // save to array\r\n $this->ctrlDir[] = $cdrec;\r\n $this->dirs[] = $name;\r\n }", "public function testAddLocation(): void\n {\n $session = $this->getMinkSession();\n $this->login('dkatz', 'pr1test');\n $session->visit($this->getUrl('/Publisher/manage_location?id=4612')); // A Bruccoli Clark Layman Book\n $page = $session->getPage();\n $this->clickCss($page, '.add-location-link');\n $this->checkFor500Error();\n }", "function addLocation($location_details){\n\t if ($this->db->insert('pofloc',$location_details))\n\t\t\t{ \n\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\treturn FALSE;\n\t\t\t}\n }", "public function addToZip(ZipArchive $zip, string $entryName): void;", "function _getZipInfo(& $data) \n {\n // Initialize variables\n $entries = array ();\n\n // Find the last central directory header entry\n $fhLast = strpos($data, $this->_ctrlDirEnd);\n do {\n $last = $fhLast;\t\t\n } while(($fhLast = strpos($data, $this->_ctrlDirEnd, $fhLast+1)) !== false);\n\n // Find the central directory offset\n $offset = 0;\n if($last) {\n $endOfCentralDirectory = unpack('vNumberOfDisk/vNoOfDiskWithStartOfCentralDirectory/vNoOfCentralDirectoryEntriesOnDisk/vTotalCentralDirectoryEntries/VSizeOfCentralDirectory/VCentralDirectoryOffset/vCommentLength', substr($data, $last+4));\n $offset = $endOfCentralDirectory['CentralDirectoryOffset'];\n }\n\t\t\n // Get details from Central directory structure.\n $fhStart = strpos($data, $this->_ctrlDirHeader, $offset);\n do {\n if (strlen($data) < $fhStart +31) {\n $this->set('error.message', 'Invalid ZIP data');\n return false;\n }\n\n $info = unpack('vMethod/VTime/VCRC32/VCompressed/VUncompressed/vLength', substr($data, $fhStart +10, 20));\n $name = substr($data, $fhStart +46, $info['Length']);\n\n $entries[$name] = array('attr' => null, 'crc' => sprintf(\"%08s\", dechex($info['CRC32'] )), 'csize' => $info['Compressed'], 'date' => null, '_dataStart' => null, 'name' => $name, 'method' => $this->_methods[$info['Method']], '_method' => $info['Method'], 'size' => $info['Uncompressed'], 'type' => null);\n $entries[$name]['date'] = mktime((($info['Time'] >> 11) & 0x1f), (($info['Time'] >> 5) & 0x3f), (($info['Time'] << 1) & 0x3e), (($info['Time'] >> 21) & 0x07), (($info['Time'] >> 16) & 0x1f), ((($info['Time'] >> 25) & 0x7f) + 1980));\n\n if (strlen($data) < $fhStart +43) {\n $this->set('error.message', 'Invalid ZIP data');\n return false;\n }\n $info = unpack('vInternal/VExternal/VOffset', substr($data, $fhStart +36, 10));\n\n $entries[$name]['type'] = ($info['Internal'] & 0x01) ? 'text' : 'binary';\n $entries[$name]['attr'] = (($info['External'] & 0x10) ? 'D' : '-') .\n (($info['External'] & 0x20) ? 'A' : '-') .\n (($info['External'] & 0x03) ? 'S' : '-') .\n (($info['External'] & 0x02) ? 'H' : '-') .\n (($info['External'] & 0x01) ? 'R' : '-');\n \n $entries[$name]['offset'] = $info['Offset'];\n\n // Get details from local file header since we have the offset\n $lfhStart = strpos($data, $this->_fileHeader, $entries[$name]['offset']);\n if (strlen($data) < $lfhStart +34) {\n $this->set('error.message', 'Invalid ZIP data');\n return false;\n }\n $info = unpack('vMethod/VTime/VCRC32/VCompressed/VUncompressed/vLength/vExtraLength', substr($data, $lfhStart +8, 25));\n $name = substr($data, $lfhStart +30, $info['Length']);\n $entries[$name]['_dataStart'] = $lfhStart +30 + $info['Length'] + $info['ExtraLength'];\n } while ((($fhStart = strpos($data, $this->_ctrlDirHeader, $fhStart +46)) !== false));\n \t\n $this->_metadata = array_values($entries);\n \n return true;\n }", "function privReadEndCentralDir(&$p_central_dir)\n {\n $v_result=1;\n\n // ----- Go to the end of the zip file\n $v_size = filesize($this->zipname);\n @fseek($this->zip_fd, $v_size);\n if (@ftell($this->zip_fd) != $v_size)\n {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \\''.$this->zipname.'\\'');\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- First try : look if this is an archive with no commentaries (most of the time)\n // in this case the end of central dir is at 22 bytes of the file end\n $v_found = 0;\n if ($v_size > 26) {\n @fseek($this->zip_fd, $v_size-22);\n if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22))\n {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \\''.$this->zipname.'\\'');\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- Read for bytes\n $v_binary_data = @fread($this->zip_fd, 4);\n $v_data = @unpack('Vid', $v_binary_data);\n\n // ----- Check signature\n if ($v_data['id'] == 0x06054b50) {\n $v_found = 1;\n }\n\n $v_pos = ftell($this->zip_fd);\n }\n\n // ----- Go back to the maximum possible size of the Central Dir End Record\n if (!$v_found) {\n $v_maximum_size = 65557; // 0xFFFF + 22;\n if ($v_maximum_size > $v_size)\n $v_maximum_size = $v_size;\n @fseek($this->zip_fd, $v_size-$v_maximum_size);\n if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size))\n {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \\''.$this->zipname.'\\'');\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- Read byte per byte in order to find the signature\n $v_pos = ftell($this->zip_fd);\n $v_bytes = 0x00000000;\n while ($v_pos < $v_size)\n {\n // ----- Read a byte\n $v_byte = @fread($this->zip_fd, 1);\n\n // ----- Add the byte\n //$v_bytes = ($v_bytes << 8) | Ord($v_byte);\n // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number\n // Otherwise on systems where we have 64bit integers the check below for the magic number will fail.\n $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte);\n\n // ----- Compare the bytes\n if ($v_bytes == 0x504b0506)\n {\n $v_pos++;\n break;\n }\n\n $v_pos++;\n }\n\n // ----- Look if not found end of central dir\n if ($v_pos == $v_size)\n {\n\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, \"Unable to find End of Central Dir Record signature\");\n\n // ----- Return\n return PclZip::errorCode();\n }\n }\n\n // ----- Read the first 18 bytes of the header\n $v_binary_data = fread($this->zip_fd, 18);\n\n // ----- Look for invalid block size\n if (strlen($v_binary_data) != 18)\n {\n\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, \"Invalid End of Central Dir Record size : \".strlen($v_binary_data));\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- Extract the values\n $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data);\n\n // ----- Check the global size\n if (($v_pos + $v_data['comment_size'] + 18) != $v_size) {\n\n\t // ----- Removed in release 2.2 see readme file\n\t // The check of the file size is a little too strict.\n\t // Some bugs where found when a zip is encrypted/decrypted with 'crypt'.\n\t // While decrypted, zip has training 0 bytes\n\t if (0) {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT,\n\t 'The central dir is not at the end of the archive.'\n\t\t\t\t\t\t .' Some trailing bytes exists after the archive.');\n\n // ----- Return\n return PclZip::errorCode();\n\t }\n }\n\n // ----- Get comment\n if ($v_data['comment_size'] != 0) {\n $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']);\n }\n else\n $p_central_dir['comment'] = '';\n\n $p_central_dir['entries'] = $v_data['entries'];\n $p_central_dir['disk_entries'] = $v_data['disk_entries'];\n $p_central_dir['offset'] = $v_data['offset'];\n $p_central_dir['size'] = $v_data['size'];\n $p_central_dir['disk'] = $v_data['disk'];\n $p_central_dir['disk_start'] = $v_data['disk_start'];\n\n // TBC\n //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) {\n //}\n\n // ----- Return\n return $v_result;\n }", "function _location($rec){\n\t\treturn array(\n\t\t\t'id' => $rec['zip'],\n\t\t\t'city' => $rec['city'],\n\t\t\t'geolocation' => sprintf('%s,%s',trim($rec['latitude']),trim($rec['longitude'])),\n\t\t\t'latitude' => $rec['latitude'],\n\t\t\t'longitude' => $rec['longitude'],\n\t\t\t'postal' => $rec['zip'],\n\t\t\t'state' => $rec['state'],\n\t\t\t'county' => $rec['county'],\n\t\t\t'country' => $rec['country'],\n\t\t);\n\t}", "public function addLocation( $city, $state, $zip )\n {\n $locationID = NULL;\n\t\t\t\t\n\t\tif( $city != \"\" && $state != \"\" && $zip != \"\" )\n\t\t{\t\t\n\t\t\t$this->findLocation( $city, $state, $zip );\n\t\t\t\n\t\t\tif( $this->locationID == 0 )\n\t\t\t{\t\t\n\t\t\t\t$core = Core::dbOpen();\n\t\t\t\t$sql = \"INSERT INTO program_locations (programID,city,state,zip)\n\t\t\t\t\t\t\t\tVALUES (:programID, :city, :state, :zip )\";\n\t\t\t\t$stmt = $core->dbh->prepare($sql);\n\t\t\t\t$stmt->bindParam(':programID', $this->programID);\n\t\t\t\t$stmt->bindParam(':city', $city);\n\t\t\t\t$stmt->bindParam(':state', $state);\n\t\t\t\t$stmt->bindParam(':zip', $zip);\n\t\t\t\tCore::dbClose();\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif($stmt->execute())\n\t\t\t\t\t\t$locationID = $core->dbh->lastInsertId(); \n\t\t\t\t} catch (PDOException $e) {\n\t\t\t\t\techo \"Location add failed!\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$locationID = $this->locationID;\n\t\t\t}\n\t\t}\n return $locationID;\n }", "function addLocation($data) {\r\n\r\n\r\n\t\t$this->query('INSERT INTO locations (`id`, `created`, `modified`, `name`) \r\n\t\t\t\t\t\t\t VALUES (NULL, CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP(), \"'. $data['name'] .'\");');\r\n\r\n\t}", "function PclZipUtilPathReduction($p_dir)\n {\n }", "public function add_location( $location = '', $groups = '', $zip_code = '', $layout_id = '' ) {\n\t\tglobal $wpdb;\n\n\t\t// We'll use a try/catch block to make sure we only add the location if all needed info is provided\n\t\ttry {\n\t\t\t// Check for the location\n\t\t\tif( @$location != '' ) {\n\t\t\t\t$location = sanitize_text_field( $location );\n\t\t\t} else {\n\t\t\t\tthrow new Exception('Location name not provided.');\n\t\t\t}\n\t\t\t\n\t\t\t// Check for groups\n\t\t\tif( @$groups != '' || !empty( $groups ) ) {\n $raw_groups = $groups;\n unset( $groups );\n $groups = array();\n foreach( $groups as $group ) {\n $groups[] = sanitize_text_field( $group );\n }\n\t\t\t} else {\n\t\t\t\tthrow new Exception('No groups selected.');\n\t\t\t}\n\t\t\t\n\t\t\t// The zip code is optional\n\t\t\tif( @$zip_code != '' ) {\n\t\t\t\t$zip_code = sanitize_text_field( $zip_code );\n\t\t\t} else {\n\t\t\t\t$zip_code = '';\n\t\t\t}\n\t\t\t\n\t\t\t// The layout is not optional\n\t\t\tif( @$layout != '' ) {\n\t\t\t\t$layout_id = sanitize_text_field( $datalayout );\n\t\t\t} else {\n\t\t\t\t$layout_id = '1';\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\treturn (object) array(\n\t\t\t\t\"status\" => \"error\",\n\t\t\t\t\"message\" => $e->getMessage()\n\t\t\t);\n\t\t}\n\t\t\n\t\t// We have the needed values, make sure it doesn't already exist\n\t\t$sql = \"SELECT * FROM `\".rpids_tableprefix().\"rpids_locations` WHERE `location`='\" . $location . \"';\";\n\t\t$sqlret = $wpdb->get_results($sql, ARRAY_A);\n\t\t\n\t\tif( $wpdb->num_rows > 0 ) {\n\t\t\treturn (object) array(\n\t\t\t\t\"status\" => \"error\",\n\t\t\t\t\"message\" => 'The location \"' . $location . '\" already exists.'\n\t\t\t);\n\t\t} else {\n\t\t\t// This is a new location\n\t\t\t\n\t\t\t// First add the zip code to the weather db, if set\n\t\t\tif( $zip_code != '' ) {\n\t\t\t\t// Check if the zip code is already in the weather table\n\t\t\t\t$sql = \"SELECT * FROM `\".rpids_tableprefix().\"rpids_weather` WHERE `zip`='\" . $zip_code . \"';\";\n\t\t\t\t$weather = $wpdb->get_row($sql, ARRAY_A);\n\t\t\t\t\n\t\t\t\tif( $wpdb->num_rows > 0 ) {\n\t\t\t\t\t// The zip already exists, we'll just grab the id\n\t\t\t\t\t$weather_id = $weather['id'];\n\t\t\t\t} else {\n\t\t\t\t\t// New zip code, add to the weather table\n\t\t\t\t\t$wpdb->insert( rpids_tableprefix() . \"rpids_weather\", array(\n\t\t\t\t\t\t\"zip\" => $zip_code\n\t\t\t\t\t) );\n\t\t\t\t\n\t\t\t\t\t// Get the weather ID\n\t\t\t\t\t$weather_id = $wpdb->insert_id;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$weather_id = 0;\n\t\t\t}\t\n\t\t\t\n\t\t\t// Add the location to the db\n\t\t\t$wpdb->insert( rpids_tableprefix() . \"rpids_locations\", array(\n\t\t\t\t\"location\" => $location, \n\t\t\t\t\"groups\" => $groups,\n\t\t\t\t\"weather_id\" => $weather_id,\n\t\t\t\t\"layout_id\" => $layout_id\n\t\t\t));\n\t\t\t\n\t\t\t// Return the location id\n\t\t\treturn array(\n\t\t\t\t\"status\" => \"success\",\n\t\t\t\t\"message\" => 'The location \"' . $location . '\" has been added.',\n\t\t\t\t\"location_id\" => $wpdb->insert_id\n\t\t\t);\n\t\t}\n\t}", "abstract public function directoryLocation();", "function api_whosonfirst_output_add_mz_uri(&$out, &$raw){\n\n\t\tif (isset($raw['wof:path'])){\n\t\t\t$path = $raw['wof:path'];\n\t\t}\n\n\t\telse {\n\t\t\t$path = whosonfirst_uri_id2relpath($raw['wof:id']);\n\t\t}\n\n\t\t# Because it's our party so we can decide these things\n\t\t# (20161021/thisisaaronland)\n\n\t\t$uri = \"https://whosonfirst.mapzen.com/data/\" . $path;\n\t\t$out['mz:uri'] = $uri;\n\n\t\t# pass by ref\n\t}", "public function store($zip , $street , AddPhotoRequest $resquest){\n\n \t$flyer = Flyer::locatedat($zip,$street);\n\n \t$photo = $resquest->file('file');\n\n \t(new AddPhotoToFlyer($flyer,$photo))->save();\n\n }", "public function zippedFile()\r\n {\r\n $data = implode(\"\", $this->datasec);\r\n $ctrldir = implode(\"\", $this->ctrlDir);\r\n\r\n return $data.\r\n $ctrldir.\r\n $this->eofCtrlDir.\r\n pack(\"v\", sizeof($this->ctrlDir)). // total number of entries \"on this disk\"\r\n pack(\"v\", sizeof($this->ctrlDir)). // total number of entries overall\r\n pack(\"V\", strlen($ctrldir)). // size of central dir\r\n pack(\"V\", strlen($data)). // offset to start of central dir\r\n \"\\x00\\x00\"; // .zip file comment length\r\n }", "function _createZIPFile(& $contents, & $ctrlDir, $path) \n {\n\t \n $data = implode('', $contents);\n $dir = implode('', $ctrlDir);\n\n $buffer = $data . $dir . $this->_ctrlDirEnd .\n /* Total # of entries \"on this disk\". */\n pack('v', count($ctrlDir)) .\n /* Total # of entries overall. */\n pack('v', count($ctrlDir)) .\n /* Size of central directory. */\n pack('V', strlen($dir)) .\n /* Offset to start of central dir. */\n pack('V', strlen($data)) .\n /* ZIP file comment length. */\n \"\\x00\\x00\";\n \n $w = $this->_vfile->write($path, $buffer);\n if (VWP::isWarning($w)) {\n return $w;\n }\t\t\n return true;\n }", "function privAddFile($p_filedescr, &$p_header, &$p_options)\n {\n $v_result=1;\n\n // ----- Working variable\n $p_filename = $p_filedescr['filename'];\n\n // TBC : Already done in the fileAtt check ... ?\n if ($p_filename == \"\") {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid file list parameter (invalid or empty list)\");\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- Look for a stored different filename\n /* TBC : Removed\n if (isset($p_filedescr['stored_filename'])) {\n $v_stored_filename = $p_filedescr['stored_filename'];\n }\n else {\n $v_stored_filename = $p_filedescr['stored_filename'];\n }\n */\n\n // ----- Set the file properties\n clearstatcache();\n $p_header['version'] = 20;\n $p_header['version_extracted'] = 10;\n $p_header['flag'] = 0;\n $p_header['compression'] = 0;\n $p_header['crc'] = 0;\n $p_header['compressed_size'] = 0;\n $p_header['filename_len'] = strlen($p_filename);\n $p_header['extra_len'] = 0;\n $p_header['disk'] = 0;\n $p_header['internal'] = 0;\n $p_header['offset'] = 0;\n $p_header['filename'] = $p_filename;\n// TBC : Removed $p_header['stored_filename'] = $v_stored_filename;\n $p_header['stored_filename'] = $p_filedescr['stored_filename'];\n $p_header['extra'] = '';\n $p_header['status'] = 'ok';\n $p_header['index'] = -1;\n\n // ----- Look for regular file\n if ($p_filedescr['type']=='file') {\n $p_header['external'] = 0x00000000;\n $p_header['size'] = filesize($p_filename);\n }\n\n // ----- Look for regular folder\n else if ($p_filedescr['type']=='folder') {\n $p_header['external'] = 0x00000010;\n $p_header['mtime'] = filemtime($p_filename);\n $p_header['size'] = filesize($p_filename);\n }\n\n // ----- Look for virtual file\n else if ($p_filedescr['type'] == 'virtual_file') {\n $p_header['external'] = 0x00000000;\n $p_header['size'] = strlen($p_filedescr['content']);\n }\n\n\n // ----- Look for filetime\n if (isset($p_filedescr['mtime'])) {\n $p_header['mtime'] = $p_filedescr['mtime'];\n }\n else if ($p_filedescr['type'] == 'virtual_file') {\n $p_header['mtime'] = time();\n }\n else {\n $p_header['mtime'] = filemtime($p_filename);\n }\n\n // ------ Look for file comment\n if (isset($p_filedescr['comment'])) {\n $p_header['comment_len'] = strlen($p_filedescr['comment']);\n $p_header['comment'] = $p_filedescr['comment'];\n }\n else {\n $p_header['comment_len'] = 0;\n $p_header['comment'] = '';\n }\n\n // ----- Look for pre-add callback\n if (isset($p_options[PCLZIP_CB_PRE_ADD])) {\n\n // ----- Generate a local information\n $v_local_header = array();\n $this->privConvertHeader2FileInfo($p_header, $v_local_header);\n\n // ----- Call the callback\n // Here I do not use call_user_func() because I need to send a reference to the\n // header.\n $v_result = $p_options[PCLZIP_CB_PRE_ADD](PCLZIP_CB_PRE_ADD, $v_local_header);\n if ($v_result == 0) {\n // ----- Change the file status\n $p_header['status'] = \"skipped\";\n $v_result = 1;\n }\n\n // ----- Update the informations\n // Only some fields can be modified\n if ($p_header['stored_filename'] != $v_local_header['stored_filename']) {\n $p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']);\n }\n }\n\n // ----- Look for empty stored filename\n if ($p_header['stored_filename'] == \"\") {\n $p_header['status'] = \"filtered\";\n }\n\n // ----- Check the path length\n if (strlen($p_header['stored_filename']) > 0xFF) {\n $p_header['status'] = 'filename_too_long';\n }\n\n // ----- Look if no error, or file not skipped\n if ($p_header['status'] == 'ok') {\n\n // ----- Look for a file\n if ($p_filedescr['type'] == 'file') {\n // ----- Look for using temporary file to zip\n if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF]))\n && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON])\n || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])\n && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_header['size'])) ) ) {\n $v_result = $this->privAddFileUsingTempFile($p_filedescr, $p_header, $p_options);\n if ($v_result < PCLZIP_ERR_NO_ERROR) {\n return $v_result;\n }\n }\n\n // ----- Use \"in memory\" zip algo\n else {\n\n // ----- Open the source file\n if (($v_file = @fopen($p_filename, \"rb\")) == 0) {\n PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, \"Unable to open file '$p_filename' in binary read mode\");\n return PclZip::errorCode();\n }\n\n // ----- Read the file content\n $v_content = @fread($v_file, $p_header['size']);\n\n // ----- Close the file\n @fclose($v_file);\n\n // ----- Calculate the CRC\n $p_header['crc'] = @crc32($v_content);\n\n // ----- Look for no compression\n if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) {\n // ----- Set header parameters\n $p_header['compressed_size'] = $p_header['size'];\n $p_header['compression'] = 0;\n }\n\n // ----- Look for normal compression\n else {\n // ----- Compress the content\n $v_content = @gzdeflate($v_content);\n\n // ----- Set header parameters\n $p_header['compressed_size'] = strlen($v_content);\n $p_header['compression'] = 8;\n }\n\n // ----- Call the header generation\n if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {\n @fclose($v_file);\n return $v_result;\n }\n\n // ----- Write the compressed (or not) content\n @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']);\n\n }\n\n }\n\n // ----- Look for a virtual file (a file from string)\n else if ($p_filedescr['type'] == 'virtual_file') {\n\n $v_content = $p_filedescr['content'];\n\n // ----- Calculate the CRC\n $p_header['crc'] = @crc32($v_content);\n\n // ----- Look for no compression\n if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) {\n // ----- Set header parameters\n $p_header['compressed_size'] = $p_header['size'];\n $p_header['compression'] = 0;\n }\n\n // ----- Look for normal compression\n else {\n // ----- Compress the content\n $v_content = @gzdeflate($v_content);\n\n // ----- Set header parameters\n $p_header['compressed_size'] = strlen($v_content);\n $p_header['compression'] = 8;\n }\n\n // ----- Call the header generation\n if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {\n @fclose($v_file);\n return $v_result;\n }\n\n // ----- Write the compressed (or not) content\n @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']);\n }\n\n // ----- Look for a directory\n else if ($p_filedescr['type'] == 'folder') {\n // ----- Look for directory last '/'\n if (@substr($p_header['stored_filename'], -1) != '/') {\n $p_header['stored_filename'] .= '/';\n }\n\n // ----- Set the file properties\n $p_header['size'] = 0;\n //$p_header['external'] = 0x41FF0010; // Value for a folder : to be checked\n $p_header['external'] = 0x00000010; // Value for a folder : to be checked\n\n // ----- Call the header generation\n if (($v_result = $this->privWriteFileHeader($p_header)) != 1)\n {\n return $v_result;\n }\n }\n }\n\n // ----- Look for post-add callback\n if (isset($p_options[PCLZIP_CB_POST_ADD])) {\n\n // ----- Generate a local information\n $v_local_header = array();\n $this->privConvertHeader2FileInfo($p_header, $v_local_header);\n\n // ----- Call the callback\n // Here I do not use call_user_func() because I need to send a reference to the\n // header.\n $v_result = $p_options[PCLZIP_CB_POST_ADD](PCLZIP_CB_POST_ADD, $v_local_header);\n if ($v_result == 0) {\n // ----- Ignored\n $v_result = 1;\n }\n\n // ----- Update the informations\n // Nothing can be modified\n }\n\n // ----- Return\n return $v_result;\n }", "function zipAddAlbum($album, $base, $zip) {\n\tglobal $_zp_zip_list, $zip_gallery;\n\t$albumbase = '.'.substr($album->name,$base).'/';\n\tforeach ($album->sidecars as $suffix) {\n\t\t$f = $albumbase.$album->name.'.'.$suffix;\n\t\tif (file_exists($f)) {\n\t\t\t$_zp_zip_list[] = $f;\n\t\t}\n\t}\n\t$images = $album->getImages();\n\tforeach ($images as $imagename) {\n\t\t$image = newImage($album, $imagename);\n\t\t$_zp_zip_list[] = $albumbase.$image->filename;\n\t\t$imagebase = stripSuffix($image->filename);\n\t\tforeach ($image->sidecars as $suffix) {\n\t\t\t$f = $albumbase.$imagebase.'.'.$suffix;\n\t\t\tif (file_exists($f)) {\n\t\t\t\t$_zp_zip_list[] = $f;\n\t\t\t}\n\t\t}\n\t}\n\t$albums = $album->getAlbums();\n\tforeach ($albums as $albumname) {\n\t\t$subalbum = new Album($zip_gallery,$albumname);\n\t\tif ($subalbum->exists && !$album->isDynamic()) {\n\t\t\tzipAddAlbum($subalbum, $base, $zip);\n\t\t}\n\t}\n}", "public function insertLocation($file, &$locationArr) {\n $fileStream = fopen($file, 'r');\n ini_set('auto_detect_line_endings', TRUE);\n //Skip the header\n fgetcsv($fileStream);\n //Gets the parent folder of passed in $file\n $verifiedFile = dirname($file) . '\\LocationVerified.csv';\n $fileErrors = array();\n $count = 1;\n $insertedRows = 0;\n while(($data = fgetcsv($fileStream)) !== FALSE) {\n $count++;\n $errors = Validator::validateLocation($data);\n if(empty($errors)) {\n //No error write to verified file\n $locationArr[] = $data[0];\n $newFile = fopen($verifiedFile, 'a');\n fputcsv($newFile, $data);\n fclose($newFile);\n $insertedRows++;\n } else {\n $fileErrors[] = new FileRowError($count, $errors);\n }\n }\n fclose($fileStream);\n $_SESSION['location-lookup.csv'] = $insertedRows;\n\n $dbConnectorInstance = DatabaseConnector::getInstance();\n $dbConnector = $dbConnectorInstance->getConnection();\n $sql = 'LOAD DATA LOCAL INFILE ? INTO TABLE location FIELDS TERMINATED BY \\',\\' LINES TERMINATED BY \\'\\n\\'';\n\n\n try {\n $stmt = $dbConnector->prepare($sql);\n $stmt->bindParam(1, $verifiedFile);\n $stmt->execute();\n } catch (PDOException $pdoEx) {\n $this->logger->error('Error loading data from local file. ', $pdoEx);\n $fileErrors = NULL;\n }\n\n //Delete verified file upon completion of uploading\n unlink($verifiedFile);\n\n return $fileErrors;\n }", "protected function readEndOfCentralDirectory(): EndOfCentralDirectory\n {\n if (!$this->findEndOfCentralDirectory()) {\n throw new ZipException('Invalid zip file. The end of the central directory could not be found.');\n }\n\n $positionECD = ftell($this->inStream) - 4;\n $sizeECD = $this->size - ftell($this->inStream);\n $buffer = fread($this->inStream, $sizeECD);\n\n [\n 'diskNo' => $diskNo,\n 'cdDiskNo' => $cdDiskNo,\n 'cdEntriesDisk' => $cdEntriesDisk,\n 'cdEntries' => $cdEntries,\n 'cdSize' => $cdSize,\n 'cdPos' => $cdPos,\n 'commentLength' => $commentLength,\n ] = unpack(\n 'vdiskNo/vcdDiskNo/vcdEntriesDisk/'\n . 'vcdEntries/VcdSize/VcdPos/vcommentLength',\n substr($buffer, 0, 18)\n );\n\n if (\n $diskNo !== 0\n || $cdDiskNo !== 0\n || $cdEntriesDisk !== $cdEntries\n ) {\n throw new ZipException(\n 'ZIP file spanning/splitting is not supported!'\n );\n }\n $comment = null;\n\n if ($commentLength > 0) {\n // .ZIP file comment (variable sizeECD)\n $comment = substr($buffer, 18, $commentLength);\n }\n\n // Check for ZIP64 End Of Central Directory Locator exists.\n $zip64ECDLocatorPosition = $positionECD - ZipConstants::ZIP64_END_CD_LOC_LEN;\n fseek($this->inStream, $zip64ECDLocatorPosition);\n // zip64 end of central dir locator\n // signature 4 bytes (0x07064b50)\n if (\n $zip64ECDLocatorPosition > 0\n && unpack('V', fread($this->inStream, 4))[1] === ZipConstants::ZIP64_END_CD_LOC\n ) {\n if (!$this->isZip64Support()) {\n throw new ZipException('ZIP64 not supported this archive.');\n }\n\n $positionECD = $this->findZip64ECDPosition();\n $endCentralDirectory = $this->readZip64EndOfCentralDirectory($positionECD);\n $endCentralDirectory->setComment($comment);\n } else {\n $endCentralDirectory = new EndOfCentralDirectory(\n $cdEntries,\n $cdPos,\n $cdSize,\n false,\n $comment\n );\n }\n\n return $endCentralDirectory;\n }", "public function getZippedfile() {\r\n\r\n $data = implode(\"\", $this -> compressedData); \r\n $controlDirectory = implode(\"\", $this -> centralDirectory); \r\n\r\n return \r\n $data. \r\n $controlDirectory. \r\n $this -> endOfCentralDirectory. \r\n pack(\"v\", sizeof($this -> centralDirectory)). \r\n pack(\"v\", sizeof($this -> centralDirectory)). \r\n pack(\"V\", strlen($controlDirectory)). \r\n pack(\"V\", strlen($data)). \r\n \"\\x00\\x00\"; \r\n }", "static private function zipdir($zip, $srcdir, $localdir=\"\")\n {\n $srcdir=rtrim($srcdir, \"/\\\\\").'/';\n // files \n foreach( array_filter(glob($srcdir . '/*'), 'is_file') as $path ) {\n $name = basename($path);\n if ($name == '.' || $name == '..') continue;\n $localname = $localdir . $name;\n $zip->addFile($path, $localname);\n }\n // dirs\n foreach( glob($srcdir . '/*', GLOB_ONLYDIR) as $path ) {\n $name = basename($path) . '/';\n if ($name == '.' || $name == '..') continue;\n $localname = $localdir . $name;\n $zip->addEmptyDir($localname);\n self::zipdir($zip, $path, $localname);\n }\n /*\n while (false !== ($entry = readdir($handle))) {\n if ($entry == \".\" || $entry == \"..\") continue;\n $file=$dir.$entry; // the file to add\n $name=$entryDir.$entry; // the zip name for the file\n if (is_dir($file)) {\n $zip->addEmptyDir($name.'/');\n self::zipDir($zip, $file.'/', $name.'/');\n }\n else if (is_file($file)) {\n $zip->addFile($file, $name);\n }\n }\n */\n }", "function ready_zip_for_remote($copy)\n{\n\t$file_locs=json_decode($copy);\n\t$zip_file_name=date(\"Ymdhis\");\n\tcreate_zip($file_locs, \"tmp/\".$zip_file_name.\".zip\");\n\techo $zip_file_name;\n}" ]
[ "0.626799", "0.6252693", "0.59027267", "0.54948527", "0.5474614", "0.53984135", "0.52814406", "0.5280893", "0.52210873", "0.5154357", "0.5141009", "0.51379585", "0.51292026", "0.5121536", "0.508517", "0.5071955", "0.5037024", "0.50327563", "0.499384", "0.49801308", "0.49585095", "0.49476248", "0.49344534", "0.4905386", "0.48482347", "0.48383164", "0.482346", "0.48163137", "0.48109704", "0.4799105" ]
0.6318284
0
Adds Zip64 end of central directory record.
private function addCdrEofZip64() { $num = count($this->files); list($num_low, $num_high) = $this->int64Split($num); list($cdr_len_low, $cdr_len_high) = $this->int64Split($this->cdr_len); list($cdr_ofs_low, $cdr_ofs_high) = $this->int64Split($this->cdr_ofs); $fields = [ // (from V,F of APPNOTE.TXT) ['V', 0x06064b50], // zip64 end of central directory signature ['V', 44], // size of zip64 end of central directory record (low) minus 12 bytes ['V', 0], // size of zip64 end of central directory record (high) ['v', self::VERSION], // version made by ['v', self::VERSION], // version needed to extract ['V', 0x0000], // this disk number (only one disk) ['V', 0x0000], // number of disk with central dir ['V', $num_low], // number of entries in the cdr for this disk (low) ['V', $num_high], // number of entries in the cdr for this disk (high) ['V', $num_low], // number of entries in the cdr (low) ['V', $num_high], // number of entries in the cdr (high) ['V', $cdr_len_low], // cdr size (low) ['V', $cdr_len_high], // cdr size (high) ['V', $cdr_ofs_low], // cdr ofs (low) ['V', $cdr_ofs_high], // cdr ofs (high) ]; $ret = $this->packFields($fields); $this->send($ret); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function addCdrEofLocatorZip64()\n {\n list($cdr_ofs_low, $cdr_ofs_high) = $this->int64Split($this->cdr_len + $this->cdr_ofs);\n \n $fields = [ // (from V,F of APPNOTE.TXT)\n ['V', 0x07064b50], // zip64 end of central dir locator signature\n ['V', 0], // this disk number\n ['V', $cdr_ofs_low], // cdr ofs (low)\n ['V', $cdr_ofs_high], // cdr ofs (high)\n ['V', 1], // total number of disks\n ];\n \n $ret = $this->packFields($fields);\n $this->send($ret);\n }", "protected function readEndOfCentralDirectory(): EndOfCentralDirectory\n {\n if (!$this->findEndOfCentralDirectory()) {\n throw new ZipException('Invalid zip file. The end of the central directory could not be found.');\n }\n\n $positionECD = ftell($this->inStream) - 4;\n $sizeECD = $this->size - ftell($this->inStream);\n $buffer = fread($this->inStream, $sizeECD);\n\n [\n 'diskNo' => $diskNo,\n 'cdDiskNo' => $cdDiskNo,\n 'cdEntriesDisk' => $cdEntriesDisk,\n 'cdEntries' => $cdEntries,\n 'cdSize' => $cdSize,\n 'cdPos' => $cdPos,\n 'commentLength' => $commentLength,\n ] = unpack(\n 'vdiskNo/vcdDiskNo/vcdEntriesDisk/'\n . 'vcdEntries/VcdSize/VcdPos/vcommentLength',\n substr($buffer, 0, 18)\n );\n\n if (\n $diskNo !== 0\n || $cdDiskNo !== 0\n || $cdEntriesDisk !== $cdEntries\n ) {\n throw new ZipException(\n 'ZIP file spanning/splitting is not supported!'\n );\n }\n $comment = null;\n\n if ($commentLength > 0) {\n // .ZIP file comment (variable sizeECD)\n $comment = substr($buffer, 18, $commentLength);\n }\n\n // Check for ZIP64 End Of Central Directory Locator exists.\n $zip64ECDLocatorPosition = $positionECD - ZipConstants::ZIP64_END_CD_LOC_LEN;\n fseek($this->inStream, $zip64ECDLocatorPosition);\n // zip64 end of central dir locator\n // signature 4 bytes (0x07064b50)\n if (\n $zip64ECDLocatorPosition > 0\n && unpack('V', fread($this->inStream, 4))[1] === ZipConstants::ZIP64_END_CD_LOC\n ) {\n if (!$this->isZip64Support()) {\n throw new ZipException('ZIP64 not supported this archive.');\n }\n\n $positionECD = $this->findZip64ECDPosition();\n $endCentralDirectory = $this->readZip64EndOfCentralDirectory($positionECD);\n $endCentralDirectory->setComment($comment);\n } else {\n $endCentralDirectory = new EndOfCentralDirectory(\n $cdEntries,\n $cdPos,\n $cdSize,\n false,\n $comment\n );\n }\n\n return $endCentralDirectory;\n }", "protected function readZip64EndOfCentralDirectory(int $zip64ECDPosition): EndOfCentralDirectory\n {\n fseek($this->inStream, $zip64ECDPosition);\n\n $buffer = fread($this->inStream, ZipConstants::ZIP64_END_OF_CD_LEN);\n\n if (unpack('V', $buffer)[1] !== ZipConstants::ZIP64_END_CD) {\n throw new ZipException('Expected ZIP64 End Of Central Directory Record!');\n }\n\n [\n// 'size' => $size,\n// 'versionMadeBy' => $versionMadeBy,\n// 'extractVersion' => $extractVersion,\n 'diskNo' => $diskNo,\n 'cdDiskNo' => $cdDiskNo,\n 'cdEntriesDisk' => $cdEntriesDisk,\n 'entryCount' => $entryCount,\n 'cdSize' => $cdSize,\n 'cdPos' => $cdPos,\n ] = unpack(\n// 'Psize/vversionMadeBy/vextractVersion/'.\n 'VdiskNo/VcdDiskNo/PcdEntriesDisk/PentryCount/PcdSize/PcdPos',\n substr($buffer, 16, 40)\n );\n\n// $platform = ZipPlatform::fromValue(($versionMadeBy & 0xFF00) >> 8);\n// $softwareVersion = $versionMadeBy & 0x00FF;\n\n if ($diskNo !== 0 || $cdDiskNo !== 0 || $entryCount !== $cdEntriesDisk) {\n throw new ZipException('ZIP file spanning/splitting is not supported!');\n }\n\n if ($entryCount < 0 || $entryCount > 0x7FFFFFFF) {\n throw new ZipException('Total Number Of Entries In The Central Directory out of range!');\n }\n\n // skip zip64 extensible data sector (variable sizeEndCD)\n\n return new EndOfCentralDirectory(\n $entryCount,\n $cdPos,\n $cdSize,\n true\n );\n }", "public function finish(): int\n {\n $centralDirectoryStartOffsetOnDisk = $this->offset;\n $sizeOfCentralDirectory = 0;\n\n // add trailing cdr file records\n foreach ($this->centralDirectoryRecords as $centralDirectoryRecord) {\n $this->send($centralDirectoryRecord);\n $sizeOfCentralDirectory += strlen($centralDirectoryRecord);\n }\n\n // Add 64bit headers (if applicable)\n if (count($this->centralDirectoryRecords) >= 0xFFFF ||\n $centralDirectoryStartOffsetOnDisk > 0xFFFFFFFF ||\n $sizeOfCentralDirectory > 0xFFFFFFFF) {\n if (!$this->enableZip64) {\n throw new OverflowException();\n }\n\n $this->send(Zip64\\EndOfCentralDirectory::generate(\n versionMadeBy: self::ZIP_VERSION_MADE_BY,\n versionNeededToExtract: Version::ZIP64->value,\n numberOfThisDisk: 0,\n numberOfTheDiskWithCentralDirectoryStart: 0,\n numberOfCentralDirectoryEntriesOnThisDisk: count($this->centralDirectoryRecords),\n numberOfCentralDirectoryEntries: count($this->centralDirectoryRecords),\n sizeOfCentralDirectory: $sizeOfCentralDirectory,\n centralDirectoryStartOffsetOnDisk: $centralDirectoryStartOffsetOnDisk,\n extensibleDataSector: '',\n ));\n\n $this->send(Zip64\\EndOfCentralDirectoryLocator::generate(\n numberOfTheDiskWithZip64CentralDirectoryStart: 0x00,\n zip64centralDirectoryStartOffsetOnDisk: $centralDirectoryStartOffsetOnDisk + $sizeOfCentralDirectory,\n totalNumberOfDisks: 1,\n ));\n }\n\n // add trailing cdr eof record\n $numberOfCentralDirectoryEntries = min(count($this->centralDirectoryRecords), 0xFFFF);\n $this->send(EndOfCentralDirectory::generate(\n numberOfThisDisk: 0x00,\n numberOfTheDiskWithCentralDirectoryStart: 0x00,\n numberOfCentralDirectoryEntriesOnThisDisk: $numberOfCentralDirectoryEntries,\n numberOfCentralDirectoryEntries: $numberOfCentralDirectoryEntries,\n sizeOfCentralDirectory: min($sizeOfCentralDirectory, 0xFFFFFFFF),\n centralDirectoryStartOffsetOnDisk: min($centralDirectoryStartOffsetOnDisk, 0xFFFFFFFF),\n zipFileComment: $this->comment,\n ));\n\n $size = $this->offset;\n\n // The End\n $this->clear();\n\n return $size;\n }", "function privReadEndCentralDir(&$p_central_dir)\n {\n $v_result=1;\n\n // ----- Go to the end of the zip file\n $v_size = filesize($this->zipname);\n @fseek($this->zip_fd, $v_size);\n if (@ftell($this->zip_fd) != $v_size)\n {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \\''.$this->zipname.'\\'');\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- First try : look if this is an archive with no commentaries (most of the time)\n // in this case the end of central dir is at 22 bytes of the file end\n $v_found = 0;\n if ($v_size > 26) {\n @fseek($this->zip_fd, $v_size-22);\n if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22))\n {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \\''.$this->zipname.'\\'');\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- Read for bytes\n $v_binary_data = @fread($this->zip_fd, 4);\n $v_data = @unpack('Vid', $v_binary_data);\n\n // ----- Check signature\n if ($v_data['id'] == 0x06054b50) {\n $v_found = 1;\n }\n\n $v_pos = ftell($this->zip_fd);\n }\n\n // ----- Go back to the maximum possible size of the Central Dir End Record\n if (!$v_found) {\n $v_maximum_size = 65557; // 0xFFFF + 22;\n if ($v_maximum_size > $v_size)\n $v_maximum_size = $v_size;\n @fseek($this->zip_fd, $v_size-$v_maximum_size);\n if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size))\n {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \\''.$this->zipname.'\\'');\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- Read byte per byte in order to find the signature\n $v_pos = ftell($this->zip_fd);\n $v_bytes = 0x00000000;\n while ($v_pos < $v_size)\n {\n // ----- Read a byte\n $v_byte = @fread($this->zip_fd, 1);\n\n // ----- Add the byte\n //$v_bytes = ($v_bytes << 8) | Ord($v_byte);\n // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number\n // Otherwise on systems where we have 64bit integers the check below for the magic number will fail.\n $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte);\n\n // ----- Compare the bytes\n if ($v_bytes == 0x504b0506)\n {\n $v_pos++;\n break;\n }\n\n $v_pos++;\n }\n\n // ----- Look if not found end of central dir\n if ($v_pos == $v_size)\n {\n\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, \"Unable to find End of Central Dir Record signature\");\n\n // ----- Return\n return PclZip::errorCode();\n }\n }\n\n // ----- Read the first 18 bytes of the header\n $v_binary_data = fread($this->zip_fd, 18);\n\n // ----- Look for invalid block size\n if (strlen($v_binary_data) != 18)\n {\n\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, \"Invalid End of Central Dir Record size : \".strlen($v_binary_data));\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- Extract the values\n $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data);\n\n // ----- Check the global size\n if (($v_pos + $v_data['comment_size'] + 18) != $v_size) {\n\n\t // ----- Removed in release 2.2 see readme file\n\t // The check of the file size is a little too strict.\n\t // Some bugs where found when a zip is encrypted/decrypted with 'crypt'.\n\t // While decrypted, zip has training 0 bytes\n\t if (0) {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT,\n\t 'The central dir is not at the end of the archive.'\n\t\t\t\t\t\t .' Some trailing bytes exists after the archive.');\n\n // ----- Return\n return PclZip::errorCode();\n\t }\n }\n\n // ----- Get comment\n if ($v_data['comment_size'] != 0) {\n $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']);\n }\n else\n $p_central_dir['comment'] = '';\n\n $p_central_dir['entries'] = $v_data['entries'];\n $p_central_dir['disk_entries'] = $v_data['disk_entries'];\n $p_central_dir['offset'] = $v_data['offset'];\n $p_central_dir['size'] = $v_data['size'];\n $p_central_dir['disk'] = $v_data['disk'];\n $p_central_dir['disk_start'] = $v_data['disk_start'];\n\n // TBC\n //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) {\n //}\n\n // ----- Return\n return $v_result;\n }", "function _addToZIPFile(& $file, & $contents, & $ctrldir) \n {\n $data = & $file['data'];\n $name = str_replace('\\\\', '/', $file['name']);\n \n $ftime = null;\n if (isset ($file['time'])) {\n $ftime = $file['time'];\n }\n \n $dtime = dechex($this->_unix2DosTime($ftime));\n $hexdtime = chr(hexdec($dtime[6] . $dtime[7])) .\n chr(hexdec($dtime[4] . $dtime[5])) .\n chr(hexdec($dtime[2] . $dtime[3])) .\n chr(hexdec($dtime[0] . $dtime[1]));\n\n /* Begin creating the ZIP data. */\n \n $fr = $this->_fileHeader; \n $fr .= \"\\x14\\x00\"; /* Version needed to extract. */\n $fr .= \"\\x00\\x00\"; /* General purpose bit flag. */\n $fr .= \"\\x08\\x00\"; /* Compression method. */\n $fr .= $hexdtime; /* Last modification time/date. */\n \n /* \"Local file header\" segment. */\n \n $unc_len = strlen($data);\n $crc = crc32($data);\n $zdata = gzcompress($data);\n $zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2);\n $c_len = strlen($zdata);\n $fr .= pack('V', $crc); /* CRC 32 information. */\n $fr .= pack('V', $c_len); /* Compressed filesize. */\n $fr .= pack('V', $unc_len); /* Uncompressed filesize. */\n $fr .= pack('v', strlen($name)); /* Length of filename. */\n $fr .= pack('v', 0); /* Extra field length. */\n $fr .= $name; /* File name. */\n \n /* \"File data\" segment. */\n $fr .= $zdata;\n\n /* Add this entry to array. */\n $old_offset = strlen(implode('', $contents));\n $contents[] = & $fr;\n\n /* Add to central directory record. */\n $cdrec = $this->_ctrlDirHeader;\n $cdrec .= \"\\x00\\x00\"; /* Version made by. */\n $cdrec .= \"\\x14\\x00\"; /* Version needed to extract */\n $cdrec .= \"\\x00\\x00\"; /* General purpose bit flag */\n $cdrec .= \"\\x08\\x00\"; /* Compression method */\n $cdrec .= $hexdtime; /* Last mod time/date. */\n $cdrec .= pack('V', $crc); /* CRC 32 information. */\n $cdrec .= pack('V', $c_len); /* Compressed filesize. */\n $cdrec .= pack('V', $unc_len); /* Uncompressed filesize. */\n $cdrec .= pack('v', strlen($name)); /* Length of filename. */\n $cdrec .= pack('v', 0); /* Extra field length. */\n $cdrec .= pack('v', 0); /* File comment length. */\n $cdrec .= pack('v', 0); /* Disk number start. */\n $cdrec .= pack('v', 0); /* Internal file attributes. */\n $cdrec .= pack('V', 32); /* External file attributes - 'archive' bit set. */\n $cdrec .= pack('V', $old_offset); /* Relative offset of local header. */\n $cdrec .= $name; /* File name. */\n /* Optional extra field, file comment goes here. */\n\n // Save to central directory array. */\n $ctrldir[] = & $cdrec;\n }", "public function addDirectory($directoryName) {\r\n $directoryName = str_replace(\"\\\\\", \"/\", $directoryName); \r\n\r\n $feedArrayRow = \"\\x50\\x4b\\x03\\x04\";\r\n $feedArrayRow .= \"\\x0a\\x00\"; \r\n $feedArrayRow .= \"\\x00\\x00\"; \r\n $feedArrayRow .= \"\\x00\\x00\"; \r\n $feedArrayRow .= \"\\x00\\x00\\x00\\x00\";\r\n\r\n $feedArrayRow .= pack(\"V\",0);\r\n $feedArrayRow .= pack(\"V\",0);\r\n $feedArrayRow .= pack(\"V\",0);\r\n $feedArrayRow .= pack(\"v\", strlen($directoryName) );\r\n $feedArrayRow .= pack(\"v\", 0 );\r\n $feedArrayRow .= $directoryName; \r\n\r\n $feedArrayRow .= pack(\"V\",0);\r\n $feedArrayRow .= pack(\"V\",0);\r\n $feedArrayRow .= pack(\"V\",0);\r\n\r\n $this -> compressedData[] = $feedArrayRow;\r\n \r\n $newOffset = strlen(implode(\"\", $this->compressedData));\r\n\r\n $addCentralRecord = \"\\x50\\x4b\\x01\\x02\";\r\n $addCentralRecord .=\"\\x00\\x00\"; \r\n $addCentralRecord .=\"\\x0a\\x00\"; \r\n $addCentralRecord .=\"\\x00\\x00\"; \r\n $addCentralRecord .=\"\\x00\\x00\"; \r\n $addCentralRecord .=\"\\x00\\x00\\x00\\x00\";\r\n $addCentralRecord .= pack(\"V\",0);\r\n $addCentralRecord .= pack(\"V\",0);\r\n $addCentralRecord .= pack(\"V\",0);\r\n $addCentralRecord .= pack(\"v\", strlen($directoryName) );\r\n $addCentralRecord .= pack(\"v\", 0 );\r\n $addCentralRecord .= pack(\"v\", 0 );\r\n $addCentralRecord .= pack(\"v\", 0 );\r\n $addCentralRecord .= pack(\"v\", 0 );\r\n $ext = \"\\x00\\x00\\x10\\x00\";\r\n $ext = \"\\xff\\xff\\xff\\xff\"; \r\n $addCentralRecord .= pack(\"V\", 16 );\r\n\r\n $addCentralRecord .= pack(\"V\", $this -> oldOffset );\r\n $this -> oldOffset = $newOffset;\r\n\r\n $addCentralRecord .= $directoryName; \r\n\r\n $this -> centralDirectory[] = $addCentralRecord; \r\n }", "public function zippedFile()\r\n {\r\n $data = implode(\"\", $this->datasec);\r\n $ctrldir = implode(\"\", $this->ctrlDir);\r\n\r\n return $data.\r\n $ctrldir.\r\n $this->eofCtrlDir.\r\n pack(\"v\", sizeof($this->ctrlDir)). // total number of entries \"on this disk\"\r\n pack(\"v\", sizeof($this->ctrlDir)). // total number of entries overall\r\n pack(\"V\", strlen($ctrldir)). // size of central dir\r\n pack(\"V\", strlen($data)). // offset to start of central dir\r\n \"\\x00\\x00\"; // .zip file comment length\r\n }", "public function addDirectory($directoryName) {\n $directoryName = str_replace(\"\\\\\", \"/\", $directoryName);\n $feedArrayRow = \"\\x50\\x4b\\x03\\x04\";\n $feedArrayRow .= \"\\x0a\\x00\";\n $feedArrayRow .= \"\\x00\\x00\";\n $feedArrayRow .= \"\\x00\\x00\";\n $feedArrayRow .= \"\\x00\\x00\\x00\\x00\";\n $feedArrayRow .= pack(\"V\",0);\n $feedArrayRow .= pack(\"V\",0);\n $feedArrayRow .= pack(\"V\",0);\n $feedArrayRow .= pack(\"v\", strlen($directoryName) );\n $feedArrayRow .= pack(\"v\", 0 );\n $feedArrayRow .= $directoryName;\n $feedArrayRow .= pack(\"V\",0);\n $feedArrayRow .= pack(\"V\",0);\n $feedArrayRow .= pack(\"V\",0);\n $this->compressedData[] = $feedArrayRow;\n $newOffset = strlen(implode(\"\", $this->compressedData));\n $addCentralRecord = \"\\x50\\x4b\\x01\\x02\";\n $addCentralRecord .=\"\\x00\\x00\";\n $addCentralRecord .=\"\\x0a\\x00\";\n $addCentralRecord .=\"\\x00\\x00\";\n $addCentralRecord .=\"\\x00\\x00\";\n $addCentralRecord .=\"\\x00\\x00\\x00\\x00\";\n $addCentralRecord .= pack(\"V\",0);\n $addCentralRecord .= pack(\"V\",0);\n $addCentralRecord .= pack(\"V\",0);\n $addCentralRecord .= pack(\"v\", strlen($directoryName) );\n $addCentralRecord .= pack(\"v\", 0 );\n $addCentralRecord .= pack(\"v\", 0 );\n $addCentralRecord .= pack(\"v\", 0 );\n $addCentralRecord .= pack(\"v\", 0 );\n $addCentralRecord .= pack(\"V\", 16 );\n $addCentralRecord .= pack(\"V\", $this->oldOffset );\n $this->oldOffset = $newOffset;\n $addCentralRecord .= $directoryName;\n $this->centralDirectory[] = $addCentralRecord;\n }", "function privReadEndCentralDir(&$p_central_dir)\n {\n }", "public function getZippedfile() {\r\n\r\n $data = implode(\"\", $this -> compressedData); \r\n $controlDirectory = implode(\"\", $this -> centralDirectory); \r\n\r\n return \r\n $data. \r\n $controlDirectory. \r\n $this -> endOfCentralDirectory. \r\n pack(\"v\", sizeof($this -> centralDirectory)). \r\n pack(\"v\", sizeof($this -> centralDirectory)). \r\n pack(\"V\", strlen($controlDirectory)). \r\n pack(\"V\", strlen($data)). \r\n \"\\x00\\x00\"; \r\n }", "function addFileToZip($downdir,$zip){\n\t// echo $downdir;\n\t$handler=opendir($downdir);\n\t// if ($handler){\n\t// \techo 'tt';\n\t// }\n\twhile(($filename=readdir($handler))!=false){\n\t\tif($filename!='.' && $filename!='..'){\n\t\t\tif(is_dir($downdir.'/'.$filename)){\n\t\t\t\taddFileToZip($downdir.'/'.$filename,$zip);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$zip->addFile($downdir.'/'.$filename);\n\t\t\t}\n\t\t}\n\t}\n @closedir($downdir);\n}", "function inline_archive_structure_end() {\n\n\techo '</div><!--end #archive-->';\n\t\n}", "private function receiveCentralDirectoryEnd($ch, $data) {\n\t\t$this->info->centralDirectoryEnd .= $data;\n\t\treturn strlen($data);\n\t}", "public function Finish()\r\n {\r\n $bitLength = $this->LeftRotateLong($this->byteCount , 3);\r\n //\r\n // add the pad bytes.\r\n //\r\n $this->Update(128);\r\n\r\n while ($this->xBufOff != 0) $this->Update(0);\r\n $this->ProcessLength($bitLength);\r\n $this->ProcessBlock();\r\n }", "public function addDir($name) {\r\n\r\n $name = str_replace(\"\\\\\", \"/\", $name);\r\n $fr = \"\\x50\\x4b\\x03\\x04\";\r\n $fr .= \"\\x0a\\x00\"; // version needed to extract\r\n $fr .= \"\\x00\\x00\"; // general purpose bit flag\r\n $fr .= \"\\x00\\x00\"; // compression method\r\n $fr .= \"\\x00\\x00\\x00\\x00\"; // last mod time and date\r\n $fr .= pack(\"V\",0); // crc32\r\n $fr .= pack(\"V\",0); //compressed filesize\r\n $fr .= pack(\"V\",0); //uncompressed filesize\r\n $fr .= pack(\"v\",strlen($name)); //length of pathname\r\n $fr .= pack(\"v\", 0); //extra field length\r\n $fr .= $name;\r\n // end of \"local file header\" segment\r\n\r\n // no \"file data\" segment for path\r\n\r\n // \"data descriptor\" segment (optional but necessary if archive is not served as file)\r\n $fr .= pack(\"V\",0); //crc32\r\n $fr .= pack(\"V\",0); //compressed filesize\r\n $fr .= pack(\"V\",0); //uncompressed filesize\r\n\r\n // add this entry to array\r\n $this->datasec[] = $fr;\r\n\r\n $newOffset = strlen(implode(\"\", $this->datasec));\r\n\r\n // ext. file attributes mirrors MS-DOS directory attr byte, detailed\r\n // at http://support.microsoft.com/support/kb/articles/Q125/0/19.asp\r\n\r\n // now add to central record\r\n $cdrec = \"\\x50\\x4b\\x01\\x02\";\r\n $cdrec .=\"\\x00\\x00\"; // version made by\r\n $cdrec .=\"\\x0a\\x00\"; // version needed to extract\r\n $cdrec .=\"\\x00\\x00\"; // general purpose bit flag\r\n $cdrec .=\"\\x00\\x00\"; // compression method\r\n $cdrec .=\"\\x00\\x00\\x00\\x00\"; // last mod time and date\r\n $cdrec .= pack(\"V\",0); // crc32\r\n $cdrec .= pack(\"V\",0); //compressed filesize\r\n $cdrec .= pack(\"V\",0); //uncompressed filesize\r\n $cdrec .= pack(\"v\", strlen($name) ); //length of filename\r\n $cdrec .= pack(\"v\", 0 ); //extra field length\r\n $cdrec .= pack(\"v\", 0 ); //file comment length\r\n $cdrec .= pack(\"v\", 0 ); //disk number start\r\n $cdrec .= pack(\"v\", 0 ); //internal file attributes\r\n $cdrec .= pack(\"V\", 16 ); //external file attributes - 'directory' bit set\r\n\r\n $cdrec .= pack(\"V\", $this->oldOffset); //relative offset of local header\r\n $this->oldOffset = $newOffset;\r\n\r\n $cdrec .= $name;\r\n // optional extra field, file comment goes here\r\n // save to array\r\n $this->ctrlDir[] = $cdrec;\r\n $this->dirs[] = $name;\r\n }", "function privAdd($p_filedescr_list, &$p_result_list, &$p_options)\n {\n $v_result=1;\n $v_list_detail = array();\n\n // ----- Look if the archive exists or is empty\n if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0))\n {\n\n // ----- Do a create\n $v_result = $this->privCreate($p_filedescr_list, $p_result_list, $p_options);\n\n // ----- Return\n return $v_result;\n }\n // ----- Magic quotes trick\n $this->privDisableMagicQuotes();\n\n // ----- Open the zip file\n if (($v_result=$this->privOpenFd('rb')) != 1)\n {\n // ----- Magic quotes trick\n $this->privSwapBackMagicQuotes();\n\n // ----- Return\n return $v_result;\n }\n\n // ----- Read the central directory informations\n $v_central_dir = array();\n if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)\n {\n $this->privCloseFd();\n $this->privSwapBackMagicQuotes();\n return $v_result;\n }\n\n // ----- Go to beginning of File\n @rewind($this->zip_fd);\n\n // ----- Creates a temporay file\n $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';\n\n // ----- Open the temporary file in write mode\n if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0)\n {\n $this->privCloseFd();\n $this->privSwapBackMagicQuotes();\n\n PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \\''.$v_zip_temp_name.'\\' in binary write mode');\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- Copy the files from the archive to the temporary file\n // TBC : Here I should better append the file and go back to erase the central dir\n $v_size = $v_central_dir['offset'];\n while ($v_size != 0)\n {\n $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n $v_buffer = fread($this->zip_fd, $v_read_size);\n @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);\n $v_size -= $v_read_size;\n }\n\n // ----- Swap the file descriptor\n // Here is a trick : I swap the temporary fd with the zip fd, in order to use\n // the following methods on the temporary fil and not the real archive\n $v_swap = $this->zip_fd;\n $this->zip_fd = $v_zip_temp_fd;\n $v_zip_temp_fd = $v_swap;\n\n // ----- Add the files\n $v_header_list = array();\n if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1)\n {\n fclose($v_zip_temp_fd);\n $this->privCloseFd();\n @unlink($v_zip_temp_name);\n $this->privSwapBackMagicQuotes();\n\n // ----- Return\n return $v_result;\n }\n\n // ----- Store the offset of the central dir\n $v_offset = @ftell($this->zip_fd);\n\n // ----- Copy the block of file headers from the old archive\n $v_size = $v_central_dir['size'];\n while ($v_size != 0)\n {\n $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n $v_buffer = @fread($v_zip_temp_fd, $v_read_size);\n @fwrite($this->zip_fd, $v_buffer, $v_read_size);\n $v_size -= $v_read_size;\n }\n\n // ----- Create the Central Dir files header\n for ($i=0, $v_count=0; $i<sizeof($v_header_list); $i++)\n {\n // ----- Create the file header\n if ($v_header_list[$i]['status'] == 'ok') {\n if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) {\n fclose($v_zip_temp_fd);\n $this->privCloseFd();\n @unlink($v_zip_temp_name);\n $this->privSwapBackMagicQuotes();\n\n // ----- Return\n return $v_result;\n }\n $v_count++;\n }\n\n // ----- Transform the header to a 'usable' info\n $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);\n }\n\n // ----- Zip file comment\n $v_comment = $v_central_dir['comment'];\n if (isset($p_options[PCLZIP_OPT_COMMENT])) {\n $v_comment = $p_options[PCLZIP_OPT_COMMENT];\n }\n if (isset($p_options[PCLZIP_OPT_ADD_COMMENT])) {\n $v_comment = $v_comment.$p_options[PCLZIP_OPT_ADD_COMMENT];\n }\n if (isset($p_options[PCLZIP_OPT_PREPEND_COMMENT])) {\n $v_comment = $p_options[PCLZIP_OPT_PREPEND_COMMENT].$v_comment;\n }\n\n // ----- Calculate the size of the central header\n $v_size = @ftell($this->zip_fd)-$v_offset;\n\n // ----- Create the central dir footer\n if (($v_result = $this->privWriteCentralHeader($v_count+$v_central_dir['entries'], $v_size, $v_offset, $v_comment)) != 1)\n {\n // ----- Reset the file list\n unset($v_header_list);\n $this->privSwapBackMagicQuotes();\n\n // ----- Return\n return $v_result;\n }\n\n // ----- Swap back the file descriptor\n $v_swap = $this->zip_fd;\n $this->zip_fd = $v_zip_temp_fd;\n $v_zip_temp_fd = $v_swap;\n\n // ----- Close\n $this->privCloseFd();\n\n // ----- Close the temporary file\n @fclose($v_zip_temp_fd);\n\n // ----- Magic quotes trick\n $this->privSwapBackMagicQuotes();\n\n // ----- Delete the zip file\n // TBC : I should test the result ...\n @unlink($this->zipname);\n\n // ----- Rename the temporary file\n // TBC : I should test the result ...\n //@rename($v_zip_temp_name, $this->zipname);\n PclZipUtilRename($v_zip_temp_name, $this->zipname);\n\n // ----- Return\n return $v_result;\n }", "protected function readCentralDirectory(EndOfCentralDirectory $endCD): array\n {\n $entries = [];\n\n $cdOffset = $endCD->getCdOffset();\n fseek($this->inStream, $cdOffset);\n\n if (!($cdStream = fopen('php://temp', 'w+b'))) {\n // @codeCoverageIgnoreStart\n throw new ZipException('A temporary resource cannot be opened for writing.');\n // @codeCoverageIgnoreEnd\n }\n stream_copy_to_stream($this->inStream, $cdStream, $endCD->getCdSize());\n rewind($cdStream);\n for ($numEntries = $endCD->getEntryCount(); $numEntries > 0; $numEntries--) {\n $zipEntry = $this->readZipEntry($cdStream);\n\n $entryName = $zipEntry->getName();\n\n /** @var UnicodePathExtraField|null $unicodePathExtraField */\n $unicodePathExtraField = $zipEntry->getExtraField(UnicodePathExtraField::HEADER_ID);\n\n if ($unicodePathExtraField !== null && $unicodePathExtraField->getCrc32() === crc32($entryName)) {\n $unicodePath = $unicodePathExtraField->getUnicodeValue();\n\n if ($unicodePath !== '') {\n $unicodePath = str_replace('\\\\', '/', $unicodePath);\n\n if (substr_count($entryName, '/') === substr_count($unicodePath, '/')) {\n $entryName = $unicodePath;\n }\n }\n }\n\n $entries[$entryName] = $zipEntry;\n }\n\n return $entries;\n }", "protected function moveRels(ZipArchive &$finalZip): void\n {\n $headerRoute = $this->getUncompressedRoute() . \"/word/_rels/header1.xml.rels\";\n if (is_file($headerRoute)) {\n $finalZip->addFile($headerRoute, 'word/_rels/header1.xml.rels');\n }\n\n $headerRoute = $this->getUncompressedRoute() . \"/word/_rels/footer1.xml.rels\";\n if (is_file($headerRoute)) {\n $finalZip->addFile($headerRoute, 'word/_rels/footer1.xml.rels');\n }\n }", "protected function _writeTrailer() {}", "function inline_archive_right_column_end() {\n\n\techo '</div><!--end .right-->';\n\t\n}", "private function writeFooter(): void\n {\n $record = 0x0015; // Record identifier\n\n /* removing for now\n // need to fix character count (multibyte!)\n if (strlen($this->phpSheet->getHeaderFooter()->getOddFooter()) <= 255) {\n $str = $this->phpSheet->getHeaderFooter()->getOddFooter();\n } else {\n $str = '';\n }\n */\n\n $recordData = StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddFooter());\n $length = strlen($recordData);\n\n $header = pack('vv', $record, $length);\n\n $this->append($header . $recordData);\n }", "public function next()\n {\n next($this->zipModel->getEntries());\n }", "public function addFile($data, $directoryName) {\r\n\r\n $directoryName = str_replace(\"\\\\\", \"/\", $directoryName); \r\n \r\n $feedArrayRow = \"\\x50\\x4b\\x03\\x04\";\r\n $feedArrayRow .= \"\\x14\\x00\"; \r\n $feedArrayRow .= \"\\x00\\x00\"; \r\n $feedArrayRow .= \"\\x08\\x00\"; \r\n $feedArrayRow .= \"\\x00\\x00\\x00\\x00\";\r\n\r\n $uncompressedLength = strlen($data); \r\n $compression = crc32($data); \r\n $gzCompressedData = gzcompress($data); \r\n $gzCompressedData = substr( substr($gzCompressedData, 0, strlen($gzCompressedData) - 4), 2);\r\n $compressedLength = strlen($gzCompressedData); \r\n $feedArrayRow .= pack(\"V\",$compression);\r\n $feedArrayRow .= pack(\"V\",$compressedLength);\r\n $feedArrayRow .= pack(\"V\",$uncompressedLength);\r\n $feedArrayRow .= pack(\"v\", strlen($directoryName) );\r\n $feedArrayRow .= pack(\"v\", 0 );\r\n $feedArrayRow .= $directoryName; \r\n\r\n $feedArrayRow .= $gzCompressedData; \r\n\r\n $feedArrayRow .= pack(\"V\",$compression);\r\n $feedArrayRow .= pack(\"V\",$compressedLength);\r\n $feedArrayRow .= pack(\"V\",$uncompressedLength);\r\n\r\n $this -> compressedData[] = $feedArrayRow;\r\n\r\n $newOffset = strlen(implode(\"\", $this->compressedData));\r\n\r\n $addCentralRecord = \"\\x50\\x4b\\x01\\x02\";\r\n $addCentralRecord .=\"\\x00\\x00\"; \r\n $addCentralRecord .=\"\\x14\\x00\"; \r\n $addCentralRecord .=\"\\x00\\x00\"; \r\n $addCentralRecord .=\"\\x08\\x00\"; \r\n $addCentralRecord .=\"\\x00\\x00\\x00\\x00\";\r\n $addCentralRecord .= pack(\"V\",$compression);\r\n $addCentralRecord .= pack(\"V\",$compressedLength);\r\n $addCentralRecord .= pack(\"V\",$uncompressedLength);\r\n $addCentralRecord .= pack(\"v\", strlen($directoryName) );\r\n $addCentralRecord .= pack(\"v\", 0 );\r\n $addCentralRecord .= pack(\"v\", 0 );\r\n $addCentralRecord .= pack(\"v\", 0 );\r\n $addCentralRecord .= pack(\"v\", 0 );\r\n $addCentralRecord .= pack(\"V\", 32 );\r\n\r\n $addCentralRecord .= pack(\"V\", $this -> oldOffset );\r\n $this -> oldOffset = $newOffset;\r\n\r\n $addCentralRecord .= $directoryName; \r\n\r\n $this -> centralDirectory[] = $addCentralRecord; \r\n }", "public function reverseJournal($newLineAfter);", "function PclZipUtilPathReduction($p_dir)\n {\n }", "public function addToZip(ZipArchive $zip, string $entryName): void;", "function zip_add_files($zipFile, $filesDir, $excludeLen) {\n $files = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($filesDir),\n RecursiveIteratorIterator::LEAVES_ONLY\n );\n\n foreach ($files as $name => $file) {\n // Get real and filename to be added for current file\n $filePath = fix_directory_separator($file->getRealPath());\n $localPath = substr($filePath, $excludeLen);\n\n // ignore editor entries\n $editor = \"editor\";\n if (substr($localPath, 0, strlen($editor)) === $editor) {\n continue;\n }\n\n // Skip directories (they will be added automatically)\n if (!$file->isDir()) {\n // Add current file to archive\n $zipFile->addFile($filePath, $localPath);\n }\n }\n}", "function _getZipInfo(& $data) \n {\n // Initialize variables\n $entries = array ();\n\n // Find the last central directory header entry\n $fhLast = strpos($data, $this->_ctrlDirEnd);\n do {\n $last = $fhLast;\t\t\n } while(($fhLast = strpos($data, $this->_ctrlDirEnd, $fhLast+1)) !== false);\n\n // Find the central directory offset\n $offset = 0;\n if($last) {\n $endOfCentralDirectory = unpack('vNumberOfDisk/vNoOfDiskWithStartOfCentralDirectory/vNoOfCentralDirectoryEntriesOnDisk/vTotalCentralDirectoryEntries/VSizeOfCentralDirectory/VCentralDirectoryOffset/vCommentLength', substr($data, $last+4));\n $offset = $endOfCentralDirectory['CentralDirectoryOffset'];\n }\n\t\t\n // Get details from Central directory structure.\n $fhStart = strpos($data, $this->_ctrlDirHeader, $offset);\n do {\n if (strlen($data) < $fhStart +31) {\n $this->set('error.message', 'Invalid ZIP data');\n return false;\n }\n\n $info = unpack('vMethod/VTime/VCRC32/VCompressed/VUncompressed/vLength', substr($data, $fhStart +10, 20));\n $name = substr($data, $fhStart +46, $info['Length']);\n\n $entries[$name] = array('attr' => null, 'crc' => sprintf(\"%08s\", dechex($info['CRC32'] )), 'csize' => $info['Compressed'], 'date' => null, '_dataStart' => null, 'name' => $name, 'method' => $this->_methods[$info['Method']], '_method' => $info['Method'], 'size' => $info['Uncompressed'], 'type' => null);\n $entries[$name]['date'] = mktime((($info['Time'] >> 11) & 0x1f), (($info['Time'] >> 5) & 0x3f), (($info['Time'] << 1) & 0x3e), (($info['Time'] >> 21) & 0x07), (($info['Time'] >> 16) & 0x1f), ((($info['Time'] >> 25) & 0x7f) + 1980));\n\n if (strlen($data) < $fhStart +43) {\n $this->set('error.message', 'Invalid ZIP data');\n return false;\n }\n $info = unpack('vInternal/VExternal/VOffset', substr($data, $fhStart +36, 10));\n\n $entries[$name]['type'] = ($info['Internal'] & 0x01) ? 'text' : 'binary';\n $entries[$name]['attr'] = (($info['External'] & 0x10) ? 'D' : '-') .\n (($info['External'] & 0x20) ? 'A' : '-') .\n (($info['External'] & 0x03) ? 'S' : '-') .\n (($info['External'] & 0x02) ? 'H' : '-') .\n (($info['External'] & 0x01) ? 'R' : '-');\n \n $entries[$name]['offset'] = $info['Offset'];\n\n // Get details from local file header since we have the offset\n $lfhStart = strpos($data, $this->_fileHeader, $entries[$name]['offset']);\n if (strlen($data) < $lfhStart +34) {\n $this->set('error.message', 'Invalid ZIP data');\n return false;\n }\n $info = unpack('vMethod/VTime/VCRC32/VCompressed/VUncompressed/vLength/vExtraLength', substr($data, $lfhStart +8, 25));\n $name = substr($data, $lfhStart +30, $info['Length']);\n $entries[$name]['_dataStart'] = $lfhStart +30 + $info['Length'] + $info['ExtraLength'];\n } while ((($fhStart = strpos($data, $this->_ctrlDirHeader, $fhStart +46)) !== false));\n \t\n $this->_metadata = array_values($entries);\n \n return true;\n }", "function privWriteCentralFileHeader(&$p_header)\n {\n $v_result=1;\n\n // TBC\n //for(reset($p_header); $key = key($p_header); next($p_header)) {\n //}\n\n // ----- Transform UNIX mtime to DOS format mdate/mtime\n $v_date = getdate($p_header['mtime']);\n $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2;\n $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday'];\n\n\n // ----- Packed data\n $v_binary_data = pack(\"VvvvvvvVVVvvvvvVV\", 0x02014b50,\n\t $p_header['version'], $p_header['version_extracted'],\n $p_header['flag'], $p_header['compression'],\n\t\t\t\t\t\t $v_mtime, $v_mdate, $p_header['crc'],\n $p_header['compressed_size'], $p_header['size'],\n strlen($p_header['stored_filename']),\n\t\t\t\t\t\t $p_header['extra_len'], $p_header['comment_len'],\n $p_header['disk'], $p_header['internal'],\n\t\t\t\t\t\t $p_header['external'], $p_header['offset']);\n\n // ----- Write the 42 bytes of the header in the zip file\n fputs($this->zip_fd, $v_binary_data, 46);\n\n // ----- Write the variable fields\n if (strlen($p_header['stored_filename']) != 0)\n {\n fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename']));\n }\n if ($p_header['extra_len'] != 0)\n {\n fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']);\n }\n if ($p_header['comment_len'] != 0)\n {\n fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']);\n }\n\n // ----- Return\n return $v_result;\n }" ]
[ "0.6524506", "0.62684804", "0.60399675", "0.60191613", "0.601667", "0.5660585", "0.5282199", "0.51426977", "0.5123915", "0.5112667", "0.4920884", "0.49105012", "0.48958436", "0.4831791", "0.48160124", "0.4786769", "0.47780445", "0.4774469", "0.4756552", "0.47549218", "0.4748249", "0.47244024", "0.4690527", "0.4675275", "0.46585006", "0.46144783", "0.46089798", "0.4585048", "0.45721093", "0.45602208" ]
0.7426264
0
/ Plugin Name: Dark Mode Plugin URI: Description: An amazing plugin. Author: Matthieu Mota Author URI: Version: 1.0.0
function darkmode() { ?> <script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/darkmode-js.min.js"></script> <script> function addDarkmodeWidget() { new Darkmode({ label: '🌓', }).showWidget(); } window.addEventListener('load', addDarkmodeWidget); </script> <style> .darkmode-layer, .darkmode-toggle { /* z-index: 500; */ } .darkmode-toggle { z-index: 500; } .darkmode--activated .navbar { position: static; } </style> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doing_dark_mode()\n {\n }", "function preview_theme()\n {\n }", "function _h_add_dark_mode_script() { ?>\n<script>\n (function() { 'use strict';\n const darkMode = localStorage.hDarkMode === 'true';\n if (darkMode) {\n document.querySelector('body').classList.add('h-is-dark');\n\n // activate the toggle\n document.addEventListener('DOMContentLoaded', () => {\n const $toggles = document.querySelectorAll('.h-dark-toggle input[type=\"checkbox\"]');\n $toggles.forEach(($t) => {\n $t.checked = true;\n });\n });\n }\n })();\n</script>\n<?php }", "function bg_startPlugin(){\n add_action( 'init', 'bg_PatchEditor' );\n add_action( 'admin_init', 'bg_AddAdminSettings' );\n add_action( 'admin_menu', 'bg_AddPluginMenu' );\n}", "function wp_dashboard_plugins()\n {\n }", "function cpotheme_metadata_plugin()\n{\n $cpotheme_data = array();\n\n $cpotheme_data[] = array(\n 'name' => 'plugin_title',\n 'std' => '',\n 'label' => 'Título del Producto',\n 'type' => 'text',\n 'desc' => 'Indica la etiqueta de título (H1) del tema.'\n );\n\n $cpotheme_data[] = array(\n 'name' => 'plugin_demo_url',\n 'std' => '',\n 'label' => 'URL de la Demo',\n 'type' => 'text',\n 'desc' => 'Especifica la URL de la demo del tema.'\n );\n\n $cpotheme_data[] = array(\n 'name' => 'plugin_url',\n 'std' => '',\n 'label' => 'External URL',\n 'type' => 'text',\n 'desc' => 'Especifica la URL del tema si es un archivo externo.'\n );\n\n $cpotheme_data[] = array(\n 'name' => 'plugin_product',\n 'std' => '',\n 'label' => 'ID de Producto',\n 'type' => 'select',\n 'option' => cpotheme_metadata_productlist_optional(),\n 'desc' => 'Indica la ID del producto para enlazarlo.'\n );\n\n $cpotheme_data[] = array(\n 'name' => 'plugin_changelog',\n 'std' => '',\n 'label' => 'Changelog',\n 'type' => 'textarea',\n 'desc' => 'Muestra el registro de cambios de la descarga.'\n );\n\n return $cpotheme_data;\n}", "function display_themes()\n {\n }", "function scbirs_add_theme_meta() {\r\n?>\r\n\t<meta name=\"theme-color\" content=\"#005fab\">\r\n<?php\r\n}", "function wonster_mce_plugin( $array ) {\r\n\t$array['wonster_mce'] = PLUGIN_MCE_URI .'js/plugin.js';\r\n\treturn $array;\r\n}", "function mediatags_deactivate_plugin()\n\t{\n\t}", "function init_plugin() : void {\n\n\t// CSS/JS.\n\tadd_action( 'enqueue_block_assets', __NAMESPACE__ . '\\load_block_frontend_assets' );\n\tadd_action( 'enqueue_block_editor_assets', __NAMESPACE__ . '\\load_block_editor_assets' );\n\tadd_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\load_full_assets' );\n\tadd_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\load_messaging_assets' );\n\n\t// Admin-only CSS/JS.\n\tadd_action( 'admin_enqueue_scripts', __NAMESPACE__ . '\\Admin\\load_admin_assets' );\n\tadd_filter( 'admin_body_class', __NAMESPACE__ . '\\Admin\\add_admin_body_class' );\n\n\t// Modify output.\n\tadd_filter( 'body_class', __NAMESPACE__ . '\\add_body_class' );\n\tadd_filter( 'the_content', __NAMESPACE__ . '\\Gating\\maybe_restrict_content' );\n\tadd_filter( 'the_title', __NAMESPACE__ . '\\Gating\\maybe_add_padlock_to_title', 10, 2 );\n\tadd_action( 'wp_head', __NAMESPACE__ . '\\print_meta_tag' );\n\n\t// Admin screens and settings.\n\tadd_filter( 'plugin_action_links_coil-web-monetization/plugin.php', __NAMESPACE__ . '\\Admin\\add_plugin_action_links' );\n\tadd_filter( 'plugin_row_meta', __NAMESPACE__ . '\\Admin\\add_plugin_meta_link', 10, 2 );\n\tadd_action( 'admin_menu', __NAMESPACE__ . '\\Settings\\register_admin_menu' );\n\tadd_action( 'admin_init', __NAMESPACE__ . '\\Settings\\register_admin_content_settings' );\n\tadd_action( 'admin_notices', __NAMESPACE__ . '\\Settings\\admin_welcome_notice' );\n\tadd_action( 'wp_ajax_dismiss_welcome_notice', __NAMESPACE__ . '\\Settings\\dismiss_welcome_notice' );\n\n\t// Term meta.\n\tadd_action( 'edit_term', __NAMESPACE__ . '\\Admin\\maybe_save_term_meta', 10, 3 );\n\tadd_action( 'create_term', __NAMESPACE__ . '\\Admin\\maybe_save_term_meta', 10, 3 );\n\tadd_action( 'delete_term', __NAMESPACE__ . '\\Admin\\delete_term_monetization_meta' );\n\tadd_term_edit_save_form_meta_actions();\n\n\t// Customizer settings.\n\tadd_action( 'customize_register', __NAMESPACE__ . '\\Admin\\add_customizer_messaging_panel' );\n\tadd_action( 'customize_register', __NAMESPACE__ . '\\Admin\\add_customizer_options_panel' );\n\tadd_action( 'customize_register', __NAMESPACE__ . '\\Admin\\add_customizer_learn_more_button_settings_panel' );\n\n\t// User profile settings.\n\tadd_action( 'personal_options', __NAMESPACE__ . '\\User\\add_user_profile_payment_pointer_option' );\n\tadd_action( 'personal_options_update', __NAMESPACE__ . '\\User\\maybe_save_user_profile_payment_pointer_option' );\n\tadd_action( 'edit_user_profile_update', __NAMESPACE__ . '\\User\\maybe_save_user_profile_payment_pointer_option' );\n\tadd_filter( 'option_coil_payment_pointer_id', __NAMESPACE__ . '\\User\\maybe_output_user_payment_pointer' );\n\n\t// Metaboxes.\n\tadd_action( 'load-post.php', __NAMESPACE__ . '\\Admin\\load_metaboxes' );\n\tadd_action( 'load-post-new.php', __NAMESPACE__ . '\\Admin\\load_metaboxes' );\n\tadd_action( 'save_post', __NAMESPACE__ . '\\Admin\\maybe_save_post_metabox' );\n\n\t// Modal messaging\n\tadd_action( 'wp_footer', __NAMESPACE__ . '\\load_plugin_templates' );\n\n\t// Load order - important.\n\tadd_action( 'init', __NAMESPACE__ . '\\Gating\\register_content_meta' );\n\tadd_action( 'init', __NAMESPACE__ . '\\Gating\\register_term_meta' );\n}", "function add_rich_plugins( $plugin_array )\n\t{\n\t\t$plugin_array['nymbleShortcodes'] = NYMBLE_TINYMCE_URI . '/plugin.js';\n\t\treturn $plugin_array;\n\t}", "function Yeelight() {\n $this->name=\"Yeelight\";\n $this->title=\"Устройства Yeelight\";\n $this->module_category=\"<#LANG_SECTION_DEVICES#>\";\n $this->checkInstalled();\n}", "function add_mce_plugin( $plugin_array ) {\n\t\t$plugin_array['infographic_mce_button'] = plugins_url( '/js/infographic-mce-plugin.js' , __FILE__ );\n\t\treturn $plugin_array;\n\t}", "abstract public function pluginDetails();", "function bureau_theme_options() {\n echo 'Activate and Deactivate';\n}", "function autodidact_theme_setup() {\n\n}", "public function getPlugin();", "public function getPlugin();", "function mediatags_activate_plugin()\n\t{\n\t\tinclude_once ( dirname (__FILE__) . '/mediatags_legacy_convert.php' );\n\t\tmediatags_plugin_version_check();\n\n\t\t// Support for Role Manager plugin http://www.im-web-gefunden.de/wordpress-plugins/role-manager/\n\t\tmediatags_add_default_capabilities();\n\t\t//mediatags_reconcile_counts();\n\t}", "function foxhound_switch_theme() {\n\tswitch_theme( WP_DEFAULT_THEME );\n\tunset( $_GET['activated'] );\n\tadd_action( 'admin_notices', 'foxhound_upgrade_notice' );\n}", "function achilles_general_settings_callback() {\n echo 'Welcome to the Achilles Theme Settings. Here you will be able to set information for your property that will be used across the website.';\n}", "function theme_colors_css() {\n if (is_customize_preview()) {\n $colors_css = get_theme_mod('colors_css');\n if ($colors_css) {\n echo \"$colors_css\\n\";\n }\n }\n}", "function tb_onPluginActivate() {\r\n add_option('tagBeep_redirect_to_plugin', 'true');\r\n}", "function getName() {\n\t\treturn 'TsvResponsiveThemePlugin';\n\t}", "function _after_switch_theme(){\n\t// GET DESIGN FROM FUNCTION\n\t$core_admin_values = childtheme_designchanges();\n\t// SAVE VALUES\n\t//update_option('core_admin_values',$core_admin_values);\n\t\t\n}", "public function get_test_plugin_theme_auto_updates()\n {\n }", "function thrive_dashboard_url()\n {\n return plugins_url() . '/thrive-visual-editor//thrive-dashboard/';\n }", "function woodstock_removeDemoModeLink() {\n if ( class_exists('ReduxFrameworkPlugin') ) {\n remove_filter( 'plugin_row_meta', array( ReduxFrameworkPlugin::get_instance(), 'plugin_metalinks'), null, 2 );\n }\n if ( class_exists('ReduxFrameworkPlugin') ) {\n remove_action('admin_notices', array( ReduxFrameworkPlugin::get_instance(), 'admin_notices' ) ); \n }\n }", "function hotel_lux_gutenberg_support() {\r\n\t$colors = cmsmasters_color_picker_palettes();\r\n\t\r\n\t$color_palette = array();\r\n\t\r\n\t\r\n\tforeach ($colors as $color) {\r\n\t\t$color_palette[] = array(\r\n\t\t\t'color' => $color,\r\n\t\t);\r\n\t}\r\n\t\r\n\t\r\n\tadd_theme_support('editor-color-palette', $color_palette);\r\n}" ]
[ "0.6921865", "0.59082514", "0.58892334", "0.5790519", "0.5785034", "0.5618339", "0.55743074", "0.55698943", "0.5565495", "0.5546699", "0.5522256", "0.55217904", "0.5493524", "0.5482564", "0.5475111", "0.5455906", "0.54505396", "0.54074", "0.54074", "0.53953576", "0.53948104", "0.5393297", "0.53908527", "0.5379077", "0.5369187", "0.5365216", "0.53620356", "0.5348846", "0.5344561", "0.53350925" ]
0.6706402
1
Constructor method for ArrayOfBurglaryExcludedDiscountFactor
public function __construct(array $burglaryExcludedDiscountFactor = array()) { $this ->setBurglaryExcludedDiscountFactor($burglaryExcludedDiscountFactor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setBurglaryExcludedDiscountFactor(array $burglaryExcludedDiscountFactor = array())\n {\n foreach ($burglaryExcludedDiscountFactor as $arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem) {\n // validation for constraint: itemType\n if (!$arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem instanceof \\Mu4ddi3\\Compensa\\Webservice\\StructType\\BurglaryExcludedDiscountFactor) {\n throw new \\InvalidArgumentException(sprintf('The BurglaryExcludedDiscountFactor property can only contain items of \\Mu4ddi3\\Compensa\\Webservice\\StructType\\BurglaryExcludedDiscountFactor, \"%s\" given', is_object($arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem) ? get_class($arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem) : gettype($arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem)), __LINE__);\n }\n }\n if (is_null($burglaryExcludedDiscountFactor) || (is_array($burglaryExcludedDiscountFactor) && empty($burglaryExcludedDiscountFactor))) {\n unset($this->BurglaryExcludedDiscountFactor);\n } else {\n $this->BurglaryExcludedDiscountFactor = $burglaryExcludedDiscountFactor;\n }\n return $this;\n }", "public function __construct(array $agriculturalInsuranceDiscountFactor = array())\n {\n $this\n ->setAgriculturalInsuranceDiscountFactor($agriculturalInsuranceDiscountFactor);\n }", "public function __construct(array $lifeInsuranceDiscountFactor = array())\n {\n $this\n ->setLifeInsuranceDiscountFactor($lifeInsuranceDiscountFactor);\n }", "public function getBurglaryExcludedDiscountFactor()\n {\n return isset($this->BurglaryExcludedDiscountFactor) ? $this->BurglaryExcludedDiscountFactor : null;\n }", "protected function _couponFromArray($arr)\n\t{\n\t\t$DiscountItem = new QuickBooks_Object_DiscountItem();\n\t\t\n\t\t$map = array(\n\t\t\t'Name' => \t\t\t\t\tarray( 'setName', 'Name' ), \n\t\t\t'ItemDesc' => \t\t\t\tarray( 'setItemDesc', 'ItemDesc' ), \n\t\t\t'SalesTaxCodeID' => \t\tarray( 'setSalesTaxCodeApplicationID', 'SalesTaxCodeRef ' . QUICKBOOKS_API_APPLICATIONID, 'setSalesTaxCodeListID' ), \n\t\t\t'SalesTaxCodeName' => \t\tarray( 'setSalesTaxCodeName', 'SalesTaxCodeRef FullName' ), \n\t\t\t'SalesTaxCodeListID' => \tarray( 'setSalesTaxCodeListID', 'SalesTaxCodeRef ListID' ), \n\t\t\t'DiscountRate' => \t\t\tarray( 'setDiscountRate', 'DiscountRate' ), \n\t\t\t'DiscountRatePercent' => \tarray( 'setDiscountRatePercent', 'DiscountRatePercent' ), \n\t\t\t'AccountID' => \t\t\t\tarray( 'setAccountApplicationID', 'AccountRef ' . QUICKBOOKS_API_APPLICATIONID, 'setAccountListID' ), \n\t\t\t'AccountListID' => \t\t\tarray( 'setAccountListID', 'AccountRef ListID' ), \n\t\t\t'AccountName' => \t\t\tarray( 'setAccountName', 'AccountRef FullName' ), \n\t\t\t);\n\t\t\n\t\t$DiscountItem = $this->_applyBaseMap($arr, $map, $DiscountItem, QUICKBOOKS_OBJECT_DISCOUNTITEM);\n\t\t\n\t\treturn $DiscountItem;\n\t}", "public function __construct(array $departmentDirectorDiscountFactor = array())\n {\n $this\n ->setDepartmentDirectorDiscountFactor($departmentDirectorDiscountFactor);\n }", "public function __construct($isBurglaryExtended = null, $isBurglaryExcluded = null)\n {\n $this\n ->setIsBurglaryExtended($isBurglaryExtended)\n ->setIsBurglaryExcluded($isBurglaryExcluded);\n }", "public function discounts()\n {\n return [\n new Discount(101, 0.06, Discount::MORE_THAN_EQUAL_TO),\n new Discount(100, 0.04),\n new Discount(20, 0.02)\n ];\n }", "public function __construct()\n {\n $this->_cash = array ( 1 => 25, 2 => 74, 5 => 14, 10 => 18, 20 => 0, 50 => 5, 100 => 30, 200 => 15, 500 => 8, 1000 => 11, 2000 => 8, 5000 => 5, 10000 => 2, 20000 => 0, 50000 => 0 );\n;\n }", "public function getDiscountData() {\n return array(\n 'discValue' => $this->discValue,\n 'discValueCode' => $this->discValueCode,\n 'minPurchaseVal' => $this->minPurchaseVal,\n 'receiptDisc' => $this->receiptDisc,\n 'maxreceDisc' => $this->maxreceDisc\n );\n }", "public function __construct(array $coverageFee = array())\n {\n $this\n ->setCoverageFee($coverageFee);\n }", "public function __construct(array $unusualVehicleUsageCorrectionFactor = array())\n {\n $this\n ->setUnusualVehicleUsageCorrectionFactor($unusualVehicleUsageCorrectionFactor);\n }", "public function __construct() {\n\n\t\t$this->contenuto=array();\n\t\t$this->quantita=array();\n }", "public function __construct($_docNum = null,$_accDate = null,$_docDate = null,$_docCode = null,$_userDeal = null,$_curCode = null,$_dcmRate = null,$_idPartner = null,$_pNum = null,$_idBranch = null,$_bNum = null,$_idGeoRegion = null,$_iTEMS = null)\n {\n parent::__construct(array('DocNum'=>$_docNum,'AccDate'=>$_accDate,'DocDate'=>$_docDate,'DocCode'=>$_docCode,'UserDeal'=>$_userDeal,'curCode'=>$_curCode,'dcmRate'=>$_dcmRate,'idPartner'=>$_idPartner,'PNum'=>$_pNum,'idBranch'=>$_idBranch,'BNum'=>$_bNum,'idGeoRegion'=>$_idGeoRegion,'ITEMS'=>$_iTEMS), false);\n }", "public function __construct()\n {\n $this->type = 'percentage';\n $this->amount = 20;\n $this->end_date = strtotime(\"+1 day\");\n $this->minimum_amount = 100;\n $this->free_shipping = false;\n $this->included_categories = [10, 20];\n $this->excluded_categories = [50];\n $this->included_products = [3];\n $this->excluded_products = [4, 1];\n }", "public function __construct(){\n $this->cases = array();\n\n for ($i=0; $i < self::NBROWS; $i++) {\n $this->cases[$i] = array();\n for ($j = 0; $j < self::NBCOLS; $j++)\n $this->cases[$i][$j] = PieceQuantik::initVoid();\n }\n }", "public function __construct($_originalRetailPrice = NULL,$_minimumAdvertisedPrice = NULL,$_minimumAdvertisedPriceExposure = NULL,$_pricingTreatment = NULL,$_soldOneBay = false,$_soldOffeBay = false,$_any = NULL)\r\n\t{\r\n\t\tparent::__construct(array('OriginalRetailPrice'=>$_originalRetailPrice,'MinimumAdvertisedPrice'=>$_minimumAdvertisedPrice,'MinimumAdvertisedPriceExposure'=>$_minimumAdvertisedPriceExposure,'PricingTreatment'=>$_pricingTreatment,'SoldOneBay'=>$_soldOneBay,'SoldOffeBay'=>$_soldOffeBay,'any'=>$_any));\r\n\t}", "public function __construct(array $array)\n {\n if (isset($array['expenseDate'])) {\n $array['expenseDate'] = new Carbon($array['expenseDate']);\n }\n\n parent::__construct($array);\n }", "function __construct(Isbn $isbnChecker) { \n $this->isbnCheker = $isbnChecker; \n $this->correctIsbns = [];\n $this->wrongIsbns = [];\n }", "public function __construct($_sKU = NULL,$_startPrice = NULL,$_quantity = NULL,$_variationSpecifics = NULL,$_quantitySold = NULL,$_sellingStatus = NULL,$_discountPriceInfo = NULL,$_any = NULL)\r\n\t{\r\n\t\tparent::__construct(array('SKU'=>$_sKU,'StartPrice'=>$_startPrice,'Quantity'=>$_quantity,'VariationSpecifics'=>($_variationSpecifics instanceof EbayShoppingStructNameValueListArrayType)?$_variationSpecifics:new EbayShoppingStructNameValueListArrayType($_variationSpecifics),'QuantitySold'=>$_quantitySold,'SellingStatus'=>$_sellingStatus,'DiscountPriceInfo'=>$_discountPriceInfo,'any'=>$_any));\r\n\t}", "public function addToBurglaryExcludedDiscountFactor(\\Mu4ddi3\\Compensa\\Webservice\\StructType\\BurglaryExcludedDiscountFactor $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\Mu4ddi3\\Compensa\\Webservice\\StructType\\BurglaryExcludedDiscountFactor) {\n throw new \\InvalidArgumentException(sprintf('The BurglaryExcludedDiscountFactor property can only contain items of \\Mu4ddi3\\Compensa\\Webservice\\StructType\\BurglaryExcludedDiscountFactor, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->BurglaryExcludedDiscountFactor[] = $item;\n return $this;\n }", "function __constructor() {\n $arr = array();\n }", "public function __construct()\n {\n $this->postules = new ArrayCollection();\n $this->competences = new ArrayCollection();\n $this->habilitations = new ArrayCollection();\n }", "function hidrate ($className)\n {\n $this->A = array_hidrate ($this->A, $className);\n return $this;\n }", "public function __construct($_items = NULL,$_bucketId = NULL,$_sellerId = NULL,$_externalSellerId = NULL,$_bucketSubtotalAmt = NULL,$_bucketShippingAmt = NULL,$_bucketInsuranceAmt = NULL,$_bucketSalesTaxAmt = NULL,$_bucketTotalAmt = NULL)\r\n\t{\r\n\t\tparent::__construct(array('Items'=>$_items,'BucketId'=>$_bucketId,'SellerId'=>$_sellerId,'ExternalSellerId'=>$_externalSellerId,'BucketSubtotalAmt'=>$_bucketSubtotalAmt,'BucketShippingAmt'=>$_bucketShippingAmt,'BucketInsuranceAmt'=>$_bucketInsuranceAmt,'BucketSalesTaxAmt'=>$_bucketSalesTaxAmt,'BucketTotalAmt'=>$_bucketTotalAmt));\r\n\t}", "public function __construct()\n {\n $this->variableHolidays = [\n new VariableHoliday('Midsommar', 6, 20, 26, 'Sat'),\n new VariableHoliday('Alla helgons dag', 10, 31, 31, 'Sat'),\n new VariableHoliday('Alla helgons dag', 11, 1, 6, 'Sat'),\n ];\n }", "public function __construct(array $keyValueOfintArrayOfBonusMalusTariffItemUncC2EDm = array())\n {\n $this\n ->setKeyValueOfintArrayOfBonusMalusTariffItemUncC2EDm($keyValueOfintArrayOfBonusMalusTariffItemUncC2EDm);\n }", "function __construct($array = []) {\n $this->array = $array;\n $this->setCalculate();\n }", "public function setAgriculturalInsuranceDiscountFactor(array $agriculturalInsuranceDiscountFactor = array())\n {\n foreach ($agriculturalInsuranceDiscountFactor as $arrayOfAgriculturalInsuranceDiscountFactorAgriculturalInsuranceDiscountFactorItem) {\n // validation for constraint: itemType\n if (!$arrayOfAgriculturalInsuranceDiscountFactorAgriculturalInsuranceDiscountFactorItem instanceof \\Mu4ddi3\\Compensa\\Webservice\\StructType\\AgriculturalInsuranceDiscountFactor) {\n throw new \\InvalidArgumentException(sprintf('The AgriculturalInsuranceDiscountFactor property can only contain items of \\Mu4ddi3\\Compensa\\Webservice\\StructType\\AgriculturalInsuranceDiscountFactor, \"%s\" given', is_object($arrayOfAgriculturalInsuranceDiscountFactorAgriculturalInsuranceDiscountFactorItem) ? get_class($arrayOfAgriculturalInsuranceDiscountFactorAgriculturalInsuranceDiscountFactorItem) : gettype($arrayOfAgriculturalInsuranceDiscountFactorAgriculturalInsuranceDiscountFactorItem)), __LINE__);\n }\n }\n if (is_null($agriculturalInsuranceDiscountFactor) || (is_array($agriculturalInsuranceDiscountFactor) && empty($agriculturalInsuranceDiscountFactor))) {\n unset($this->AgriculturalInsuranceDiscountFactor);\n } else {\n $this->AgriculturalInsuranceDiscountFactor = $agriculturalInsuranceDiscountFactor;\n }\n return $this;\n }", "public function nonArray()\n {\n $inCriterion = new stubInCriterion('foo', 'bar');\n }" ]
[ "0.6607878", "0.6542491", "0.64514095", "0.5913188", "0.57401437", "0.56704056", "0.56264037", "0.5550084", "0.5540131", "0.5419293", "0.53886443", "0.53261036", "0.5248413", "0.52325684", "0.52010983", "0.51948416", "0.5170309", "0.5155475", "0.5146486", "0.5142307", "0.51325893", "0.51101345", "0.5107289", "0.5102389", "0.50886375", "0.5085581", "0.50738364", "0.50587916", "0.5057069", "0.50318694" ]
0.818553
0
Get BurglaryExcludedDiscountFactor value An additional test has been added (isset) before returning the property value as this property may have been unset before, due to the fact that this property is removable from the request (nillable=true+minOccurs=0)
public function getBurglaryExcludedDiscountFactor() { return isset($this->BurglaryExcludedDiscountFactor) ? $this->BurglaryExcludedDiscountFactor : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNoDiscount() {\n return $this->item->getNoDiscount();\n }", "public function getAttributeName()\n {\n return 'BurglaryExcludedDiscountFactor';\n }", "public function getDiscountConditions()\n {\n return isset($this->DiscountConditions) ? $this->DiscountConditions : null;\n }", "public function getDiscount(): ?float\n {\n return $this->discount;\n }", "public function getDiscounted()\n {\n if (is_null($this->discounted)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_DISCOUNTED);\n if (is_null($data)) {\n return null;\n }\n\n $this->discounted = DiscountedPriceDraftModel::of($data);\n }\n\n return $this->discounted;\n }", "public function getDiscounted()\n {\n if (is_null($this->discounted)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_DISCOUNTED);\n if (is_null($data)) {\n return null;\n }\n\n $this->discounted = DiscountedPriceModel::of($data);\n }\n\n return $this->discounted;\n }", "public function getDiscountRefunded();", "public function getDiscountCanceled();", "public function getAgriculturalInsuranceDiscountFactor()\n {\n return isset($this->AgriculturalInsuranceDiscountFactor) ? $this->AgriculturalInsuranceDiscountFactor : null;\n }", "public function getCalculatedHandlingDiscount()\n {\n return $this->calculatedHandlingDiscount;\n }", "public function setBurglaryExcludedDiscountFactor(array $burglaryExcludedDiscountFactor = array())\n {\n foreach ($burglaryExcludedDiscountFactor as $arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem) {\n // validation for constraint: itemType\n if (!$arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem instanceof \\Mu4ddi3\\Compensa\\Webservice\\StructType\\BurglaryExcludedDiscountFactor) {\n throw new \\InvalidArgumentException(sprintf('The BurglaryExcludedDiscountFactor property can only contain items of \\Mu4ddi3\\Compensa\\Webservice\\StructType\\BurglaryExcludedDiscountFactor, \"%s\" given', is_object($arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem) ? get_class($arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem) : gettype($arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem)), __LINE__);\n }\n }\n if (is_null($burglaryExcludedDiscountFactor) || (is_array($burglaryExcludedDiscountFactor) && empty($burglaryExcludedDiscountFactor))) {\n unset($this->BurglaryExcludedDiscountFactor);\n } else {\n $this->BurglaryExcludedDiscountFactor = $burglaryExcludedDiscountFactor;\n }\n return $this;\n }", "public function getDiscounted()\n {\n return $this->discounted instanceof DiscountedPriceDraftBuilder ? $this->discounted->build() : $this->discounted;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\r\n {\r\n return $this->discount;\r\n }", "public function getDepartmentDirectorDiscountFactor()\n {\n return isset($this->DepartmentDirectorDiscountFactor) ? $this->DepartmentDirectorDiscountFactor : null;\n }", "public function hasDiscount(){\n return $this->_has(9);\n }", "public function getDiscountAmount()\n\t{\n\t\treturn $this->discount_amount;\n\t}", "public function getDiscountAmount(){\n return $this->getParameter('discount_amount');\n }", "public function getDiscountAmount();", "public function getDroitSuppression(): ?bool {\n return $this->droitSuppression;\n }", "public function getLifeInsuranceDiscountFactor()\n {\n return isset($this->LifeInsuranceDiscountFactor) ? $this->LifeInsuranceDiscountFactor : null;\n }", "public function getBaseDiscountRefunded();", "function getDiscountedPrice()\n {\n if (!$this->hasDiscount()) return null;\n $price = $this->price;\n if ($this->discount_active) {\n $price = $this->discountprice;\n }\n// NOTE: Add more conditions and rules as desired, i.e.\n// if ($this->testFlag('Outlet')) {\n// $discountRate = $this->getOutletDiscountRate();\n// $price = number_format(\n// $price * (100 - $discountRate) / 100,\n// 2, '.', '');\n// }\n return $price;\n }", "public function getPriceDiscount()\n\t{\n\t\treturn $this->priceDiscount;\n\t}", "public function getDiscount()\n\t{\n\t\treturn $this->getKeyValue('Discount'); \n\n\t}" ]
[ "0.6445477", "0.6307113", "0.625749", "0.62265867", "0.6158091", "0.6082559", "0.601071", "0.5984825", "0.59839815", "0.5975843", "0.5974094", "0.5954664", "0.5940398", "0.5940398", "0.5940398", "0.5940398", "0.5940398", "0.5940398", "0.5914922", "0.5910009", "0.5782612", "0.5754247", "0.57537234", "0.5748229", "0.5728948", "0.57155776", "0.5707347", "0.56785053", "0.5666074", "0.5642977" ]
0.8349522
0
Set BurglaryExcludedDiscountFactor value This property is removable from request (nillable=true+minOccurs=0), therefore if the value assigned to this property is null, it is removed from this object
public function setBurglaryExcludedDiscountFactor(array $burglaryExcludedDiscountFactor = array()) { foreach ($burglaryExcludedDiscountFactor as $arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem) { // validation for constraint: itemType if (!$arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem instanceof \Mu4ddi3\Compensa\Webservice\StructType\BurglaryExcludedDiscountFactor) { throw new \InvalidArgumentException(sprintf('The BurglaryExcludedDiscountFactor property can only contain items of \Mu4ddi3\Compensa\Webservice\StructType\BurglaryExcludedDiscountFactor, "%s" given', is_object($arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem) ? get_class($arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem) : gettype($arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem)), __LINE__); } } if (is_null($burglaryExcludedDiscountFactor) || (is_array($burglaryExcludedDiscountFactor) && empty($burglaryExcludedDiscountFactor))) { unset($this->BurglaryExcludedDiscountFactor); } else { $this->BurglaryExcludedDiscountFactor = $burglaryExcludedDiscountFactor; } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBurglaryExcludedDiscountFactor()\n {\n return isset($this->BurglaryExcludedDiscountFactor) ? $this->BurglaryExcludedDiscountFactor : null;\n }", "public function __construct(array $burglaryExcludedDiscountFactor = array())\n {\n $this\n ->setBurglaryExcludedDiscountFactor($burglaryExcludedDiscountFactor);\n }", "public function addToBurglaryExcludedDiscountFactor(\\Mu4ddi3\\Compensa\\Webservice\\StructType\\BurglaryExcludedDiscountFactor $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\Mu4ddi3\\Compensa\\Webservice\\StructType\\BurglaryExcludedDiscountFactor) {\n throw new \\InvalidArgumentException(sprintf('The BurglaryExcludedDiscountFactor property can only contain items of \\Mu4ddi3\\Compensa\\Webservice\\StructType\\BurglaryExcludedDiscountFactor, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->BurglaryExcludedDiscountFactor[] = $item;\n return $this;\n }", "public function getAttributeName()\n {\n return 'BurglaryExcludedDiscountFactor';\n }", "public function setDiscountAmount($amount);", "public function setBaseDiscountAmount($amount);", "public function setBaseShippingDiscountAmount($amount);", "public function setBaseDiscountRefunded($baseDiscountRefunded);", "public function setDiscountRefunded($discountRefunded);", "public function setDiscountAmount($value){\n return $this->setParameter('discount_amount', $value);\n }", "public function setBillingSubscriptionDiscountsAttribute($value)\n {\n $this->attributes['billing_subscription_discounts'] = empty($value) ? null : json_encode($value);\n }", "public function setDiscountRate($value){\n return $this->setParameter('discount_rate', $value);\n }", "public function setDiscountCanceled($discountCanceled);", "public function setDiscount($value)\n {\n $this->data->amount->subtotals->discount = (float) $value;\n\n return $this;\n }", "public function setShippingDiscountAmount($amount);", "public function setDisruptionBudget($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\OsConfig\\V1\\FixedOrPercent::class);\n $this->disruption_budget = $var;\n\n return $this;\n }", "public function setBaseDiscountCanceled($baseDiscountCanceled);", "public function setAttributes_discounted( $attributes_discounted ) {\n\t\t$this->attributes_discounted = $attributes_discounted;\n\t}", "public function setDiscountRate($rate)\n\t{\n\t\treturn $this->set('DiscountRate', (float) $rate);\n\t}", "public function setDiscount(?float $discount): self\n {\n $this->initialized['discount'] = true;\n $this->discount = $discount;\n\n return $this;\n }", "public function setDepartmentDirectorDiscountFactor(array $departmentDirectorDiscountFactor = array())\n {\n foreach ($departmentDirectorDiscountFactor as $arrayOfDepartmentDirectorDiscountFactorDepartmentDirectorDiscountFactorItem) {\n // validation for constraint: itemType\n if (!$arrayOfDepartmentDirectorDiscountFactorDepartmentDirectorDiscountFactorItem instanceof \\Mu4ddi3\\Compensa\\Webservice\\StructType\\DepartmentDirectorDiscountFactor) {\n throw new \\InvalidArgumentException(sprintf('The DepartmentDirectorDiscountFactor property can only contain items of \\Mu4ddi3\\Compensa\\Webservice\\StructType\\DepartmentDirectorDiscountFactor, \"%s\" given', is_object($arrayOfDepartmentDirectorDiscountFactorDepartmentDirectorDiscountFactorItem) ? get_class($arrayOfDepartmentDirectorDiscountFactorDepartmentDirectorDiscountFactorItem) : gettype($arrayOfDepartmentDirectorDiscountFactorDepartmentDirectorDiscountFactorItem)), __LINE__);\n }\n }\n if (is_null($departmentDirectorDiscountFactor) || (is_array($departmentDirectorDiscountFactor) && empty($departmentDirectorDiscountFactor))) {\n unset($this->DepartmentDirectorDiscountFactor);\n } else {\n $this->DepartmentDirectorDiscountFactor = $departmentDirectorDiscountFactor;\n }\n return $this;\n }", "public function setAgriculturalInsuranceDiscountFactor(array $agriculturalInsuranceDiscountFactor = array())\n {\n foreach ($agriculturalInsuranceDiscountFactor as $arrayOfAgriculturalInsuranceDiscountFactorAgriculturalInsuranceDiscountFactorItem) {\n // validation for constraint: itemType\n if (!$arrayOfAgriculturalInsuranceDiscountFactorAgriculturalInsuranceDiscountFactorItem instanceof \\Mu4ddi3\\Compensa\\Webservice\\StructType\\AgriculturalInsuranceDiscountFactor) {\n throw new \\InvalidArgumentException(sprintf('The AgriculturalInsuranceDiscountFactor property can only contain items of \\Mu4ddi3\\Compensa\\Webservice\\StructType\\AgriculturalInsuranceDiscountFactor, \"%s\" given', is_object($arrayOfAgriculturalInsuranceDiscountFactorAgriculturalInsuranceDiscountFactorItem) ? get_class($arrayOfAgriculturalInsuranceDiscountFactorAgriculturalInsuranceDiscountFactorItem) : gettype($arrayOfAgriculturalInsuranceDiscountFactorAgriculturalInsuranceDiscountFactorItem)), __LINE__);\n }\n }\n if (is_null($agriculturalInsuranceDiscountFactor) || (is_array($agriculturalInsuranceDiscountFactor) && empty($agriculturalInsuranceDiscountFactor))) {\n unset($this->AgriculturalInsuranceDiscountFactor);\n } else {\n $this->AgriculturalInsuranceDiscountFactor = $agriculturalInsuranceDiscountFactor;\n }\n return $this;\n }", "public function removeNonProrateCoupons()\n {\n $this->coupons = $this->discounts->reject(function ($value, $key) {\n if (!$value->prorate) {\n return $value;\n }\n });\n\n return $this;\n }", "public function setDiscountTaxCompensationAmount($amount);", "public function setBillableAmount(float $billableAmount) : self\n {\n $this->billableAmount = $billableAmount;\n return $this;\n }", "public function getDepartmentDirectorDiscountFactor()\n {\n return isset($this->DepartmentDirectorDiscountFactor) ? $this->DepartmentDirectorDiscountFactor : null;\n }", "public function setBaseDiscountTaxCompensationAmount($amount);", "public function setShippingDiscountTaxCompensationAmount($amount);", "public function getDiscount(): ?float\n {\n return $this->discount;\n }", "public function getNoDiscount() {\n return $this->item->getNoDiscount();\n }" ]
[ "0.72576165", "0.64541745", "0.6219199", "0.57935286", "0.5399821", "0.5362321", "0.53430957", "0.5325981", "0.5256104", "0.51741374", "0.5161432", "0.5151781", "0.51341367", "0.5090727", "0.5079376", "0.50381726", "0.50248635", "0.4886677", "0.48737356", "0.48023295", "0.47949207", "0.47244024", "0.4720114", "0.46703357", "0.4668862", "0.46651572", "0.46454883", "0.46325997", "0.46301135", "0.46286663" ]
0.6954686
1
Add item to BurglaryExcludedDiscountFactor value
public function addToBurglaryExcludedDiscountFactor(\Mu4ddi3\Compensa\Webservice\StructType\BurglaryExcludedDiscountFactor $item) { // validation for constraint: itemType if (!$item instanceof \Mu4ddi3\Compensa\Webservice\StructType\BurglaryExcludedDiscountFactor) { throw new \InvalidArgumentException(sprintf('The BurglaryExcludedDiscountFactor property can only contain items of \Mu4ddi3\Compensa\Webservice\StructType\BurglaryExcludedDiscountFactor, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); } $this->BurglaryExcludedDiscountFactor[] = $item; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setBurglaryExcludedDiscountFactor(array $burglaryExcludedDiscountFactor = array())\n {\n foreach ($burglaryExcludedDiscountFactor as $arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem) {\n // validation for constraint: itemType\n if (!$arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem instanceof \\Mu4ddi3\\Compensa\\Webservice\\StructType\\BurglaryExcludedDiscountFactor) {\n throw new \\InvalidArgumentException(sprintf('The BurglaryExcludedDiscountFactor property can only contain items of \\Mu4ddi3\\Compensa\\Webservice\\StructType\\BurglaryExcludedDiscountFactor, \"%s\" given', is_object($arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem) ? get_class($arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem) : gettype($arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem)), __LINE__);\n }\n }\n if (is_null($burglaryExcludedDiscountFactor) || (is_array($burglaryExcludedDiscountFactor) && empty($burglaryExcludedDiscountFactor))) {\n unset($this->BurglaryExcludedDiscountFactor);\n } else {\n $this->BurglaryExcludedDiscountFactor = $burglaryExcludedDiscountFactor;\n }\n return $this;\n }", "public function getBurglaryExcludedDiscountFactor()\n {\n return isset($this->BurglaryExcludedDiscountFactor) ? $this->BurglaryExcludedDiscountFactor : null;\n }", "public function __construct(array $burglaryExcludedDiscountFactor = array())\n {\n $this\n ->setBurglaryExcludedDiscountFactor($burglaryExcludedDiscountFactor);\n }", "public function addItemDiscountAmount($amount)\n {\n $this->itemDiscountAmount += $amount;\n }", "function apply_special_item_discount($id, $count, &$disc_amount) {\r\n switch($id) {\r\n case 99999:\r\n case 99998:\r\n if ($count > 100) {\r\n $disc_amount = 50; \r\n }\r\n break; \r\n case 99997:\r\n $disc_amount = 75;\r\n break; \r\n }\r\n }", "public function addBaseItemDiscountAmount($amount)\n {\n $this->baseItemDiscountAmount +=$amount;\n }", "function apply_special_category_discount($category, $count, &$disc_amount) {\r\n switch($category) {\r\n case 99999:\r\n case 99998:\r\n if ($count > 100) {\r\n $disc_amount = 50; \r\n }\r\n break; \r\n case 99997:\r\n $disc_amount = 75;\r\n break;\r\n }\r\n }", "public function discountBifurcation(Varien_Event_Observer $observer)\n {\n $rule = $observer->getEvent()->getRule();\n $result = $observer->getEvent()->getResult();\n $itemId = $observer->getEvent()->getItem()->getItemId();\n //set Unique key\n $curUnique= $rule->getRuleId().'_'.$itemId;\n //check if Mage registry unique call set\n if(Mage::registry('uniqueCall')!==null){\n //if check in array\n $uniqueCalls = Mage::registry('uniqueCall');\n if( in_array($curUnique,$uniqueCalls)){\n return;\n }else{\n //unset existing registry. also take existing array in variable\n Mage::unregister('uniqueCall');\n $uniqueCalls[]= $curUnique ;\n //set registry again with new array include $uniqueCall into it\n Mage::register('uniqueCall',$uniqueCalls);\n }\n }else{\n //set registry again with new array include $uniqueCall into it\n $array = array();\n $array[]=$rule->getRuleId().'_'.$itemId;\n Mage::register('uniqueCall',$array);\n\n } \n\n //condition for the Promotional coupons\n if ( $rule->getCouponType() == Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON ) {\n $promotionDiscount = 0;\n $promotionDiscount = Mage::registry('promotion');\n if (Mage::registry('promotion')!==null){\n Mage::unregister('promotion');\n }\n if (Mage::registry('promo_lable')!==null){\n Mage::unregister('promo_lable');\n }\n $promotionDiscount += $result->getDiscountAmount();\n Mage::register('promotion', $promotionDiscount);\n Mage::register('promo_lable',$rule->getName());\n } elseif ( $rule->getCouponType() == self::COUPON_TYPE_FUE_GENERATED ) {\n $couponDiscount = 0;\n $couponDiscount = Mage::registry('coupon');\n if(Mage::registry('coupon')!==null){\n Mage::unregister('coupon');\n }\n //sum up all the values of discounted coupons\n $couponDiscount += $result->getDiscountAmount();\n Mage::register('coupon',$couponDiscount);\n }\n $quote = $observer->getEvent()->getQuote();\n $quoteAddress = $observer->getEvent()->getAddress();\n //set discounted coupons and promotional coupons amount in quote\n $quote->setCouponDiscount(Mage::registry('coupon'));\n $quote->setPromotionalDiscount(Mage::registry('promotion'));\n\n if (Mage::getStoreConfig('promodiscount/promodiscount/use_default')) {\n $quote->setPromoLable(Mage::getStoreConfig('promodiscount/promodiscount/default_lable'));\n } else {\n if (Mage::registry('promo_lable')) {\n $quote->setPromoLable(Mage::registry('promo_lable'));\n } else {\n $quote->setPromoLable(Mage::getStoreConfig('promodiscount/promodiscount/default_lable'));\n }\n }\n \n $quoteAddress->setCouponDiscount(Mage::registry('coupon'));\n $quoteAddress->setPromotionalDiscount(Mage::registry('promotion'));\n if (Mage::registry('promo_lable')) {\n $quoteAddress->setPromoLable(Mage::registry('promo_lable'));\n } else {\n $quoteAddress->setPromoLable(Mage::getStoreConfig('promodiscount/promodiscount/default_lable'));\n }\n }", "protected function calculateDiscount() : void{\r\n $percentage = ($this->discounted_value * 100) / $this->order->getTrueTotal();\r\n $new_total = $this->order->getTrueTotal() - $this->discounted_value;\r\n\r\n $this->order_discount_value = $this->discounted_value;\r\n $this->order_discount_percentage = $percentage;\r\n $this->order_discount_reason = \"For every \" . $this->products_nr . \" products from category #\" . $this->category_id . \" you get one free. You got: \";\r\n foreach($this->items_matching as $item){\r\n $this->order_discount_reason .= floor($item[\"qty\"] / $this->products_nr) . \" x '\" . $item[\"description\"] . \"' (€\". $item[\"price\"] .\" each) ; \";\r\n }\r\n $this->order_new_total = $new_total;\r\n }", "public function addBaseShippingDiscountAmount($amount)\n {\n $this->baseShippingDiscountAmount +=$amount;\n }", "public function addShippingDiscountAmount($amount)\n {\n $this->shippingDiscountAmount += $amount;\n }", "public function addDiscount(DiscountInterface $discount);", "public function applyCartDiscount(Varien_Event_Observer $observer)\n { \n try\n { \n $bundle_product_ids = [];\n $quote_product_ids = [];\n $cookieValue = Mage::getModel('core/cookie')->get('ivid');\n $userBundleCollection = Mage::getModel('increasingly_analytics/bundle')->getCollection()->addFieldToFilter('increasingly_visitor_id',$cookieValue);\n $items = $observer->getEvent()->getQuote()->getAllItems();\n $eligibleProducts = [];\n $discount = 0;\n foreach ($items as $item) {\n array_push($quote_product_ids, $item->getProductId());\n }\n foreach ($userBundleCollection as $bundle) {\n //First Bundle products\n $bundle_product_ids = explode(',', $bundle->getProductIds()); \n $productsIds = array_intersect($quote_product_ids, $bundle_product_ids);\n if(count($productsIds) == count($bundle_product_ids) )\n $discount += $bundle->getDiscountPrice();\n }\n\n if($discount > 0){\n $quote=$observer->getEvent()->getQuote();\n $quoteid=$quote->getId();\n $discountAmount=$discount;\n if($quoteid) { \n if($discountAmount>0) {\n $total=$quote->getBaseSubtotal();\n $quote->setSubtotal(0);\n $quote->setBaseSubtotal(0);\n\n $quote->setSubtotalWithDiscount(0);\n $quote->setBaseSubtotalWithDiscount(0);\n\n $quote->setGrandTotal(0);\n $quote->setBaseGrandTotal(0);\n \n\n $canAddItems = $quote->isVirtual()? ('billing') : ('shipping'); \n foreach ($quote->getAllAddresses() as $address) {\n\n $address->setSubtotal(0);\n $address->setBaseSubtotal(0);\n\n $address->setGrandTotal(0);\n $address->setBaseGrandTotal(0);\n\n $address->collectTotals();\n\n $quote->setSubtotal((float) $quote->getSubtotal() + $address->getSubtotal());\n $quote->setBaseSubtotal((float) $quote->getBaseSubtotal() + $address->getBaseSubtotal());\n\n $quote->setSubtotalWithDiscount(\n (float) $quote->getSubtotalWithDiscount() + $address->getSubtotalWithDiscount()\n );\n $quote->setBaseSubtotalWithDiscount(\n (float) $quote->getBaseSubtotalWithDiscount() + $address->getBaseSubtotalWithDiscount()\n );\n\n $quote->setGrandTotal((float) $quote->getGrandTotal() + $address->getGrandTotal());\n $quote->setBaseGrandTotal((float) $quote->getBaseGrandTotal() + $address->getBaseGrandTotal());\n\n $quote ->save(); \n\n $quote->setGrandTotal($quote->getBaseSubtotal()-$discountAmount)\n ->setBaseGrandTotal($quote->getBaseSubtotal()-$discountAmount)\n ->setSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)\n ->setBaseSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)\n ->save(); \n\n\n if($address->getAddressType()==$canAddItems) {\n //echo $address->setDiscountAmount; exit;\n $address->setSubtotalWithDiscount((float) $address->getSubtotalWithDiscount()-$discountAmount);\n $address->setGrandTotal((float) $address->getGrandTotal()-$discountAmount);\n $address->setBaseSubtotalWithDiscount((float) $address->getBaseSubtotalWithDiscount()-$discountAmount);\n $address->setBaseGrandTotal((float) $address->getBaseGrandTotal()-$discountAmount);\n if($address->getDiscountDescription()){\n $address->setDiscountAmount(-($address->getDiscountAmount()-$discountAmount));\n $address->setDiscountDescription($address->getDiscountDescription().', Custom Discount');\n $address->setBaseDiscountAmount(-($address->getBaseDiscountAmount()-$discountAmount));\n }else {\n $address->setDiscountAmount(-($discountAmount));\n $address->setDiscountDescription('Custom Discount');\n $address->setBaseDiscountAmount(-($discountAmount));\n }\n $address->save();\n }//end: if\n } //end: foreach\n //echo $quote->getGrandTotal();\n\n foreach($quote->getAllItems() as $item){\n //We apply discount amount based on the ratio between the GrandTotal and the RowTotal\n $rat=$item->getPriceInclTax()/$total;\n $ratdisc=$discountAmount*$rat;\n $item->setDiscountAmount(($item->getDiscountAmount()+$ratdisc) * $item->getQty());\n $item->setBaseDiscountAmount(($item->getBaseDiscountAmount()+$ratdisc) * $item->getQty())->save(); \n }\n } \n }\n }\n }\n catch(Exception $e)\n {\n Mage::log(\"Remove from cart tracking - \" . $e->getMessage(), null, 'Increasingly_Analytics.log');\n }\n\n }", "public function applyGlobalDiscount($discount_rate)\n {\n }", "public function getAttributeName()\n {\n return 'BurglaryExcludedDiscountFactor';\n }", "function reduceAddedByCouponsValueIfQuantityIsLess() {\r\n\t\tif(is_array($this->basket->basket_items)){\r\n\t\t\tforeach($this->basket->basket_items as $articleUid => $item) {\r\n\t\t\t\tif(is_array($item->tx_commercecoupons_addedbycouponid)) {\r\n\t\t\t\t\t#debug($item);\r\n\t\t\t\t}\r\n\t\t\t\tif(is_array($item->tx_commercecoupons_addedbycouponid) && count($item->tx_commercecoupons_addedbycouponid)>$item->quantity) {\r\n\t\t\t\t\t$new_addedByCoupons_value = $this->getFirstItemsOfArray($item->tx_commercecoupons_addedbycouponid, $item->quantity);\r\n\t\t\t\t\t$old_addedByCoupons_value = $item->tx_commercecoupons_addedbycouponid;\r\n\t\t\t\t\tif(is_array($this->basket->basket_items[$articleUid]->tx_commercecoupons_relatedcoupon)) {\r\n\r\n\t\t\t\t\t\t$removedItems = array_diff($old_addedByCoupons_value,$new_addedByCoupons_value);\r\n\t\t\t\t\t\t$this->removeItemsByValue($this->basket->basket_items[$articleUid]->tx_commercecoupons_relatedcoupon,$removedItems);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->basket->basket_items[$articleUid]->tx_commercecoupons_addedbycouponid = $new_addedByCoupons_value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function setDiscountAmount($amount);", "public function AssignDiscount()\n\t{\t\n\t}", "private static function limitAvailableDiscountValue($rule, $item)\n {\n // Ограничение скидки для товара\n if (!empty($rule['limit']['status']) && !empty($rule['limit']['value']) && $rule['limit']['value'] >= 0) {\n $limit = $rule['limit'];\n // Собираем минимальное значение цены товара\n $product_price_minimum = 0;\n switch ($limit['price1']) {\n case \"purchase\":\n $product_price_minimum += $item['purchase_price'];\n break;\n case \"compare_price\":\n $product_price_minimum += $item['compare_price'];\n break;\n }\n if ($limit['currency'] == '%') {\n $price2 = 0;\n switch ($limit['price2']) {\n case \"purchase\":\n $price2 += $item['purchase_price'];\n break;\n case \"price\":\n $price2 += $item['price'];\n break;\n case \"compare_price\":\n $price2 += $item['compare_price'];\n break;\n }\n $product_price_minimum += max(0.0, min(100.0, (float) $limit['value'])) * $price2 / 100;\n } else {\n $product_price_minimum += (float) shop_currency((float) $limit['value'], $limit['currency'], self::getOrderInfo('currency'), false);\n }\n\n // Если товар участвовал в скидках\n if (!empty(self::$available_products[$item['sku_id']][$rule['id']])) {\n // Размер скидки для одной единицы товара\n $product_discount = self::$available_products[$item['sku_id']][$rule['id']]['discount'] / self::$available_products[$item['sku_id']][$rule['id']]['quantity'];\n // Если размер скидки для товара больше, чем установлено ограничением\n if ($item['price'] - $product_discount < $product_price_minimum) {\n // Меняем скидку для товара\n self::$available_products[$item['sku_id']][$rule['id']]['discount'] = shopFlexdiscountHelper::round($item['price'] - $product_price_minimum) * self::$available_products[$item['sku_id']][$rule['id']]['quantity'];\n // Если скидка товара ниже 0, это означает, что минимальная цена товара получилась выше самой цены товара.\n // Удаляем товар из массива скидок\n if (self::$available_products[$item['sku_id']][$rule['id']]['discount'] <= 0) {\n unset(self::$available_products[$item['sku_id']][$rule['id']]);\n }\n }\n }\n }\n\n // Максимальное значение бонусов для товара\n $maximum_product_affiliate = (isset($rule['maximum_product_affiliate']) && $rule['maximum_product_affiliate'] !== '') ? shopFlexdiscountHelper::floatVal($rule['maximum_product_affiliate']) : null;\n if ($maximum_product_affiliate !== null && !empty(self::$available_products[$item['sku_id']][$rule['id']])) {\n // Размер бонусов для одной единицы товара\n $product_affiliate = self::$available_products[$item['sku_id']][$rule['id']]['affiliate'] / self::$available_products[$item['sku_id']][$rule['id']]['quantity'];\n // Если размер бонусов для товара больше, чем установлено ограничением\n if ($product_affiliate > $maximum_product_affiliate) {\n // Меняем бонусы для товара\n self::$available_products[$item['sku_id']][$rule['id']]['affiliate'] = $maximum_product_affiliate * self::$available_products[$item['sku_id']][$rule['id']]['quantity'];\n }\n }\n }", "function AddBid(&$bid)\n\t{\n\t\t$bid->supplierId = $this->supplierId;\n\t\t$found = false;\n\t\tforeach($this->_bidList as $bid2)\n\t\t{\n\t\t\tif ($bid->bidId > 0 && $bid->bidId == $bid2->bidId)\n\t\t\t{\n\t\t\t\t$found = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!$found)\n\t\t{\n\t\t\t$this->_bidList[] = $bid;\n\t\t}\n\t}", "public function postProcess() {\n if ($this->_action & CRM_Core_Action::DELETE) {\n CRM_CiviDiscount_BAO_Item::del($this->_id);\n CRM_Core_Session::setStatus(ts('Selected Discount has been deleted.'));\n return;\n }\n\n if ($this->_action & CRM_Core_Action::COPY) {\n $params = $this->exportValues();\n $newCode = CRM_CiviDiscount_Utils::randomString('abcdefghjklmnpqrstwxyz23456789', 8);\n CRM_CiviDiscount_BAO_Item::copy($this->_cloneID, $params, $newCode);\n CRM_Core_Session::setStatus(ts('Selected Discount has been duplicated.'));\n return;\n }\n\n $params = $this->exportValues();\n\n if ($this->_action & CRM_Core_Action::UPDATE) {\n $params['id'] = $this->_id;\n }\n $params['multi_valued'] = $this->_multiValued;\n\n if(in_array(0, $params['events']) && count($params['events']) > 1) {\n CRM_Core_Session::setStatus(ts('You selected `any event` and specific events, specific events have been unset'));\n $params['events'] = array(0);\n }\n\n $params['filters'] = $this->getFiltersFromParams($params);\n $item = CRM_CiviDiscount_BAO_Item::add($params);\n\n CRM_Core_Session::setStatus(ts('The discount \\'%1\\' has been saved.',\n array(1 => $item->description ? $item->description : $item->code)));\n }", "public function addNutritionalBenefit(){\n \t$id = $this->formValueForKey(\"nutritionalBenefitSelection\");\n \n \t$foundNutritionalBenefit = BLGenericRecord::recordMatchingKeyAndValue(\"NutritionalBenefit\", \"id\", $id);\n \t$this->currentRecipe()->addNutritionalBenefit($foundNutritionalBenefit);\n }", "public function getDiscountCanceled();", "public function setDiscountCanceled($discountCanceled);", "public function setBaseDiscountAmount($amount);", "public function setBaseShippingDiscountAmount($amount);", "public function getDiscountAmount();", "function apply_cart_discounts_after_tax() {\t\n\t\t\t\n\t\t\tif ($this->applied_coupons) foreach ($this->applied_coupons as $code) :\n\t\t\t\t$coupon = new cmdeals_coupon( $code );\n\t\t\t\t\n\t\t\t\tdo_action( 'cmdeals_cart_discount_after_tax_' . $coupon->type, $coupon );\n\t\t\t\t\n\t\t\t\tif ( !$coupon->apply_before_tax() && $coupon->is_valid() ) :\n\t\t\t\t\t\n\t\t\t\t\tswitch ($coupon->type) :\n\t\t\t\t\t\n\t\t\t\t\t\tcase \"fixed_cart\" :\n\t\n\t\t\t\t\t\t\t$this->discount_total = $this->discount_total + $coupon->amount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"percent\" :\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$percent_discount = (round( $this->cart_contents_total + $this->tax_total , 2) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->discount_total = $this->discount_total + $percent_discount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tendswitch;\n\t\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t}", "function removeArticlesAddedByInvalidCoupon() {\r\n\t\t$coupons = $this->getSessionCoupons();\r\n\t\tif(is_array($this->basket->basket_items)){\r\n\t\t\treset($this->basket->basket_items);\r\n\t\t\tforeach($this->basket->basket_items as $articleUid => $theItem) {\r\n\t\t\t\t$item = &$this->basket->basket_items[$articleUid];\r\n\t\t\t\tif(is_array($item->tx_commercecoupons_addedbycouponid)) {\r\n\t\t\t\t\tforeach($item->tx_commercecoupons_addedbycouponid as $key => $couponid) {\r\n\t\t\t\t\t\tif(!$coupons[$couponid]) {\r\n\t\t\t\t\t\t\t$this->basket->change_quantity($articleUid,$item->get_quantity()-1);\r\n\t\t\t\t\t\t\tunset($item->tx_commercecoupons_addedbycouponid[$key]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function addDiscount(AdjustmentDataInterface $discount)\n {\n $this->discounts[] = $discount;\n }" ]
[ "0.6371696", "0.63480055", "0.62901795", "0.60273093", "0.6026336", "0.5838916", "0.5708942", "0.5593888", "0.55592257", "0.55023235", "0.54956406", "0.54891443", "0.5449712", "0.54480624", "0.5423988", "0.53848", "0.5372779", "0.53662604", "0.53316665", "0.5255153", "0.52466375", "0.52423", "0.5242114", "0.52312565", "0.5229111", "0.5221962", "0.52069896", "0.51815814", "0.51812077", "0.5175843" ]
0.72386545
0
Tests a parameterized section reference in an action group resolved with user args.
public function testGetStepsWithParameterizedArg() { // Mock Entity Object Handler $this->setEntityObjectHandlerReturn(function ($entityName) { if ($entityName == "data2") { return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build(); } }); // mock the section object handler response $element = new ElementObject("element1", "textArea", ".selector {{var1}}", null, null, true); $section = new SectionObject("testSection", ["element1" => $element]); // bypass the private constructor $sectionInstance = AspectMock::double(SectionObjectHandler::class, ['getObject' => $section])->make(); AspectMock::double(SectionObjectHandler::class, ['getInstance' => $sectionInstance]); $actionGroupUnderTest = (new ActionGroupObjectBuilder()) ->withActionObjects( [new ActionObject('action1', 'testAction', ['selector' => '{{section1.element1(arg1.field2)}}'])] ) ->withArguments([new ArgumentObject('arg1', null, 'entity')]) ->build(); // XML Data $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY); $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector testValue2']); // Persisted Data $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data2$'], self::ACTION_GROUP_MERGE_KEY); $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector $data2.field2$']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isActionAllowed($section, $reference, $action = NULL) ;", "public function testGetStepsWithParameterizedSimpleArg()\n {\n // Mock Entity Object Handler\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n // mock the section object handler response\n $element = new ElementObject(\"element1\", \"textArea\", \".selector {{var1}}\", null, null, true);\n $section = new SectionObject(\"testSection\", [\"element1\" => $element]);\n // bypass the private constructor\n $sectionInstance = AspectMock::double(SectionObjectHandler::class, ['getObject' => $section])->make();\n AspectMock::double(SectionObjectHandler::class, ['getInstance' => $sectionInstance]);\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects(\n [new ActionObject('action1', 'testAction', ['selector' => '{{section1.element1(simple)}}'])]\n )\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n // String Literal\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'stringLiteral'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector stringLiteral']);\n\n // String Literal w/ data-like structure\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector data2.field2']);\n\n // Persisted Data\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$someData.field1$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector $someData.field1$']);\n }", "public function testGetStepsWithCustomArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // entity.field as argument\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // String Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'override'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'override']);\n }", "function section ( $arguments = \"\" ) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('tsection');\n return $rc->newInstanceArgs( $arguments ); \n}", "private function validate_input( $assoc_args, $grouping ) {\n\t\t// Check if valid arguments were passed.\n\t\t$arg_match = preg_grep( '/^set-(\\w+)/i', array_keys( $assoc_args ) );\n\n\t\t// Verify passed-arguments.\n\t\tif ( empty( $grouping ) && empty( $arg_match ) ) {\n\t\t\tWP_CLI::error( 'No valid arguments passed.' );\n\t\t}\n\n\t\t// Check whether passed arguments contain value or not.\n\t\t$assoc_arg_values = array_filter( array_intersect_key( $assoc_args, array_flip( $arg_match ) ) );\n\n\t\tif ( empty( $grouping ) && empty( $assoc_arg_values ) ) {\n\t\t\tWP_CLI::error( 'No value passed to arguments.' );\n\t\t}\n\t}", "public function testGetStepsWithPersistedArgs()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data3$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n\n // Simple Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$data3.field2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n }", "abstract function perform($userinfo, $groupinfo, $args);", "public function testHandleArgs()\n {\n $input = array('foo' => 'bar', 'bar' => 'baz');\n $lookup = new Lookup($input);\n\n $this->assertSame('bar', $lookup->getArg('foo'));\n $this->assertNull($lookup->getArg('animal'));\n $this->assertSame($input, $lookup->getArgs());\n }", "public function isAuthorized($action = '', $params = array(), &$user = array()) {\n\t\tif (!$this->activeUser && empty($user)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (empty($action)) {\n\t\t\t$action = $this->Auth->action();\n\t\t} else {\n\t\t\t$parsed = Router::parse($action);\n\t\t\t$action = Set::filter(array(Inflector::camelize($parsed['plugin']), Inflector::camelize($parsed['controller']), $parsed['action']));\n\t\t\t$action = implode('/', $action);\n\t\t}\n\n\t\tif (empty($user)) {\n\t\t\t$user =& $this->activeUser;\n\t\t}\n\t\tif (empty($params)) {\n\t\t\t$params = $this->passedArgs;\n\t\t}\n\t\tunset($user['ConditionalGroup']);\n\t\t$user['ConditionalGroup'] = $this->_setConditionalGroups($params, $user);\n\n\t\t// main group\n\t\t$mainAccess = Core::acl($user['Group']['id'], $action);\n\n\t\t$condAccess = false;\n\t\t// check for conditional group\n\t\tif (!empty($user['ConditionalGroup'])) {\n\t\t\tforeach ($user['ConditionalGroup'] as $group) {\n\t\t\t\t$condAccess = Core::acl($group['Group']['id'], $action, 'conditional');\n\t\t\t\tif ($condAccess) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $mainAccess || $condAccess;\n\t}", "public function testExceptionOnMissingArguments()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $this->expectException(TestReferenceException::class);\n $this->expectExceptionMessageRegExp('/Arguments missed .* for actionGroup/');\n $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n }", "function testLoadVarFromSection(){\n\t\tTestsHelper::Print(\"testing magratheaConfig loading a var from a section...\");\n\t\t$confs = array(\n\t\t\t'this_section' => array(\n\t\t\t\t'this_var' => 'ok', \n\t\t\t\t'this_other_var' => 'ok2' ), \n\t\t\t'this_other_section' => array(\n\t\t\t\t'this_var' => 'ok3', \n\t\t\t\t'this_other_var' => 'ok4' ), \n\t\t\t'this_last_section' => array() \n\t\t );\n\t\t$this->magConfig->setConfig($confs);\n\t\t$this->magConfig->Save(true);\n\n\t\t$newConf = new ConfigFile();\n\t\t$newConf->setPath($this->configPath);\n\t\t$newConf->setFile($this->fileName);\n\t\t$section = (array)$newConf->GetConfig();\n\t\t$this->assertCount(3, $section);\n\n\t\t$section = $newConf->GetConfig(\"this_section\");\n\t\t$this->assertEquals($section[\"this_var\"], \"ok\");\n\n\t\t$var = $newConf->getConfig(\"this_other_section/this_var\");\n\n\n\t\t$this->assertEquals($var, \"ok3\");\n\t}", "function checkSection($section) {\n\t\treturn in_array(\"*\", $this->_sections) || in_array($section, $this->_sections);\n\t}", "public function testArgument() {\n $view = Views::getView('test_view');\n foreach (['en' => 'John', 'xx-lolspeak' => 'George'] as $langcode => $name) {\n $view->setDisplay();\n $view->displayHandlers->get('default')->overrideOption('arguments', [\n 'langcode' => [\n 'id' => 'langcode',\n 'table' => 'views_test_data',\n 'field' => 'langcode',\n ],\n ]);\n $this->executeView($view, [$langcode]);\n\n $expected = [\n ['name' => $name],\n ];\n $this->assertIdenticalResultset($view, $expected, ['views_test_data_name' => 'name']);\n $view->destroy();\n }\n }", "function cleanyeti_sections_callback( $section_passed ) {\n\tglobal $cleanyeti_tabs;\n\t$cleanyeti_tabs = cleanyeti_get_settings_page_tabs();\n\tforeach ( $cleanyeti_tabs as $tabname => $tab ) {\n\t\t$tabsections = $tab['sections'];\n\t\tforeach ( $tabsections as $sectionname => $section ) {\n\t\t\tif ( 'cleanyeti_' . $sectionname . '_section' == $section_passed['id'] ) {\n\t\t\t\t?>\n\t\t\t\t<p><?php echo $section['description']; ?></p>\n\t\t\t\t<?php\n\t\t\t}\n\t\t}\n\t}\n}", "function checkSectionCategory(&$row, $include, $sections=array(), $catids=array(), $contentids=array()) {\r\n\t\t/* doc id excluded ? */\r\n\t\tif (in_array((($row->REPLACEid == 0) ? -1 : $row->REPLACEid), $contentids))\r\n\t\t\treturn false;\r\n\r\n\t\t/* category included or excluded ? */\r\n\t\t$result = in_array((($row->REPLACEcatid == 0) ? -1 : $row->REPLACEcatid), $sections);\r\n\t\tif (($include && !$result) || (!$include && $result))\r\n\t\t\treturn false; /* include and not found OR exclude and found */\r\n\r\n\t\treturn true;\r\n\t}", "public function isUserInSection($user){\n\t\t$sql = \"SELECT id_user FROM tbl_user_section_assignment WHERE id_section=:id_section AND id_user=:id_user\";\n\t\t$command = Yii::app()->db->createCommand($sql);\n\t\t$command->bindValue(\":id_section\", $this->id_section, PDO::PARAM_INT);\n\t\t$command->bindValue(\":id_user\", $user->id, PDO::PARAM_INT);\n\t\treturn $command->execute()==1;\n\t}", "function testLoadVarFromSection(){\n\t\t\techo \"testing magratheaConfig loading a var from a section... <br/>\";\n\t\t\t$confs = array(\n\t\t\t\t'this_section' => array(\n\t\t\t\t\t'this_var' => 'ok', \n\t\t\t\t\t'this_other_var' => 'ok2' ), \n\t\t\t\t'this_other_section' => array(\n\t\t\t\t\t'this_var' => 'ok3', \n\t\t\t\t\t'this_other_var' => 'ok4' ), \n\t\t\t\t'this_last_section' => array() \n\t\t\t );\n\t\t\t$this->magConfig->setConfig($confs);\n\t\t\t$this->magConfig->Save(true);\n\n\t\t\t$newConf = new MagratheaConfigFile();\n\t\t\t$newConf->setPath($this->configPath);\n\t\t\t$newConf->setFile(\"test_conf.conf\");\n\t\t\t$section = $newConf->GetConfig();\n\t\t\t$this->assertEqual(count($section), 3);\n\n\t\t\t$section = $newConf->GetConfig(\"this_section\");\n\t\t\t$this->assertEqual($section[\"this_var\"], \"ok\");\n\n\t\t\t$var = $newConf->getConfig(\"this_other_section/this_var\");\n\n\t\t\t$this->assertEqual($var, \"ok3\");\n\t\t}", "public function addSectionAction($values)\n\t{\n\t\t$this->vars['section_action'][] = (object) $values;\n\t}", "public static function sectionURI($mnt,$section)\n{\nreturn self::commandURI($mnt,'section&name='.$section);\n}", "public function testExceptionOnMissingActions()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $this->expectException(TestReferenceException::class);\n $this->expectExceptionMessageRegExp('/Arguments missed .* for actionGroup/');\n $actionGroupUnderTest->getSteps(['arg2' => 'data1'], self::ACTION_GROUP_MERGE_KEY);\n }", "public function testEditSection() {\n\t\t$name = 'Help:ApiEditPageTest_testEditSection';\n\t\t$page = WikiPage::factory( Title::newFromText( $name ) );\n\t\t$text = \"==section 1==\\ncontent 1\\n==section 2==\\ncontent2\";\n\t\t// Preload the page with some text\n\t\t$page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), 'summary' );\n\n\t\tlist( $re ) = $this->doApiRequestWithToken( array(\n\t\t\t'action' => 'edit',\n\t\t\t'title' => $name,\n\t\t\t'section' => '1',\n\t\t\t'text' => \"==section 1==\\nnew content 1\",\n\t\t) );\n\t\t$this->assertEquals( 'Success', $re['edit']['result'] );\n\t\t$newtext = WikiPage::factory( Title::newFromText( $name ) )\n\t\t\t->getContent( Revision::RAW )\n\t\t\t->getNativeData();\n\t\t$this->assertEquals( \"==section 1==\\nnew content 1\\n\\n==section 2==\\ncontent2\", $newtext );\n\n\t\t// Test that we raise a 'nosuchsection' error\n\t\ttry {\n\t\t\t$this->doApiRequestWithToken( array(\n\t\t\t\t'action' => 'edit',\n\t\t\t\t'title' => $name,\n\t\t\t\t'section' => '9999',\n\t\t\t\t'text' => 'text',\n\t\t\t) );\n\t\t\t$this->fail( \"Should have raised a UsageException\" );\n\t\t} catch ( UsageException $e ) {\n\t\t\t$this->assertEquals( 'nosuchsection', $e->getCodeString() );\n\t\t}\n\t}", "private function check_section() {\n $cond = NULL;\n if($this->type_post != 'add') {\n $cond = \"AND sec_id != {$this->get_id}\";\n }\n $ch = $this->select(\"*\", \"jops_sections\", \"WHERE sec_unique = ? {$cond}\");\n $ch->execute(array($this->unique));\n $info = $ch->rowCount();\n if($info > 0) {\n return true;\n }\n return false;\n }", "public function update( &$args ) {\n\n\t\t$section = $this->parse( $args );\n\n\t\tif ( empty( $section['section_id'] ) ) {\n\t\t\treturn $this->create( $args );\n\t\t}\n\n\t\t$section_id = $section['section_id'];\n\t\t$update_data = array(\n\t\t\t'section_name' => $section['section_name'],\n\t\t\t'section_course_id' => $section['section_course_id'],\n\t\t\t'section_order' => $section['section_order'],\n\t\t\t'section_description' => $section['section_description'],\n\t\t);\n\n\t\tglobal $wpdb;\n\n\t\t$wpdb->update(\n\t\t\t$wpdb->learnpress_sections,\n\t\t\t$update_data,\n\t\t\tarray( 'section_id' => $section_id )\n\t\t);\n\t\t$section['section_id'] = $section_id;\n\n\t\treturn $section;\n\t}", "public static function checkViewAccess($group, $section, $sub_section = NULL) {\n /** @var \\Drupal\\group\\Entity\\GroupInterface $group_entity */\n $group_entity = \\Drupal::entityTypeManager()\n ->getStorage('group')\n ->load($group);\n /** @var \\Drupal\\living_spaces_sections\\LivingSpacesSectionsManagerInterface $service */\n $service = \\Drupal::service('living_spaces_sections.manager');\n\n if (!$group_entity ||\n !$service->isSectionsEnabled($group_entity->bundle()) ||\n !$group_entity->access('view')\n ) {\n return AccessResult::forbidden();\n }\n\n $path = implode('/', [$section, $sub_section]);\n $section = $service->getSectionFromGroupByPath($group_entity, $path);\n return AccessResult::allowedIf($section && $section->access('view'));\n }", "public function testPluginsProvidingCustomAttributesAndContextualLinks() {\n $assert_session = $this->assertSession();\n $page = $this->getSession()->getPage();\n\n $this->drupalLogin($this->drupalCreateUser([\n 'access contextual links',\n 'configure any layout',\n 'administer node display',\n ]));\n\n $this->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default');\n $this->submitForm(['layout[enabled]' => TRUE], 'Save');\n $page->clickLink('Manage layout');\n $page->clickLink('Add section');\n $page->clickLink('Layout Builder Test Plugin');\n $page->pressButton('Add section');\n $page->clickLink('Add block');\n $page->clickLink('Test Attributes');\n $page->pressButton('Add block');\n $page->pressButton('Save layout');\n\n $this->drupalGet('node/1');\n\n $assert_session->elementExists('css', '.attribute-test-class');\n $assert_session->elementExists('css', '[custom-attribute=test]');\n $assert_session->elementExists('css', 'div[data-contextual-id*=\"layout_builder_test\"]');\n }", "public function inSection( array $params = null )\n {\n $this->searchEntities($params, 'section');\n }", "public function verifyAc(array $args);", "public function is_group( $args, $assoc_args = array() ) {\n\t\t$alias = $args[0];\n\n\t\t$aliases = WP_CLI::get_runner()->aliases;\n\n\t\tif ( empty( $aliases[ $alias ] ) ) {\n\t\t\tWP_CLI::error( \"No alias found with key '{$alias}'.\" );\n\t\t}\n\n\t\t// how do we know the alias is a group?\n\t\t// + array keys are numeric\n\t\t// + array values begin with '@'\n\n\t\t$first_item = $aliases[ $alias ];\n\t\t$first_item_key = key( $first_item );\n\t\t$first_item_value = $first_item[ $first_item_key ];\n\n\t\tif ( is_numeric( $first_item_key ) && substr( $first_item_value, 0, 1 ) === '@' ) {\n\t\t\tWP_CLI::halt( 0 );\n\t\t}\n\t\tWP_CLI::halt( 1 );\n\n\t}", "public function testUserControllerWithVariadicArguments()\n {\n $route = new Route();\n \n $route->set(null, \"user\", null, \"Anax\\Route\\MockHandlerController\");\n \n $path = \"user/variadic\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"variadicAction collection:0\", $res);\n\n $path = \"user/variadic/1\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"variadicAction collection:1\", $res);\n\n $path = \"user/variadic/1/2/3/moped\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"variadicAction collection:4\", $res);\n }", "public function modEditsection($group, $section, $value, $store_id = 0) {\r\r\n\t\t$this->db->query(\r\r\n\t\t\t\"DELETE FROM \" . DB_PREFIX . $this->tbl_module . \" WHERE \r\r\n\t\t\t`store_id`\t= '\" . (int)$store_id . \"' AND \r\r\n\t\t\t`group`\t\t= '\" . $this->db->escape($group) . \"' AND \r\r\n\t\t\t`section`\t\t= '\" . $this->db->escape($section) . \"'\r\r\n\t\t\");\r\r\n\r\r\n\t\t//echo \"<pre>\".print_r($value,true).\"</pre>\";\r\r\n\t\tforeach ($value as $k => $v) {\r\r\n\t\t\t$this->db->query(\r\r\n\t\t\t\t\"INSERT INTO \" . DB_PREFIX . $this->tbl_module . \" SET \r\r\n\t\t\t\t`store_id`\t= '\" . (int)$store_id . \"',\r\r\n\t\t\t\t`group`\t\t= '\" . $this->db->escape($group) . \"', \r\r\n\t\t\t\t`section`\t= '\" . $this->db->escape($section) . \"', \r\r\n\t\t\t\t`key`\t\t= '\" . $this->db->escape($k) . \"', \r\r\n\t\t\t\t`value`\t\t= '\" . $this->db->escape(json_encode($v)) . \"'\r\r\n\t\t\t\");\r\r\n\t\t}\r\r\n\t}" ]
[ "0.58181256", "0.55953324", "0.53428715", "0.5264419", "0.52022636", "0.51012194", "0.4941738", "0.48870313", "0.4838513", "0.47824267", "0.47665146", "0.4740185", "0.47240394", "0.47177273", "0.47083986", "0.46732798", "0.46647125", "0.46636122", "0.46594095", "0.46525747", "0.46505758", "0.46334395", "0.46218288", "0.46145546", "0.4604032", "0.4601728", "0.45947313", "0.45851555", "0.4583363", "0.45789996" ]
0.5897048
0
Tests a parameterized section reference in an action group resolved with user simpleArgs.
public function testGetStepsWithParameterizedSimpleArg() { // Mock Entity Object Handler $this->setEntityObjectHandlerReturn(function ($entityName) { if ($entityName == "data2") { return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build(); } }); // mock the section object handler response $element = new ElementObject("element1", "textArea", ".selector {{var1}}", null, null, true); $section = new SectionObject("testSection", ["element1" => $element]); // bypass the private constructor $sectionInstance = AspectMock::double(SectionObjectHandler::class, ['getObject' => $section])->make(); AspectMock::double(SectionObjectHandler::class, ['getInstance' => $sectionInstance]); $actionGroupUnderTest = (new ActionGroupObjectBuilder()) ->withActionObjects( [new ActionObject('action1', 'testAction', ['selector' => '{{section1.element1(simple)}}'])] ) ->withArguments([new ArgumentObject('simple', null, 'string')]) ->build(); // String Literal $steps = $actionGroupUnderTest->getSteps(['simple' => 'stringLiteral'], self::ACTION_GROUP_MERGE_KEY); $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector stringLiteral']); // String Literal w/ data-like structure $steps = $actionGroupUnderTest->getSteps(['simple' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY); $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector data2.field2']); // Persisted Data $steps = $actionGroupUnderTest->getSteps(['simple' => '$someData.field1$'], self::ACTION_GROUP_MERGE_KEY); $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector $someData.field1$']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetStepsWithParameterizedArg()\n {\n // Mock Entity Object Handler\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n // mock the section object handler response\n $element = new ElementObject(\"element1\", \"textArea\", \".selector {{var1}}\", null, null, true);\n $section = new SectionObject(\"testSection\", [\"element1\" => $element]);\n // bypass the private constructor\n $sectionInstance = AspectMock::double(SectionObjectHandler::class, ['getObject' => $section])->make();\n AspectMock::double(SectionObjectHandler::class, ['getInstance' => $sectionInstance]);\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects(\n [new ActionObject('action1', 'testAction', ['selector' => '{{section1.element1(arg1.field2)}}'])]\n )\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n // XML Data\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector testValue2']);\n\n // Persisted Data\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector $data2.field2$']);\n }", "public function isActionAllowed($section, $reference, $action = NULL) ;", "public function testGetStepsWithCustomArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // entity.field as argument\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // String Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'override'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'override']);\n }", "function section ( $arguments = \"\" ) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('tsection');\n return $rc->newInstanceArgs( $arguments ); \n}", "private function validate_input( $assoc_args, $grouping ) {\n\t\t// Check if valid arguments were passed.\n\t\t$arg_match = preg_grep( '/^set-(\\w+)/i', array_keys( $assoc_args ) );\n\n\t\t// Verify passed-arguments.\n\t\tif ( empty( $grouping ) && empty( $arg_match ) ) {\n\t\t\tWP_CLI::error( 'No valid arguments passed.' );\n\t\t}\n\n\t\t// Check whether passed arguments contain value or not.\n\t\t$assoc_arg_values = array_filter( array_intersect_key( $assoc_args, array_flip( $arg_match ) ) );\n\n\t\tif ( empty( $grouping ) && empty( $assoc_arg_values ) ) {\n\t\t\tWP_CLI::error( 'No value passed to arguments.' );\n\t\t}\n\t}", "public function testGetStepsWithPersistedArgs()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data3$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n\n // Simple Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$data3.field2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n }", "public static function sectionURI($mnt,$section)\n{\nreturn self::commandURI($mnt,'section&name='.$section);\n}", "function cleanyeti_sections_callback( $section_passed ) {\n\tglobal $cleanyeti_tabs;\n\t$cleanyeti_tabs = cleanyeti_get_settings_page_tabs();\n\tforeach ( $cleanyeti_tabs as $tabname => $tab ) {\n\t\t$tabsections = $tab['sections'];\n\t\tforeach ( $tabsections as $sectionname => $section ) {\n\t\t\tif ( 'cleanyeti_' . $sectionname . '_section' == $section_passed['id'] ) {\n\t\t\t\t?>\n\t\t\t\t<p><?php echo $section['description']; ?></p>\n\t\t\t\t<?php\n\t\t\t}\n\t\t}\n\t}\n}", "public function testHandleArgs()\n {\n $input = array('foo' => 'bar', 'bar' => 'baz');\n $lookup = new Lookup($input);\n\n $this->assertSame('bar', $lookup->getArg('foo'));\n $this->assertNull($lookup->getArg('animal'));\n $this->assertSame($input, $lookup->getArgs());\n }", "abstract function perform($userinfo, $groupinfo, $args);", "public function testEditSection() {\n\t\t$name = 'Help:ApiEditPageTest_testEditSection';\n\t\t$page = WikiPage::factory( Title::newFromText( $name ) );\n\t\t$text = \"==section 1==\\ncontent 1\\n==section 2==\\ncontent2\";\n\t\t// Preload the page with some text\n\t\t$page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), 'summary' );\n\n\t\tlist( $re ) = $this->doApiRequestWithToken( array(\n\t\t\t'action' => 'edit',\n\t\t\t'title' => $name,\n\t\t\t'section' => '1',\n\t\t\t'text' => \"==section 1==\\nnew content 1\",\n\t\t) );\n\t\t$this->assertEquals( 'Success', $re['edit']['result'] );\n\t\t$newtext = WikiPage::factory( Title::newFromText( $name ) )\n\t\t\t->getContent( Revision::RAW )\n\t\t\t->getNativeData();\n\t\t$this->assertEquals( \"==section 1==\\nnew content 1\\n\\n==section 2==\\ncontent2\", $newtext );\n\n\t\t// Test that we raise a 'nosuchsection' error\n\t\ttry {\n\t\t\t$this->doApiRequestWithToken( array(\n\t\t\t\t'action' => 'edit',\n\t\t\t\t'title' => $name,\n\t\t\t\t'section' => '9999',\n\t\t\t\t'text' => 'text',\n\t\t\t) );\n\t\t\t$this->fail( \"Should have raised a UsageException\" );\n\t\t} catch ( UsageException $e ) {\n\t\t\t$this->assertEquals( 'nosuchsection', $e->getCodeString() );\n\t\t}\n\t}", "private function check_section() {\n $cond = NULL;\n if($this->type_post != 'add') {\n $cond = \"AND sec_id != {$this->get_id}\";\n }\n $ch = $this->select(\"*\", \"jops_sections\", \"WHERE sec_unique = ? {$cond}\");\n $ch->execute(array($this->unique));\n $info = $ch->rowCount();\n if($info > 0) {\n return true;\n }\n return false;\n }", "public function testCustomSectionAttributes() {\n $assert_session = $this->assertSession();\n $page = $this->getSession()->getPage();\n\n $this->drupalLogin($this->drupalCreateUser([\n 'configure any layout',\n 'administer node display',\n ]));\n\n $this->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default');\n $this->submitForm(['layout[enabled]' => TRUE], 'Save');\n $page->clickLink('Manage layout');\n $page->clickLink('Add section');\n $page->clickLink('Layout Builder Test Plugin');\n $page->pressButton('Add section');\n // See \\Drupal\\layout_builder_test\\Plugin\\Layout\\LayoutBuilderTestPlugin::build().\n $assert_session->elementExists('css', '.go-birds');\n }", "public function testUserControllerWithVariadicArguments()\n {\n $route = new Route();\n \n $route->set(null, \"user\", null, \"Anax\\Route\\MockHandlerController\");\n \n $path = \"user/variadic\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"variadicAction collection:0\", $res);\n\n $path = \"user/variadic/1\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"variadicAction collection:1\", $res);\n\n $path = \"user/variadic/1/2/3/moped\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"variadicAction collection:4\", $res);\n }", "public function testSectionLabels() {\n $assert_session = $this->assertSession();\n $page = $this->getSession()->getPage();\n\n $this->drupalLogin($this->drupalCreateUser([\n 'configure any layout',\n 'administer node display',\n ]));\n\n $this->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default');\n $page->checkField('layout[enabled]');\n $page->pressButton('Save');\n $page->checkField('layout[allow_custom]');\n $page->pressButton('Save');\n\n $this->drupalGet('node/1/layout');\n $page->clickLink('Add section');\n $page->clickLink('One column');\n $page->fillField('layout_settings[label]', 'My Cool Section');\n $page->pressButton('Add section');\n $assert_session->pageTextContains('My Cool Section');\n $page->pressButton('Save layout');\n $assert_session->pageTextNotContains('My Cool Section');\n }", "public function is_group( $args, $assoc_args = array() ) {\n\t\t$alias = $args[0];\n\n\t\t$aliases = WP_CLI::get_runner()->aliases;\n\n\t\tif ( empty( $aliases[ $alias ] ) ) {\n\t\t\tWP_CLI::error( \"No alias found with key '{$alias}'.\" );\n\t\t}\n\n\t\t// how do we know the alias is a group?\n\t\t// + array keys are numeric\n\t\t// + array values begin with '@'\n\n\t\t$first_item = $aliases[ $alias ];\n\t\t$first_item_key = key( $first_item );\n\t\t$first_item_value = $first_item[ $first_item_key ];\n\n\t\tif ( is_numeric( $first_item_key ) && substr( $first_item_value, 0, 1 ) === '@' ) {\n\t\t\tWP_CLI::halt( 0 );\n\t\t}\n\t\tWP_CLI::halt( 1 );\n\n\t}", "public function testArgument() {\n $view = Views::getView('test_view');\n foreach (['en' => 'John', 'xx-lolspeak' => 'George'] as $langcode => $name) {\n $view->setDisplay();\n $view->displayHandlers->get('default')->overrideOption('arguments', [\n 'langcode' => [\n 'id' => 'langcode',\n 'table' => 'views_test_data',\n 'field' => 'langcode',\n ],\n ]);\n $this->executeView($view, [$langcode]);\n\n $expected = [\n ['name' => $name],\n ];\n $this->assertIdenticalResultset($view, $expected, ['views_test_data_name' => 'name']);\n $view->destroy();\n }\n }", "public function testFilters_byUserNameOrGroupId()\n {\n $users = $this->_mockUserAccess();\n $users->Auth\n ->staticExpects($this->at(1))\n ->method('user')\n ->with('group_id')\n ->will($this->returnValue(1));\n $this->testAction(\"/users/index?filter_operator=any&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=o&filter_param%5B2%5D%5B1%5D=group_id&filter_param%5B2%5D%5B2%5D=is&filter_param%5B2%5D%5B3%5D=1\");\n $this->assertEqual(count($this->vars['users']), 2); \n }", "public function isAuthorized($action = '', $params = array(), &$user = array()) {\n\t\tif (!$this->activeUser && empty($user)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (empty($action)) {\n\t\t\t$action = $this->Auth->action();\n\t\t} else {\n\t\t\t$parsed = Router::parse($action);\n\t\t\t$action = Set::filter(array(Inflector::camelize($parsed['plugin']), Inflector::camelize($parsed['controller']), $parsed['action']));\n\t\t\t$action = implode('/', $action);\n\t\t}\n\n\t\tif (empty($user)) {\n\t\t\t$user =& $this->activeUser;\n\t\t}\n\t\tif (empty($params)) {\n\t\t\t$params = $this->passedArgs;\n\t\t}\n\t\tunset($user['ConditionalGroup']);\n\t\t$user['ConditionalGroup'] = $this->_setConditionalGroups($params, $user);\n\n\t\t// main group\n\t\t$mainAccess = Core::acl($user['Group']['id'], $action);\n\n\t\t$condAccess = false;\n\t\t// check for conditional group\n\t\tif (!empty($user['ConditionalGroup'])) {\n\t\t\tforeach ($user['ConditionalGroup'] as $group) {\n\t\t\t\t$condAccess = Core::acl($group['Group']['id'], $action, 'conditional');\n\t\t\t\tif ($condAccess) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $mainAccess || $condAccess;\n\t}", "public function show(User $user, Section $section)\n {\n return $user->hasPermission('show-reference-section');\n }", "public function isUserInSection($user){\n\t\t$sql = \"SELECT id_user FROM tbl_user_section_assignment WHERE id_section=:id_section AND id_user=:id_user\";\n\t\t$command = Yii::app()->db->createCommand($sql);\n\t\t$command->bindValue(\":id_section\", $this->id_section, PDO::PARAM_INT);\n\t\t$command->bindValue(\":id_user\", $user->id, PDO::PARAM_INT);\n\t\treturn $command->execute()==1;\n\t}", "public function print_section_html($args)\r\n {\r\n var_dump($args);\r\n print 'Enter your settings below:';\r\n }", "public function coverageSection(string $section);", "public function testCheckArray() {\n\t\t$iniFile = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS . 'acl.ini.php';\n\n\t\t$Ini = new IniAcl();\n\t\t$Ini->config = $Ini->readConfigFile($iniFile);\n\t\t$Ini->userPath = 'User.username';\n\n\t\t$user = array(\n\t\t\t'User' => array('username' => 'admin')\n\t\t);\n\t\t$this->assertTrue($Ini->check($user, 'posts'));\n\t}", "public function inSection( array $params = null )\n {\n $this->searchEntities($params, 'section');\n }", "public function testGetStepsWithNoArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data1\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field1' => 'testValue'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{data1.field1}}'])])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue']);\n }", "public function set_default_field_args( $field_args, $tab_key, $section_key ) {\n\n $type = isset($field_args['type']) ? $field_args['type'] : 'text';\n $conditions = isset($field_args['conditions']) ? $field_args['conditions'] : false;\n\n $disable = isset($field_args['disable']) ? boolval($field_args['disable']) : false;\n\n if ( isset($field_args['global']) && $field_args['global'] === true) {\n $disable = $this->is_disabled( $field_args['name'] ) ? true : $disable;\n $name_id = $this->get_option_prefix( $field_args['name'] );\n }\n else if ( isset($field_args['parent']) ) {\n $disable = $this->is_disabled( $field_args['name'], false, $section_key ) ? true : $disable;\n $name_id = $field_args['parent']['name_id'] . '[' . $field_args['name'] . ']';\n }\n else {\n $disable = $this->is_disabled( $field_args['name'], false, $section_key ) ? true : $disable;\n $name_id = $this->get_option_prefix($section_key . '[' . $field_args['name'] . ']');\n }\n\n $args = array(\n 'id' => $field_args['name'],\n 'name_id' => $name_id,\n 'label_for' => $args['label_for'] = \"{$section_key}[{$field_args['name']}]\",\n 'desc' => isset($field_args['desc']) ? $field_args['desc'] : '',\n 'placeholder' => isset($field_args['placeholder']) ? $field_args['placeholder'] : '',\n 'global' => isset($field_args['global']) ? boolval($field_args['global']) : false,\n 'label' => isset($field_args['label']) ? $field_args['label'] : '',\n 'title' => isset($field_args['title']) ? $field_args['title'] : '',\n 'tab' => $tab_key,\n 'section' => $section_key,\n 'parent' => isset($field_args['parent']) ? $field_args['parent'] : false,\n 'size' => isset($field_args['size']) ? $field_args['size'] : null,\n 'options' => isset($field_args['options']) ? $field_args['options'] : '',\n 'std' => isset($field_args['default']) ? $field_args['default'] : '',\n 'disable' => $disable,\n 'sanitize_callback' => isset($field_args['sanitize_callback']) ? $field_args['sanitize_callback'] : '',\n 'type' => $type,\n 'sub_fields' => ( $type === 'sub_fields' && isset($field_args['sub_fields']) ) ? $field_args['sub_fields'] : false,\n 'display' => (isset($field_args['display'])) ? $field_args['display'] : '',\n 'conditions' => $conditions\n );\n\n return $args;\n }", "public function set(string $section, string $key, $value) : bool;", "function checkSection($section) {\n\t\treturn in_array(\"*\", $this->_sections) || in_array($section, $this->_sections);\n\t}", "public function testParsingSingleArgument()\n {\n $request = $this->parser->parse('foo bar');\n $this->assertEquals('foo', $request->getCommandName());\n $this->assertEquals(['bar'], $request->getArgumentValues());\n $this->assertEquals([], $request->getOptionValues());\n }" ]
[ "0.5803498", "0.5566526", "0.53851414", "0.5227098", "0.51804197", "0.50407124", "0.48020297", "0.4778006", "0.47397548", "0.47348225", "0.47177112", "0.46829703", "0.46779534", "0.4668429", "0.46591905", "0.4640222", "0.46230632", "0.46077523", "0.4570732", "0.4569551", "0.45618418", "0.45480436", "0.45466194", "0.4543158", "0.45395902", "0.4526322", "0.45241687", "0.45193633", "0.45154953", "0.4515121" ]
0.6504436
0
Tests a data reference in an action group resolved with a persisted reference used in another function.
public function testGetStepsWithOuterScopePersistence() { $actionGroupUnderTest = (new ActionGroupObjectBuilder()) ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field1}}'])]) ->withArguments([new ArgumentObject('arg1', null, 'entity')]) ->build(); $steps = $actionGroupUnderTest->getSteps(['arg1' => '$$someData$$'], self::ACTION_GROUP_MERGE_KEY); $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$$someData.field1$$']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkData($callable, $params = null, $group = null){\r\n \t\t$group = ($group) ? $group : $this->_options['defaultgroup'];\r\n \r\n \t\t// Get the storage handler\r\n \t\t$handler =& $this->_getStorage();\r\n \t\tif (!JError::isError($handler) && $this->_options['caching']) {\r\n \t\t\treturn !!$handler->get($this->_makeId($callable, $params), $group, (isset($this->_options['checkTime']))? $this->_options['checkTime'] : true);\r\n \t\t}\r\n \t\treturn false;\r\n }", "function testObjReference() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n \r\n\t\t// Create an object to reference\r\n\t\t$obj = new CAntObject($dbh, \"customer\", null, $this->user);\r\n\t\t$obj->setValue(\"name\", \"testGenSave\");\r\n\t\t$oid = $obj->save(false);\r\n\r\n\t\t// Create an activity with the reference\r\n\t\t$objAct = new CAntObject($dbh, \"activity\", null, $this->user);\r\n\t\t$objAct->setValue(\"obj_reference\", \"customer:$oid\");\r\n\t\t$aid = $objAct->save(false);\r\n\t\t$this->assertTrue($aid > 0 );\r\n\t\tunset($objAct);\r\n\r\n\t\t// Close and then open again\r\n\t\t$objAct = new CAntObject($dbh, \"activity\", $aid, $this->user);\r\n\t\t$this->assertEquals($objAct->getValue(\"obj_reference\"), \"customer:$oid\");\r\n\t\tunset($objAct);\r\n\r\n\t\t// Test with the list cache\r\n\t\t$list = new CAntObjectList($dbh, \"activity\", $this->user);\r\n\t\t$list->addCondition(\"and\", \"id\", \"is_equal\", $aid);\r\n\t\t$list->getObjects();\r\n\t\t$this->assertEquals($list->getNumObjects(), 1);\r\n\t\t$objAct = $list->getObject(0);\r\n\t\t$this->assertEquals($objAct->getValue(\"obj_reference\"), \"customer:$oid\");\r\n \r\n\t\t// Cleanup\r\n\t\t$obj->removeHard();\r\n\t\t$objAct->removeHard();\r\n\t}", "function store($id, $group, $data)\n {\n return true;\n }", "public function dataIsReference()\n {\n return [\n [\n '/* testBitwiseAndA */',\n false,\n ],\n [\n '/* testBitwiseAndB */',\n false,\n ],\n [\n '/* testBitwiseAndC */',\n false,\n ],\n [\n '/* testBitwiseAndD */',\n false,\n ],\n [\n '/* testBitwiseAndE */',\n false,\n ],\n [\n '/* testBitwiseAndF */',\n false,\n ],\n [\n '/* testBitwiseAndG */',\n false,\n ],\n [\n '/* testBitwiseAndH */',\n false,\n ],\n [\n '/* testBitwiseAndI */',\n false,\n ],\n [\n '/* testFunctionReturnByReference */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceA */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceB */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceC */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceD */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceE */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceF */',\n true,\n ],\n [\n '/* testFunctionPassByReferenceG */',\n true,\n ],\n [\n '/* testForeachValueByReference */',\n true,\n ],\n [\n '/* testForeachKeyByReference */',\n true,\n ],\n [\n '/* testArrayValueByReferenceA */',\n true,\n ],\n [\n '/* testArrayValueByReferenceB */',\n true,\n ],\n [\n '/* testArrayValueByReferenceC */',\n true,\n ],\n [\n '/* testArrayValueByReferenceD */',\n true,\n ],\n [\n '/* testArrayValueByReferenceE */',\n true,\n ],\n [\n '/* testArrayValueByReferenceF */',\n true,\n ],\n [\n '/* testArrayValueByReferenceG */',\n true,\n ],\n [\n '/* testArrayValueByReferenceH */',\n true,\n ],\n [\n '/* testAssignByReferenceA */',\n true,\n ],\n [\n '/* testAssignByReferenceB */',\n true,\n ],\n [\n '/* testAssignByReferenceC */',\n true,\n ],\n [\n '/* testAssignByReferenceD */',\n true,\n ],\n [\n '/* testAssignByReferenceE */',\n true,\n ],\n [\n '/* testPassByReferenceA */',\n true,\n ],\n [\n '/* testPassByReferenceB */',\n true,\n ],\n [\n '/* testPassByReferenceC */',\n true,\n ],\n [\n '/* testPassByReferenceD */',\n true,\n ],\n [\n '/* testPassByReferenceE */',\n true,\n ],\n [\n '/* testPassByReferenceF */',\n true,\n ],\n [\n '/* testPassByReferenceG */',\n true,\n ],\n [\n '/* testPassByReferenceH */',\n true,\n ],\n [\n '/* testPassByReferenceI */',\n true,\n ],\n [\n '/* testPassByReferenceJ */',\n true,\n ],\n [\n '/* testNewByReferenceA */',\n true,\n ],\n [\n '/* testNewByReferenceB */',\n true,\n ],\n [\n '/* testUseByReference */',\n true,\n ],\n [\n '/* testArrowFunctionReturnByReference */',\n true,\n ],\n [\n '/* testArrowFunctionPassByReferenceA */',\n true,\n ],\n [\n '/* testArrowFunctionPassByReferenceB */',\n true,\n ],\n [\n '/* testClosureReturnByReference */',\n true,\n ],\n ];\n\n }", "public function testGetSetGroup()\n {\n $action = new CallbackAction('callback', function () { });\n\n $group = new Group('test');\n $action->setGroup($group);\n\n $this->assertSame($group, $action->getGroup());\n }", "public function testRelatedGroupsAreSaved(): void\n {\n $items = Category::factory()->count(1)->create();\n $group = Group::factory()->create();\n\n Livewire::actingAs(User::factory()->admin()->create())\n ->test(CategoriesTable::class, ['items' => $items])\n ->emit('edit', $items[0]->id)\n ->set('editValues.groups', [$group->id])\n ->emit('save')\n ->assertOk()\n ->assertDispatchedBrowserEvent('notify', function ($name, $data) {\n return data_get($data, 'level') === 'success';\n });\n\n $this->assertEquals(1, $items[0]->groups()->count());\n }", "public function testGetStepsWithPersistedArgs()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data3$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n\n // Simple Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$data3.field2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n }", "public function testSaveDataScopeStore()\n {\n $this->entityModel->expects($this->once())->method('getNewSku')->will($this->returnValue([\n 'sku_assoc1' => ['entity_id' => 1],\n 'productsku' => ['entity_id' => 2, 'attr_set_code' => 'Default', 'type_id' => 'grouped']\n ]));\n $this->entityModel->expects($this->once())->method('getOldSku')->will($this->returnValue([\n 'sku_assoc2' => ['entity_id' => 3]\n ]));\n $attributes = ['position' => ['id' => 0], 'qty' => ['id' => 0]];\n $this->links->expects($this->once())->method('getAttributes')->will($this->returnValue($attributes));\n\n $bunch = [[\n 'associated_skus' => 'sku_assoc1=1, sku_assoc2=2',\n 'sku' => 'productsku',\n 'product_type' => 'grouped'\n ]];\n $this->entityModel->expects($this->at(2))->method('getNextBunch')->will($this->returnValue($bunch));\n $this->entityModel->expects($this->any())->method('isRowAllowedToImport')->will($this->returnValue(true));\n $this->entityModel->expects($this->at(4))->method('getRowScope')->will($this->returnValue(\n \\Magento\\CatalogImportExport\\Model\\Import\\Product::SCOPE_DEFAULT\n ));\n $this->entityModel->expects($this->at(5))->method('getRowScope')->will($this->returnValue(\n \\Magento\\CatalogImportExport\\Model\\Import\\Product::SCOPE_STORE\n ));\n\n $this->links->expects($this->once())->method('saveLinksData');\n $this->grouped->saveData();\n }", "public function testGetData() {\r\n $action = $this->_action;\r\n $this->assertEquals(null, $action->getData());\r\n\r\n $action->setData(array());\r\n $this->assertEquals(array(), $action->getData());\r\n }", "public function testDereferenceBasic()\n {\n $src = 'success';\n $ref = &$src;\n $this->debug->log('ref', $ref);\n $src = 'fail';\n $output = $this->debug->output();\n $this->assertContains('success', $output);\n }", "public function store($id, $group, $data)\n\t{\n\t\treturn true;\n\t}", "public function testActionUseCase2()\n {\n // person and target\n\n // workflow, rule and action\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n $workflow->actions()->sync([$action1->getKey()]);\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n 'runnable_once' => true,\n 'run_interval' => 0,\n ]);\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type own',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $this->leadTypeId,\n ]);\n\n $action1->rules()->sync([ $rule1->getKey(), $rule2->getKey()]); //\n\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $this->tag->getKey(),\n ]);\n // check tag\n $this->seeInDatabase('taggables',[\n 'user_id' => $this->user->getKey(),\n 'tag_id' => $this->tag->getKey(),\n 'taggable_id' => $this->person->getKey(),\n 'taggable_type' => 'persons',\n ]);\n\n //// first time run ////\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n $this->assertEquals($status, 0);\n //$this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n\n // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //// second run must failed ////\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n 'info' => 'Already run once!',\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }", "public function testActionUseCase1()\n {\n // person data\n\n // workflow data\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey()\n ]);\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n ]);\n\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type rent',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $this->leadTypeId,\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n app(WorkflowService::class)->syncActions($workflow, $action1);\n\n\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n\necho $output->fetch();\n $this->assertEquals($status, 0);\n //$this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n $this->seeInDatabase('persons',[\n 'id' => $this->person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n // TODO: check to ES action_logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }", "public function testGetValueDeref()\r\n\t{\r\n\t\t$obj = CAntObject::factory($this->dbh, \"task\", null, $this->user);\r\n\t\t$obj->setValue(\"user_id\", $this->user->id);\r\n\t\t$obj->save();\r\n\r\n\t\t$this->assertEquals($this->user->getValue(\"name\"), $obj->getValueDeref(\"user_id.name\"));\r\n\r\n\t\t// Cleanup\r\n\t\t$obj->removeHard();\r\n\t}", "function getActionIdByGroupAndAction($group, $action) {\n $sql = \"SELECT a.action_id, g.actiongroup_id\n FROM %s a\n INNER JOIN %s g\n ON a.action_group = g.actiongroup_id\n WHERE a.action_name = '%s'\n AND g.actiongroup_name = '%s'\";\n $sqlParams = array($this->tableActions, $this->tableGroups, $action, $group);\n $result = NULL;\n if ($res = $this->databaseQueryFmt($sql, $sqlParams)) {\n if ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $result = $row['action_id'];\n }\n }\n return $result;\n }", "public function test_do_action_closure( $hook ) {\n $var_name = rand_str();\n $var_value = rand_str();\n $GLOBALS['test_var'] = $var_name;\n $GLOBALS[ $var_name ] = $var_value;\n\n $this->assertSame( $var_value, $GLOBALS[ $var_name ] );\n $this->assertSame( 0, yourls_did_action( $hook ) );\n yourls_do_action( $hook );\n $this->assertSame( 1, yourls_did_action( $hook ) );\n $this->assertNotSame( $var_value, $GLOBALS[ $var_name ] );\n\n return $hook;\n\t}", "public function testStoreSupplierGroup()\n {\n }", "public function testActionUseCase3()\n {\n\n // person, user, and target\n $user = factory(UserEloquent::class)->create();\n $person = factory(PersonEloquent::class)->create([\n 'is_pre_approved' => 0,\n 'is_primary' => 0,\n ]);\n $leadTypeId = LeadTypeEloquent::where('label', 'own')->where('user_id', null)->first()->getKey();\n $stageId = StageEloquent::where('label', 'prospect')->where('user_id', null)->first()->getKey();\n $stageLeadId = StageEloquent::where('label', 'lead')->where('user_id', null)->first()->getKey();\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $stageId,\n 'lead_type_id' => $leadTypeId,\n ]);\n $tag = TagEloquent::find(10);\n $person->tags()->attach($tag->getKey(), ['user_id' => $user->getKey()]);\n\n // workflow, rule, action and object\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_pre_approved',\n 'value' => '1',\n ]);\n $action2 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'person_contexts',\n 'target_field' => 'stage_id',\n 'value' => $stageLeadId,\n ]);\n $workflow->actions()->sync([$action1->getKey(), $action2->getKey()]); //\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $tag->getKey(),\n ]);\n\n\n // // parent rule\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'not preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '0'\n ]);\n\n // dependent rule\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'is prospect person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.stage_id',\n 'value' => $stageId,\n 'parent_id' => $rule1->getKey(),\n ]);\n $action1->rules()->sync([ $rule1->getKey()]);\n $action2->rules()->sync([ $rule2->getKey()]);\n\n\n\n //// first time run ////\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action2->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n //// check should failed /////\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action2->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => $person->getLoggableType(), //$leadContext->getLoggableType(),\n 'object_id' => $person->getKey(), //$leadContext->getKey(),\n 'info' => 'Dependent rule(s) not meet!',\n ]);\n $this->notSeeInDatabase('person_contexts',[\n 'id' => $leadContext->getKey(),\n $action2->target_field => $action2->value,\n ]);\n\n //// second run, run action 1 first /////\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n $this->assertEquals($status, 0);\n //echo $output->fetch();\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(),\n 'object_id' => $person->getKey(),\n ]);\n // check updated by status\n $this->seeInDatabase('persons',[\n 'id' => $person->getKey(),\n $action1->target_field => $action1->value,\n ]);\n\n //// second run, run action 2 then ///\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action2->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action2->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), //$leadContext->getLoggableType(),\n 'object_id' => $person->getKey(), //$leadContext->getKey(),\n ]);\n // check updated by status\n $this->seeInDatabase('person_contexts',[\n 'id' => $leadContext->getKey(),\n $action2->target_field => $action2->value,\n ]);\n\n $this->cleanUpRecords(new PersonObserver, $person);\n }", "public function test_do_action_funcname( $hook ) {\n $var_name = rand_str();\n $var_value = rand_str();\n $GLOBALS['test_var'] = $var_name;\n $GLOBALS[ $var_name ] = $var_value;\n\n $this->assertSame( $var_value, $GLOBALS[ $var_name ] );\n $this->assertSame( 0, yourls_did_action( $hook ) );\n yourls_do_action( $hook );\n $this->assertSame( 1, yourls_did_action( $hook ) );\n $this->assertNotSame( $var_value, $GLOBALS[ $var_name ] );\n\n return $hook;\n\t}", "function save($data, $group_id = false, $permission_data = null, $permission_action_data = null)\n {\n $success = false;\n\n if (!$group_id) {\n if ($this->db->insert('groups', $data)) {\n\n $data['group_id'] = $this->db->insert_id();\n\n // We have either inserted or updated a new employee, now lets set permissions.\n if ($data['group_id'] && !empty($permission_data) && !empty($permission_action_data)) {\n\n // Run these queries as a transaction, we want to make sure we do all or nothing\n $this->db->trans_start();\n\n // First lets clear out any permissions the employee currently has.\n $success = $this->db->delete('group_permissions', array('group_id' => $data['group_id']));\n\n // Now insert the new permissions\n if ($success) {\n foreach ($permission_data as $allowed_module) {\n $this->db->insert('group_permissions', array('module_id' => $allowed_module, 'group_id' => $data['group_id']));\n }\n }\n\n // First lets clear out any permissions actions the employee currently has.\n $success = $this->db->delete('group_permissions_actions', array('group_id' => $data['group_id']));\n\n // Now insert the new permissions actions\n if ($success) {\n foreach ($permission_action_data as $permission_action) {\n list($module, $action) = explode('|', $permission_action);\n\t\t\t\t\t\t\t// if($action == 'view_scope_all' || $action == 'view_scope_owner' || $action == 'view_scope_location')\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\t// $this->db->insert('group_permissions_actions', array('module_id' => 'all', 'action_id' => $action, 'group_id' => $data['group_id']));\n\t\t\t\t\t\t\t// }\n $this->db->insert('group_permissions_actions', array('module_id' => $module, 'action_id' => $action, 'group_id' => $data['group_id']));\n }\n }\n\n $this->db->trans_complete();\n }\n\n return $data['group_id'];\n }\n return $success;\n }\n\n /* Update Group */\n $this->db->where('group_id', $group_id);\n $success = $this->db->update('groups', $data);\n\n if ($success && !empty($permission_data) && !empty($permission_action_data)) {\n\n // Run these queries as a transaction, we want to make sure we do all or nothing\n $this->db->trans_start();\n\n // First lets clear out any permissions the employee currently has.\n $success = $this->db->delete('group_permissions', array('group_id' => $group_id));\n\n // Now insert the new permissions\n if ($success) {\n foreach ($permission_data as $allowed_module) {\n $this->db->insert('group_permissions', array('module_id' => $allowed_module, 'group_id' => $group_id));\n }\n }\n\n // First lets clear out any permissions actions the employee currently has.\n $success = $this->db->delete('group_permissions_actions', array('group_id' => $group_id));\n\n // Now insert the new permissions actions\n if ($success) {\n foreach ($permission_action_data as $permission_action) {\n list($module, $action) = explode('|', $permission_action);\n\t\t\t\t\t\t\t\t\t\t// if($action == 'view_scope_all' || $action == 'view_scope_owner' || $action == 'view_scope_location')\n\t\t\t\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\t\t\t\t// \t$this->db->insert('group_permissions_actions', array('module_id' => 'all', 'action_id' => $action, 'group_id' => $group_id));\n\t\t\t\t\t\t\t\t\t\t// }\n $this->db->insert('group_permissions_actions', array('module_id' => $module, 'action_id' => $action, 'group_id' => $group_id));\n }\n }\n\n $this->db->trans_complete();\n }\n\n return $success;\n }", "public function testDeleteSupplierGroup()\n {\n }", "public function hasAssignment(ElementableDependencyDataProvider $data_provider): bool;", "public function getByReference(): bool;", "public function populateAsReference()\n {\n\n $orm = $this->db->getOrm();\n\n // Reference Container zum befüllen der Referenz Datensätze\n $refContainers = array();\n\n // Sicher stelle, das keine unerwarteten Daten in der Tabelle sind\n $orm->cleanResource('WbfsysRoleGroup');\n\n // Leeren des Caches\n $orm->clearCache();\n\n // global\n $orm->import\n (\n 'WbfsysRoleGroup',\n array\n (\n array\n (\n 'name' => 'name_1',\n 'access_key' => 'access_key_1',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipisici elit,\nsed eiusmod tempor incidunt ut labore et dolore magna aliqua.\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut\naliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit\nesse cillum dolore eu fugiat nulla pariatur.\nExcepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt\nmollit anim id est laborum.'\n ),\n )\n );\n\n }", "public function testMergeActions() {\n $contact = $this->contact('testAnyone');\n $action = new Actions;\n $action->actionDescription = \"TEST\";\n $action->visibility = 1;\n $action->associationType = \"contacts\";\n $action->associationId = $contact->id;\n $action->save();\n\n $model = new Contacts;\n foreach ($contact->attributes as $key => $val) {\n if ($key != 'id' && $key != 'nameId') {\n $model->$key = $val;\n }\n }\n $model->save();\n\n $this->assertEquals(0,\n Yii::app()->db->createCommand()->select('COUNT(*)')\n ->from('x2_actions')\n ->where(\n 'associationType = \"contacts\" AND associationId = :id',\n array(':id' => $model->id))\n ->queryScalar());\n $this->assertEquals(1,\n Yii::app()->db->createCommand()->select('COUNT(*)')\n ->from('x2_actions')\n ->where(\n 'associationType = \"contacts\" AND associationId = :id',\n array(':id' => $contact->id))\n ->queryScalar());\n\n $mergeData = $model->mergeActions($contact, true);\n\n $this->assertEquals(1,\n Yii::app()->db->createCommand()->select('COUNT(*)')\n ->from('x2_actions')\n ->where(\n 'associationType = \"contacts\" AND associationId = :id',\n array(':id' => $model->id))\n ->queryScalar());\n $this->assertEquals(0,\n Yii::app()->db->createCommand()->select('COUNT(*)')\n ->from('x2_actions')\n ->where(\n 'associationType = \"contacts\" AND associationId = :id',\n array(':id' => $contact->id))\n ->queryScalar());\n\n $model->unmergeActions($contact->id, $mergeData);\n\n $this->assertEquals(1,\n Yii::app()->db->createCommand()->select('COUNT(*)')\n ->from('x2_actions')\n ->where(\n 'associationType = \"contacts\" AND associationId = :id',\n array(':id' => $contact->id))\n ->queryScalar());\n $this->assertEquals(0,\n Yii::app()->db->createCommand()->select('COUNT(*)')\n ->from('x2_actions')\n ->where(\n 'associationType = \"contacts\" AND associationId = :id',\n array(':id' => $model->id))\n ->queryScalar());\n }", "public function testChangingReferenceName(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->setAlias('FavoritePost');\n $table->addBehavior(\n 'Translate',\n ['fields' => ['body'], 'referenceName' => 'Posts']\n );\n\n $items = $table->associations();\n $association = $items->getByProperty('body_translation');\n $this->assertNotEmpty($association, 'Translation association not found');\n\n $found = false;\n foreach ($association->getConditions() as $key => $value) {\n if (strpos($key, 'body_translation.model') !== false) {\n $found = true;\n $this->assertSame('Posts', $value);\n break;\n }\n }\n\n $this->assertTrue($found, '`referenceName` field condition on a Translation association was not found');\n }", "public function testReference()\n {\n if (is_null($this->ref)) {\n return;\n }\n\n $this->assertArrayHasKey(\n 'extensions',\n $this->ref,\n \"No extension in Reference\"\n );\n\n $this->assertArrayHasKey(\n 'functions',\n $this->ref,\n \"No function in Reference\"\n );\n\n $this->assertArrayHasKey(\n 'constants',\n $this->ref,\n \"No constant in Reference\"\n );\n\n $this->assertArrayHasKey(\n 'classes',\n $this->ref,\n \"No classe in Reference\"\n );\n\n $this->assertArrayHasKey(\n 'interfaces',\n $this->ref,\n \"No interface in Reference\"\n );\n }", "function update( string $_group_key, IIndexedEntity $_entity ): bool;", "public function testCustomSave() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\r\n\t\t$dbh->Query(\"insert into customer_labels(name) values('Test r1');\");\r\n\t\t$dbh->Query(\"insert into customer_labels(name) values('Test r2');\");\r\n\r\n\t\t$result = $dbh->Query(\"select id from customer_labels limit 2\");\r\n\t\t$g1 = $dbh->GetValue($result, 0, \"id\");\r\n\t\t$g2 = $dbh->GetValue($result, 1, \"id\");\r\n\r\n\t\t// Test mValue\r\n\t\t$obj = new CAntObject($dbh, \"customer\", null, $this->user);\r\n\t\t$obj->setValue(\"name\", \"my test\");\r\n\t\t$obj->setMValue(\"groups\", $g1);\r\n\t\t$obj->setMValue(\"groups\", $g2);\r\n\t\t$cid = $obj->save(false);\r\n\t\tunset($obj);\r\n\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $this->user);\r\n\t\t$obj->removeMValue(\"groups\", $g2);\r\n\t\t$cid = $obj->save(false);\r\n\t\tunset($obj);\r\n\r\n\t\t// Make sure mvalues reload and that we are not using too many queries to load the object\r\n\t\t// TODO: work on the dacl to only allow one query when loading an object\r\n\t\t$statBefore = $dbh->statNumQueries;\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $this->user);\r\n\t\t$obj->setValue(\"name\", \"Test Assoc\");\r\n\t\t$this->assertFalse($obj->getMValueExists(\"groups\", $g2));\r\n\t\t$this->assertTrue($obj->getMValueExists(\"groups\", $g1));\r\n\t\t$this->assertTrue(($dbh->statNumQueries-$statBefore)<=2); // Loading an object should never take more than 2 queries\r\n\t\t//echo \"<pre>Num Queries: \".($dbh->statNumQueries-$statBefore).\"</pre>\";\r\n\r\n\t\t// Test object_multi\r\n\t\t$cont = new CAntObject($dbh, \"contact_personal\", null, $this->user);\r\n\t\t$cont->setValue(\"first_name\", \"Test Personal Contact\");\r\n\t\t$contactId = $cont->save();\r\n\t\t$this->assertTrue($contactId > 0);\r\n\t\t$obj->debug = true;\r\n\t\t$obj->setMValue(\"associations\", \"contact_personal:$contactId\");\r\n\t\t$cid = $obj->save(false);\r\n\t\tunset($obj);\r\n\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid);\r\n\t\t$this->assertTrue($obj->getMValueExists(\"associations\", \"contact_personal:$contactId\")!=false);\r\n \r\n // Test remove the mvalue\r\n $obj->removeMValue(\"associations\", \"contact_personal:$contactId\");\r\n $obj->save(false);\r\n unset($obj);\r\n \r\n $obj = new CAntObject($dbh, \"customer\", $cid);\r\n $this->assertFalse($obj->getMValueExists(\"associations\", \"contact_personal:$contactId\")==false);\r\n unset($obj);\r\n \r\n // Test remove all mvalues\r\n $obj = new CAntObject($dbh, \"customer\", $cid);\r\n $obj->setMValue(\"associations\", \"contact_personal:$contactId\");\r\n $obj->save(false);\r\n unset($obj);\r\n \r\n $obj = new CAntObject($dbh, \"customer\", $cid);\r\n $this->assertTrue($obj->getMValueExists(\"associations\", \"contact_personal:$contactId\")!=false); // Make sure the mvalue was set\r\n $obj->removeMValues(\"associations\"); // now remove the mvalues\r\n $obj->save(false);\r\n unset($obj);\r\n \r\n $obj = new CAntObject($dbh, \"customer\", $cid);\r\n $this->assertFalse($obj->getMValueExists(\"associations\", \"contact_personal:$contactId\")==false);\r\n\r\n\t\t// Test object (with no type)\r\n\t\t$com = new CAntObject($dbh, \"comment\", null);\r\n\t\t$com->setValue(\"obj_reference\", \"contact_personal:$cid\");\r\n\t\t$comid = $com->save(false);\r\n\t\tunset($com);\r\n\t\t$com = new CAntObject($dbh, \"comment\", $comid);\r\n\t\t$this->assertEquals($com->getValue(\"obj_reference\"), \"contact_personal:$cid\");\r\n\t\t$com->removeHard();\r\n\t\t\r\n\t\t// Cleanup\r\n\t\t$cont->removeHard();\r\n\t\t$obj->removeHard();\r\n\r\n\t\t$dbh->Query(\"delete from customer_labels where name='Test r1';\");\r\n\t\t$dbh->Query(\"delete from customer_labels where name='Test r2';\");\r\n\t}", "public function call($data, $action)\n {\n }" ]
[ "0.55856687", "0.5303218", "0.5226912", "0.5214344", "0.5114084", "0.510651", "0.50734234", "0.50573486", "0.49922308", "0.49728733", "0.49337897", "0.4901503", "0.4877171", "0.48696864", "0.48554236", "0.48498982", "0.48407695", "0.482481", "0.47914854", "0.4770309", "0.46481895", "0.46301314", "0.4607268", "0.46048322", "0.46020687", "0.4582351", "0.4560912", "0.45591438", "0.45417604", "0.45084423" ]
0.56405944
0
Tests an action group with mismatching args.
public function testExceptionOnMissingActions() { $actionGroupUnderTest = (new ActionGroupObjectBuilder()) ->withArguments([new ArgumentObject('arg1', null, 'entity')]) ->build(); $this->expectException(TestReferenceException::class); $this->expectExceptionMessageRegExp('/Arguments missed .* for actionGroup/'); $actionGroupUnderTest->getSteps(['arg2' => 'data1'], self::ACTION_GROUP_MERGE_KEY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExceptionOnMissingArguments()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $this->expectException(TestReferenceException::class);\n $this->expectExceptionMessageRegExp('/Arguments missed .* for actionGroup/');\n $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n }", "public function testIndexGroupActionBadConditionsPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => GROUP_ACTION_LOG_DELETE,\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t'BAD_CONDITIONS'\n\t\t\t\t]\n\t\t\t],\n\t\t\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$result = $this->testAction('/admin/logs/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}", "public function testGetStepsWithNoArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data1\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field1' => 'testValue'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{data1.field1}}'])])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue']);\n }", "public function test_do_action_no_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => '',)\" );\n yourls_do_action( $hook );\n }", "public function testIndexBadGroupActionPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => 'BAD_ACTION',\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'Log' => [\n\t\t\t\t\t\t\t'id' => '1'\n\t\t\t\t\t\t]\n\t\t\t\t\t]\n\t\t\t\t]\n\t\t\t],\n\t\t\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$this->testAction('/admin/logs/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}", "public function testIndexBadGroupActionPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => 'BAD_ACTION',\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'Deferred' => [\n\t\t\t\t\t\t\t'id' => '2'\n\t\t\t\t\t\t]\n\t\t\t\t\t]\n\t\t\t\t]\n\t\t\t],\n\t\t\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$this->testAction('/admin/deferred/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Processing of selected tasks put in queue...') . '|' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}", "public function testIndexGroupActionBadConditionsPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => GROUP_ACTION_DEFERRED_SAVE_REJECT,\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t'BAD_CONDITIONS'\n\t\t\t\t]\n\t\t\t],\n\t\t\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$result = $this->testAction('/admin/deferred/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Processing of selected tasks put in queue...') . '|' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}", "public function testStepKeyReplacementFilteredOut()\n {\n $clickStepKey = \"clickStepKey\";\n $fillFieldStepKey = \"fillFieldStepKey\";\n $clickAction = \"click\";\n $fillFieldAction =\"fillField\";\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([\n new ActionObject($clickStepKey, $clickAction, ['selector' => 'value']),\n new ActionObject($fillFieldStepKey, $fillFieldAction, ['selector' => 'value'])\n ])\n ->build();\n\n $result = $actionGroupUnderTest->extractStepKeys();\n\n $this->assertNotContains($clickStepKey, $result);\n $this->assertNotContains($fillFieldStepKey, $result);\n $this->assertCount(0, $result);\n }", "private function validate_input( $assoc_args, $grouping ) {\n\t\t// Check if valid arguments were passed.\n\t\t$arg_match = preg_grep( '/^set-(\\w+)/i', array_keys( $assoc_args ) );\n\n\t\t// Verify passed-arguments.\n\t\tif ( empty( $grouping ) && empty( $arg_match ) ) {\n\t\t\tWP_CLI::error( 'No valid arguments passed.' );\n\t\t}\n\n\t\t// Check whether passed arguments contain value or not.\n\t\t$assoc_arg_values = array_filter( array_intersect_key( $assoc_args, array_flip( $arg_match ) ) );\n\n\t\tif ( empty( $grouping ) && empty( $assoc_arg_values ) ) {\n\t\t\tWP_CLI::error( 'No value passed to arguments.' );\n\t\t}\n\t}", "public function testGetStepsWithNoFieldArg()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n }", "#[@test]\n public function doesMatch_should_return_false_if_args_are_unequal() {\n $this->sut->setArguments(array('1', 2, 3.0, '4'));\n\n $this->assertFalse($this->sut->doesMatchArgs(array('x', 2, 3.0, '4')));\n }", "function failUnlessExtensionArgs($expected_args)\n {\n $expected_args['mode'] = $this->msg->mode;\n $this->assertEquals($expected_args, $this->msg->getExtensionArgs());\n }", "private function _hasAllArguments()\n {\n $errors = [];\n foreach ($this->action->args as $key => $val) {\n if (!isset($this->args[$key])) {\n $errors[] = $key;\n }\n }\n\n return $errors;\n }", "public function assertNotAction($action, $message = '') {\r\n\t\t$this->_incrementAssertionCount();\r\n\t\t$selectedAction = $this->_serviceManager->getState()->getRoute()->getAction();\n\t\tif ($action == $selectedAction) {\r\n\t\t\t$msg = sprintf('Failed asserting last action used <\"%s\"> was NOT \"%s\"', $selectedAction, $action);\r\n\t\t\tif (!empty($message)) {\r\n\t\t\t\t$msg = $message . \"\\n\" . $msg;\r\n\t\t\t}\r\n\t\t\t$this->fail($msg);\r\n\t\t}\r\n\t}", "public function testGetNameFail() {\r\n $this->_action->getName();\r\n }", "public function testDispatchAction() {\n\t\ttry {\n\t\t\t$this->object->dispatchAction(null); // wrong action name\n\t\t\t$this->object->dispatchAction('noAction'); // wrong action name\n\t\t\t$this->object->dispatchAction('_actionPseudoPrivate'); // underscored private action\n\t\t\t$this->object->dispatchAction('actionProtected'); // protected action\n\t\t\t$this->object->dispatchAction('actionPrivate'); // private action\n\t\t\t$this->object->dispatchAction('dispatchAction'); // method from parent\n\t\t\t$this->assertTrue(false);\n\n\t\t} catch (\\Exception $e) {\n\t\t\t$this->assertTrue(true);\n\t\t}\n\n\t\t$this->assertEquals('actionNoArgs', $this->object->dispatchAction('actionNoArgs'));\n\t\t$this->assertEquals('actionNoArgs', $this->object->dispatchAction('actionNoArgs', ['foo', 'bar']));\n\t\t$this->assertEquals(125, $this->object->dispatchAction('actionWithArgs'));\n\t\t$this->assertEquals(555, $this->object->dispatchAction('actionWithArgs', [505, 50]));\n\t\t$this->assertEquals(335, $this->object->dispatchAction('actionWithArgs', [335]));\n\t\t$this->assertEquals(0, $this->object->dispatchAction('actionWithArgs', ['foo', 'bar']));\n\t}", "public function testGetStepsWithCustomArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // entity.field as argument\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // String Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'override'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'override']);\n }", "public function testDispatchOmittedArgs()\n {\n $response = $this->uut->dispatch($this->buildRequest('/omitted-args/foo'));\n\n $this->assertInstanceOf(Response::class, $response);\n $this->assertEquals('foo-bar', $response->getContent());\n }", "public function testManageUsersThrowsExceptionForInvalidOp()\n {\n $refMethod = \\Codeception\\Module\\UnitHelper::getNonPublicMethod(\n '\\Codeception\\Module\\DrupalUserRegistry',\n \"manageTestUsers\"\n );\n $this->setExpectedException(\n '\\Codeception\\Exception\\Module',\n \"Invalid operation not-an-op when managing users.\"\n );\n $refMethod->invokeArgs($this->module, array(\"not-an-op\"));\n }", "public function testMergeActionsException()\n {\n $testActionMergeUtil = new ActionMergeUtil(null, null);\n\n $actionObject = new ActionObject('fakeAction', 'comment', [\n 'userInput' => '{{someEntity.entity}}'\n ]);\n\n $this->expectExceptionMessage(\"Could not resolve entity reference \\\"{{someEntity.entity}}\\\" \" .\n \"in Action with stepKey \\\"fakeAction\\\".\\n\" .\n \"Exception occurred parsing action at StepKey \\\"fakeAction\\\"\");\n\n $testActionMergeUtil->resolveActionSteps([\"merge123\" => $actionObject]);\n }", "public function requireAction()\n {\n $args = func_get_args();\n foreach ($args as $arg)\n {\n // Check if action is set and exists\n if ($_POST['action'] == $arg || $_GET['action'] == $arg)\n {\n // quit here\n return;\n }\n }\n\n $this->sendJsonResponse(false, 'Invalid Action!');\n die;\n }", "public function testAddGroupPermissionFailsIfLackingPermissions(): void\n {\n $this->expectException(\\Exception::class);\n $this->slimStub->shouldReceive('halt')->times(1)->with(403, '{\"status\":403,\"message\":\"Access Denied\",\"title\":\"You do not have the permission: manage_groups\"}')->andThrow(new \\Exception);\n\n $this->userController->_add_group_permission();\n }", "public function testAddGroupFailsIfLackingPermissions(): void\n {\n $this->expectException(\\Exception::class);\n $this->slimStub->shouldReceive('halt')->times(1)->with(403, '{\"status\":403,\"message\":\"Access Denied\",\"title\":\"You do not have the permission: manage_groups\"}')->andThrow(new \\Exception);\n\n $this->userController->_add_group();\n }", "public function isAction()\n {\n $args = func_get_args();\n foreach ($args as $arg)\n {\n // Check if action is set and exists\n if ($_POST['action'] == $arg || $_GET['action'] == $arg)\n {\n // quit here\n return true;\n }\n }\n\n return false;\n }", "public function isButtonValidBrokenSetupMultiplePrimaryActionsGivenExpectFalse() {}", "public function testManageUsersThrowsExceptionForEmptyOp()\n {\n $refMethod = \\Codeception\\Module\\UnitHelper::getNonPublicMethod(\n '\\Codeception\\Module\\DrupalUserRegistry',\n \"manageTestUsers\"\n );\n $this->setExpectedException(\n '\\Codeception\\Exception\\Module',\n \"Invalid operation when managing users.\"\n );\n $refMethod->invokeArgs($this->module, array(\"\"));\n }", "public function testGetStepsWithPersistedArgs()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data3$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n\n // Simple Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$data3.field2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n }", "public function testUpdateGroupFailsIfLackingPermissions(): void\n {\n $this->expectException(\\Exception::class);\n $this->slimStub->shouldReceive('halt')->times(1)->with(403, '{\"status\":403,\"message\":\"Access Denied\",\"title\":\"You do not have the permission: manage_groups\"}')->andThrow(new \\Exception);\n\n $this->userController->_update_group();\n }", "public function testRemoveGroupPermissionFailsIfLackingPermissions(): void\n {\n $this->expectException(\\Exception::class);\n $this->slimStub->shouldReceive('halt')->times(1)->with(403, '{\"status\":403,\"message\":\"Access Denied\",\"title\":\"You do not have the permission: manage_groups\"}')->andThrow(new \\Exception);\n\n $this->userController->_remove_group_permission();\n }", "private function verify_action_params( $subscription ){\n if( empty( $subscription->id ) )\n return false;\n\n $plan = pms_get_subscription_plan( $subscription->subscription_plan_id );\n\n if( $plan->type != 'group' )\n return false;\n\n return true;\n }" ]
[ "0.6711915", "0.5943424", "0.5873942", "0.58558935", "0.58453363", "0.56876296", "0.56719136", "0.56472015", "0.5643773", "0.5631943", "0.55989444", "0.5559942", "0.5527703", "0.5479974", "0.5437495", "0.5410346", "0.5408815", "0.5405819", "0.54036486", "0.53920025", "0.537265", "0.5343249", "0.5336191", "0.53361213", "0.53322333", "0.5308536", "0.5298363", "0.5294572", "0.5291666", "0.5252779" ]
0.7050148
0
Tests an action group with missing args.
public function testExceptionOnMissingArguments() { $actionGroupUnderTest = (new ActionGroupObjectBuilder()) ->withArguments([new ArgumentObject('arg1', null, 'entity')]) ->build(); $this->expectException(TestReferenceException::class); $this->expectExceptionMessageRegExp('/Arguments missed .* for actionGroup/'); $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExceptionOnMissingActions()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $this->expectException(TestReferenceException::class);\n $this->expectExceptionMessageRegExp('/Arguments missed .* for actionGroup/');\n $actionGroupUnderTest->getSteps(['arg2' => 'data1'], self::ACTION_GROUP_MERGE_KEY);\n }", "public function testGetStepsWithNoArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data1\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field1' => 'testValue'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{data1.field1}}'])])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue']);\n }", "public function test_do_action_no_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => '',)\" );\n yourls_do_action( $hook );\n }", "public function testGetStepsWithNoFieldArg()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n }", "public function testDispatchOmittedArgs()\n {\n $response = $this->uut->dispatch($this->buildRequest('/omitted-args/foo'));\n\n $this->assertInstanceOf(Response::class, $response);\n $this->assertEquals('foo-bar', $response->getContent());\n }", "public function requireAction()\n {\n $args = func_get_args();\n foreach ($args as $arg)\n {\n // Check if action is set and exists\n if ($_POST['action'] == $arg || $_GET['action'] == $arg)\n {\n // quit here\n return;\n }\n }\n\n $this->sendJsonResponse(false, 'Invalid Action!');\n die;\n }", "public function testDispatchAction() {\n\t\ttry {\n\t\t\t$this->object->dispatchAction(null); // wrong action name\n\t\t\t$this->object->dispatchAction('noAction'); // wrong action name\n\t\t\t$this->object->dispatchAction('_actionPseudoPrivate'); // underscored private action\n\t\t\t$this->object->dispatchAction('actionProtected'); // protected action\n\t\t\t$this->object->dispatchAction('actionPrivate'); // private action\n\t\t\t$this->object->dispatchAction('dispatchAction'); // method from parent\n\t\t\t$this->assertTrue(false);\n\n\t\t} catch (\\Exception $e) {\n\t\t\t$this->assertTrue(true);\n\t\t}\n\n\t\t$this->assertEquals('actionNoArgs', $this->object->dispatchAction('actionNoArgs'));\n\t\t$this->assertEquals('actionNoArgs', $this->object->dispatchAction('actionNoArgs', ['foo', 'bar']));\n\t\t$this->assertEquals(125, $this->object->dispatchAction('actionWithArgs'));\n\t\t$this->assertEquals(555, $this->object->dispatchAction('actionWithArgs', [505, 50]));\n\t\t$this->assertEquals(335, $this->object->dispatchAction('actionWithArgs', [335]));\n\t\t$this->assertEquals(0, $this->object->dispatchAction('actionWithArgs', ['foo', 'bar']));\n\t}", "public function testGetStepsWithDefaultCase()\n {\n $entity = (new EntityDataObjectBuilder())\n ->withDataFields(['field1' => 'testValue'])\n ->build();\n $this->setEntityObjectHandlerReturn($entity);\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())->build();\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'literal']);\n }", "public function testStepKeyReplacementFilteredOut()\n {\n $clickStepKey = \"clickStepKey\";\n $fillFieldStepKey = \"fillFieldStepKey\";\n $clickAction = \"click\";\n $fillFieldAction =\"fillField\";\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([\n new ActionObject($clickStepKey, $clickAction, ['selector' => 'value']),\n new ActionObject($fillFieldStepKey, $fillFieldAction, ['selector' => 'value'])\n ])\n ->build();\n\n $result = $actionGroupUnderTest->extractStepKeys();\n\n $this->assertNotContains($clickStepKey, $result);\n $this->assertNotContains($fillFieldStepKey, $result);\n $this->assertCount(0, $result);\n }", "public function testManageUsersThrowsExceptionForEmptyOp()\n {\n $refMethod = \\Codeception\\Module\\UnitHelper::getNonPublicMethod(\n '\\Codeception\\Module\\DrupalUserRegistry',\n \"manageTestUsers\"\n );\n $this->setExpectedException(\n '\\Codeception\\Exception\\Module',\n \"Invalid operation when managing users.\"\n );\n $refMethod->invokeArgs($this->module, array(\"\"));\n }", "private function _hasAllArguments()\n {\n $errors = [];\n foreach ($this->action->args as $key => $val) {\n if (!isset($this->args[$key])) {\n $errors[] = $key;\n }\n }\n\n return $errors;\n }", "public function isAction()\n {\n $args = func_get_args();\n foreach ($args as $arg)\n {\n // Check if action is set and exists\n if ($_POST['action'] == $arg || $_GET['action'] == $arg)\n {\n // quit here\n return true;\n }\n }\n\n return false;\n }", "public function testGetStepsWithPersistedArgs()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data3$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n\n // Simple Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$data3.field2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n }", "public function testGetSetGroup()\n {\n $action = new CallbackAction('callback', function () { });\n\n $group = new Group('test');\n $action->setGroup($group);\n\n $this->assertSame($group, $action->getGroup());\n }", "private function validate_input( $assoc_args, $grouping ) {\n\t\t// Check if valid arguments were passed.\n\t\t$arg_match = preg_grep( '/^set-(\\w+)/i', array_keys( $assoc_args ) );\n\n\t\t// Verify passed-arguments.\n\t\tif ( empty( $grouping ) && empty( $arg_match ) ) {\n\t\t\tWP_CLI::error( 'No valid arguments passed.' );\n\t\t}\n\n\t\t// Check whether passed arguments contain value or not.\n\t\t$assoc_arg_values = array_filter( array_intersect_key( $assoc_args, array_flip( $arg_match ) ) );\n\n\t\tif ( empty( $grouping ) && empty( $assoc_arg_values ) ) {\n\t\t\tWP_CLI::error( 'No value passed to arguments.' );\n\t\t}\n\t}", "public function testIndexGroupActionBadConditionsPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => GROUP_ACTION_LOG_DELETE,\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t'BAD_CONDITIONS'\n\t\t\t\t]\n\t\t\t],\n\t\t\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$result = $this->testAction('/admin/logs/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}", "public function testGetStepsWithCustomArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // entity.field as argument\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // String Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'override'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'override']);\n }", "public function test_has_action_return_values() {\n $hook = rand_str();\n\n yourls_add_action( $hook, 'some_function' );\n yourls_add_action( $hook, 'some_other_function', 1337 );\n\n $this->assertTrue( yourls_has_action( $hook ) );\n $this->assertSame( 10, yourls_has_action( $hook, 'some_function' ) );\n $this->assertSame( 1337, yourls_has_action( $hook, 'some_other_function' ) );\n $this->assertFalse( yourls_has_action( $hook, 'nope_not_this_function' ) );\n }", "public function testGetNameFail() {\r\n $this->_action->getName();\r\n }", "public function testIsActionName(): void\n {\n foreach (['delete', 'edit', 'index', 'view'] as $action) {\n $this->assertFalse($this->Request->is($action));\n }\n\n $this->assertTrue($this->Request->is('add'));\n $this->assertTrue($this->Request->is(['add', 'edit']));\n $this->assertFalse($this->Request->is(['delete', 'edit']));\n }", "public function testGetOrderAction(): void\n {\n $this->assertTrue(method_exists($this->stack, 'getOrderAction'));\n }", "public function testIndexBadGroupActionPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => 'BAD_ACTION',\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'Log' => [\n\t\t\t\t\t\t\t'id' => '1'\n\t\t\t\t\t\t]\n\t\t\t\t\t]\n\t\t\t\t]\n\t\t\t],\n\t\t\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$this->testAction('/admin/logs/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}", "public function test_get_actions() {\n $hook = rand_str();\n\n yourls_add_action( $hook, 'some_function' );\n yourls_add_action( $hook, 'some_other_function', 1337 );\n\n $actions = yourls_get_actions( $hook );\n $this->assertTrue(isset($actions[10]['some_function']));\n $this->assertTrue(isset($actions[1337]['some_other_function']));\n\n $this->assertSame( [], yourls_get_actions( rand_str() ) );\n }", "public function testIndexBadGroupActionPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => 'BAD_ACTION',\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'Deferred' => [\n\t\t\t\t\t\t\t'id' => '2'\n\t\t\t\t\t\t]\n\t\t\t\t\t]\n\t\t\t\t]\n\t\t\t],\n\t\t\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$this->testAction('/admin/deferred/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Processing of selected tasks put in queue...') . '|' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}", "public function test_add_several_actions_default_priority() {\n $hook = rand_str();\n\n $times = mt_rand( 5, 15 );\n for ( $i = 1; $i <= $times; $i++ ) {\n yourls_add_action( $hook, rand_str() );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n global $yourls_filters;\n $this->assertSame( $times, count( $yourls_filters[ $hook ][10] ) );\n }", "public function hasPermission($action = \"\");", "function test_init_action_is_run() {\n\t}", "public function test_admin_delete_all_user_actions_with_not_existent_user_id() {\n\n // Generate allowed actions\n factory(\\App\\UserAction::class, 3)->create(['user_id' => $this->user->id]);\n\n // Generate info actions\n factory(\\App\\UserAction::class, 'info', 4)->create(['user_id' => $this->user->id]);\n\n $this->actingAs($this->admin)\n ->post('/admin-center/users-manager/user/' . rand(1000, 9999) . '/delete-actions/all')\n ->seeJson([\n 'success' => false,\n 'message' => trans('users_manager.user_not_found')\n ]);\n }", "public function testGetGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function test_init_action_added() {\n\t\t$this->assertSame( 10, has_action( 'init', 'rest_api_init' ) );\n\t}" ]
[ "0.7223563", "0.6607539", "0.6257137", "0.6115341", "0.57558686", "0.5725823", "0.56694883", "0.5650369", "0.5647196", "0.5646793", "0.5584209", "0.557697", "0.5561265", "0.5554617", "0.54801255", "0.54650414", "0.5450285", "0.54251176", "0.54036295", "0.53963804", "0.53802073", "0.53635657", "0.53484327", "0.5343135", "0.5340358", "0.5338949", "0.5308714", "0.5307515", "0.52960074", "0.5293828" ]
0.67242515
1
Tests the stepKey replacement with "stepKey + invocationKey" process filter Specific to actions that make it past a "require stepKey replacement" filter
public function testStepKeyReplacementFilteredIn() { $createStepKey = "createDataStepKey"; $updateStepKey = "updateDataStepKey"; $actionGroupUnderTest = (new ActionGroupObjectBuilder()) ->withActionObjects([ new ActionObject( $updateStepKey, ActionGroupObject::STEPKEY_REPLACEMENT_ENABLED_TYPES[6], ['selector' => 'value'] ), new ActionObject( $createStepKey, ActionGroupObject::STEPKEY_REPLACEMENT_ENABLED_TYPES[7], ['selector' => 'value'] ) ]) ->build(); $result = $actionGroupUnderTest->extractStepKeys(); $this->assertContains($updateStepKey, $result); $this->assertContains($createStepKey, $result); $this->assertCount(2, $result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testStepKeyReplacementFilteredOut()\n {\n $clickStepKey = \"clickStepKey\";\n $fillFieldStepKey = \"fillFieldStepKey\";\n $clickAction = \"click\";\n $fillFieldAction =\"fillField\";\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([\n new ActionObject($clickStepKey, $clickAction, ['selector' => 'value']),\n new ActionObject($fillFieldStepKey, $fillFieldAction, ['selector' => 'value'])\n ])\n ->build();\n\n $result = $actionGroupUnderTest->extractStepKeys();\n\n $this->assertNotContains($clickStepKey, $result);\n $this->assertNotContains($fillFieldStepKey, $result);\n $this->assertCount(0, $result);\n }", "protected function executeSpecificStep() {}", "public function testGetStepsWithNoArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data1\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field1' => 'testValue'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{data1.field1}}'])])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue']);\n }", "public function testGetStepsWithNoFieldArg()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n }", "public function testGetStepsWithCustomArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // entity.field as argument\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // String Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'override'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'override']);\n }", "public function testGetStepsWithDefaultCase()\n {\n $entity = (new EntityDataObjectBuilder())\n ->withDataFields(['field1' => 'testValue'])\n ->build();\n $this->setEntityObjectHandlerReturn($entity);\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())->build();\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'literal']);\n }", "public function testGetStepsWithPersistedArgs()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data3$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n\n // Simple Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$data3.field2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n }", "function view_key_replace_arguments($values, &$handler) {\n foreach ($values as $value) {\n if (strpos($value, '__arg:') === 0) {\n // Get the argument and make sure its actually on the view still.\n $arg_id = drupal_substr($value, drupal_strlen('__arg:'));\n if (isset($handler->view->argument[$arg_id]) && $handler->view->argument[$arg_id]->argument_validated) {\n // Argument is there and ready to go!\n $argument = clone($handler->view->argument[$arg_id]);\n $arg_value = $argument->get_value();\n // Might need to split this up.\n if (!empty($argument->options['break_phrase'])) {\n views_break_phrase($argument->get_value(), $argument);\n foreach ($argument->value as $new_val) {\n $values[$new_val] = $new_val;\n }\n }\n else {\n $new_val = $argument->get_value();\n $values[$new_val] = $new_val;\n }\n }\n // Always remove the dummy argument value.\n unset($values[$value]);\n }\n }\n\n return $values;\n }", "public function testSetGetArgumentKeyValueSeparator()\n {\n $this->ruleParse->setArgumentKeyValueDelimiter('==');\n $this->assertEquals('==', $this->ruleParse->getArgumentKeyValueDelimiter());\n }", "function walk_test_input(&$value,$key)\n{\n $value=test_input($value);\n}", "public function testFacetSourceFilterKeyOverride() {\n $facet_source = new FacetSource(['filter_key' => 'ab'], 'facets_facet_source');\n\n // Override the container with the new facet source.\n $storage = $this->createMock(EntityStorageInterface::class);\n $storage->expects($this->once())\n ->method('load')\n ->willReturn($facet_source);\n $em = $this->getMockBuilder(EntityTypeManagerInterface::class)\n ->disableOriginalConstructor()\n ->getMock();\n $em->expects($this->any())\n ->method('getStorage')\n ->willReturn($storage);\n\n $container = \\Drupal::getContainer();\n $container->set('entity_type.manager', $em);\n \\Drupal::setContainer($container);\n\n $facet = new Facet([], 'facets_facet');\n $facet->setFieldIdentifier('test');\n $facet->setFacetSourceId('facet_source__dummy');\n $facet->setUrlAlias('test');\n\n $request = new Request();\n $request->query->set('ab', []);\n\n $this->processor = new QueryString(['facet' => $facet], 'query_string', [], $request, $this->entityManager, $this->eventDispatcher, $this->urlGenerator);\n $results = $this->processor->buildUrls($facet, $this->originalResults);\n\n /** @var \\Drupal\\facets\\Result\\ResultInterface $r */\n foreach ($results as $r) {\n $this->assertInstanceOf(ResultInterface::class, $r);\n $this->assertEquals('route:test?ab%5B0%5D=test%3A' . $r->getRawValue(), $r->getUrl()->toUriString());\n }\n }", "public function testFilterByKeys()\n {\n $array = ['bar' => 'baz', 'controller' => 'Groups', 'action' => 'index'];\n $allowed = ['plugin', 'controller', 'action'];\n $expected = ['plugin' => null, 'controller' => 'Groups', 'action' => 'index'];\n\n $result = Hash::filterByKeys($array, $allowed);\n $this->assertEquals($expected, $result);\n }", "public function testGetStepsWithParameterizedArg()\n {\n // Mock Entity Object Handler\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n // mock the section object handler response\n $element = new ElementObject(\"element1\", \"textArea\", \".selector {{var1}}\", null, null, true);\n $section = new SectionObject(\"testSection\", [\"element1\" => $element]);\n // bypass the private constructor\n $sectionInstance = AspectMock::double(SectionObjectHandler::class, ['getObject' => $section])->make();\n AspectMock::double(SectionObjectHandler::class, ['getInstance' => $sectionInstance]);\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects(\n [new ActionObject('action1', 'testAction', ['selector' => '{{section1.element1(arg1.field2)}}'])]\n )\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n // XML Data\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector testValue2']);\n\n // Persisted Data\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector $data2.field2$']);\n }", "public function testProcessWeirdCase1()\n {\n $unit1 = $this->getUnit('test');\n $unit1->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit1->setReversedConnection([\n 'tid' => 'id',\n ]);\n $unit1->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'id' => 'id',\n ]);\n $unit1->setFilesystem($this->getFS(\n [\n ['Pete', 'tst1', '1'],\n false,\n ]\n ));\n $unit1->setTmpFileName('customer_tmp.csv');\n\n $unit2 = $this->getUnit('test2');\n $unit2->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit2->setReversedConnection([\n 'tid' => 'parent_id',\n ]);\n $unit2->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'parent_id' => 'id',\n ]);\n $unit2->setFilesystem($this->getFS(\n [\n ['Pete', 'tst1', '2'],\n false,\n ]\n ));\n $unit2->setTmpFileName('customer_tmp.csv');\n $unit2->setParent($unit1);\n\n $action = $this->getAction([$unit1, $unit2]);\n $action->process($this->getResultMock());\n }", "public function test_getReplenishmentProcessByFilter() {\n\n }", "public function testProcessWeirdCase2()\n {\n $unit1 = $this->getUnit('test');\n $unit1->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit1->setReversedConnection([\n 'tid' => 'id',\n ]);\n $unit1->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'id' => 'id',\n ]);\n $unit1->setFilesystem($this->getFS(\n [\n ['Pete', 'tst1', '1'],\n false,\n ]\n ));\n $unit1->setTmpFileName('customer_tmp.csv');\n\n $unit2 = $this->getUnit('test2');\n $unit2->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit2->setReversedConnection([\n 'tid' => 'parent_id',\n ]);\n $unit2->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'parent_id' => 'id',\n ]);\n $unit2->setFilesystem($this->getFS(\n [\n false\n ]\n ));\n $unit2->setTmpFileName('customer_tmp.csv');\n $unit2->setParent($unit1);\n\n $action = $this->getAction([$unit1, $unit2]);\n $action->process($this->getResultMock());\n }", "public function testActionUseCaseNotFound()\n {\n $workflow = factory(WorkflowEloquent::class)->create();\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n ]);\n $leadTypeId = LeadTypeEloquent::where('label', 'own')->where('user_id', null)->first()->getKey();\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type own',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $leadTypeId,\n ]);\n $rule3 = factory(RuleEloquent::class)->create([\n 'name' => 'imposible rule',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.id',\n 'value' => 0,\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n $workflow->actions()->sync([$action1->getKey()]);\n\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n\n $this->assertEquals($status, 0);\n $this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => null,\n 'object_id' => null,\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule3->getKey()\n ]);\n }", "public function test_filters($my_filters) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('test_filters', func_get_args()));\n }", "function erp_process_actions() {\n if ( isset( $_REQUEST['erp-action'] ) ) {\n $action = sanitize_text_field( wp_unslash( $_REQUEST['erp-action'] ) );\n\n do_action( 'erp_action_' .$action, $_REQUEST );\n }\n}", "public function test_do_action_1_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',)\" );\n yourls_do_action( $hook, 'hello' );\n }", "public function testAddAllFieldProcessesAlters($field_plugin_method, $expected_process) {\n $this->assertFieldProcess($this->fieldDiscovery, $this->migrationPluginManager, FieldDiscoveryInterface::DRUPAL_7, $field_plugin_method, $expected_process);\n }", "public function test_do_action_no_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => '',)\" );\n yourls_do_action( $hook );\n }", "public function test_do_action_2_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => 'hello',1 => 'world',)\" );\n yourls_do_action( $hook, 'hello', 'world' );\n }", "public function testGetStepsWithParameterizedSimpleArg()\n {\n // Mock Entity Object Handler\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n // mock the section object handler response\n $element = new ElementObject(\"element1\", \"textArea\", \".selector {{var1}}\", null, null, true);\n $section = new SectionObject(\"testSection\", [\"element1\" => $element]);\n // bypass the private constructor\n $sectionInstance = AspectMock::double(SectionObjectHandler::class, ['getObject' => $section])->make();\n AspectMock::double(SectionObjectHandler::class, ['getInstance' => $sectionInstance]);\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects(\n [new ActionObject('action1', 'testAction', ['selector' => '{{section1.element1(simple)}}'])]\n )\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n // String Literal\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'stringLiteral'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector stringLiteral']);\n\n // String Literal w/ data-like structure\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector data2.field2']);\n\n // Persisted Data\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$someData.field1$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector $someData.field1$']);\n }", "abstract public function doVerify(string $expected, string $payload, Key $key): bool;", "public function testFilterKeywords()\n {\n $this->visit('/properties')\n ->type('the', '#keywords')\n ->press('Update results')\n ->see('Shack in the desert')\n ->see('Victorian townhouse');\n $this->notSee('Five bedroom mill conversion');\n }", "public function testActionUseCase1()\n {\n // person data\n\n // workflow data\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey()\n ]);\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n ]);\n\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type rent',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $this->leadTypeId,\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n app(WorkflowService::class)->syncActions($workflow, $action1);\n\n\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n\necho $output->fetch();\n $this->assertEquals($status, 0);\n //$this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n $this->seeInDatabase('persons',[\n 'id' => $this->person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n // TODO: check to ES action_logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }", "function process_action($target, $action) {\n //implement if needed\n }", "public function testContinueContinues()\n {\n $tierApp = new TierApp(new Injector(), new NullCallback());\n \n $fn1 = function () {\n return false;\n };\n \n $called = false;\n \n $fn2 = function () use (&$called) {\n $called = true;\n return TierApp::PROCESS_END;\n };\n \n $tierApp->addExecutable(0, $fn1);\n $tierApp->addExecutable(1, $fn2);\n $tierApp->executeInternal();\n \n $this->assertTrue($called);\n }", "public function testFilterByKeysDefault()\n {\n $array = ['bar' => 'baz', 'controller' => 'Groups', 'action' => 'index'];\n $allowed = ['plugin', 'controller', 'action', 0];\n $expected = ['plugin' => null, 'controller' => 'Groups', 'action' => 'index', 0 => null];\n\n $result = Hash::filterByKeys($array, $allowed);\n $this->assertEquals($expected, $result);\n }" ]
[ "0.72146386", "0.5390567", "0.5371273", "0.5311302", "0.53003556", "0.5131763", "0.49525613", "0.48656347", "0.4828903", "0.47970685", "0.4785259", "0.47845724", "0.4775462", "0.47712243", "0.47585717", "0.47413877", "0.4722941", "0.47062543", "0.46786904", "0.46491084", "0.4618692", "0.46087435", "0.45885742", "0.45640033", "0.45399287", "0.45277143", "0.45235315", "0.4520761", "0.45055372", "0.44732597" ]
0.7201753
1
Tests the stepKey replacement with "stepKey + invocationKey" process filter Specific to actions that make are removed by a "require stepKey replacement" filter
public function testStepKeyReplacementFilteredOut() { $clickStepKey = "clickStepKey"; $fillFieldStepKey = "fillFieldStepKey"; $clickAction = "click"; $fillFieldAction ="fillField"; $actionGroupUnderTest = (new ActionGroupObjectBuilder()) ->withActionObjects([ new ActionObject($clickStepKey, $clickAction, ['selector' => 'value']), new ActionObject($fillFieldStepKey, $fillFieldAction, ['selector' => 'value']) ]) ->build(); $result = $actionGroupUnderTest->extractStepKeys(); $this->assertNotContains($clickStepKey, $result); $this->assertNotContains($fillFieldStepKey, $result); $this->assertCount(0, $result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testStepKeyReplacementFilteredIn()\n {\n $createStepKey = \"createDataStepKey\";\n $updateStepKey = \"updateDataStepKey\";\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([\n new ActionObject(\n $updateStepKey,\n ActionGroupObject::STEPKEY_REPLACEMENT_ENABLED_TYPES[6],\n ['selector' => 'value']\n ),\n new ActionObject(\n $createStepKey,\n ActionGroupObject::STEPKEY_REPLACEMENT_ENABLED_TYPES[7],\n ['selector' => 'value']\n )\n ])\n ->build();\n\n $result = $actionGroupUnderTest->extractStepKeys();\n\n $this->assertContains($updateStepKey, $result);\n $this->assertContains($createStepKey, $result);\n $this->assertCount(2, $result);\n }", "public function testGetStepsWithNoArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data1\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field1' => 'testValue'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{data1.field1}}'])])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue']);\n }", "public function testGetStepsWithNoFieldArg()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n }", "public function testKeyGetsRemoved()\n {\n $this->filter->value('test')->remove();\n\n $result = $this->filter->filter([\n 'test' => 'test',\n 'test2' => 'test',\n ]);\n\n $this->assertEquals(['test2' => 'test'], $result);\n }", "protected function executeSpecificStep() {}", "public function testGetStepsWithCustomArgs()\n {\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // entity.field as argument\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2.field2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'testValue2']);\n\n // String Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => 'override'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'override']);\n }", "public function testGetStepsWithDefaultCase()\n {\n $entity = (new EntityDataObjectBuilder())\n ->withDataFields(['field1' => 'testValue'])\n ->build();\n $this->setEntityObjectHandlerReturn($entity);\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())->build();\n $steps = $actionGroupUnderTest->getSteps(null, self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => 'literal']);\n }", "public function testFilterByKeys()\n {\n $array = ['bar' => 'baz', 'controller' => 'Groups', 'action' => 'index'];\n $allowed = ['plugin', 'controller', 'action'];\n $expected = ['plugin' => null, 'controller' => 'Groups', 'action' => 'index'];\n\n $result = Hash::filterByKeys($array, $allowed);\n $this->assertEquals($expected, $result);\n }", "public function test_remove_filter_funcname() {\n $hook = rand_str();\n $function = rand_str();\n\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, $function );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n $removed = yourls_remove_filter( $hook, $function );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }", "public function testGetStepsWithPersistedArgs()\n {\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{arg1.field2}}'])])\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data3$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n\n // Simple Data\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects([new ActionObject('action1', 'testAction', ['userInput' => '{{simple}}'])])\n ->withArguments([new ArgumentObject('simple', null, 'string')])\n ->build();\n\n $steps = $actionGroupUnderTest->getSteps(['simple' => '$data3.field2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['userInput' => '$data3.field2$']);\n }", "function view_key_replace_arguments($values, &$handler) {\n foreach ($values as $value) {\n if (strpos($value, '__arg:') === 0) {\n // Get the argument and make sure its actually on the view still.\n $arg_id = drupal_substr($value, drupal_strlen('__arg:'));\n if (isset($handler->view->argument[$arg_id]) && $handler->view->argument[$arg_id]->argument_validated) {\n // Argument is there and ready to go!\n $argument = clone($handler->view->argument[$arg_id]);\n $arg_value = $argument->get_value();\n // Might need to split this up.\n if (!empty($argument->options['break_phrase'])) {\n views_break_phrase($argument->get_value(), $argument);\n foreach ($argument->value as $new_val) {\n $values[$new_val] = $new_val;\n }\n }\n else {\n $new_val = $argument->get_value();\n $values[$new_val] = $new_val;\n }\n }\n // Always remove the dummy argument value.\n unset($values[$value]);\n }\n }\n\n return $values;\n }", "public function testActionUseCaseNotFound()\n {\n $workflow = factory(WorkflowEloquent::class)->create();\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n ]);\n $leadTypeId = LeadTypeEloquent::where('label', 'own')->where('user_id', null)->first()->getKey();\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type own',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $leadTypeId,\n ]);\n $rule3 = factory(RuleEloquent::class)->create([\n 'name' => 'imposible rule',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.id',\n 'value' => 0,\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n $workflow->actions()->sync([$action1->getKey()]);\n\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n\n $this->assertEquals($status, 0);\n $this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => null,\n 'object_id' => null,\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule3->getKey()\n ]);\n }", "public function test_getReplenishmentProcessByFilter() {\n\n }", "public function testProcessWeirdCase1()\n {\n $unit1 = $this->getUnit('test');\n $unit1->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit1->setReversedConnection([\n 'tid' => 'id',\n ]);\n $unit1->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'id' => 'id',\n ]);\n $unit1->setFilesystem($this->getFS(\n [\n ['Pete', 'tst1', '1'],\n false,\n ]\n ));\n $unit1->setTmpFileName('customer_tmp.csv');\n\n $unit2 = $this->getUnit('test2');\n $unit2->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit2->setReversedConnection([\n 'tid' => 'parent_id',\n ]);\n $unit2->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'parent_id' => 'id',\n ]);\n $unit2->setFilesystem($this->getFS(\n [\n ['Pete', 'tst1', '2'],\n false,\n ]\n ));\n $unit2->setTmpFileName('customer_tmp.csv');\n $unit2->setParent($unit1);\n\n $action = $this->getAction([$unit1, $unit2]);\n $action->process($this->getResultMock());\n }", "public function test_do_action_no_params() {\n $hook = rand_str();\n yourls_add_action( $hook, array( $this, 'accept_multiple_params' ) );\n\n $this->expectOutputString( \"array (0 => '',)\" );\n yourls_do_action( $hook );\n }", "function spr_section_exclude_lifecycle($event,$step) {\n// $event:\t\"plugin_lifecycle.stm_article_order\"\n// $step:\t\"installed\", \"enabled\", \"disabled\", \"deleted\"\n// TXP 4.5: reinstall/upgrade only triggers \"installed\" event (now have to manually detect whether upgrade required)\nglobal $spr_exclude_debug;\n\nif ($spr_exclude_debug) {\n\techo \"spr_section_exclude_lifecycle start\";\n}\n\n\t$result = '?';\n\tif (($step == 'enabled') or ($step = 'installed')) {\n\t\t\t$result = spr_section_exclude_install();\n\t}\n\telse if ($step == 'deleted') {\n\t\t$result = spr_section_exclude_uninstall();\n\t}\n\tif ($spr_exclude_debug){\n\t\techo \"Event=$event Step=$step Result=$result\";\n\t}\n}", "public function testAddAllFieldProcessesAlters($field_plugin_method, $expected_process) {\n $this->assertFieldProcess($this->fieldDiscovery, $this->migrationPluginManager, FieldDiscoveryInterface::DRUPAL_7, $field_plugin_method, $expected_process);\n }", "public function testProcessWeirdCase2()\n {\n $unit1 = $this->getUnit('test');\n $unit1->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit1->setReversedConnection([\n 'tid' => 'id',\n ]);\n $unit1->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'id' => 'id',\n ]);\n $unit1->setFilesystem($this->getFS(\n [\n ['Pete', 'tst1', '1'],\n false,\n ]\n ));\n $unit1->setTmpFileName('customer_tmp.csv');\n\n $unit2 = $this->getUnit('test2');\n $unit2->setReversedMapping([\n 'name' => 'map.field1',\n ]);\n $unit2->setReversedConnection([\n 'tid' => 'parent_id',\n ]);\n $unit2->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n 'parent_id' => 'id',\n ]);\n $unit2->setFilesystem($this->getFS(\n [\n false\n ]\n ));\n $unit2->setTmpFileName('customer_tmp.csv');\n $unit2->setParent($unit1);\n\n $action = $this->getAction([$unit1, $unit2]);\n $action->process($this->getResultMock());\n }", "public function testRemoveOnNotExistingKeyWithValues()\n {\n $this->filter->value('test')->remove();\n\n $result = $this->filter->filter(['test2' => 'test']);\n\n $this->assertEquals(['test2' => 'test'], $result);\n }", "function erp_process_actions() {\n if ( isset( $_REQUEST['erp-action'] ) ) {\n $action = sanitize_text_field( wp_unslash( $_REQUEST['erp-action'] ) );\n\n do_action( 'erp_action_' .$action, $_REQUEST );\n }\n}", "public function test_remove_filter_priority() {\n $hook = rand_str();\n $function = rand_str();\n // Random priority but not 10\n do {\n $priority = rand( 1,100 );\n } while ( $priority == 10 );\n\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, $function, $priority );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n $removed = yourls_remove_filter( $hook, $function );\n $this->assertFalse( $removed );\n\n $removed = yourls_remove_filter( $hook, $function, $priority );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }", "public function test_filters($my_filters) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('test_filters', func_get_args()));\n }", "function walk_test_input(&$value,$key)\n{\n $value=test_input($value);\n}", "public function test_remove_only_actions_with_given_prio() {\n $hook = rand_str();\n $priorities = array();\n\n $times = mt_rand( 10, 30 );\n for ( $i = 1; $i <= $times; $i++ ) {\n $prio = mt_rand( 1, 100 );\n $priorities[] = $prio;\n yourls_add_action( $hook, rand_str(), $prio );\n }\n $this->assertTrue( yourls_has_action( $hook ) );\n\n global $yourls_filters;\n\n // Pick a random number of randomly picked priorities (but not all of them)\n $priorities = array_unique( $priorities );\n $random_priorities = (array) array_rand( $priorities, mt_rand( 1, count( $priorities ) - 1 ) );\n\n // Count how many we're supposed to remove\n $removed = 0;\n foreach( $yourls_filters[ $hook ] as $prio => $action ) {\n if( in_array( $prio, $random_priorities ) )\n $removed += count( $yourls_filters[ $hook ][ $prio ] );\n }\n\n // Remove the randomly picked priorities\n foreach( $random_priorities as $random_priority ) {\n yourls_remove_all_actions( $hook, $random_priority );\n }\n\n $this->assertTrue( yourls_has_action( $hook ) );\n\n // Count how many are left\n $remaining = 0;\n foreach( $yourls_filters[ $hook ] as $prio => $action ) {\n $remaining += count( $yourls_filters[ $hook ][ $prio ] );\n }\n $this->assertSame( $remaining, $times - $removed );\n }", "public function testGetStepsWithParameterizedArg()\n {\n // Mock Entity Object Handler\n $this->setEntityObjectHandlerReturn(function ($entityName) {\n if ($entityName == \"data2\") {\n return (new EntityDataObjectBuilder())->withDataFields(['field2' => 'testValue2'])->build();\n }\n });\n // mock the section object handler response\n $element = new ElementObject(\"element1\", \"textArea\", \".selector {{var1}}\", null, null, true);\n $section = new SectionObject(\"testSection\", [\"element1\" => $element]);\n // bypass the private constructor\n $sectionInstance = AspectMock::double(SectionObjectHandler::class, ['getObject' => $section])->make();\n AspectMock::double(SectionObjectHandler::class, ['getInstance' => $sectionInstance]);\n\n $actionGroupUnderTest = (new ActionGroupObjectBuilder())\n ->withActionObjects(\n [new ActionObject('action1', 'testAction', ['selector' => '{{section1.element1(arg1.field2)}}'])]\n )\n ->withArguments([new ArgumentObject('arg1', null, 'entity')])\n ->build();\n\n // XML Data\n $steps = $actionGroupUnderTest->getSteps(['arg1' => 'data2'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector testValue2']);\n\n // Persisted Data\n $steps = $actionGroupUnderTest->getSteps(['arg1' => '$data2$'], self::ACTION_GROUP_MERGE_KEY);\n $this->assertOnMergeKeyAndActionValue($steps, ['selector' => '.selector $data2.field2$']);\n }", "public function testFilterByKeysDefault()\n {\n $array = ['bar' => 'baz', 'controller' => 'Groups', 'action' => 'index'];\n $allowed = ['plugin', 'controller', 'action', 0];\n $expected = ['plugin' => null, 'controller' => 'Groups', 'action' => 'index', 0 => null];\n\n $result = Hash::filterByKeys($array, $allowed);\n $this->assertEquals($expected, $result);\n }", "public function testFacetSourceFilterKeyOverride() {\n $facet_source = new FacetSource(['filter_key' => 'ab'], 'facets_facet_source');\n\n // Override the container with the new facet source.\n $storage = $this->createMock(EntityStorageInterface::class);\n $storage->expects($this->once())\n ->method('load')\n ->willReturn($facet_source);\n $em = $this->getMockBuilder(EntityTypeManagerInterface::class)\n ->disableOriginalConstructor()\n ->getMock();\n $em->expects($this->any())\n ->method('getStorage')\n ->willReturn($storage);\n\n $container = \\Drupal::getContainer();\n $container->set('entity_type.manager', $em);\n \\Drupal::setContainer($container);\n\n $facet = new Facet([], 'facets_facet');\n $facet->setFieldIdentifier('test');\n $facet->setFacetSourceId('facet_source__dummy');\n $facet->setUrlAlias('test');\n\n $request = new Request();\n $request->query->set('ab', []);\n\n $this->processor = new QueryString(['facet' => $facet], 'query_string', [], $request, $this->entityManager, $this->eventDispatcher, $this->urlGenerator);\n $results = $this->processor->buildUrls($facet, $this->originalResults);\n\n /** @var \\Drupal\\facets\\Result\\ResultInterface $r */\n foreach ($results as $r) {\n $this->assertInstanceOf(ResultInterface::class, $r);\n $this->assertEquals('route:test?ab%5B0%5D=test%3A' . $r->getRawValue(), $r->getUrl()->toUriString());\n }\n }", "public function test_form_keygenerate_tests()\n {\n Livewire::test(ConfiguratorForm::class)\n ->set(\"name\", \"Test\")\n ->set(\"stepGenerateKey\", true)\n ->call('submitForm')\n ->assertSee(file_get_contents(base_path(self::DIR_MOCK . \"generate-key.yaml\")));\n\n\n Livewire::test(ConfiguratorForm::class)\n ->set(\"name\", \"Test\")\n ->set(\"stepGenerateKey\", false)\n ->call('submitForm')\n ->assertDontSee(\"run: php artisan key:generate\");\n\n }", "function duplicateStepsForTestCase($testCase, $relation, $clientID) {\n\n global $definitions;\n\n //DEFINITIONS\n $itemTypeStepsID = getClientItemTypeID_RelatedWith_byName($definitions['steps'], $clientID);\n\n //DEFINITIONS FOR PROPERTIES\n $tcParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsTestCaseParentID'], $clientID);\n $relatedStepPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsRelatedID'], $clientID);\n $relatedRelationPropertyID = getClientPropertyID_RelatedWith_byName($definitions['stepsRoundSubjectRelationID'], $clientID);\n\n //First, duplicate the steps inside the test case and set the new relation\n //build the return array\n $returnProperties = array();\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $tcParentPropertyID, 'value' => $testCase);\n $filters[] = array('ID' => $relatedStepPropertyID, 'value' => 0);\n\n // get testcase steps\n $steps = getFilteredItemsIDs($itemTypeStepsID, $clientID, $filters, $returnProperties);\n\n foreach ($steps as $step) {\n // make a copy of the step\n $stepCopy = duplicateItem($itemTypeStepsID, $step['ID'], $clientID);\n\n // change some properties\n setPropertyValueByID($relatedStepPropertyID, $itemTypeStepsID, $stepCopy, $clientID, $step['ID'], '', $RSuserID);\n setPropertyValueByID($relatedRelationPropertyID, $itemTypeStepsID, $stepCopy, $clientID, $relation['ID'], '', $RSuserID);\n }\n}", "public function testDeleteKey()\n {\n }" ]
[ "0.71910894", "0.5436694", "0.5326946", "0.51743805", "0.5116195", "0.49828285", "0.49818963", "0.49506244", "0.48371398", "0.48229936", "0.48151606", "0.4800575", "0.47229818", "0.4705595", "0.46993807", "0.46828488", "0.46654025", "0.46615893", "0.46502796", "0.46337062", "0.46166137", "0.46018928", "0.457826", "0.4577247", "0.45474544", "0.4541196", "0.45285097", "0.4525837", "0.45245892", "0.45212746" ]
0.74772835
0
This function takes a desired return for the EntityObjectHandler mock and performs set up of the mock for the duration of a single test case.
private function setEntityObjectHandlerReturn($return) { $instance = AspectMock::double(DataObjectHandler::class, ['getObject' => $return]) ->make(); // bypass the private constructor AspectMock::double(DataObjectHandler::class, ['getInstance' => $instance]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUp()\n {\n $this->mock = m::mock('Eloquent', 'App\\User', $this->value);\n $this->object = new UserEntity($this->mock);\n }", "protected function _prepareMockObjects()\n {\n $this->requestMock = $this->getMockBuilder(\\Magento\\Framework\\App\\Request\\Http::class)\n ->disableOriginalConstructor()\n ->getMock();\n $this->objectManagerMock = $this->createMock(\\Magento\\Framework\\ObjectManagerInterface::class);\n $this->storeManagerMock = $this->getMockForAbstractClass(\\Magento\\Store\\Model\\StoreManagerInterface::class);\n $this->storeModelMock = $this->createPartialMock(\\Magento\\Store\\Model\\Store::class, ['__wakeup', 'getId']);\n $this->reviewMock = $this->createPartialMock(\n \\Magento\\Review\\Model\\Review::class,\n ['__wakeup', 'create', 'save', 'getId', 'getResource', 'aggregate', 'getEntityIdByCode']\n );\n $this->reviewFactoryMock = $this->createPartialMock(\\Magento\\Review\\Model\\ReviewFactory::class, ['create']);\n $this->ratingMock = $this->createPartialMock(\n \\Magento\\Review\\Model\\Rating::class,\n ['__wakeup', 'setRatingId', 'setReviewId', 'addOptionVote']\n );\n $this->ratingFactoryMock = $this->createPartialMock(\\Magento\\Review\\Model\\RatingFactory::class, ['create']);\n $this->resultFactoryMock = $this->getMockBuilder(\\Magento\\Framework\\Controller\\ResultFactory::class)\n ->disableOriginalConstructor()\n ->getMock();\n $this->resultRedirectMock = $this->getMockBuilder(\\Magento\\Backend\\Model\\View\\Result\\Redirect::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->resultFactoryMock->expects($this->any())\n ->method('create')\n ->with(ResultFactory::TYPE_REDIRECT, [])\n ->willReturn($this->resultRedirectMock);\n }", "protected function setUp()\n {\n $this->object = new Entity;\n }", "public function setUp() {\n\t\t$this->mockDecoratedRequestEngine = $this->getMockBuilder('TYPO3\\Flow\\Http\\Client\\RequestEngineInterface')->getMock();\n\t\t$this->cacheAwareRequestEngine = new CacheAwareRequestEngine($this->mockDecoratedRequestEngine);\n\n\t\t$this->mockRequestCache = $this->getMockBuilder('TYPO3\\Flow\\Cache\\Frontend\\VariableFrontend')->disableOriginalConstructor()->getMock();\n\t\t$this->inject($this->cacheAwareRequestEngine, 'requestCache', $this->mockRequestCache);\n\n\t\t# simulating a date in order to test absolute expiration dates\n\t\t$this->mockNow = new Now('Sat, 13 Dec 2014 20:00:00 +0100');\n\t\t$this->inject($this->cacheAwareRequestEngine, 'now', $this->mockNow);\n\n\t\t# we use real request/response objects by intention (otherwise there are too many mocks to create)\n\t\t$this->mockRequest = new Request(array(), array(), array(), array());\n\t\t$this->mockResponse = new Response();\n\t}", "protected function setUp() : void {\n $this->databaseConnector = \\Mockery::mock(DataBaseConnector::class);\n $this->entityManagerOK = \\Mockery::mock(EntityManager::class);\n $this->entityManagerOK->shouldReceive('insertUser')->andReturn(true);\n }", "protected function setUp()\n {\n $this->object = $this->createMock(AbstractRequest::class, [\n $this->getHttpClient(),\n $this->getHttpRequest(),\n self::TOKEN,\n \\Omnipay\\Rede\\Gateway::TEST_ENDPOINT\n ]);\n }", "protected function setUp()\n {\n $this->entity = $this->getMockForAbstractClass('VisioCrudModeler\\Model\\TableGateway\\Entity\\AbstractEntity');\n }", "protected function setUp()\n {\n $this->object = $this->getMockForAbstractClass('Ise\\Bread\\Entity\\AbstractEntity');\n }", "protected function mockEntityManager()\n {\n $originA = $this->makeOrigin('192.168.21', 'Sede A', true); \n $originRepository = $this->createMock(OriginRepository::class);\n $originRepository->expects($this->once())\n ->method('findAll')\n ->willReturn([$originA]);\n $entityManager = $this->createMock(EntityManagerInterface::class);\n $entityManager->expects($this->exactly(1))\n ->method('getRepository')\n ->withConsecutive([Origin::class])\n ->willReturnOnConsecutiveCalls($originRepository);\n $entityManager->expects($this->once())\n ->method('persist');\n $entityManager->expects($this->once())\n ->method('flush');\n return $entityManager;\n }", "public function setUp(): void\n {\n $this->objectManager = Bootstrap::getObjectManager();\n $this->auth = $this->objectManager->create(Auth::class);\n $this->urlBuilder = $this->objectManager->create(UrlBuilder::class);\n\n $this->httpResponseGet = $this->createPartialMock(HttpResponse::class, [\n 'getBody'\n ]);\n $this->httpClientGet = $this->getMockBuilder(HttpClient::class)\n ->disableOriginalConstructor()\n ->setMethods([\n 'request'\n ])\n ->getMock();\n $this->httpClientFactoryGet = $this->createConfiguredMock(\n HttpClientFactory::class,\n ['create' => $this->httpClientGet]\n );\n $this->inventoryCenterApiGet = $this->objectManager->create(InventoryCenterApiGet::class, [\n 'httpClientFactory' => $this->httpClientFactoryGet,\n ]);\n\n $this->storeManager = $this->objectManager->create(StoreManager::class);\n\n $this->jsonSerializer = $this->objectManager->create(Json::class);\n\n $this->dataObjectFactory = $this->objectManager->create(DataObjectFactory::class);\n\n $this->subject = $this->objectManager->create(Subject::class, [\n 'flowCentersApiClient' => $this->inventoryCenterApiGet\n ]);\n }", "public function setUp() {\n\t\t$this->mockObjectManager = $this->getMock('F3\\FLOW3\\Object\\ObjectManagerInterface');\n\t\t$this->mockObjectFactory = $this->getMock('F3\\FLOW3\\Object\\ObjectFactoryInterface');\n\t\t$this->mockReflectionService = $this->getMock('F3\\FLOW3\\Reflection\\ReflectionService');\n\t\t$this->mockReflectionService->expects($this->any())->method('getPropertyNamesByTag')->will($this->returnValue(array()));\n\n\t\t$this->objectBuilder = new \\F3\\FLOW3\\Object\\ObjectBuilder();\n\t\t$this->objectBuilder->injectObjectManager($this->mockObjectManager);\n\t\t$this->objectBuilder->injectObjectFactory($this->mockObjectFactory);\n\t\t$this->objectBuilder->injectReflectionService($this->mockReflectionService);\n\t}", "protected function setUp()\n\t{\n\t\t$this->instance = new Entity($this->getTestFields(), $this->getTestData());\n\t}", "public function setUp() {\n $this->request = $this->getMock('Imbo\\Http\\Request\\RequestInterface');\n $this->response = $this->getMock('Imbo\\Http\\Response\\ResponseInterface');\n $this->database = $this->getMock('Imbo\\Database\\DatabaseInterface');\n $this->storage = $this->getMock('Imbo\\Storage\\StorageInterface');\n $this->event = $this->getMock('Imbo\\EventManager\\EventInterface');\n $this->manager = $this->getMock('Imbo\\EventManager\\EventManager');\n $this->event->expects($this->any())->method('getRequest')->will($this->returnValue($this->request));\n $this->event->expects($this->any())->method('getResponse')->will($this->returnValue($this->response));\n $this->event->expects($this->any())->method('getDatabase')->will($this->returnValue($this->database));\n $this->event->expects($this->any())->method('getStorage')->will($this->returnValue($this->storage));\n $this->event->expects($this->any())->method('getManager')->will($this->returnValue($this->manager));\n\n $this->resource = $this->getNewResource();\n }", "protected function setUp(): void\n {\n $this->mockObjectManager = $this->createMock(ObjectManagerInterface::class);\n $this->route = $this->getAccessibleMock(Routing\\Route::class, ['dummy']);\n $this->route->_set('objectManager', $this->mockObjectManager);\n\n $this->mockPersistenceManager = $this->createMock(PersistenceManagerInterface::class);\n $this->mockPersistenceManager->method('convertObjectsToIdentityArrays')->will(self::returnCallBack(function ($array) {\n return $array;\n }));\n $this->inject($this->route, 'persistenceManager', $this->mockPersistenceManager);\n }", "protected function setUp() {\n $this->object = new UploadHandler;\n }", "protected function setUp() {\n $this->object = new ConfigHandler;\n }", "public function setUp(): void\n {\n $this->tokenMock = $this->createMock('Omise\\Payment\\Helper\\TokenHelper');\n $this->urlMock = $this->createMock('Magento\\Framework\\UrlInterface');\n $this->model = new ReturnUrlHelper($this->urlMock, $this->tokenMock);\n }", "protected function setUp(): void\n {\n $this->object = new OpenID_Extension_Mock(OpenID_Extension::REQUEST);\n }", "protected function setUp()\n\t{\n\t\t$this->object = new Response;\n\t}", "public function setUp(): void\n {\n $this->eventName = EntityEventName::UPDATE;\n\n $this->persistService = $this->createMock(PersistServiceInterface::class);\n\n $this->entityManager = $this->createMock(EntityManagerInterface::class);\n\n $this->logger = $this->createMock(LoggerInterface::class);\n }", "protected function setUp() {\n\t\t$this->object = $this->getMockBuilder('hypeJunction\\\\Scraper\\\\Hasher')->disableOriginalConstructor()->getMock();\n\t}", "public function setup()\n {\n $mock = new MockHandler([\n new Response(200, ['X-Foo' => 'Bar'], json_encode([\n 'output_ResponseCode' => 'INS-0',\n 'output_ResponseDesc' => 'Request processed successfully',\n 'output_SessionID' => 1\n ])),\n new Response(200, ['X-Foo' => 'Bar'], json_encode([\n 'output_ResponseCode' => 'INS-0',\n 'output_ResponseDesc' => 'Request processed successfully',\n 'output_TransactionID' => 2,\n 'output_ConversationID' => 'f1ddae567e6c45e580504764571dbe2f',\n 'output_ThirdPartyConversationID' => 'Narration',\n ])),\n new Response(202, ['Content-Length' => 0]),\n new RequestException('Error Communicating with Server', new Request('GET', 'test'))\n ]);\n\n $handlerStack = HandlerStack::create($mock);\n\n $client = new Client(['handler' => $handlerStack]);\n\n $this->forodha = new Forodha([\n 'api_key' => Fixture::$apiKey,\n 'public_key' => Fixture::$publicKey,\n ], $client);\n }", "public function setUp()\n {\n // Create a mock handler\n $this->mock = new MockHandler();\n $handler = HandlerStack::create($this->mock);\n\n // Add history middleware to the client for inspecting requests\n $this->history = [];\n $handler->push(Middleware::history($this->history));\n\n // Create a Guzzle client whose requests can be inspected and responses\n // are mocked\n $this->guzzle = new Client(['handler' => $handler]);\n\n // Create faker instance for faking data\n $this->faker = \\Faker\\Factory::create();\n\n // Create an event loop\n $this->loop = Factory::create();\n\n // Create the API client\n $this->client = new ApiClient($this->loop, $this->guzzle);\n\n // Initialize exception queue\n $this->exceptionQueue = new \\SplQueue();\n }", "protected function setUp()\r\n {\r\n $this->object = new TestAsset\\ConcreteEntity;\r\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->data[$this->identifier] = 1;\n\n $this->entity = new $this->class($this->data);\n }", "protected function setUp()\n {\n $this->object = new LazyClassDefinition('\\stdClass');\n \n }", "protected function setUp() {\n $this->object = new HttpRequestBuilder();\n }", "public function setUp(): void\n {\n $this->objectManager = Bootstrap::getObjectManager();\n $this->httpResponse = $this->createPartialMock(HttpResponse::class, ['getStatusCode']);\n $httpPromise = $this->objectManager->create(HttpPromise::class, [\n 'waitFn' => function () use (&$httpPromise) {\n $httpPromise->resolve($this->httpResponse);\n }\n ]);\n $this->httpPromise = $httpPromise;\n $this->httpClient = $this->getMockBuilder(HttpClient::class)\n ->disableOriginalConstructor()\n ->setMethods([\n 'postAsync'\n ])\n ->getMock();\n\n $this->httpClientFactory = $this->createConfiguredMock(\n HttpClientFactory::class,\n ['create' => $this->httpClient]\n );\n $this->itemUpdateApiClient = $this->objectManager->create(InventoryUpdatesApiClient::class, [\n 'httpClientFactory' => $this->httpClientFactory,\n ]);\n $this->subject = $this->objectManager->create(Subject::class, [\n 'itemUpdateApiClient' => $this->itemUpdateApiClient,\n ]);\n $this->createProductsFixture = $this->objectManager->create(CreateProductsWithCategories::class);\n $this->productRepository = $this->objectManager->create(ProductRepository::class);\n $this->inventorySyncRepository = $this->objectManager->create(InventorySyncRepository::class);\n $this->searchCriteriaBuilder = $this->objectManager->create(SearchCriteriaBuilder::class);\n $this->auth = $this->objectManager->create(Auth::class);\n $this->urlBuilder = $this->objectManager->create(UrlBuilder::class, [\n 'auth' => $this->auth\n ]);\n $this->storeManager = $this->objectManager->create(StoreManager::class);\n }", "private function configureMock()\n {\n $this->controller->expects($this->once())->method('doSomething')->with($this->parameters);\n }", "protected function setUp()\n {\n $this->storeManager = $this->getMockBuilder(StoreManager::class)\n ->disableOriginalConstructor()\n ->setMethods(['getStore'])\n ->getMockForAbstractClass();\n $this->coreRegistry = $this->getMockBuilder(Registry::class)\n ->disableOriginalConstructor()\n ->setMethods(['registry'])\n ->getMock();\n\n $objectManager = new ObjectManagerHelper($this);\n\n $this->resolver = $objectManager->getObject(\n CategoryName::class,\n [\n 'storeManager' => $this->storeManager,\n 'coreRegistry' => $this->coreRegistry,\n ]\n );\n }" ]
[ "0.6571329", "0.6288633", "0.6287574", "0.61066675", "0.60748005", "0.600548", "0.59620893", "0.59560007", "0.5941131", "0.5935079", "0.5923942", "0.5920214", "0.5917649", "0.59144336", "0.59088993", "0.5873484", "0.5873246", "0.5869505", "0.58603555", "0.58421516", "0.58403236", "0.58374846", "0.58305335", "0.5822978", "0.58228946", "0.58101666", "0.5804029", "0.58021057", "0.5779152", "0.5763991" ]
0.6584198
0
Listar todos los roles ordernados por nombre. Selecciona el id y nombre de cada uno de los roles guardados.
public static function listarRoles(): array { $consulta = "SELECT * FROM rol ORDER BY nombre"; return Conexion::getInstancia()->seleccionar($consulta); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listarRoles(){\n\t\t\t$sql = \"SELECT CodRole,Nombre,Estado FROM role WHERE Estado='1' ORDER BY Nombre\";\n\t\t\treturn ejecutarConsulta($sql);\n\t\t}", "public function listarRoles()\n {\n //return AutorizadorRol::all();\n\n $roles = AutorizadorRolAccion::join('autorizador_roles', 'autorizador_rol_acciones.rol_id', '=', 'autorizador_roles.id')\n ->selectRaw('autorizador_rol_acciones.id as accion_id,\n autorizador_rol_acciones.accion as controlador,\n autorizador_roles.id as rol_id,\n autorizador_roles.rol as rol,\n autorizador_roles.descripcion as descripcion'\n )->orderBy('rol')->get(); \n return response()->json($roles);\n }", "public function getRolesList()\n\t{\n\t\t$roles = Role::select('name as text', 'id')->get();\n\t\treturn $roles;\n\t}", "function get_all_roles() {\n return get_records('role', '', '', 'sortorder ASC');\n}", "public function getMarcas(){\n\t\t//consulta a la tabla roles usando el objeto db de la clase modelo\n\t\t$marcas = $this->_db->query(\"SELECT id, nombre FROM marcas ORDER BY nombre\");\n\n\t\t//retornamos lo que haya en la tabla roles\n\t\treturn $marcas->fetchall();\n\t}", "public function roles()\n {\n $this->roles = $this->Role->list($_SESSION['guild_id']);\n }", "public function list_roles(){\n $roles=$this->roles->pluck('name')->toArray();\n //el primer parametro es el separador, y el segundo para es el arreglo a seprar\n // es lo opuesto al explode que retorna una arreglo\n $string=implode(', ',$roles);\n return $string;\n\n }", "public function getRoles()\n {\n $roles = Role::lists('name','id');\n\n return $roles;\n }", "public function listAll()\n {\n $roles = $this->model->lists('name', 'id');\n\n return $roles;\n }", "public function roles()\n {\n\n $roles = get_editable_roles();\n $output = array();\n foreach ($roles as $key => $val) {\n $output[$key] = $val['name'];\n }\n return $output;\n }", "public function getRoles()\n {\n $roles = Role::all();\n\n return Datatables::of($roles)\n ->editColumn('routes', function ($role) {\n return htmlentities(strlen($role->getOriginal('routes')) > 50 ? substr($role->getOriginal('routes'), 0, 50) : $role->getOriginal('routes'));\n })\n ->addColumn('actions', function ($role) {\n $editBtn = '<a style=\"margin-right: 0.2em;\" href=\"' . url('admin/roles/' . $role->id . '/edit/') . '\" title=\"Edit\"><i class=\"fa fa-2 fa-pencil\"></i></a>';\n $deleteBtn = '';\n if ($role->name != 'Admin') {\n $deleteBtn = '&nbsp;<a href=\"' . url('admin/roles/' . $role->id) . '\" class=\"message_box text-danger\" data-box=\"#message-box-delete\" data-action=\"DELETE\" title=\"Permanent Delete\"><i class=\"fa fa-2 fa-remove\"></i></i></a>';\n }\n return $editBtn . $deleteBtn;\n })->make(true);\n }", "public function getRoles(){\n $db = new MainModel();\n $query = \"SELECT r.id as idRol, r.name as nameRol from roles as r\";\n return $response = $db->consultQueryAll($query);\n }", "public function listarRoles(){\r\n $sql = \"SELECT * FROM roles;\";\r\n $roles = $this->conexion->getTable($sql);\r\n return $roles;\r\n}", "public static function todos()\n\t{\n\t\t// Arreglo que va a contener todos los roles\n\t\t$lista_medios = [];\n\n\n\t\t// Crear una instancia de la conexion\n\t\t$conexion = new Conexion;\n\n\n\t\t// Consulta para la base de datos y despues lo guarda en la variable\n\t\t$resultado = $conexion->conn->query(\"SELECT * FROM \". static::$tablaConsulta );\n\n\n\t\t// Recorrer todos los roles que llegaron de la bd\n\t\twhile ( $medio = $resultado->fetch_assoc() ) {\n\n\t\t\t// Crear un reporte temporal en cada vuelta\n\t\t\t$medioTemporal = new MedioPago;\n\n\t\t\t// Añadir los campos al rol\n\t\t\t$medioTemporal->id \t = $medio['id'];\n\t\t\t$medioTemporal->medio \t = $medio['medio'];\n\n\t\t\t// Guarda el objeto rol en el arreglo\n\t\t\t$lista_medios[] = $medioTemporal;\n\t\t}\n\n\t\t// Devolver todos los roles\n\t\treturn $lista_medios;\n\n\t}", "public function roles();", "public function roles();", "public function roles();", "public function roles();", "public static function obtenerRoles()\n {\n $consulta = \"SELECT * FROM usuarios_roles ORDER BY id_rol ASC\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }", "public function index()\n {\n $roles = App\\User::find(1)->roles()->orderBy('name')->get();\n }", "public function getAllRoles()\n {\n return \\EntityManager::getRepository('stoykov\\Ohrana\\Models\\Doctrine\\Role')->findAll();\n }", "public function roleListAll() {\n $this->_adminUserDao = new AdminUserDao();\n\n $ret = array();\n $roles = $this->_adminroledao->getAll();\n foreach ($roles as $role) {\n $user = $this->_adminUserDao->getRow(array(array('username', '=', $role->owner)));\n if($user){\n $ret[$role->owner]['role'][] = $role;\n $ret[$role->owner]['user'] = $user;\n }else{\n if($role->owner == config('admin.user.super_user.username')){\n $ret[$role->owner]['role'][] = $role;\n// $ret[$role->owner]['user'] = (new AdminUserDao())->fill(config('admin.user.super_user'));\n// $ret[$role->owner]['user'] = $this->_adminUserDao->getRow(array(array('id', '=', config('admin.user\n $ret[$role->owner]['user']['username'] = $role->owner;\n }\n }\n }\n return $ret;\n }", "public function findAll() {\n\n // Récupération des différents type d'utilisateur\n $result = $this->getDb()->fetchAll(\"select * from roles order by nom asc\");\n \n $roles = array();\n foreach ($result as $row) {\n $roles[$row['id']] = $this->buildDomainObject($row);\n }\n return $roles;\n }", "function getAll()\n\t{\n\t\t$this->db->order_by(\"roleName\",\"ASC\");\n\t\t$query = $this->db->get('roles');\n\t\treturn $query;\n\t}", "public function getAll()\n {\n return $this->roles->whereStatus(1)->orderBy('id', 'desc')->get();\n }", "function get_all_roles()\n {\n $this->db->order_by('role', 'asc');\n return $this->db->get('tbl_roles')->result_array();\n }", "protected function get_roles_disponibles()\n\t{\n\t\t$roles_existentes = array();\n\t\t$datos = $this->db->listar_roles();\n\t\tforeach($datos as $valor) {\n\t\t\t$roles_existentes[] = strtolower($valor['rolname']);\n\t\t}\n\t\treturn $roles_existentes;\n\t}", "private function get_all_roles(){\n return Role::all();\n }", "public function getRoles()\n {\n #obsolete, I don't wnat user roles, I want the permission those roles are linked to\n # so I just need a getPermissions once, store those constants in a small session array\n #$roles = $this->roles;\n\n #d($roles);\n\n #foreach ($roles as $role) {\n # echo $role->name;\n #}\n }", "public function roleList()\n {\n $roleList = '<ul>';\n foreach ($this->roles as $role) {\n $roleList .= '<li>'.$role->name.'</li>';\n }\n $roleList .= '</ul>';\n\n return $roleList;\n }" ]
[ "0.7626586", "0.68903637", "0.6789378", "0.67386603", "0.67336816", "0.66068685", "0.65842694", "0.65399075", "0.6528065", "0.6501007", "0.64997554", "0.64497507", "0.64450026", "0.64397794", "0.643844", "0.643844", "0.643844", "0.643844", "0.6404932", "0.639373", "0.63833874", "0.63757026", "0.6363379", "0.635468", "0.6340617", "0.6338522", "0.6331011", "0.631887", "0.63126093", "0.631107" ]
0.73717165
1
Listar un resumen limitado de roles. Selecciona el id, nombre, cantidad de usuarios asociados y cantidad de permisos asociados para uno de los roles segun el limite establecido.
public static function listarResumenRoles($limite): array { if ($limite > 0) { $consulta = "SELECT * FROM vw_rol ORDER BY id DESC LIMIT {$limite}"; return Conexion::getInstancia()->seleccionar($consulta); } return array(0, "No se estableció un limite válido"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listarRoles(){\n\t\t\t$sql = \"SELECT CodRole,Nombre,Estado FROM role WHERE Estado='1' ORDER BY Nombre\";\n\t\t\treturn ejecutarConsulta($sql);\n\t\t}", "public function roles()\n {\n $this->roles = $this->Role->list($_SESSION['guild_id']);\n }", "public function indexRoles()\n {\n\n $users = User::with('roles')\n ->whereNotIn('id', [1, auth()->user()->id])\n ->orderBy('created_at', 'asc')\n ->paginate(10);\n\n $roles = Role::all();\n\n return view('admin.roles.assign', compact('users', 'roles'));\n }", "public function getRoles(){\n $db = new MainModel();\n $query = \"SELECT r.id as idRol, r.name as nameRol from roles as r\";\n return $response = $db->consultQueryAll($query);\n }", "public static function listarRoles(): array {\n $consulta = \"SELECT * FROM rol ORDER BY nombre\";\n return Conexion::getInstancia()->seleccionar($consulta);\n }", "public function roles();", "public function roles();", "public function roles();", "public function roles();", "public function getRoles()\n {\n $roles = Role::all();\n\n return Datatables::of($roles)\n ->editColumn('routes', function ($role) {\n return htmlentities(strlen($role->getOriginal('routes')) > 50 ? substr($role->getOriginal('routes'), 0, 50) : $role->getOriginal('routes'));\n })\n ->addColumn('actions', function ($role) {\n $editBtn = '<a style=\"margin-right: 0.2em;\" href=\"' . url('admin/roles/' . $role->id . '/edit/') . '\" title=\"Edit\"><i class=\"fa fa-2 fa-pencil\"></i></a>';\n $deleteBtn = '';\n if ($role->name != 'Admin') {\n $deleteBtn = '&nbsp;<a href=\"' . url('admin/roles/' . $role->id) . '\" class=\"message_box text-danger\" data-box=\"#message-box-delete\" data-action=\"DELETE\" title=\"Permanent Delete\"><i class=\"fa fa-2 fa-remove\"></i></i></a>';\n }\n return $editBtn . $deleteBtn;\n })->make(true);\n }", "public function listarRoles()\n {\n //return AutorizadorRol::all();\n\n $roles = AutorizadorRolAccion::join('autorizador_roles', 'autorizador_rol_acciones.rol_id', '=', 'autorizador_roles.id')\n ->selectRaw('autorizador_rol_acciones.id as accion_id,\n autorizador_rol_acciones.accion as controlador,\n autorizador_roles.id as rol_id,\n autorizador_roles.rol as rol,\n autorizador_roles.descripcion as descripcion'\n )->orderBy('rol')->get(); \n return response()->json($roles);\n }", "public function getRolesList()\n\t{\n\t\t$roles = Role::select('name as text', 'id')->get();\n\t\treturn $roles;\n\t}", "public function showRoles(Request $request) {\n\n $roles = Roles::paginate(10);\n \n return $roles;\n \n }", "public function ObtenerRolesSupeAdmin()\r\n {\r\n return Rol::all();\r\n }", "public function index()\n {\n $roles = App\\User::find(1)->roles()->orderBy('name')->get();\n }", "public function getRoles()\n {\n #obsolete, I don't wnat user roles, I want the permission those roles are linked to\n # so I just need a getPermissions once, store those constants in a small session array\n #$roles = $this->roles;\n\n #d($roles);\n\n #foreach ($roles as $role) {\n # echo $role->name;\n #}\n }", "function getAllRoles(){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getAllRoles();\r\n }", "public function index()\n {\n return Roles::all();\n }", "public function mattRolesAction() {\n $opciones = $this->getRequest()->getSession()->get('opciones');\n\n $rolDao = new RolDao($this->getDoctrine());\n $roles = $rolDao->getRoles();\n return $this->render('MinSalSCAAdminBundle:Roles:manttRolesSystemForm.html.twig', array('roles' => $roles, 'opciones' => $opciones,));\n }", "public function index()\n {\n $roles = Role::paginate(15);\n\n $permissions = array();\n $user_roles = Auth::user()->roles;\n foreach ($user_roles as $key => $val) {\n foreach ($val->permissions as $permission) {\n $permissions[$permission->id] = $permission->name;\n }\n }\n\n return view('roles.index')->withRoles($roles)->withPermissions($permissions);\n }", "public function getAllRoles(): array;", "private function get_all_roles(){\n return Role::all();\n }", "public function get_roles() {\n return DB::query(Database::SELECT, 'SELECT * FROM roles WHERE id > 1')\n ->as_object()\n ->execute($this->db);\n }", "public function actionRoles()\n\t{\n\t\tYii::app()->user->rightsReturnUrl = array('authItem/roles');\n\t\t\n\t\t$dataProvider = new RAuthItemDataProvider('roles', array(\n\t\t\t'type'=>CAuthItem::TYPE_ROLE,\n\t\t\t'sortable'=>array(\n\t\t\t\t'id'=>'RightsRoleTableSort',\n\t\t\t\t'element'=>'.role-table',\n\t\t\t\t'url'=>$this->createUrl('authItem/sortable'),\n\t\t\t),\n\t\t));\n\n\t\t// Render the view\n\t\t$this->render('roles', array(\n\t\t\t'dataProvider'=>$dataProvider,\n\t\t\t'isBizRuleEnabled'=>$this->module->enableBizRule,\n\t\t\t'isBizRuleDataEnabled'=>$this->module->enableBizRuleData,\n\t\t));\n\t}", "public function getRoles() {\n return DB::table('dx_users_roles as ur')\n ->join('dx_roles as r', 'r.id', '=', 'ur.role_id')\n ->select('r.id', 'r.title', DB::raw('COUNT(*) as total_users'))\n ->where('r.is_system', '=', '0')\n ->groupBy('r.id')\n ->orderBy('r.title')\n ->get();\n }", "public function rolesForUser();", "public function getList() {\n $data['data'] = $this->role->get();\n return view('roles.list_role',$data);\n }", "public function getAllRoles()\n {\n return \\EntityManager::getRepository('stoykov\\Ohrana\\Models\\Doctrine\\Role')->findAll();\n }", "function roles_get() {\n\n $result_set = $this->model_all->getTableDataInArray(\"app_roles\", array(\"id!=\" => \"1\"), \"id,role_name,short_form\");\n if (($result_set['total_rows']) > 0) {\n $result[\"status\"] = 1;\n $result[\"message\"] = \"Records Found\";\n $result[\"roles\"] = $result_set['records'];\n $this->response($result, 200);\n exit;\n } else {\n $result[\"status\"] = 0;\n $result[\"message\"] = \"Detais Not Found\";\n $this->response($result, 200);\n exit;\n }\n }", "public function index()\n {\n return Role::all();\n }" ]
[ "0.7244106", "0.717365", "0.7018752", "0.70109254", "0.6955933", "0.693262", "0.693262", "0.693262", "0.693262", "0.69078493", "0.68993795", "0.6840279", "0.6819489", "0.67942625", "0.67924464", "0.678074", "0.6780577", "0.6772386", "0.6747796", "0.6741106", "0.67353255", "0.6731232", "0.6718539", "0.67181027", "0.6714696", "0.6702557", "0.66994226", "0.6687078", "0.66831446", "0.66442335" ]
0.7205636
1
/ Returns the current cache client
public function getCacheClient() { if ($this->cacheClient) { return $this->cacheClient; } return $this->cacheClient = new CacheClient($this->cacheConnectionDsn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClient()\n\t{\n\t\treturn $this->redisClient;\n\t}", "public function getClient()\n {\n if (!$this->client) {\n $this->client = $this->createClient();\n $this->client->addCache($this->cachePool);\n }\n\n return $this->client;\n }", "public function getCache() {\n\t\treturn $this->get('Cundd\\\\Rest\\\\Cache\\\\Cache');\n\t}", "public function getClient() {\n return $this->_get( 'client' );\n }", "public function getCache()\r\n {\r\n \treturn $this->_cache;\r\n }", "public function getCaching()\n {\n return (!is_null($this->_cache) ? $this->_cache : Cache::instance('redis'));\n }", "public function getClient()\n\t{\n\t\treturn $this->_client;\n\t}", "public function getHost() {\n return new Client($this->memcache, $this->shareData[\"host\"]);\n }", "protected function getCache()\n {\n return $this->cache;\n }", "public function client()\n {\n return $this->client;\n }", "public function client()\n {\n return $this->client;\n }", "function getClient() {\n return $this -> _client;\n }", "public function getCache()\n {\n return $this->_cache;\n }", "public function getCache() {\n\n // return our instance of Cache\n return $this->oCache;\n }", "public function getCache()\r\n\t{\r\n\t\treturn $this->m_cache;\r\n\t}", "public function getCache() {\n\t\t$this->sync();\n\t\treturn $this->cache;\n\t}", "public static function getClient() {\n return self::$client;\n }", "public function getCache()\n\t{\n\t\treturn ($this->_cache);\n\t}", "public function getCache()\n {\n return $this->Cache;\n }", "public static function getCache()\n {\n return self::$_cache;\n }", "public function getCache()\n\t{\n\t\treturn $this->cache;\n\t}", "private function get_client() {\n\t\treturn $this->client;\n\t}", "private function get_client() {\n\t\treturn $this->client;\n\t}", "private function get_client() {\n\t\treturn $this->client;\n\t}", "public static function getClient(){\n $redis=new \\Redis();\n $redis->connect(self::CLIENT_CONF['host'], self::CLIENT_CONF['port']);\n $redis->auth(self::CLIENT_CONF['password']);\n return $redis;\n }", "public function getCache()\n {\n return $this->cache;\n }", "public function getCache()\n {\n return $this->cache;\n }", "public function getCache()\n {\n return $this->cache;\n }", "public function getCache()\n {\n return $this->cache;\n }", "public function getCache()\n {\n return $this->cache;\n }" ]
[ "0.7260233", "0.724409", "0.71030086", "0.69043005", "0.682955", "0.6823672", "0.6822708", "0.67673963", "0.67619896", "0.6756854", "0.67511517", "0.6738703", "0.6736963", "0.6727503", "0.67053026", "0.6704763", "0.6696726", "0.6694915", "0.6692241", "0.6680761", "0.6680061", "0.6673797", "0.6673797", "0.6673797", "0.666945", "0.66606176", "0.66606176", "0.66606176", "0.66606176", "0.66606176" ]
0.80121833
0
Connect to MPD server
public function connect($timeout = 30){ $this->connection = \stream_socket_client("tcp://$this->host:$this->port", $errno, $errstr, $timeout); if (!$this->connection) { echo "$errstr ($errno)<br />\n"; return; } $resp = fgets($this->connection, 1024); if(strncmp(MPDClient::OK, $resp, strlen(MPDClient::OK)) === 0){ if(strlen($resp) > strlen(MPDClient::OK)){ $this->mpdProtoVersion = substr($resp, strlen(MPDClient::OK)); } }else{ echo "Error connecting to MPD, No response\n"; fclose($this->connection); return; } if(isset($this->passwd)){ $this->send(MPDClient::PASSWORD.' '.$this->passwd); } //Read stats and status $this->updateState(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function connect() { \n\t\n\t\t// Look at the current instance and pull the options for said instance\n\t\t$options = self::get_instance(); \n\t\t$this->_mpd = new mpd($options['host'],$options['port'],$options['password']);\n\n\t\tif ($this->_mpd->connected) { return true; } \n\n\t\treturn false;\n\n\t}", "function connect() {\n\n\t\t// only if logins are set\n\t\tif ($this->server->ip && $this->server->port && $this->server->login && $this->server->pass) {\n\t\t\t// log console message\n\t\t\t$this->console('Try to connect to MP dedicated server on {1}:{2} timeout {3}s',\n\t\t\t $this->server->ip, $this->server->port,\n\t\t\t ($this->server->timeout !== null ? $this->server->timeout : 0));\n\n\t\t\t// connect to the server\n\t\t\tif (!$this->client->InitWithIp($this->server->ip, $this->server->port, $this->server->timeout)) {\n\t\t\t\ttrigger_error('[' . $this->client->getErrorCode() . '] InitWithIp - ' . $this->client->getErrorMessage(), E_USER_WARNING);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// log console message\n\t\t\t$this->console(\"Try to authenticate with login '{1}' and password '{2}'\",\n\t\t\t $this->server->login, $this->server->pass);\n\n\t\t\t// check login\n\t\t\tif ($this->server->login != 'SuperAdmin') {\n\t\t\t\ttrigger_error(\"Invalid login '\" . $this->server->login . \"' - must be 'SuperAdmin' in config.xml !\", E_USER_WARNING);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// check password\n\t\t\tif ($this->server->pass == 'SuperAdmin') {\n\t\t\t\ttrigger_error(\"Insecure password '\" . $this->server->pass . \"' - should be changed in dedicated config and config.xml !\", E_USER_WARNING);\n\t\t\t}\n\n\t\t\t// log into the server\n\t\t\tif (!$this->client->query('Authenticate', $this->server->login, $this->server->pass)) {\n\t\t\t\ttrigger_error('[' . $this->client->getErrorCode() . '] Authenticate - ' . $this->client->getErrorMessage(), E_USER_WARNING);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// enable callback system\n\t\t\t$this->client->query('EnableCallbacks', true);\n\n\t\t\t// wait for server to be ready\n\t\t\t$this->waitServerReady();\n\n\t\t\t// connection established\n\t\t\treturn true;\n\t\t} else {\n\t\t\t// connection failed\n\t\t\treturn false;\n\t\t}\n\t}", "public function pconnect(): void\n {\n }", "final public function p_connect() {\n \t$this->connect('', '', '', '', true);\n \t}", "function connect() {\n $this->conn = imap_open('{'.$this->server.'/notls}', $this->user, $this->pass);\n }", "public function connect() {\n $this->getConnectionSocket();\n }", "private function mpowerConnect()\n {\n $errno = 0;\n $errstr = \"\";\n $this->_socket = @fsockopen($this->_server, $this->_port, $errno, $errstr, $this->_connectionTimeout);\n if (!$this->_socket) {\n @fclose($this->_socket);\n throw new \\Exception(\n sprintf(\n \"[MPServer::mpowerConnect]Failed to connect to %s:%s.Errno:%d:%s\",\n $this->_server, $this->_port, $errno, $errstr\n )\n );\n }\n\n }", "public function connect() {\n if ($this->client) {\n $this->client->connect();\n }\n }", "function msgsrv_open ($host, $port, $appname, $username, $password) {}", "public function connect() {\n $this->connection = AMQPStreamConnection($this->server_ip, $this->server_port, $this->username, $this->password);\n }", "protected function connect()\n {\n $res = $this->memc->connect(MEMCACHE_HOST, 11211);\n $this->namespace = MEMCACHE_NAMESPACE;\n if (MEMCACHE_DEBUG) {\n if ($res) {\n Logger::write('Memcache::connect(): connected');\n } else {\n Logger::write('Memcache::connect(): connect FAILED!');\n }\n }\n }", "function msession_connect($host, $port)\n{\n}", "private function connect()\n {\n try {\n self::$connection = new PDO($this->buildDSN(), $this->user, $this->pass, $this->options);\n } catch (PDOException $e) {\n die('Connection failed: ' . $e->getMessage());\n }\n\n }", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "protected function connect($config) {\n\t\t// set the Memcache plugin\n\t\t$this->_memcached = new Memcached;\n\n\t\t$this->_memcached->addServer($config['host'], $config['port'])\n\t\t\tor die('Could not connect to server');\n\n\t\t$this->_isConnected = true;\n\t}", "private function connect() {\n\t\tif (!$this->connected) {\n\t\t\t$this->socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n\t\t\t$this->connected = @socket_connect($this->socket, $this->host, $this->port);\n\t\t}\n\t}", "function connect() {\n\n $this->conn = imap_open('{'.$this->server.'/notls}', $this->user, $this->pass);\n\n}", "public function connect()\n {\n if (!$this->isConnected()) {\n $this->manager->connect();\n }\n }", "public function connect()\n\t{\n\t\t$this->isConnected = false;\n\n\t\t$this->connectInternal();\n\t}", "public function connect()\r\n {\r\n $this->log( \"Connecting to {$this->_server}:{$this->_port}\" );\r\n \r\n // open the connection\r\n $this->_conn = fsockopen( $this->_server, $this->_port, $errno, $errstr, 10 );\r\n \r\n if ( $this->_conn )\r\n {\r\n $this->log( \"Connected.\" );\r\n \r\n // start processing the data\r\n $this->main();\r\n }\r\n }" ]
[ "0.72100955", "0.67200947", "0.6688605", "0.66860205", "0.6523335", "0.6515528", "0.6492286", "0.64142805", "0.6376998", "0.63415784", "0.62969965", "0.62872267", "0.6283951", "0.62791747", "0.62791747", "0.62791747", "0.62791747", "0.62791747", "0.62791747", "0.62791747", "0.62791747", "0.62791747", "0.62791747", "0.62791747", "0.6277593", "0.6230658", "0.62175006", "0.61946166", "0.6175011", "0.61735785" ]
0.7104345
1
Mark this leaf as completed for a user.
public function markCompletedFor($a_user_id) { global $ilAppEventHandler; $ilAppEventHandler->raise("Services/Tracking", "updateStatus", array( "obj_id" => $this->getId(), "usr_id" => $a_user_id, "status" => ilLPStatus::LP_STATUS_COMPLETED_NUM, "percentage" => 100 )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function mark_complete() {\n // Create record\n $this->timecompleted = time();\n\n // Save record\n if ($this->id) {\n $this->update();\n } else {\n $this->insert();\n }\n\n // Mark course completion record as started (if not already)\n $cc = array(\n 'course' => $this->course,\n 'userid' => $this->userid\n );\n $ccompletion = new completion_completion($cc);\n $ccompletion->mark_inprogress($this->timecompleted);\n }", "public function setActiveAttemptCompleted(LearningPath $learningPath, TreeNode $treeNode, User $user)\n {\n $activeAttempt = $this->attemptService->getOrCreateActiveTreeNodeAttempt($learningPath, $treeNode, $user);\n\n $activeAttempt->setCompleted(true);\n $this->trackingRepository->update($activeAttempt);\n }", "public function complete($completed = true)\n {\n $this->update(compact('completed'));\n }", "public function setCompletedBy(?WorkbookEmailIdentity $value): void {\n $this->getBackingStore()->set('completedBy', $value);\n }", "public function markAsCompleted()\n {\n $this->forceFill(['completed_at' => now()])->save();\n\n return $this;\n }", "public function markWorkoutAsComplete(){\n $this->autoRender = false;\n \n $success = true;\n $message = 'Workout has been marked as complete.';\n \n //get user id and check authentication\n $userId = $this->Session->check('User.id')?$this->Session->read('User.id'):'';\n if(empty($userId)){\n $success = false;\n $message = 'Authentication Failed';\n }\n \n if(!$this->request->is('put')){\n $success = false;\n $message = 'Invalid request method';\n }\n \n $data = $this->request->input('json_decode', true); \n if(empty($data)){\n return;\n }\n $programWorkoutId = $data['programWorkoutId'];\n $completed = isset($data['completed'])?$data['completed']:1;\n \n $respData = [];\n $this->loadModel('UserWorkout');\n try{\n \n $userProgramWorkoutId = $this->chkUserPogramWorkout($userId, $programWorkoutId);\n \n $userWrokoutdata = [];\n $userWrokoutdata['UserWorkout']['user_id'] = $userId;\n $userWrokoutdata['UserWorkout']['program_workout_id'] = $programWorkoutId;\n $userWrokoutdata['UserWorkout']['completed_status'] = $completed;\n if(!empty($userProgramWorkoutId)){\n //update the data for given id\n $userWrokoutdata['UserWorkout']['id'] = $userProgramWorkoutId; \n }\n $this->UserWorkout->save($userWrokoutdata);\n } catch (Exception $ex) {\n $message = $ex->getMessage();\n $success = false;\n }\n \n //prepare response \n $resp = $this->UserWorkout->prepareResponse($success, $message, $respData); \n return $resp;\n }", "function tsk_mark_complete() {\n\t$lesson_args = array(\n\t\t'post_type' => 'lesson',\n\t\t'posts_per_page' => '-1'\n\t);\n\n\t$lesson_arr = get_posts($lesson_args);\n\t\n\t// Is there a better way to do this?\n\tforeach ($lesson_arr as $lesson) { \n\t\tif ( isset( $_POST['_lesson_'.$lesson->ID.'_complete'] ) ) {\n\t\t\t$new_state = $_POST['_lesson_'.$lesson->ID.'_complete'];\n\t\t\t$user_id = get_current_user_id();\n\n\t\t\tupdate_user_meta( $user_id, '_lesson_'.$lesson->ID.'_complete', $new_state ); \n\n\t\t\tif ( is_wp_error( $user_id ) ) {\n\t\t\t\t// There was an error, probably that user doesn't exist.\n\t\t\t} else {\n\t\t\t\t// Success!\n\t\t\t}\n\t\t}\n\t}\n\n}", "public function setFinished(User $user, Order $order)\n {\n if ($user->isChef()) {\n return false;\n }\n\n return ($user->id == $order->waiter_id) && ($order->order_status_id == 5);\n }", "public function markAsDone() {\n\t\t$sql = \"UPDATE\twbb\".WBB_N.\"_thread\n\t\t\tSET\tisDone = 1\n\t\t\tWHERE\tthreadID = \".$this->threadID;\n\t\tWCF::getDB()->sendQuery($sql);\n\t}", "public function setIsCompleted($value)\n {\n $this->setItemValue('is_completed', (bool)$value);\n }", "public static function maybe_mark_complete() {\n\t\t// The install notice still exists so don't complete the profiler.\n\t\tif ( ! class_exists( 'WC_Admin_Notices' ) || \\WC_Admin_Notices::has_notice( 'install' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$onboarding_data = get_option( self::PROFILE_DATA_OPTION, array() );\n\t\t// Don't make updates if the profiler is completed, but task list is potentially incomplete.\n\t\tif ( isset( $onboarding_data['completed'] ) && $onboarding_data['completed'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$onboarding_data['completed'] = true;\n\t\tupdate_option( self::PROFILE_DATA_OPTION, $onboarding_data );\n\t\tupdate_option( 'woocommerce_task_list_hidden', 'yes' );\n\t}", "public static function _hasUserCompleted($a_obj_id, $a_user_id)\n\t{\n\t\treturn (self::_lookupStatus($a_obj_id, $a_user_id) == self::LP_STATUS_COMPLETED_NUM);\n\t}", "public function questComplete($questid, $userid)\n {\n $query = $this->dbh->prepare('UPDATE `playerquests` SET `completed` = 1\n WHERE `questid` = ?\n AND `userid` = ?');\n $query->execute(array($questid, $userid));\n }", "public function setIsComplete(?bool $value): void {\n $this->getBackingStore()->set('isComplete', $value);\n }", "public function isCompletedByCurrentUser()\n {\n return SwagUser::getCurrent()->isSwagpathCompleted($this);\n }", "public function setComplete($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->complete !== $v) {\n $this->complete = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_COMPLETE] = true;\n }\n\n return $this;\n }", "public function setUploadCompleted(bool $completed = true): void\n {\n $this->uploadCompletedAt = $completed ? new DateTime() : null;\n }", "public function completeTour()\n {\n $userOnBoarding = auth()->user()->userOnBoarding;\n $userOnBoarding->completed_tour = true;\n $userOnBoarding->save();\n Session::forget('first_login');\n }", "public function markComplete($id) {\n\n // Recover the task.\n $task = Task::find($id);\n\n // Verify it's actually recovered\n if(is_null($task)) {\n Session::flash('flash_message', 'Unable to locate task');\n return redirect('/tasks');\n }\n\n // Mark complete\n $task->complete = 1;\n\n // save\n $task->save();\n\n // Let the user know, get on with it.\n Session::flash('flash_message', 'Completed: '.$task->description);\n return redirect('/tasks');\n }", "public function markVerifiedForUser(User $user): void\n {\n session()->put($this->getMfaVerifiedSessionKey($user), 'true');\n }", "function annotation_user_complete($course, $user, $mod, $annotation) {\n}", "public function completing($task)\n {\n $task->update(['complete' => true]);\n\n $this->createActive('create_with_complete_task', 'App\\Models\\Task', $this->id);\n }", "function setCompleted() {\n global $connection, $user;\n\n $this->movePosition(1);\n\n $sql = 'update TR_BATCH set completed_date = now() where tr_batch_id = ?';\n if ($statement = $connection->prepare($sql)) {\n $statement->bind_param(\"i\", $this->batch_id);\n $statement->execute();\n } else {\n throw new Exception(\"Database connection failed\");\n }\n }", "function completeLessonbyUser($userEmail, $lessonId){\n\n\t\tglobal $conn;\n\n\t\t$query = \"UPDATE UserLesson SET lessonCompleted='1' WHERE emailUser='\" . $userEmail . \"' AND idLesson='\" . $lessonId . \"' \";\n\n\t\t$result = $conn->query($query);\n\n\t}", "protected function resolveStatusAndSetCompletedFields()\n {\n if ($this->status != Task::STATUS_COMPLETED)\n {\n $this->completed = false;\n }\n else\n {\n $this->completed = true;\n }\n\n if ($this->completed == true)\n {\n if ($this->completedDateTime == null)\n {\n $this->completedDateTime = DateTimeUtil::convertTimestampToDbFormatDateTime(time());\n }\n $this->unrestrictedSet('latestDateTime', $this->completedDateTime);\n }\n }", "public function transactionDone(User $user)\n {\n //Empty The Field.\n }", "public static function MarkOrderProcessAsCompleted()\n {\n $_SESSION[self::SESSION_KEY_NAME_ORDER_SUCCESS] = true;\n }", "public function mark_completed($todo=null)\n {\n \n try {\n // if the returned instance wasn't found\n if(\\is_null($todo)) {\n return $this->resourceNotFound();\n }\n\n // mark the Todo as completed\n $todo->update(['completed' => 1] );\n \n return $this->sendResponse(new TodoResource($todo), 'Successfully marked as completed');\n \n } catch (\\Throwable $th) {\n \\Log::error($th);\n return $this->sendServerError('Unable to mark Todo as completed');\n }\n }", "private function complete_login(Users $user)\n {\n // Update the number of logins\n $user->logins = $user->logins + 1;\n\n // Set the last login date\n $user->last_login = time();\n\n // Save the user\n $user->update();\n }", "public function giveBadgeIfProfileCompleted(User $user)\n {\n return $this->getProfileCompletedBadge($user);\n }" ]
[ "0.68063885", "0.6559841", "0.63267815", "0.62253404", "0.59917057", "0.58770436", "0.58551323", "0.57687795", "0.5694659", "0.56599915", "0.56224483", "0.5597721", "0.5558037", "0.5512748", "0.54968286", "0.54931045", "0.54824984", "0.54628104", "0.5461529", "0.5454887", "0.5429896", "0.5366617", "0.5341182", "0.53337693", "0.52789474", "0.52712065", "0.52594465", "0.52536654", "0.52471846", "0.52341586" ]
0.7415121
0
Ensures that the buyer's cart contains the contents of the given deal.
protected function prepareCart(PriceWaiter_NYPWidget_Model_Deal $deal) { $cart = Mage::getSingleton('checkout/cart'); $quote = $cart->getQuote(); $deal->ensurePresentInQuote($quote); $cart->save(); // Track the current PW buyer ID so we can automatically discover // other deals the buyer has made. Mage::getSingleton('nypwidget/session') ->setBuyerId($deal->getPricewaiterBuyerId()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_cart_items() {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\t$result = $this->check_cart_item_stock();\n\t\t\tif (is_wp_error($result)) $cmdeals->add_error( $result->get_error_message() );\n\t\t}", "function check_cart_item_stock() {\n\t\t\t$error = new WP_Error();\n\t\t\tforeach ($this->cart_contents as $cart_item_key => $values) :\n\t\t\t\t$_deals = $values['data'];\n\t\t\t\tif ($_deals->managing_stock()) :\n\t\t\t\t\tif ($_deals->is_in_stock() && $_deals->has_enough_stock( $values['quantity'] )) :\n\t\t\t\t\t\t// :)\n\t\t\t\t\telse :\n\t\t\t\t\t\t$error->add( 'out-of-stock', sprintf(__('Sorry, we do not have enough \"%s\" in stock to fulfill your order (%s in stock). Please edit your cart and try again. We apologise for any inconvenience caused.', 'cmdeals'), $_deals->get_title(), $_deals->_stock ) );\n\t\t\t\t\t\treturn $error;\n\t\t\t\t\tendif;\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t\treturn true;\n\t\t}", "private function check_cart() {\n $users_id = $this->session->userdata('id');\n if ($users_id) {\n // User connected > DB\n $this->data['deals'] = $this->users_cart->getForUser($users_id);\n } else {\n // Guest > Session\n $deals = $this->session->userdata('cart');\n if ($deals) {\n $this->data['deals'] = $this->deals->getDeals(false, false, false, false, false, false, $deals);\n } else {\n $this->data['deals'] = array();\n }\n }\n }", "public function prepare($deal = null)\n\t{\n\t\tif ($deal)\n\t\t{\n\t\t\t// Set some coupon values\n\t\t\t$deal->coupon_value \t= (float) @$deal->f_coupon_value;\n\t\t\t$deal->original_value \t= (float) @$deal->f_original_value;\n\t\t\t$deal->saved_value \t\t= $deal->original_value - $deal->coupon_value;\n\t\t\t$deal->discount \t\t= round((1 - ($deal->coupon_value / $deal->original_value)) * 100, 0);\n\t\t\t$deal->expires_at \t\t= (int) $deal->f_expires_at;\n\t\t\t$deal->time_left \t\t= (int) $deal->expires_at - time();\n\t\t\t$coupon_expires \t\t= (int) @$deal->f_coupon_expiration_date;\n\t\t\t$deal->coupon_expires \t= mktime(23,59,59,date('m', $coupon_expires),date('d', $coupon_expires),date('Y', $coupon_expires)); // 'Till theend of the day\n\t\t\t\n\t\t\t// Get number of sold items\n\t\t\t$deal->sold_number = (int) $this->cart_item_m->count_by(array(\n\t\t\t\t 'entry_id'\t=> $deal->id\n\t\t\t\t,'status'\t=> 'pg-success'\n\t\t\t));\n\t\t\t\n\t\t\t// There's the possibility to fake the number of sold coupons so we set that here\n\t\t\tif (isset($deal->f_fake_coupons) and (int) $deal->f_fake_coupons)\n\t\t\t{\n\t\t\t\t$deal->sold_number += (int) $deal->f_fake_coupons;\n\t\t\t}\n\t\t\t\n\t\t\t// Get number of bought items\n\t\t\t$deal->bought_number = (int) $this->cart_item_m->count_by(array(\n\t\t\t\t 'entry_id'\t=> $deal->id\n\t\t\t\t,'status'\t=> 'pg-success'\n\t\t\t\t,'user_id'\t=> user_id()\n\t\t\t));\n\t\t\t\n\t\t\t// Still needed number to sell\n\t\t\t$deal->need_to_sell = (int) @$deal->f_minimum_coupons - $deal->sold_number;\n\t\t\t\n\t\t\t// Is expired, successful, available\n\t\t\t$deal->is_expired = (bool) $this->is_expired($deal);\n\t\t\t$deal->is_successful = (bool) $this->is_successful($deal);\n\t\t\t$deal->is_available = (bool) $this->is_available($deal);\n\t\t}\n\t\t\n\t\treturn $deal;\n\t\t\n\t}", "function add_to_cart( $deal_id, $quantity = 1, $variation_id = '', $variation = '' ) {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\tif ($quantity < 1) return false;\n\t\t\t\n\t\t\t// Load cart item data - may be added by other plugins\n\t\t\t$cart_item_data = (array) apply_filters('cmdeals_add_cart_item_data', array(), $deal_id);\n\t\t\t\n\t\t\t// Generate a ID based on deals ID, variation ID, variation data, and other cart item data\n\t\t\t$cart_id = $this->generate_cart_id( $deal_id, $variation_id, $variation, $cart_item_data );\n\t\t\t\n\t\t\t// See if this deals and its options is already in the cart\n\t\t\t$cart_item_key = $this->find_deals_in_cart($cart_id);\n\t\t\t\n\t\t\tif ($variation_id>0) :\n\t\t\t\t$deal_data = new cmdeals_deals_variation( $variation_id );\n\t\t\telse :\n\t\t\t\t$deal_data = new cmdeals_deals( $deal_id );\n\t\t\tendif;\n\t\t\t\n\t\t\t// Type/Exists check\n\t\t\tif ( $deal_data->is_type('external') || !$deal_data->exists() ) :\n\t\t\t\t$cmdeals->add_error( __('This deals cannot be purchased.', 'cmdeals') );\n\t\t\t\treturn false; \n\t\t\tendif;\n\t\t\t\n\t\t\t// Price set check\n\t\t\tif( $deal_data->get_price() === '' ) :\n\t\t\t\t$cmdeals->add_error( __('This deals cannot be purchased - the price is not yet set.', 'cmdeals') );\n\t\t\t\treturn false; \n\t\t\tendif;\n\t\n\t\t\t// Stock check - only check if we're managing stock and backsales are not allowed\n\t\t\tif ( !$deal_data->has_enough_stock( $quantity ) ) :\n\t\t\t\t$cmdeals->add_error( sprintf(__('You cannot add that amount to the cart since there is not enough stock. We have %s in stock.', 'cmdeals'), $deal_data->get_stock_quantity() ));\n\t\t\t\treturn false; \n\t\t\telseif ( !$deal_data->is_in_stock() ) :\n\t\t\t\t$cmdeals->add_error( __('You cannot add that deals to the cart since the deals is out of stock.', 'cmdeals') );\n\t\t\t\treturn false;\n\t\t\tendif;\n\t\t\t\n\t\t\tif ($cart_item_key) :\n\t\n\t\t\t\t$quantity = $quantity + $this->cart_contents[$cart_item_key]['quantity'];\n\t\t\t\t\n\t\t\t\t// Stock check - this time accounting for whats already in-cart\n\t\t\t\tif ( !$deal_data->has_enough_stock( $quantity ) ) :\n\t\t\t\t\t$cmdeals->add_error( sprintf(__('You cannot add that amount to the cart since there is not enough stock. We have %s in stock and you already have %s in your cart.', 'cmdeals'), $deal_data->get_stock_quantity(), $this->cart_contents[$cart_item_key]['quantity'] ));\n\t\t\t\t\treturn false; \n\t\t\t\telseif ( !$deal_data->is_in_stock() ) :\n\t\t\t\t\t$cmdeals->add_error( __('You cannot add that deals to the cart since the deals is out of stock.', 'cmdeals') );\n\t\t\t\t\treturn false;\n\t\t\t\tendif;\n\t\n\t\t\t\t$this->cart_contents[$cart_item_key]['quantity'] = $quantity;\n\t\n\t\t\telse :\n\t\t\t\t\n\t\t\t\t// Add item after merging with $cart_item_data - hook to allow plugins to modify cart item\n\t\t\t\t$this->cart_contents[$cart_id] = apply_filters('cmdeals_add_cart_item', array_merge( $cart_item_data, array(\n\t\t\t\t\t'deal_id'\t=> $deal_id,\n\t\t\t\t\t'variation_id'\t=> $variation_id,\n\t\t\t\t\t'variation' \t=> $variation,\n\t\t\t\t\t'quantity' \t\t=> $quantity,\n\t\t\t\t\t'data'\t\t\t=> $deal_data\n\t\t\t\t)));\n\t\t\t\n\t\t\tendif;\n\t\n\t\t\t$this->set_session();\n\t\t\t\n\t\t\treturn true;\n\t\t}", "private function validate_sale_items() {\n\t\tif ( 'yes' === $this->exclude_sale_items && $this->is_type( wc_get_product_coupon_types() ) ) {\n\t\t\t$valid_for_cart = false;\n\t\t\t$product_ids_on_sale = wc_get_product_ids_on_sale();\n\n\t\t\tif ( ! WC()->cart->is_empty() ) {\n\t\t\t\tforeach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {\n\t\t\t\t\tif ( ! empty( $cart_item['variation_id'] ) ) {\n\t\t\t\t\t\tif ( ! in_array( $cart_item['variation_id'], $product_ids_on_sale, true ) ) {\n\t\t\t\t\t\t\t$valid_for_cart = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ( ! in_array( $cart_item['product_id'], $product_ids_on_sale, true ) ) {\n\t\t\t\t\t\t$valid_for_cart = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! $valid_for_cart ) {\n\t\t\t\tthrow new Exception( self::E_WC_COUPON_NOT_VALID_SALE_ITEMS );\n\t\t\t}\n\t\t}\n\t}", "function wordimpress_is_conditional_product_in_cart( $product_id ) {\n //Check to see if user has product in cart\n global $woocommerce;\n \n //flag no book in cart\n $book_in_cart = false;\n \n foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) {\n $_product = $values['data'];\n \n if ( in_array($_product->id, $product_id) ) {\n //book is in cart!\n $book_in_cart = true;\n \n }\n }\n \n return $book_in_cart;\n \n}", "public static function check_cart_for_specials() {\n\n $contains_special = false;\n\n foreach ( WC()->cart->get_cart() as $cart_item ) {\n if ( self::is_item_special( $cart_item['data'] ) ) {\n $contains_special = true;\n break;\n }\n }\n\n return $contains_special;\n }", "public function check_cart_items() {\n\t\t$return = true;\n\t\t$result = $this->check_cart_item_validity();\n\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\twc_add_notice( $result->get_error_message(), 'error' );\n\t\t\t$return = false;\n\t\t}\n\n\t\t$result = $this->check_cart_item_stock();\n\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\twc_add_notice( $result->get_error_message(), 'error' );\n\t\t\t$return = false;\n\t\t}\n\n\t\treturn $return;\n\n\t}", "private function validate_cart_excluded_sale_items() {\n\t\tif ( $this->exclude_sale_items == 'yes' ) {\n\t\t\t$valid_for_cart = true;\n\t\t\t$product_ids_on_sale = wc_get_product_ids_on_sale();\n\t\t\tif ( ! WC()->cart->is_empty() ) {\n\t\t\t\tforeach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {\n\t\t\t\t\tif ( ! empty( $cart_item['variation_id'] ) ) {\n\t\t\t\t\t\tif ( in_array( $cart_item['variation_id'], $product_ids_on_sale, true ) ) {\n\t\t\t\t\t\t\t$valid_for_cart = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ( in_array( $cart_item['product_id'], $product_ids_on_sale, true ) ) {\n\t\t\t\t\t\t$valid_for_cart = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! $valid_for_cart ) {\n\t\t\t\tthrow new Exception( self::E_WC_COUPON_NOT_VALID_SALE_ITEMS );\n\t\t\t}\n\t\t}\n\t}", "protected function checkStock()\n {\n DB::beginTransaction();\n try{\n foreach ($this->cart as $item){\n $unit = Itens::find($item->id);\n $qtd = !empty($unit->quantity) ? $unit->quantity : $unit->weight;\n\n if($qtd >= $item->qty){\n if(!empty($unit->quantity)){\n $unit->quantity = $unit->quantity - $item->qty;\n }else{\n $unit->weight = $unit->weight - $item->qty;\n }\n $unit->save();\n }\n }\n DB::commit();\n $this->addItensToOrder();\n Session::flash('error', 'INfelizmente não foi possível processar sua compra devido a falta de estoque para um de nossos itens em cotação');\n }catch (Exception $e){\n DB::rollback();\n DebugBar::addException($e);\n }\n\n }", "public function testDealCard() {\n\t\t\t#test we have one card missing when we deal a card\n\t\t\t$d = new Deck();\n\t\t\t$this->assertEquals(True,is_object($d->dealCard()));\n\t\t\t$this->assertEquals(51,count($d->getDeck()));\n\t\t}", "protected function CheckBasketContents()\n {\n if ('basket' !== $this->fieldSystemname) {\n $oBasket = $this->getShopService()->getActiveBasket();\n if ($oBasket->dTotalNumberOfArticles <= 0) {\n $oBasketStep = TdbShopOrderStep::GetStep('basket');\n $this->JumpToStep($oBasketStep);\n }\n }\n }", "function VariationIsInCart() {\r\n\t\t$variations = $this->owner->Variations();\r\n\t\tif($variations) {\r\n\t\t\tforeach($variations as $variation) {\r\n\t\t\t\tif($variation->OrderItem() && $variation->OrderItem()->Quantity > 0) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function checkOut($order, $cart)\n {\n $db = new Database();\n $conn = $db->getConnection();\n\n $success = false;\n\n $conn->autocommit(FALSE);\n $conn->begin_transaction();\n\n $ordersDataService = new OrderDataService();\n $productBusinessService = new ProductBusinessService();\n\n $orderID = $this->addOrdersLine($order, $conn);\n\n foreach ($cart->getItems() as $product_id => $qty) {\n\n $product = $productBusinessService->getProductByID($product_id);\n\n $orderDetails = new OrderDetails($orderID, $product_id, $qty, ($qty * $product->getPrice()), \"here is some description\");\n $okdetails = $this->addDetailsLine($orderID, $orderDetails, $conn);\n }\n\n if ($orderID && $okdetails) {\n $conn->commit();\n $success = true;\n } else {\n $conn->rollback();\n }\n\n $conn->close();\n\n return $success;\n }", "function getfaircoin_only_one_item_on_cart($download_id) {\r\n //echo 'CART CONTENTS: ';\r\n //print_r($cart_contents);\r\n //$cart_contents = edd_get_cart_contents();\r\n //if($cart_contents) return false;\r\n //else return $download_id;\r\n edd_empty_cart();\r\n}", "public function isGoodsInShopcart()\n\t{\n\t\treturn !!$this->count();\n\t}", "public function bought_coupons($deal_id = null, $user_id = null)\n\t{\n\t\t$bought = 0;\n\t\t\n\t\tif ( ! $user_id) $user_id = user_id();\n\t\t\n\t\t// Get number of bought items\n\t\tif ($entry_id AND $user_id)\n\t\t{\n\t\t\t$bought = self::$_ci->cart_item_m->count_by(array\n\t\t\t(\n\t\t\t\t'user_id' => $user_id,\n\t\t\t\t'entry_id' => $entry_id,\n\t\t\t\t'status' => 'pg-success',\n\t\t\t));\n\t\t}\n\t\t\t\n\t\treturn (int) $bought;\n\t\t\n\t}", "function is_purchased($song){\n if (in_array($song, $this->purchased_songs)){\n return True;\n }\n return False;\n }", "private function validate_cart_excluded_items() {\n\t\tif ( ! $this->is_type( wc_get_product_coupon_types() ) ) {\n\t\t\t$this->validate_cart_excluded_product_ids();\n\t\t\t$this->validate_cart_excluded_product_categories();\n\t\t\t$this->validate_cart_excluded_sale_items();\n\t\t}\n\t}", "public function testRepeatOrderSuccess() {\n $order = new Yourdelivery_Model_Order($this->placeOrder());\n $this->dispatch('/request_order/repeat?hash=' . $order->getHashtag());\n $this->assertResponseCode(200);\n $response = $this->getResponse()->getBody();\n $this->assertGreaterThan(0, strlen($response));\n $json = json_decode($response);\n $this->assertTrue(is_object($json));\n\n $cart = $order->getCard();\n foreach ($cart['bucket'] as $cElem) {\n foreach ($cElem as $elem) {\n\n $count = (integer) $elem['count'];\n $mealId = (integer) $elem['meal']->getId();\n $sizeId = (integer) $elem['size'];\n\n $found = false;\n foreach ($json->meal as $hash => $meal) {\n if ((integer) $meal->id == $mealId &&\n (integer) $meal->size == $sizeId &&\n (integer) $meal->count == $count) {\n $found = true;\n break;\n }\n }\n\n $this->assertTrue($found);\n }\n }\n }", "function checkAuthors () {\n\t\tif ( count ( $this->authors) == 0 ) return ;\n\t\n\t\tif ( isset($this->existing_q) ) {\n\t\t\t$this->wd->loadItem ( $this->existing_q ) ;\n\t\t\t$i = $this->wd->getItem ( $this->existing_q ) ;\n\t\t\t$c1 = $i->getClaims ( $this->props['author'] ) ;\n\t\t\t$c2 = $i->getClaims ( $this->props['short author'] ) ;\n\t\t\t$this->invalidateExistingAuthors ( $c1 ) ;\n\t\t\t$this->invalidateExistingAuthors ( $c2 ) ;\n\t\t\t\n\t\t\t// Special case: Single author, one author already in item...\n\t\t\tif ( count($this->authors) == 1 && count($c1)+count($c2) == 1 ) {\n\t\t\t\t$this->authors[1]->hadthat = true ;\n\t\t\t}\n\t\t}\n\t}", "private function checkIfExistsProducts()\n {\n if (isset($_COOKIE['cart-data'])) {\n $productCookie = htmlspecialchars($_COOKIE['cart-data']);\n $products = trim($productCookie, '|');\n $products = explode('|', $products);\n foreach ($products as $product) {\n if (!Product::find($product)) {\n $productCookie = str_replace('|' . $product . '|', '|', $productCookie);\n }\n }\n setcookie('cart-data', $productCookie, time() + (86400 * 365), \"/\");\n }\n }", "public function cartExists() {\n\t\t$cart = $this->find('first', array('conditions' => $this->cartConditions(), 'contain' => FALSE));\n\t\treturn !empty($cart);\n\t}", "public function sold($deal = null)\n\t{\n\t\t$sold = 0;\n\t\t\n\t\t// Find deal by ID\n\t\tif (is_numeric($deal))\n\t\t{\n\t\t\t$deal = $this->get($deal);\n\t\t}\n\t\t\n\t\t\n\t\t// Find number of sold coupons\n\t\tif ($deal and isset($deal->sold_number))\n\t\t{\n\t\t\t$sold = (int) $deal->sold_number;\n\t\t}\n\t\telseif ($deal)\n\t\t{\n\t\t\t// Get number of sold items\n\t\t\t$sold = (int) $this->cart_item_m->count_by(array\n\t\t\t(\n\t\t\t\t'entry_id' => $deal->id,\n\t\t\t\t'status' => 'pg-success',\n\t\t\t));\n\t\t}\n\t\t\n\t\t\n\t\t// There's the possibility to fake the number of sold coupons so we set that here\n\t\tif (isset($deal->f_fake_coupons) and (int) $deal->f_fake_coupons)\n\t\t{\n\t\t\t$deal->sold_number += (int) $deal->f_fake_coupons;\n\t\t}\n\t\t\n\t\treturn $sold;\n\t\t\n\t}", "function checkCart($TmpCart){\n\t\t$result = array();\n\t\tforeach ($this->Cart as $k => $v){ if($v[\"id\"] == $TmpCart[\"id\"]) $result[] = $k; } // Find Elements with the same product Id\n\t\t$unigue = true;\n\t\tif(count($result)>0){\n\t\t\tforeach ($result as $v){ // Check to see if all the data is the same. Messages and Engravins will always add a new item\n\t\t\t\tif($this->Cart[$v][\"spec\"] == $TmpCart[\"spec\"] && \n\t\t\t\t\t $this->Cart[$v][\"special\"] == $TmpCart[\"special\"] && \n\t\t\t\t\t $this->Cart[$v][\"selections\"] == $TmpCart[\"selections\"] && \n\t\t\t\t\t intval($this->Cart[$v][\"msgs\"]) == 0){ $newattnd=true;\n\t\t\t\t\t\t// Lets check our attendee list and make sure we have any new Attendees: this check is for NITA\n\t\t\t\t\t\tif(isset($this->Cart[$v][\"attnd\"]) && count($this->Cart[$v]['attnd']) > 0 && count($TmpCart['attnd']) > 0){\n\t\t\t\t\t\t\tforeach($this->Cart[$v][\"attnd\"] as $attnd){\n\t\t\t\t\t\t\t\tif($TmpCart['attnd'][0]==$attnd) { $newattnd=false; $unigue = false; break; }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($newattnd && count($TmpCart['attnd'])>0) $this->Cart[$v][\"attnd\"][]=$TmpCart['attnd'][0]; // Add our new Attendee\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(isset($this->Cart[$v]['attnd']) && count($this->Cart[$v]['attnd'])>0 && $this->Cart[$v]['attnd']!==0){\n\t\t\t\t\t\t\t$FoundNull=true;\n\t\t\t\t\t\t\twhile($FoundNull){ $FoundNull=false;\n\t\t\t\t\t\t\t\tforeach($this->Cart[$v]['attnd'] as $KeyAttnd => $ValAttnd){\n\t\t\t\t\t\t\t\t\tif( (is_int($ValAttnd) && intval($ValAttnd)==0) || is_null($ValAttnd) ){\n\t\t\t\t\t\t\t\t\t\tunset( $this->Cart[$v]['attnd'][$KeyAttnd] ); $FoundNull=true; break;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!isset($this->Cart[$v]['attnd']) || $this->Cart[$v]['attnd']===0) $this->Cart[$v]['attnd']=array();\n\t\t\t\t\t\t$this->Cart[$v]['name'] = $TmpCart['name']; // Going to store the name here so we don't have to query the web service for every item in the cart\n\t\t\t\t\t\t$this->Cart[$v][\"type\"] = $TmpCart['type']; // Type 1 = program, Type 2 = product\n\t\t\t\t\t\t//if($TmpCart['type']==1 && count($this->Cart[$v]['attnd'])>0) $this->Cart[$v][\"qty\"]= count($this->Cart[$v]['attnd']); // If product is program quantity equals the number of attendees have a check for zero to allow for item to placed in cart without any attendee's selected\n\t\t\t\t\t\t//else\n\t\t\t\t\t\t$this->Cart[$v][\"qty\"] += $TmpCart[\"qty\"]; $unigue = false; break; // Updates our cart quantitee\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($unigue) $this->Cart[] = $TmpCart; // If we have a unigue item add it to the cart.\n\t}", "public static function geoCart_initItem_forceOutsideCart()\n {\n //most need to return false.\n return false;\n }", "function is_deal_booked_by_user($mobile,$deal_id){\n //check this deal is not booked by this user already\n $count = Db::rowCount(\"booked_deals\",array(\n \"mobile\" => $mobile,\n \"deal_id\" => $deal_id\n ),array(\"=\",\"=\"));\n return $count >= 1 ? true : false;\n}", "private function verifyItems(string $objectId): void\n {\n //====================================================================//\n // Read Order Data from Module\n $data = $this->getOrderItemsData($objectId);\n //====================================================================//\n // Read Order from Magento\n $items = $this->getMagentoOrderItems($objectId);\n //====================================================================//\n // Verify Quantities\n $totalFound = 0;\n foreach ($items as $key => $orderItem) {\n $splashItem = $data[\"lines\"][$key];\n //====================================================================//\n // Splash Item Has Qty & Prices Set\n $this->assertArrayHasKey(\"qty_ordered\", $splashItem);\n $this->assertArrayHasKey(\"unit_price\", $splashItem);\n $this->assertNotEmpty($splashItem[\"unit_price\"]);\n if ((\"bundle\" == $orderItem->getProductType()) || $orderItem->getHasChildren()) {\n //====================================================================//\n // Bundle Has Null Qty\n $this->assertEquals(0, $splashItem[\"qty_ordered\"]);\n //====================================================================//\n // Bundle Has Real Prices\n $this->assertGreaterThan(0, $splashItem[\"unit_price\"][\"ht\"]);\n $this->assertGreaterThan(0, $splashItem[\"unit_price\"][\"ttc\"]);\n $totalFound++;\n }\n //====================================================================//\n // Bundle Has Qty\n if ($orderItem->getParentItemId()) {\n $this->assertGreaterThan(0, $splashItem[\"qty_ordered\"]);\n $this->assertGreaterThan(0, $splashItem[\"unit_price\"][\"ht\"]);\n $this->assertGreaterThan(0, $splashItem[\"unit_price\"][\"ttc\"]);\n $totalFound++;\n }\n }\n $this->assertGreaterThan(1, $totalFound);\n }", "function checkCartForItem($addItem, $cartItems) {\n if (is_array($cartItems) && !(is_null($cartItems)))\n {\n foreach($cartItems as $key => $item) \n {\n if($item['productId'] == $addItem)\n return true;\n }\n }\n return false;\n}" ]
[ "0.5724019", "0.56867766", "0.5617687", "0.5592178", "0.55857885", "0.53485966", "0.5319544", "0.53194904", "0.5308252", "0.5212544", "0.51938987", "0.5121895", "0.5091952", "0.5048193", "0.5046037", "0.5021176", "0.5005272", "0.4992454", "0.49872866", "0.49625215", "0.49554121", "0.49460617", "0.4945084", "0.49373484", "0.48701638", "0.4852172", "0.48103714", "0.47966915", "0.47912577", "0.4775891" ]
0.5968807
0
get array number day by month current
function getDay($month, $year) { if ( empty($year) ) { $year = date('Y'); } $day_arr = array(); if ( $month != 0 ) { $number = date('t', mktime(0, 0, 0, $month, 1, $year)); for ( $i = 1; $i <= $number; $i++ ) { $i = sprintf('%02d', $i); $day_arr[$i] = $i; } } return $day_arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_month_days_cm ($fecha) {\n $labels = array();\n $month = month_converter($fecha->month);\n $monthdays = cal_days_in_month(CAL_GREGORIAN, $fecha->month, $fecha->year);\n $i = 0;\n while ($i < $monthdays) {\n $i++;\n $labels[] = $i;\n }\n return $labels;\n}", "function getCurrentDayInMonthNumber ()\n\t{\n\t\treturn date ('j');\n\t}", "private function _daysInMonth ()\n {\n return date('t', strtotime($this->currentYear.'-'.$this->currentMonth));\n }", "function get_month_days ($month) {\n $labels = array();\n $month = month_converter($month);\n $monthdays = cal_days_in_month(CAL_GREGORIAN, $month, $date->format('Y'));\n $day = $date->format('d');\n $i = 0;\n while ($i < 30) {\n if ($day <= $monthdays) {\n if (strlen($day) == 1) {\n $day = '0' . $day;\n }\n if (strlen($month) == 1) {\n $month = '0' . $month;\n }\n $labels[] = $day.'-'.$month;\n $day++;\n $i++;\n } else {\n $day = 1;\n $month++;\n $monthdays = cal_days_in_month(CAL_GREGORIAN, $month, $date->format('Y'));\n }\n }\n return $labels;\n}", "function get_daily_weather_for_month( \n $y = 2014, \n $m = 01 )\n {\n $days = date( 't', mktime( 0, 0, 0, $m, 1, $y ) );\n $data = array();\n for ( $i = 1; $i <= $days; $i++ ) {\n $date = date( 'Y-m-d', mktime( 0, 0, 0, $m, $i, $y ) );\n $results = $this->_db->select( \n \"SELECT * \n FROM weather_days\n WHERE date_day = '\".$date.\"'\" );\n if ( is_object( $results[0] ) ) {\n $data[$i] = $results[0];\n }\n }\n return $data;\n }", "public function daysOfMonthProvider(): array\n {\n return [\n // Time Days Match?\n ['1st January', [1], true],\n ['2nd January', [1], false],\n ['2nd January', [2], true],\n ['2nd January', [1, 2], true],\n ['31st January', [1, 8, 23, 31], true],\n ['29th February 2020', [29], true],\n ];\n }", "public function getDaysAsArray()\n {\n $days = [];\n $startCurrent = $this->weekdayIndexes[$this->currentMonth[\"weekday\"]];\n $startPrevious = $this->noOfDaysPrevious - ($startCurrent - 1);\n // Add days of previous month\n for ($i = $startPrevious; $i <= $this->noOfDaysPrevious; $i++) {\n $days[] = $i;\n }\n // Add days of current month\n for ($j = 1; $j <= $this->noOfDays; $j++) {\n $days[] = $j;\n }\n // Add days of next month\n for ($k = 1; count($days) % 7 !== 0; $k++) {\n $days[] = $k;\n }\n return $days;\n }", "protected function getDaysArray($month, $year)\n\t{\n\t\t$daysinmonth = $this->days_in_month($month, $year);\n\t\t$domStar = false;\n\t\t$dowStar = false;\n\t\t$da = array_pad([], $daysinmonth + 1, null);\n\t\tunset($da[0]);\n\t\t$dwa = array_pad([], $daysinmonth + 1, null);\n\t\tunset($dwa[0]);\n\t\tforeach ($this->_attr[self::DAY_OF_MONTH] as $d) {\n\t\t\tif ($d['dom'] === '*' || $d['dom'] === '?') {\n\t\t\t\t$domStar = (($d['dom'] == '?') || ($d['period'] == 1));\n\t\t\t\tforeach ($da as $key => $value) {\n\t\t\t\t\tif (($key - 1) % $d['period'] == 0) {\n\t\t\t\t\t\t$da[$key] = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif (is_numeric($d['dom'])) {\n\t\t\t\t$startDay = $d['dom'];\n\t\t\t\tif ($d['domWeekday']) {\n\t\t\t\t\t$datea = getdate(strtotime(\"$year-$month-$startDay\"));\n\t\t\t\t\tif ($datea['wday'] == 6) {\n\t\t\t\t\t\tif ($startDay == 1) {\n\t\t\t\t\t\t\t$startDay = 3;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$startDay--;\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ($datea['wday'] == 0) {\n\t\t\t\t\t\tif ($startDay == $daysinmonth) {\n\t\t\t\t\t\t\t$startDay = $daysinmonth - 2;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$startDay++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$endDay = $d['end'];\n\t\t\t\tif ($d['endWeekday']) {\n\t\t\t\t\t$datea = getdate(strtotime(\"$year-$month-$endDay\"));\n\t\t\t\t\tif ($datea['wday'] == 6) {\n\t\t\t\t\t\tif ($endDay == 1) {\n\t\t\t\t\t\t\t$endDay = 3;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$endDay--;\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ($datea['wday'] == 0) {\n\t\t\t\t\t\tif ($endDay == $daysinmonth) {\n\t\t\t\t\t\t\t$endDay = $daysinmonth - 2;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$endDay++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor ($i = $startDay; $i <= $endDay && $i <= 31; $i += $d['period']) {\n\t\t\t\t\t$da[$i] = 1;\n\t\t\t\t}\n\t\t\t} elseif ($d['dom'] == 'L') {\n\t\t\t\t$less = empty($d['end']) ? 0 : $d['end'];\n\t\t\t\t$da[$daysinmonth - $less] = 1;\n\t\t\t}\n\t\t}\n\t\t$firstDatea = getdate(strtotime(\"$year-$month-01\"));\n\t\tforeach ($this->_attr[self::DAY_OF_WEEK] as $d) {\n\t\t\tif (is_numeric($d['dow'])) {\n\t\t\t\t//start at the first sunday on or before the 1st day of the month\n\t\t\t\tfor ($i = 1 - $firstDatea['wday']; $i <= $daysinmonth; $i += 7) {\n\t\t\t\t\tfor ($ii = $d['dow']; ($ii <= $d['end']) && ($ii < 7) && (($i + $ii) <= $daysinmonth); $ii += $d['period']) {\n\t\t\t\t\t\t$iii = $i + $ii;\n\t\t\t\t\t\t$w = floor(($iii + 6) / 7);\n\t\t\t\t\t\t$lw = floor(($daysinmonth - $iii) / 7);\n\n\t\t\t\t\t\tif (($iii >= 0) && ((!$d['week'] || $d['week'] == $w) && (!$d['lastDow'] || $lw == 0))) {\n\t\t\t\t\t\t\t$dwa[$iii] = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($dowStar) {\n\t\t\treturn $da;\n\t\t} elseif ($domStar) {\n\t\t\treturn $dwa;\n\t\t}\n\t\tforeach ($da as $key => $value) {\n\t\t\t$da[$key] = $value && ($dwa[$key] ?? 0);\n\t\t}\n\t\treturn $da;\n\t}", "function getDays_ym($month, $year){\n // Start of Month\n $start = new DateTime(\"{$year}-{$month}-01\");\n $month = $start->format('F');\n\n // Prepare results array\n $results = array();\n\n // While same month\n while($start->format('F') == $month){\n // Add to array\n $day = $start->format('D');\n $sort_date = $start->format('j');\n $date = $start->format('Y-m-d');\n $results[$date] = ['day' => $day,'sort_date' => $sort_date,'date' => $date];\n\n // Next Day\n $start->add(new DateInterval(\"P1D\"));\n }\n // Return results\n return $results;\n}", "function getDaysInMonth()\r\n {\r\n return Data_Calc::diasInMonth($this->mes, $this->ano);\r\n }", "function ShowDayOfMonth($get_month){\n\t$arr_d1 = explode(\"-\",$get_month);\n\t$xdd = \"01\";\n\t$xmm = \"$arr_d1[1]\";\n\t$xyy = \"$arr_d1[0]\";\n\t$get_date = \"$xyy-$xmm-$xdd\"; // วันเริ่มต้น\n\t//echo $get_date.\"<br>\";\n\t$xFTime1 = getdate(date(mktime(0, 0, 0, intval($xmm+1), intval($xdd-1), intval($xyy))));\n\t$numcount = $xFTime1['mday']; // ฝันที่สุดท้ายของเดือน\n\tif($numcount > 0){\n\t\t$j=1;\n\t\t\tfor($i = 0 ; $i < $numcount ; $i++){\n\t\t\t\t$xbasedate = strtotime(\"$get_date\");\n\t\t\t\t $xdate = strtotime(\"$i day\",$xbasedate);\n\t\t\t\t $xsdate = date(\"Y-m-d\",$xdate);// วันถัดไป\t\t\n\t\t\t\t $arr_d2 = explode(\"-\",$xsdate);\n\t\t\t\t $xFTime = getdate(date(mktime(0, 0, 0, intval($arr_d2[1]), intval($arr_d2[2]), intval($arr_d2[0]))));\t\n\t\t\t\t if($xFTime['wday'] == 0){\n\t\t\t\t\t $j++;\n\t\t\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t\tif($xFTime['wday'] != \"0\"){\n\t\t\t\t\t\t$arr_date[$j][$xFTime['wday']] = $xsdate;\t\n\t\t\t\t\t}\n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t}//end if($numcount > 0){\n\treturn $arr_date;\t\n}", "private function daysDefault(){\n $data = array();\n\n for($i=1; $i<=31; $i++){\n $data['day_'.$i] = 0;\n }\n\n return $data;\n }", "function get_month()\n {\n $datearray=getdate($this->timestamp);\n return $datearray[\"mon\"];\n }", "private function _getDaysArray($month, $year = 0)\n {\n if ($year == 0)\n {\n $year = $this->year;\n }\n\n $days = array();\n\n // Return everyday of the month if both bit[2] and bit[4] are '*'\n if ($this->bits[2] == '*' AND $this->bits[4] == '*')\n {\n $days = $this->_getDays($month, $year);\n }\n else\n {\n // Create an array for the weekdays\n if (substr($this->bits[4], 0, 1) == '*')\n {\n if (substr($this->bits[4], 1, 1) == '/')\n {\n $step = (int) substr($this->bits[4], 2);\n }\n else\n {\n $step = 1;\n }\n \n for ($i = 0; $i <= 6; $i += $step)\n {\n $arWeekdays[] = $i;\n }\n }\n else\n {\n $arWeekdays = $this->_expandRanges($this->bits[4]);\n $arWeekdays = $this->_sanitize($arWeekdays, 0, 7);\n\n // Map 7 to 0, both represents Sunday. Array is sorted already!\n if (in_array(7, $arWeekdays))\n {\n if (in_array(0, $arWeekdays))\n {\n array_pop($arWeekdays);\n }\n else\n {\n $tmp[] = 0;\n array_pop($arWeekdays);\n $arWeekdays = array_merge($tmp, $arWeekdays);\n }\n }\n }\n\n if ($this->bits[2] == '*')\n {\n $daysmonth = $this->_getDays($month, $year);\n }\n else\n {\n $daysmonth = $this->_expandRanges($this->bits[2]);\n\n // So that we do not end up with 31 of Feb\n $daysInMonth = $this->_daysInMonth($month, $year);\n $daysmonth = $this->_sanitize($daysmonth, 1, $daysInMonth);\n }\n\n // Now match these days with weekdays\n foreach ($daysmonth AS $day)\n {\n $wkday = date('w', mktime(0, 0, 0, $month, $day, $year));\n if (in_array($wkday, $arWeekdays))\n {\n $days[] = $day;\n }\n }\n }\n\n return $days;\n }", "function get_day()\n {\n $datearray=getdate($this->timestamp);\n return $datearray[\"mday\"];\n }", "public static function getDaysInMonth($month, $year) {}", "private function _daysInMonth($month=null,$year=null){\n \n if(null==($year))\n $year = date(\"Y\",time()); \n \n if(null==($month))\n $month = date(\"m\",time());\n \n return date('t',strtotime($year.'-'.$month.'-01'));\n }", "private function _getDays($month, $year)\n {\n $daysInMonth = $this->_daysInMonth($month, $year);\n $days = array();\n\n for ($i = 1; $i <= $daysInMonth; $i++)\n {\n $days[] = $i;\n }\n\n return $days;\n }", "function getMonthArray()\n{\n\t$arrMonths = array();\n\n\tfor ($i=1; $i<13; $i++)\n\t{\n\t\t$arrMonths[$i] = date('M', mktime(0, 0, 1, $i, 1));\n\t}\n\t\n\treturn $arrMonths;\n}", "public function getMonthEn() \n {\n $month = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');\n \n return $month;\n }", "public function mes(){\n\n\t\t$date = $this->dia;\n $date = DateTime::createFromFormat('Y-m-d', $date);\n \t \n\t\treturn $date->format('m') - 1;\n\t}", "public function getTwelveMonth() {\n $result = array();\n $cur = strtotime(date('Y-m-01', time()));\n for ($i = 0; $i <= 11; $i++) {\n $result[$i] = date('M', $cur);\n $cur = strtotime('next month', $cur);\n }\n\n return $result;\n }", "function _makeMonth($date){\n // YYYY-MM and return an array of all the days\n // in the the month. The array that is returned\n // is in the same formate which is returned by\n // 'makeWeek' function\n $start = Carbon::parse($date)->startOfMonth();\n $end = Carbon::parse($date)->endOfMonth();\n $month = [];\n while ($start->lte($end)) {\n $carbon = $start;\n $month[] = $this->_makeDay($carbon);\n $start->addDay();\n }\n return $month;\n }", "public function SelectArrayStartingToday()\n {\n\t\t$ListOfDates;\n\t\t\n\t\t\n\t\t$TodayDay = $this->GetThisDay();\n\t\t$ThisMonth = date('m');\n\t\t$ThisYear = $this->GetThisYear();\n\t\t$NextYear = $ThisYear+1;\n\t\t$ListOfDates = [ $ThisYear, $NextYear ];\n\t\t\n\t\t$rangeMonths = array();\n\t\tfor ($i = $ThisMonth; $i <= 12; $i++ )\n\t\t{\n\t\t\tarray_push( $rangeMonths, $i);\n\t\t}\n\t\t$ListOfDates[$ThisYear] = $rangeMonths;\n\t\t\n\t\t$rangeMonths = array();\n\t\tfor ($i = 1; $i <= 12; $i++ )\n\t\t{\n\t\t\tarray_push($rangeMonths, $i );\n\t\t}\n\t\t$ListOfDates[$NextYear] = $rangeMonths;\n\t\t\n\t\t//Get the number of days in this month\n\t\t$NumberofDays = cal_days_in_month(CAL_GREGORIAN, $ThisMonth, $ThisYear);\n\t\t\n\t\t//Subtract NumberofDays by $TodayDay to get days left. 31 - 14 = 17days left 15, 16 , 17 to 31 \n\t\t$Daysleft = $NumberofDays - $TodayDay;\n\t\t$rangeofdaysleft = array(); // will hold the array of days left in the month, including today.\n\t\t\n\t\tfor( $i = $TodayDay; $i <= $NumberofDays; $i++ )\n\t\t{\n\t\t\tarray_push($rangeofdaysleft, $i);\n\t\t}\n\t\n\t\t//$ListOfDates[$ThisYear];\n\t\tfor( $i = $ThisMonth; $i <= 12 ; $i++)\n\t\t{\n\t\t\tif($i == $ThisMonth)\n\t\t\t{\n\t\t\t\t$ListOfDates[$ThisYear][$i] = $rangeofdaysleft;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$range = array();\n\t\t\t\t$MaxDays = cal_days_in_month(CAL_GREGORIAN, $i, $ThisYear);\n\t\t\t\tfor($d = 1; $d <= $MaxDays; $d++)\n\t\t\t\t{\n\t\t\t\t\tarray_push($range, $d);\n\t\t\t\t}\n\t\t\t\t$ListOfDates[$ThisYear][$i] = $range;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t//array_push($ListOfDates, $arrCurrentYear);\n\t\t\n\t\n\t\tfor( $i = 1 ; $i <= 12; $i++\t)\n\t\t{\n\t\t\t$range = array();\n\t\t\t$MaxDays = cal_days_in_month(CAL_GREGORIAN, $i, $NextYear);\n\t\t\tfor($d = 1; $d <= $MaxDays; $d++)\n\t\t\t{\n\t\t\t\tarray_push($range, $d);\n\t\t\t}\n\t\t\t$ListOfDates[$NextYear][$i] = $range;\n\t\t\t\n\t\t}\n\t\t//array_push($ListOfDates, $arrNextYear);\n\t\t\n\t\t\n\t\t\n\t\treturn json_encode($ListOfDates);\n\t\n\t}", "function getDayInMonthFromDate ($theDate)\n\t{\n\t\tif (gettype($theDate) == 'string')\n\t\t{\n\t\t\t$theDate = strtotime ($theDate);\n\t\t}\n\t\t$dateArray = getdate ($theDate);\n\t\treturn $dateArray ['mday'];\n\t}", "protected function getMonthValues()\r\n {\r\n\t $month = array();\r\n\t $month[1] = 'January';\r\n\t $month[2] = 'February';\r\n\t $month[3] = 'March';\r\n\t $month[4] = 'April';\r\n\t $month[5] = 'May';\r\n\t $month[6] = 'June';\r\n\t $month[7] = 'July';\r\n\t $month[8] = 'August';\r\n\t $month[9] = 'September';\r\n\t $month[10] = 'October';\r\n\t $month[11] = 'November';\r\n\t $month[12] = 'December';\t \r\n\t \r\n\t return $month;\r\n }", "function createNextMonthArray() { \n\t\t$date = date(\"Ymd\");\n\t\t$result = array($date);\n\n\n\t\tfor ($i=0; $i < 5; $i++) { \n\t\t\t$timestamp = strtotime($date);\n\t\t\t$date =date(\"Ymd\", strtotime('+1 day', $timestamp));\n\t\t\tarray_push($result,$date);\n\t\t}\n\t\treturn $result;\n\t}", "public function getNumberOfDays($month = \"\"){ $month = ($month == \"\")? $this->getMonth(): $month; return cal_days_in_month(CAL_GREGORIAN,$month,$this->getYear());}", "public function getDayOfMonth()\n {\n return $this->dayOfMonth;\n }", "protected function month(){\n return $this->now->format('m');\n }" ]
[ "0.6923537", "0.6776679", "0.6755445", "0.66507155", "0.66411805", "0.6601844", "0.65470237", "0.65130025", "0.6460665", "0.64301217", "0.6428734", "0.637385", "0.6306657", "0.6304316", "0.62353903", "0.61570704", "0.61460215", "0.6082594", "0.6061218", "0.6047434", "0.60170555", "0.5999408", "0.59577006", "0.5947453", "0.59359235", "0.59295714", "0.5917627", "0.5908068", "0.59025484", "0.5883601" ]
0.70013785
0
convert date to YYYYMM
function date2YearMonth($date=null){ if(!empty($date)){ return date('Ym', strtotime($date)); }else{ return ''; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convert_date_to_mmdd($date) {\n\t$date = date('m/d', strtotime($date));\n\n\treturn $date;\n}", "public function transform($date)\n {\n if ($date === null) {\n return '';\n }\n return $date->format('d') . '/' . $date->format('m') . '/' . $date->format('Y');\n }", "public function convert_month_year_display($created_date){\n\t\tif(($created_date != '') && ($created_date != '0000-00-00') && ($created_date != '0000-00-00 00:00:00')){\n\t\t\t$c_d = date('M-Y', strtotime($created_date));\n\t\t\treturn $c_d;\n\t\t}\n\t}", "public function transform($date)\n {\n if (null === $date) {\n return '';\n }\n return $date->format('d') . '/' . $date->format('m') . '/' . $date->format('Y');\n }", "function uwwtd_get_MM_DD_YYYY_from_YYYY_MM_DD_XXX($date) {\n $return = '';\n if (!empty($date)) {\n if (strlen($date) > 10) {\n $date = substr($date, 0, 10);\n }\n $dateObj = new DateTime($date);\n $return = $dateObj->format('m/d/Y');\n }\n return $return;\n}", "function utility_convertDateToWikiMonth($date) {\n $s = date_create_from_format('Ymd', '20010101');\n $e = date_create_from_format('Ymd', $date);\n $diff = $s->diff($e);\n // Need to add years to the month diff\n $m = ($diff->format('%y') * 12) + $diff->format('%m');\n return $m;\n}", "function monthdate($date) {\n #print \"monthdate($date)<br>\\n\";\n return trim(substr($date, 5, 2) . substr($date, 8, 2));\n }", "function conv_date($date)\n\t{\n\t\t$arr = explode(' ', $date);\n\t\t$y = $arr[2];\n\t\t$m = $this->convert_month_name('Eng-Num', str_replace(',','',$arr[0]));\n\t\t$d = $arr[1];\n\t\t\n\t\treturn $y.'-'.$m.'-'.$d; // output : 1986-1-24\n\t}", "public function convertCCYYMMDD($date = null);", "function uwwtd_get_DD_MM_YYYY_from_YYYY_MM_DD_XXX($date) {\n $return = '';\n if (!empty($date)) {\n if (strlen($date) > 10) {\n $date = substr($date, 0, 10);\n }\n $dateObj = new DateTime($date);\n $return = $dateObj->format('d/m/Y');\n }\n return $return;\n}", "public function transform($date)\n {\n if (null === $date) {\n return '';\n }\n\n return $date->format('Y');\n }", "function convertdateanglais($date){\n\t$ladate=explode('-',$date);\n\t$jour=$ladate[2];\n\t$moi=$ladate[1];\n\t$anne=$ladate[0];\n\t$madate=date(\"d/m/Y\", mktime(0, 0, 0, $moi, $jour, $anne));\n\treturn $madate;\n}", "public static function getFullMonthNumberFromDate($date) {\n\t\treturn substr($date, 5, 2);\n\t}", "function date_month($date){\r\n\t$month = NULL;\r\n\t$cont = 0;\r\n\tfor($i = 0; $i < strlen($date); $i++){\r\n\t\tif(is_numeric(substr($date, $i, 1))){\r\n\t\t\tif($cont == 1){\r\n\t\t\t\t$month .= substr($date, $i, 1);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif($cont > 0){\r\n\t\t\t\treturn $month;\r\n\t\t\t}else{\r\n\t\t\t\t$cont++;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn $month;\r\n}", "function numtomonth($nmonth)\n {\n if($nmonth==1){\n return \"January\";\n }elseif ($nmonth==2) {\n return \"February\";\n }elseif ($nmonth==3) {\n return \"March\";\n }elseif ($nmonth==4) {\n return \"April\";\n }elseif ($nmonth==5) {\n return \"May\";\n }elseif ($nmonth==6) {\n return \"Jun\";\n }elseif ($nmonth==7) {\n return \"July\";\n }elseif ($nmonth==8) {\n return \"August\";\n }elseif ($nmonth==9) {\n return \"September\";\n }elseif ($nmonth==10) {\n return \"October\";\n }elseif ($nmonth==11) {\n return \"November\";\n }elseif ($nmonth==12) {\n return \"December\";\n }else\n {\n $nmonth=$nmonth-12;\n return numtomonth($nmonth);\n }\n }", "function convert_date_to_daymmdd($date) {\n\t$date = date('l m/d', strtotime($date));\n\n\treturn $date;\n}", "public function convert_quater_month($created_date){\n\t\tif(($created_date != '') && ($created_date != '0000-00-00')){\n\t\t\t$c_d = date('M', strtotime($created_date));\n\t\t\treturn $c_d;\n\t\t}\n\t}", "function getMonthDir() {\n return date(\"Y_m\");\n }", "function dateformatusa($date)\n{\n\t$ndate = explode(\"-\",$date);\n\t$year = $ndate[2];\n\t$day = $ndate[0];\n\t$month = $ndate[1];\n\t\n\treturn $year . \"-\" . $month . \"-\" . $day;\n}", "public function monthPadDates()\n {\n return date('w', strtotime(date('Y-m-01', strtotime($this->strStart))));\n }", "function numtomonth($nmonth)\n\t {\n\t if($nmonth==1){\n\t return \"January\";\n\t }elseif ($nmonth==2) {\n\t return \"February\";\n\t }elseif ($nmonth==3) {\n\t return \"March\";\n\t }elseif ($nmonth==4) {\n\t return \"April\";\n\t }elseif ($nmonth==5) {\n\t return \"May\";\n\t }elseif ($nmonth==6) {\n\t return \"Jun\";\n\t }elseif ($nmonth==7) {\n\t return \"July\";\n\t }elseif ($nmonth==8) {\n\t return \"August\";\n\t }elseif ($nmonth==9) {\n\t return \"September\";\n\t }elseif ($nmonth==10) {\n\t return \"October\";\n\t }elseif ($nmonth==11) {\n\t return \"November\";\n\t }elseif ($nmonth==12) {\n\t return \"December\";\n\t }else\n\t {\n\t $nmonth=$nmonth-12;\n\t return numtomonth($nmonth);\n\t }\n\t }", "function _reformat_date($inDate) {\n $outDate = $inDate;\n $months = array(\n \"Maa\" => \"Mar\",\n \"Mei\" => \"May\",\n \"Okt\" => \"Oct\"\n );\n if (empty($inDate)) {\n return $outDate;\n }\n $parts = explode(\"-\", $inDate);\n if (!isset($parts[1]) || !isset($parts[2])) {\n return $outDate;\n } else {\n $newMonth = CRM_Utils_Array::value($parts[1], $months);\n if (!empty($newMonth)) {\n $outDate = $parts[0].\"-\".$newMonth.\"-\".$parts[2];\n }\n }\n return $outDate;\n}", "function dateToDDMMYYYY ($dateSource, $date) {\n\t$dateOUT = \"\";\n\t$dateSource = strtolower($dateSource);\n\t// Replace '/' by '-' from original date. This allow me use \"sscanf($date,\"%d %d %d\")\"\n\t$date = str_ireplace(\"/\", \"-\", $date);\n\tif ($date != \"\") {\n\t\tif ($dateSource == \"yyyymmdd\")\n\t\t\tlist($year, $month, $day) = sscanf($date,\"%d %d %d\");\n\t\tif ($dateSource == \"ddmmyyyy\")\n\t\t\tlist($day, $month, $year) = sscanf($date,\"%d %d %d\");\n\t\tif ($dateSource == \"yyyyddmm\")\n\t\t\tlist($year, $day, $month) = sscanf($date,\"%d %d %d\");\n\t\tif ($dateSource == \"mmyyyydd\")\n\t\t\tlist($month, $year, $day) = sscanf($date,\"%d %d %d\");\n\t\tif ($dateSource == \"\") {\n\t\t\t// Autodetect mode [Supported modes: (YYYYMMDD) Or (DDMMYYYY)]\n\t\t\tlist($day, $month, $year) = sscanf($date,\"%d %d %d\");\n\t\t\tif (strlen($year) <= 3) {\n\t\t\t\tlist($year, $month, $day) = sscanf($date,\"%d %d %d\");\n\t\t\t}\n\t\t}\n\t\t$dateOUT = sprintf (\"%02d/%02d/%04d\", abs($day), abs($month), abs($year));\n\t}\n\treturn ($dateOUT);\n}", "public function getMonth($date=null){\n\t\treturn date_format($this->createDate($date),\"m\");\n\t}", "function format_date_YYYYMMDD($filename = '')\n{\n $dff = date_from_filename($filename);\n if (count($dff) == 0) return '';\n return join('', $dff);\n}", "function dateToGoodFormat($date){\n\t\t$toTest = explode(\"/\",$date);\n\t\t$jj = intval($toTest[0]);\n\t\t$mm = intval($toTest[1]);\n\t\t$aaaa = intval($toTest[2]);\n\t\treturn ($aaaa.\"-\".$mm.\"-\".$jj);\n\t}", "function dateFix($date) {\n\n $dateArray = explode(\"-\",$date);\n\n $year = $dateArray[0];\n $month = $dateArray[1];\n $day = $dateArray[2];\n\n return date(\"Y-m-d\",mktime(0,0,0,$month,$day,$year));\n\n}", "function dbdate($date){\n\t\t$date=explode(\"-\",$date);\n\t\t$year=explode(\" \",$date[2]);\n\t\t$date1=$year[0].\"-\";\n\t\tif($date[1]<10 && (substr($date[1],0,1)!=0))\n\t\t\t$date1.=\"0\".$date[1].\"-\";\n\t\telse\n\t\t\t$date1.=$date[1].\"-\";\n\t\tif($date[0]<10 && (substr($date[0],0,1)!=0))\n\t\t\t$date1.=\"0\".$date[0].\" \".$year[1];\n\t\telse\n\t\t$date1.=$date[0].\" \".$year[1];\n\t\treturn $date1;\n\t}", "static function getFolderMonthYear($filename) {\n $str = explode('_', $filename);\n return $str [0] . '_' . $str [1];\n }", "public function toMonth(int $int)\n {\n return date('F', mktime(0, 0, 0, $int, 10));\n }" ]
[ "0.6681563", "0.6523007", "0.6498544", "0.6492454", "0.6471678", "0.64606804", "0.6431762", "0.6411973", "0.6279234", "0.6236314", "0.6206356", "0.61481196", "0.61475796", "0.6126886", "0.6065553", "0.6064248", "0.6042289", "0.6038749", "0.603303", "0.602878", "0.6013536", "0.59800947", "0.5971009", "0.590334", "0.5881195", "0.5849746", "0.5843576", "0.58235127", "0.57997215", "0.57974523" ]
0.7367376
0
convert time 3 digit to 4 digit
function time2D4($time){ if ( strlen($time) <= 3 ) $time = sprintf('%04d', $time); $result = array( 'hh' => '00', 'mm' => '00' ); if ( strlen($time) == 4 ) { $result['hh'] = substr($time, 0, 2); $result['mm'] = substr($time, 2, 2); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convert_time ($time = '') {\n $str_time = '';\n\n $time_in_second = $time / 1000;\n\n $nb_minutes = $time_in_second / 60;\n $nb_seconds = $time_in_second % 60;\n\n $str_time = $nb_seconds.'s';\n\n if ($nb_minutes >= 60) {\n $nb_heures = $nb_minutes / 60;\n $nb_minutes = $nb_minutes % 60;\n $str_time = floor($nb_heures).'h '.$nb_minutes.'m '.$str_time;\t\t\t\t\t\t\t\t\t\n } else {\n $str_time = floor($nb_minutes).'m '.$str_time;\n }\t\t\n return $str_time;\n\n }", "function timeFormat($string1, $string2, $string3){\n if ($string1 >=0 && $string1 <=9){\n $string1 = 0 . $string1;\n }\n if ($string2 >=0 && $string2 <=9){\n $string2 = 0 . $string2;\n }\n if ($string3 >=0 && $string2 <=9){\n $string3 = 0 . $string3;\n }\n return $string1 . \":\" . $string2 .\":\" . $string3;\n}", "static function string_format_time($time){\r\n $h = intval($time / 60);\r\n $min = $time % 60;\r\n $ret = '';\r\n\r\n if($h > 0){\r\n if($h == 1){\r\n $ret .= $h.' heure ';\r\n } else {\r\n $ret .= $h.' heures ';\r\n }\r\n }\r\n\r\n if($min > 0){\r\n $ret .= $min . ' minutes';\r\n }\r\n\r\n if($time == 0){\r\n $ret .= '0 heure';\r\n }\r\n\r\n return $ret;\r\n }", "function formatTime($time){\n if(!$time){\n return '-';\n }\n $seconds = ($time/1000);//\n $minutes =floor($seconds / 60);\n $seconds = ($seconds % 60);//\n $hours = floor($seconds / 3600);\n\n return $hours.':'.$minutes.':'.$seconds;\n }", "function time2str ($t) {\n\tif ($t == '00:00:00' OR $t == '') {\n\t\treturn '';\n\t}\n\tlist($h,$m,$s) = explode(\":\",$t);\n\t$ampm = ($h >= 12) ? \"p.m.\" : \"a.m.\";\n\t// if between 12 - 1 p.m.\n if ($h % 12 == 0) {\n return ($m > 0) ? \"12:\" . $m . \" \" . $ampm : \"Noon\";\n\t } else {\n\t\t\treturn ($m > 0) ? $h % 12 . \":\" . $m . \" \" . $ampm : $h % 12 . \" \" . $ampm;\n\t }\n}", "public function timeFormat();", "function convert_time($time) {\n\t$date = date('g:i A', strtotime($time));\n\n\treturn $date;\n}", "function formatTime($tokenList)\n\t{\n\t\t$time = join(\" \",$tokenList);\t\t\n\n\t\t// if am/pm denoted as a or p, remove space between digit and a/p char\t\t\n\t\t$time = preg_replace(\"/([0-9]*[0-9]) (A|P) /i\", \" \\\\1\\\\2 \",$time);\n\t\t\n\t\t// compress small times like 8 - 5 or 8a - 5p\n\n\t\t$time = str_replace(\" - \",\"-\",$time);\n\t\t$time = str_replace(\"- \",\"-\",$time);\n\t\treturn $time;\t\t\n\t}", "function timeConversion($s) {\n /*\n * Write your code here.\n */\n $tim = \"\";\n $arr = preg_split(\"/[:]/\",$s);\n\n if( preg_match( '/AM$/', $arr[2]) ) {\n $replace = str_replace('AM', '', $arr[2]);\n if($arr[0] === \"12\"){\n $arr[0] = \"00\";\n }\n }else{ // PM\n $replace = str_replace('PM', '', $arr[2]);\n\n if($arr[0] !== \"12\"){\n $arr[0] = strval(intval($arr[0]) + 12);\n }\n }\n $arr[2] = $replace;\n return $arr[0] .\":\". $arr[1] .\":\". $arr[2];\n}", "function to_time($string){\n $split = explode(':', $string);\n $front = $split[0];\n $back = $split[1];\n // am or pm\n $period = substr($back, -2);\n $back = substr($back, 0,2);\n\n if($period == 'PM' and $front != '12'){\n $front += 12;\n }\n\n return ((string)$front . \":\" . (string)$back . \":00\");\n }", "function FormatTime($time) {\n $hour = $time[0];\n $min = $time[1];\n\n $hourModulo12 = $hour % 12;\n if ($hourModulo12 == 0) $hourModulo12 = 12;\n\n if ($hour >= 12)\n $ampm = \"PM\";\n else\n $ampm = \"AM\";\n\n if ($hourModulo12 < 10)\n $hourStr = \"0\" . $hourModulo12;\n else\n $hourStr = $hourModulo12;\n if ($min < 10)\n $minStr = \"0\" . $min;\n else\n $minStr = $min;\n return $hourStr . \":\" . $minStr . $ampm;\n}", "public function convertTimeToDisplayTime( $twentFourHourTime )\n\t{\n\t\t$AmPm = \"TIME\";\t\t\n\t\t$AmPm = date(\"g:i a\", strtotime($twentFourHourTime));\t\t\n\t\treturn $AmPm;\n\t}", "function format_time($secs) {\n\t\t $times = array(3600, 60, 1);\n\t\t $time = '';\n\t\t $tmp = '';\n\t\t for($i = 1; $i < 3; $i++) {\n\t\t\t $tmp = floor($secs / $times[$i]);\n\t\t\t if($tmp < 1) {\n\t\t\t\t $tmp = '00';\n\t\t\t }\n\t\t\t elseif($tmp < 10) {\n\t\t\t\t $tmp = '0' . $tmp;\n\t\t\t }\n\t\t\t $time .= $tmp;\n\t\t\t if($i < 2) {\n\t\t\t\t $time .= ':';\n\t\t\t }\n\t\t\t $secs = $secs % $times[$i];\n\t\t }\n\t\t return $time;\n\t\t}", "private function time_rule($time){\n $hour = floor($time/3600);//divisão retornando parte inteira.\n $hour_rest = fmod($time, 3600);//divisão retornando restante\n $min = floor($hour_rest/60); // calculo de minutos apartir do restante de horas\n $sec = fmod($hour_rest, 60); // calculos dos segundos\n return $this->number_format($sec,$min,$hour);\n }", "function times2str ($t1,$t2) {\n\tif ($t1 == '00:00:00' OR $t1 == '')\n\t\treturn '';\n\t// no end time\n\tif ($t2 == '00:00:00' OR $t2 == '')\n\t\treturn time2str($t1);\n\tlist($h1,$m1,$s1) = explode(\":\",$t1);\n\tlist($h2,$m2,$s2) = explode(\":\",$t2);\n\t$ampm1 = ($h1 >= 12) ? \" p.m.\" : \" a.m.\";\n\t$ampm2 = ($h2 >= 12) ? \" p.m.\" : \" a.m.\";\n\t$ampm1 = ($ampm1 != $ampm2) ? $ampm1 : \"\";\n\t// if time1 is 12:xx p.m.\n\tif ($h1 == \"12\") {\n\t\t$time_str = ($m1 > 0) ? \"12:\" . $m1 . $ampm1 : \"Noon\";\n\t} else {\n\t\t$time_str = ($m1 > 0) ? $h1 % 12 . \":\" . $m1 . $ampm1 : $h1 % 12 . $ampm1;\n\t}\n\t$time_str .= \"-\";\n\tif ($h2 == \"12\") {\n\t\t$time_str .= ($m2 > 0) ? \"12:\" . $m2 . $ampm2 : \"Noon\";\n\t} else {\n\t\t$time_str .= ($m2 > 0) ? $h2 % 12 . \":\" . $m2 . $ampm2 : $h2 % 12 . $ampm2;\n\t}\n\treturn ($time_str);\n}", "function format_time($t,$f=':'){\n\t\t//return ($t< 0 ? '-' : '') . sprintf(\"%02d%s%02d%s%02d\", floor(abs($t)/3600), $f, (abs($t)/60)%60, $f, abs($t)%60);\n\t\t\n\t\t$seconds = abs($t)%60;\n\t\t$minutes = (abs($t)/60)%60;\n\t \n\t\tif($seconds>30){\n\t\t\t$minutes = $minutes+1;\n\t\t}\n\t\treturn sprintf(\"%02d\",$minutes);//($t< 0 ? '-' : '') . sprintf(\"%02d%s%02d%s%02d\", floor(abs($t)/3600), $f, (abs($t)/60)%60, $f, abs($t)%60);\n }", "function MilitaryTimeToCommonTime($time)\n {\n if ($time == \"\")\n return \"\";\n return date(\"h:i A\", strtotime($time));\n }", "function stripTime($t){\n $temp = substr($t, 0, 2);\n return $temp;\n }", "function win_time($timestr) {\r\n return substr($timestr, 4, 2) . \"/\" . substr($timestr, 6, 2) . \"/\" .\r\n substr($timestr, 0, 4) . \" \" . substr($timestr, 8, 2) . \":\" .\r\n substr($timestr, 10, 2) . \":\" . substr($timestr, 12, 2) . \" \" .\r\n substr($timestr, -4);\r\n}", "function CommonTimeToMilitaryTime($time)\n {\n if ($time == \"\")\n return \"\";\n\n return date(\"H:i\", strtotime($time));\n }", "function times2str_ampm ($t) {\n\tif ($t == '00:00:00' OR $t == '') {\n\t\treturn $t;\n\t}\n\tlist($h,$m,$s) = explode(\":\",$t);\n\t$ampm = ($h >= 12) ? \"PM\" : \"AM\";\n\t$h = ($h > 12) ? $h - 12 : $h;\n\treturn \"{$h}:{$m}:{$s} {$ampm}\";\n}", "function sec2time ($sec) {\n $sec = (int) $sec;\n $time = ''; $h = 0;\n if ($sec >= 3600 ) {\n $h = (int) ($sec / 3600);\n if ($h > 0) { $time .= $h.':'; }\n $sec = $sec - $h*3600;\n }\n $m = (int) ($sec / 60);\n if ($h == 0) { $time .= $m.':'; }\n else { $time .= sprintf(\"%02d\", $m).':'; };\n if ($m > 0) { $sec = $sec - $m*60; }\n $time .= sprintf(\"%02d\", $sec);\n return $time;\n}", "function timeConversion($originalTime) {\n\t$newTime;\n\n $hours = substr($originalTime, 0, 2);\n $minutes = substr($originalTime, 3, 2);\n\n if ($hours > 12) $newTime = ($hours - 12) . \":\" . $minutes . \" PM\";\n else if ($hours == 12) $newTime = $hours . \":\" . $minutes . \" PM\";\n else if ($hours == 0) $newTime = 12 . \":\" . $minutes . \" AM\";\n else $newTime = substr($hours, 1) . \":\" . $minutes . \" AM\";\n\n \treturn $newTime;\n}", "function value_time($value){\r\n\t$separator = \":\";\r\n\tif(strlen($value) == 12){\r\n\t\t$value = substr($value, 0, 8);\r\n\t}\r\n\tif((strlen($value) == 8) && (substr($value, 2, 1) == $separator) && (substr($value, 5, 1) == $separator)){\r\n\t\t$hou = (int) substr($value, 0, 2);\r\n\t\t$min = (int) substr($value, 3, 2);\r\n\t\t$sec = (int) substr($value, 6, 2);\r\n\t}elseif((strlen($value) == 5) && (substr($value, 2, 1) == $separator)){\r\n\t\t$hou = (int) substr($value, 0, 2);\r\n\t\t$min = (int) substr($value, 3, 2);\r\n\t\t$sec = 0;\r\n\t}else{\r\n\t\treturn NULL;\r\n\t}\r\n\tif(($hou < 0 || $hou > 23) || ($min < 0 || $min > 59) || ($sec < 0 || $sec > 59)){\r\n\t\treturn NULL;\r\n\t}else{\r\n\t\treturn str_pad($hou, 2, \"0\", STR_PAD_LEFT).$separator.str_pad($min, 2, \"0\", STR_PAD_LEFT).$separator.str_pad($sec, 2, \"0\", STR_PAD_LEFT);\r\n\t}\r\n}", "function timeConversion($s) {\n /*\n * Write your code here.\n */\n $timeArray = explode(':', $s);\n $hour = $timeArray[0];\n $minute = $timeArray[1];\n $sec = $timeArray[2];\n $period = substr($sec, 2);\n $originalSec = rtrim($sec, $period);\n $newTime;\n if((0 <= $hour && $hour < 12) && ($period == 'AM')) {\n $newTime = $hour.\":\".$minute.\":\".$originalSec;\n }elseif ((0 <= $hour && $hour < 12) && ($period == 'PM')) {\n $newTime = 12+$hour.\":\".$minute.\":\".$originalSec;\n }elseif (($hour == 12) && ($period == 'AM')) {\n $newTime = \"00\".\":\".$minute.\":\".$originalSec;\n }elseif (($hour == 12) && ($period == 'PM')) {\n $newTime = $hour.\":\".$minute.\":\".$originalSec;\n }\n\n return $newTime; \n\n\n\n}", "function convertTime($time){\n return date(\"H:i\", strtotime($time));\n}", "private function timeToHex($time)\n {\n return str_pad(dechex($time), 4, \"0\", STR_PAD_LEFT);\n }", "function milisecond_to_time($time) {\n $hours = gmdate(\"H\", $time / 1000);\n $mins = gmdate(\"i\", $time / 1000);\n $seconds = gmdate(\"s\", $time / 1000);\n if($hours > 24) {\n $tags = Math.floor($hours/24);\n $hours = $hours % 24;\n }\n $res = \"$hours:$mins:$seconds\";\n return $res;\n }", "static function time($value){\n\t\t$separator = \":\";\n\t\t$value = substr($value, 0, 8);\n\t\tif((strlen($value) == 8) && (substr($value, 2, 1) == $separator) && (substr($value, 5, 1) == $separator)){\n\t\t\t$hou = (int) substr($value, 0, 2);\n\t\t\t$min = (int) substr($value, 3, 2);\n\t\t\t$sec = (int) substr($value, 6, 2);\n\t\t}elseif((strlen($value) == 5) && (substr($value, 2, 1) == $separator)){\n\t\t\t$hou = (int) substr($value, 0, 2);\n\t\t\t$min = (int) substr($value, 3, 2);\n\t\t\t$sec = 0;\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t\tif(($hou < 0 || $hou > 23) || ($min < 0 || $min > 59) || ($sec < 0 || $sec > 59)){\n\t\t\treturn null;\n\t\t}else{\n\t\t\treturn str_pad($hou, 2, \"0\", STR_PAD_LEFT).$separator.str_pad($min, 2, \"0\", STR_PAD_LEFT).$separator.str_pad($sec, 2, \"0\", STR_PAD_LEFT);\n\t\t}\n\t}", "static function formatTime($time){\n return date('j.n.Y G:i:s', $time);\n\n }" ]
[ "0.71102345", "0.6962839", "0.6711381", "0.6686256", "0.6601823", "0.65190905", "0.65145236", "0.65109605", "0.649926", "0.64447546", "0.639491", "0.637864", "0.6365775", "0.6347314", "0.6306025", "0.6298372", "0.62940764", "0.628181", "0.6281184", "0.62802505", "0.6277497", "0.6247091", "0.6240519", "0.6233741", "0.6213663", "0.61765397", "0.6171888", "0.617029", "0.6160623", "0.61446077" ]
0.801905
0
/ Add discovery process.
protected function _addDiscoveryProcess() { if (empty($this->_server)) { throw new Exception('init failed'); } $process = new SwooleProcess([ $this, 'onDiscoveryProcessAdd' ]); $this->setProcess($process); $this->_server->addProcess($process); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function buildDiscovery();", "public function discover () {\n\t\techo \"They can only discover\";\n\t}", "public function addCachedDiscovery(CachedDiscoveryInterface $cached_discovery);", "function wp_oembed_add_discovery_links()\n {\n }", "protected function listen()\n {\n // Set time limit to indefinite execution\n set_time_limit (0);\n\n $this->socket = socket_create(\n AF_INET,\n SOCK_DGRAM,\n SOL_UDP\n );\n\n if (!is_resource($this->socket))\n {\n $this->logger->log(\"Failed to create a socket for the discovery server. The reason was: \" .\n socket_strerror(socket_last_error()));\n }\n\n if (!@socket_bind(\n $this->socket,\n $this->config->getSetting('discovery-address'),\n $this->config->getSetting('discovery-port')))\n {\n $this->logger->log(\"Failed to bind to socket while initialising the discovery server.\");\n }\n\n // enter an infinite loop, waiting for data\n $data = '';\n while (true)\n {\n if (@socket_recv($this->socket, $data, 9999, MSG_WAITALL))\n {\n $this->logger->log(\"Discovery server received the following: $data\");\n\n $this->handleMessage($data);\n }\n }\n }", "abstract protected function createDiscovery(array $initializers = array());", "public function process(ContainerBuilder $container)\n {\n if (!$container->has('ho_peter1018.service_helper.services.registry_registry')) {\n return;\n }\n $definition = $container->findDefinition('ho_peter1018.service_helper.services.registry_registry');\n\n // find all service IDs with the ho_peter1018.service_helper.services.registry_pool tag\n $taggedServices = $container->findTaggedServiceIds('ho_peter1018.service_helper.services.registry_pool');\n\n foreach ($taggedServices as $id => $tags) {\n // add the service to the registry service\n $definition->addMethodCall('add', [$id, new Reference($id), $tags]);\n }\n }", "function discover_install() {\n\t\t$installer =& JInstaller::getInstance();\n\t\t$eid = JRequest::getVar('eid',0);\n\t\tif (is_array($eid) || $eid) {\n\t\t\tif (!is_array($eid)) {\n\t\t\t\t$eid = Array($eid);\n\t\t\t}\n\t\t\tJArrayHelper::toInteger($eid);\n\t\t\t$app =& JFactory::getApplication();\n\t\t\t$failed = false;\n\t\t\tforeach($eid as $id) {\n\t\t\t\t$result = $installer->discover_install($id);\n\t\t\t\tif (!$result) {\n\t\t\t\t\t$failed = true;\n\t\t\t\t\t$app->enqueueMessage(JText::_('Discover install failed').': '. $id);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->setState('action', 'remove');\n\t\t\t$this->setState('name', $installer->get('name'));\n\t\t\t$this->setState('message', $installer->message);\n\t\t\t$this->setState('extension_message', $installer->get('extension_message'));\n\t\t\tif (!$failed) $app->enqueueMessage(JText::_('Discover install successful'));\n\t\t} else {\n\t\t\t$app =& JFactory::getApplication();\n\t\t\t$app->enqueueMessage(JText::_('No extension selected'));\n\t\t}\n\t}", "public function discover($url)\n {\n }", "public function discovery()\n {\n return $this->discovery;\n }", "protected function add() {\n\t}", "public function onSpeakersAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public function onEventAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public function add(ProcessDefinition $definition);", "public function add()\n {\n foreach ($this->filters as $filter) {\n call_user_func_array($this->addCallback, $filter);\n }\n }", "public function startListening();", "public function prepareDiscoverInstall()\n\t{\n\t\t$client = ApplicationHelper::getClientInfo($this->parent->extension->client_id);\n\t\t$manifestPath = $client->path . '/modules/' . $this->parent->extension->element . '/' . $this->parent->extension->element . '.xml';\n\t\t$this->parent->manifest = $this->parent->isManifest($manifestPath);\n\t\t$this->parent->setPath('manifest', $manifestPath);\n\t\t$this->setManifest($this->parent->getManifest());\n\t}", "private function registerServices() {\n // Modules\n $this->addService('modules', 'MyTravel\\Core\\Service\\Modules::setService');\n // Routing\n $this->addService('routing', 'MyTravel\\Core\\Service\\Routing::setService');\n // Event dispatcher\n $this->serviceContainer\n ->register('events', 'Symfony\\Component\\EventDispatcher\\EventDispatcher');\n // Database\n $this->addService('db', 'MyTravel\\Core\\Service\\Db::setService');\n // Access\n $this->addService('access', 'MyTravel\\Core\\Service\\Access::setService');\n }", "public function start() {\r\n\t\tparent::start ();\r\n\t\tif (( string ) $this->data->ipaddr == 'dhcp') {\r\n\t\t\t$this->enableDHCP ();\r\n\t\t}\r\n\t}", "public function add()\n\t{\n\t\t// Only add the events if we are on that controller\n\t\tif (Router::$controller == 'main')\n\t\t{\n\t\t\tEvent::add('ushahidi_filter.view_pre_render.layout', array($this, 'add_requirements'));\n\t\t\t\n\t\t\tEvent::add('ushahidi_action.header_scripts', array($this, '_main_js'));\n\t\t\tEvent::add('ushahidi_action.map_main_filters', array($this, '_button'));\n\t\t}\n\t}", "function addProcess (&$processCallback) {\n\t\t$this->_processCallbacks[] =& $processCallback;\n\t}", "public function run()\n {\n Service::create([\n 'name'=>'consultation'\n ]);\n Service::create([\n 'name'=>'operation'\n ]);\n }", "public function process(ContainerBuilder $container)\n {\n $services = $container->findTaggedServiceIds('find_me');\n\n /** @var OptionalRegistry $seeker */\n $seeker = $container->get('seeker');\n\n foreach($services as $service){\n $seeker->addDependency(new OptionalDependency());\n }\n }", "public function register_services(): void {\n\t\t// Bail early so we don't instantiate services twice.\n\t\tif ( \\count( $this->service_container ) > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add the injector as the very first service.\n\t\t$this->service_container->put(\n\t\t\tstatic::SERVICE_PREFIX . static::INJECTOR_ID,\n\t\t\t$this->injector\n\t\t);\n\n\t\t$services = $this->get_service_classes();\n\n\t\tif ( $this->enable_filters ) {\n\t\t\t/**\n\t\t\t * Filter the default services that make up this plugin.\n\t\t\t *\n\t\t\t * This can be used to add services to the service container for\n\t\t\t * this plugin.\n\t\t\t *\n\t\t\t * @param array<string, string> $services Associative array of identifier =>\n\t\t\t * class mappings. The provided\n\t\t\t * classes need to implement the\n\t\t\t * Service interface.\n\t\t\t */\n\t\t\t$filtered_services = apply_filters(\n\t\t\t\tstatic::HOOK_PREFIX . static::SERVICES_FILTER,\n\t\t\t\t$services\n\t\t\t);\n\n\t\t\t$services = $this->validate_services( $filtered_services );\n\t\t}\n\n\t\twhile ( null !== key( $services ) ) {\n\t\t\t$id = $this->maybe_resolve( key( $services ) );\n\n\t\t\t$class = $this->maybe_resolve( current( $services ) );\n\n\t\t\t// Delay registering the service until all requirements are met.\n\t\t\tif (\n\t\t\t\tis_a( $class, HasRequirements::class, true )\n\t\t\t) {\n\t\t\t\tif ( ! $this->requirements_are_met( $id, $class, $services ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->schedule_potential_service_registration( $id, $class );\n\n\t\t\tnext( $services );\n\t\t}\n\t}", "public function run()\n {\n $advertisements = factory(Advertisement::class, 5)->create();\n }", "protected function add()\n {\n $this->numArgs = $this->findNumArgs($this->callback);\n if (is_string($this->callback) && class_exists($this->callback)) {\n $this->useCallbackManager('invoke', $this->callback);\n }\n foreach ((array) $this->hook as $hook) {\n \\add_filter($hook, $this->callback, $this->priority, $this->numArgs);\n }\n }", "public function announce();", "public function run()\n {\n factory(Ospiti::class, 10) -> create();// create server per INSERIRE I DATI NEL DATABASE\n }", "function start()\n{\n global $ipfsutils, $staticFile, $urlpath, $avahi_type, $avahi_port, $avahi_desc;\n $ret = execute_program_detached($ipfsutils.\" startDaemon $avahi_port $avahi_type\");\n //$output = ptxt(\" \". print_r($ret['output'][0],1));\n\n // Announce the IPFS instance to the community cloud via any of the\n // available methods -including IPFS itself, if enabled-\n $pub_res = avahi_publish($avahi_type, $avahi_desc, $avahi_port, null);\n\n setFlash(txt(t('ipfs_flash_publish')) . ptxt($pub_res));\n return(array('type'=>'redirect','url'=>$staticFile.$urlpath));\n}", "public function process(ContainerBuilder $container):void \n {\n $definition = $container->findDefinition(FactoryBuilderInterface::class);\n $taggedServices = $container->findTaggedServiceIds(FactoryInterface::TAG_NAME);\n foreach ($taggedServices as $id => $tags) {\n $definition->addMethodCall('addFactory', [new Reference($id)]);\n }\n }" ]
[ "0.648646", "0.57982194", "0.5671558", "0.53643703", "0.5324215", "0.5293005", "0.52735525", "0.5151731", "0.51439315", "0.51206493", "0.51106125", "0.5098104", "0.507639", "0.49984893", "0.49599975", "0.49526846", "0.49359635", "0.4885875", "0.4883293", "0.4833266", "0.48331675", "0.48277485", "0.48120236", "0.47987854", "0.47975183", "0.4780243", "0.47605526", "0.4756793", "0.47561282", "0.47521895" ]
0.780687
0
Move the internal data for a username to a new username. Is NEVER called for the currently loaded user, so Storage backend writers can safely assume that you'll never be asked to rename the loaded user. Before performing the move, this function MUST validate that the OLD user EXISTS and that the NEW user DOESN'T EXIST, and MUST throw an exception if either of those checks fail. This is to ensure that users don't lose data by accidentally overwriting something.
public function moveUser ($oldUsername, $newUsername) { // Verify that the old username exists and fetch the old data. $oldSettings = $this->_getUserKey($oldUsername, self::SETTINGS); $oldCookies = $this->_getUserKey($oldUsername, self::COOKIES); if ($oldSettings === null) { // Only settings are vital. throw new SettingsException(sprintf( 'Cannot move non-existent user "%s".', $oldUsername )); } // Verify that the new username does not exist. if ($this->hasUser($newUsername)) { throw new SettingsException(sprintf( 'Refusing to overwrite existing user "%s".', $newUsername )); } // Now attempt to write all data to the new name. $this->_setUserKey($newUsername, self::SETTINGS, $oldSettings); if ($oldCookies !== null) { // Only if cookies existed. $this->_setUserKey($newUsername, self::COOKIES, $oldCookies); } // Delete the previous user keys. $this->deleteUser($oldUsername); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function change_username($new_username) {\n $this->user->username = $new_username;\n $this->user->update();\n\n $this->impersonate($this->id);\n }", "function user_set_name($user_id, $new_username)\n{\n\tif(strcmp($new_username,user_get_name($user_id)))\n\t{\n\t\t//check that no other user has it\n\t\tif(!user_name_exists($new_username))\n\t\t{\n\t\t\t//set it\n\t\t\t$sql=\"UPDATE \".PREFIX.\"user SET username='\".sql_safe($new_username).\"' WHERE id=\".sql_safe($user_id).\";\";\n\t\t\tif(mysql_query($sql))\n\t\t\t\tadd_message(\"New user name set\");\n\t\t\telse\n\t\t\t\tadd_error(\"User name could not be set: \".mysql_error());\n\t\t}\n\t\telse\n\t\t\tadd_error(\"User name '$new_username' is already in use.\");\n\t}\n}", "public function user_move($username, $container) {\n if (!$this->_bind){ return (false); }\n if ($username === null){ return (\"Missing compulsory field [username]\"); }\n if ($container === null){ return (\"Missing compulsory field [container]\"); }\n if (!is_array($container)){ return (\"Container must be an array\"); }\n \n $userinfo = $this->user_info($username, array(\"*\"));\n $dn = $userinfo[0]['distinguishedname'][0];\n $newrdn = \"cn=\" . $username;\n $container = array_reverse($container);\n $newcontainer = \"ou=\" . implode(\",ou=\",$container);\n $newbasedn = strtolower($newcontainer) . \",\" . $this->_base_dn;\n $result=@ldap_rename($this->_conn,$dn,$newrdn,$newbasedn,true);\n if ($result !== true) {\n return (false);\n }\n return (true);\n }", "public function changeUsername( $userid, $username )\r\n\t{\r\n\t\t$this->debug->guard( );\r\n\r\n\t\tif ( empty( $username ) )\r\n\t\t{\r\n\t\t\t$this->debug->write( 'Problem changing username of a user: no username was given for the user', 'warning' );\r\n\t\t\t$this->messages->setMessage( 'Problem changing the username of a user: no username was given for the user', 'warning' );\r\n\t\t\t$this->debug->unguard( false );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$sql = $this->database->prepare( \"SELECT * FROM \" . $this->configuration->getConfiguration( 'zeitgeist', 'tables', 'table_users' ) . \" WHERE user_username = ?\" );\r\n\t\t$sql->bindParam( 1, $username );\r\n\r\n\t\tif ( !$sql->execute( ) )\r\n\t\t{\r\n\t\t\t$this->debug->write( 'Problem changing username of a user: could not read from users table', 'warning' );\r\n\t\t\t$this->messages->setMessage( 'Problem changing username of a user: could not read from users table', 'warning' );\r\n\r\n\t\t\t$this->debug->unguard( false );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif ( $sql->rowCount( ) > 0 )\r\n\t\t{\r\n\t\t\t$this->debug->write( 'Problem changing username of a user: username already exists', 'warning' );\r\n\t\t\t$this->messages->setMessage( 'Problem changing username of a user: username already exists', 'warning' );\r\n\t\t\t$this->debug->unguard( false );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$sql = $this->database->prepare( \"UPDATE \" . $this->configuration->getConfiguration( 'zeitgeist', 'tables', 'table_users' ) . \" SET user_username = ? WHERE user_id = ?\" );\r\n\t\t$sql->bindParam( 1, $username );\r\n\t\t$sql->bindParam( 2, $userid );\r\n\r\n\t\tif ( !$sql->execute( ) )\r\n\t\t{\r\n\t\t\t$this->debug->write( 'Problem changing username of a user: could not update database', 'warning' );\r\n\t\t\t$this->messages->setMessage( 'Problem changing username of a user:could not update database', 'warning' );\r\n\r\n\t\t\t$this->debug->unguard( false );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$this->debug->unguard( true );\r\n\t\treturn true;\r\n\t}", "public function setUserName($newUserName) {\n\t\t$this->userName = $newUserName;\n\t}", "public function validate_username_update($errors, $update, $user)\n {\n if (property_exists($user, 'ID')){\n $user_id = $user->ID;\n $old_user_login = $user->user_login;\n $new_user_login = $old_user_login;\n if (isset($_POST['user_login'])) {\n $new_user_login = trim( sanitize_text_field($_POST['user_login']) );\n }\n\n\n\n //we need to validate annother user doesn't exist with the same name\n if ($new_user_login !== $old_user_login) {\n $another_user_has_user_login = username_exists($new_user_login);\n if ($another_user_has_user_login) {\n $errors->add('user_login', '<strong>ERROR</strong>: You can\\'t change your username to ' . $new_user_login . ', another user is using that username.');\n return;\n }\n\n\n\n if (is_plugin_active('appthemes-xero-invoices/appthemes-xero-invoices.php')) {\n $xero_contact_exists = AXI_User_Validation::check_if_xero_contact_exists($new_user_login);\n //check if there is Xero Contact with the desired name\n if ($xero_contact_exists) {\n $message = '<strong>ERROR</strong>: You can\\'t change your username to ' . $new_user_login . ', another user is using that username.';\n if(current_user_can( 'manage_options' )){\n $message = '<strong>ERROR</strong>: You can\\'t change this user\\'s username to <strong>' . $new_user_login . '</strong>, there is an existing Xero Contact using that name.';\n }\n $errors->add('user_login', $message);\n return;\n }\n }\n\n // //now update the username\n global $wpdb;\n $update1 = $wpdb->prepare(\"UPDATE $wpdb->users SET user_login = %s WHERE user_login = %s\", $new_user_login, $old_user_login);\n\n if ($wpdb->query($update1) !== false) {\n // Update user_nicename.\n $update2 = $wpdb->prepare(\"UPDATE $wpdb->users SET user_nicename = %s WHERE user_login = %s AND user_nicename = %s\", $new_user_login, $new_user_login, $old_user_login); // phpcs:ignore WordPressVIPMinimum.Variables.RestrictedVariables\n $wpdb->query(\n $update2\n );\n\n // Update display_name.\n $update3 = $wpdb->prepare(\"UPDATE $wpdb->users SET display_name = %s WHERE user_login = %s AND display_name = %s\", $new_user_login, $new_user_login, $old_user_login); // phpcs:ignore WordPressVIPMinimum.Variables.RestrictedVariables\n $wpdb->query(\n $update3\n );\n\n // If the user is a Super Admin, update their permissions.\n if (is_multisite() && is_super_admin($user_id)) {\n grant_super_admin($user_id);\n }\n }\n\n //we may also need to update the contact name in Xero\n if (is_plugin_active('appthemes-xero-invoices/appthemes-xero-invoices.php')) {\n $xero_contact_update = AXI_User_Validation::update_contact_name($user_id, $new_user_login);\n }\n\n }\n }\n }", "public function save()\n {\n $this->validate();\n $user = User::findOrFail($this->userId);\n if(strtolower($this->origName) == strtolower($this->newName)){\n $this->updateName($user);\n return;\n }else{\n $user->info->update(['company_name' => $this->newName]);\n $user->save();\n $this->updateName($user);\n }\n\n\n }", "public function testUpdateUser()\n {\n // grab test user data\n $user = User::where('email', '[email protected]') -> first();\n $oldName = $user -> name;\n $newName = 'name'.rand(1,999999);\n // update user name\n User::where('email', '[email protected]') -> update(['name' => $newName]);\n // verify name is different\n $user = User::where('email', '[email protected]') -> first();\n $this -> assertSame($user -> name, $newName);\n $this -> assertFalse($oldName == $user -> name);\n }", "public function renameUser( $OldID, $NewID, $Pass = \"\" ) {\r\n if ( $this->EMPTY ) {\r\n return FALSE;\r\n }\r\n if ( empty( $OldID ) ) {\r\n return FALSE;\r\n }\r\n if ( empty( $NewID ) ) {\r\n return FALSE;\r\n }\r\n if ( !($this->isUser( $OldID )) ) {\r\n //\tSend an auth failure - prevents people from fishing for\r\n //\tvalid userIDs.\r\n //\tYOU will know its's because User is Unknown -\r\n //\tthis error is slightly different than the real\r\n //\tauthentication failure message. Compare the two.\r\n //\tSecurity through obscurity sucks but oh well..\r\n $this->error( \"renameUser failure for [$OldID]: Authentication Failure\", 0 );\r\n return FALSE;\r\n }\r\n if ( $this->isUser( $NewID ) ) {\r\n $this->error( \"Cannot change UserID, [$NewID] already exists\", 0 );\r\n return FALSE;\r\n }\r\n // If no Password, force a name change,\r\n // otherwise authenticate first.\r\n // Be SURE to always send the Pass!\r\n if ( !(empty( $Pass )) ) {\r\n //\tMust validate the user now\r\n if ( !($this->verifyUser( $OldID, $Pass )) ) {\r\n $this->error( \"renameUser failure for [$OldID] : Authentication Failed\", 0 );\r\n return FALSE;\r\n }\r\n // OK - so the password is valid - are we planning\r\n // on actually changing our name ?\r\n if ( $NewID == $OldID ) {\r\n // Nice new name ya got there Homer...\r\n return TRUE;\r\n }\r\n }\r\n // Valid user, OK to change.\r\n $usernum = $this->getUserNum( $OldID );\r\n if ( $usernum == -1 ) {\r\n return FALSE;\r\n }\r\n $this->USERS[$usernum][\"user\"] = $NewID;\r\n if ( !($this->htWriteFile()) ) {\r\n $this->error( \"FATAL could not save password file! [$php_errormsg]\", 1 );\r\n }\r\n return TRUE;\r\n }", "function updateName($NewUsername, $OldUsername){\n\t\t\t$query=\"UPDATE users SET name='{$NewUsername}' WHERE name='{$OldUsername}';\" ;\n\t\t\t$this->db->ExecuteSQL($query);\n\t\t\treturn true;\n\t\t}", "public function updateUsername()\n {\n $user = User::find(Database::connection(), $_SESSION['id']);\n\n // Update Username\n return $user->updateUsername(Database::connection(), $_POST['username']);\n }", "function forum_user_change($new_username) {\n\t global $vbulletin;\n\n\t // LOG USER OUT\n\t $this->forum_logout();\n\n\n\t $vb_username = $new_username;\n\n\t $vbulletin->db->query_write(\"UPDATE \" . TABLE_PREFIX . \"user SET username='$vb_username' WHERE userid='\".$this->forum_user[userid].\"'\");\n\n\t // RESET USER INFO\n\t $this->user_info[user_username] = $new_username;\n\n\t // RETRIEVE INFORMATION\n\t $this->forum_user_check();\n\n\t // LOG USER BACK IN\n\t $this->forum_login(1);\n\n\t}", "public static function setUsername(string $newUsername): void\n {\n self::writeConfiguration(['username' => $newUsername]);\n }", "protected function OnBeforeCopy()\n {\n parent::OnBeforeCopy();\n\n $sUserNameBase = 'newuser';\n $sUserName = $sUserNameBase;\n $iCount = 1;\n $bNameAvailable = false;\n do {\n $query = \"SELECT * FROM `cms_user` WHERE `login` = '\".MySqlLegacySupport::getInstance()->real_escape_string($sUserName).\"'\";\n $tRes = MySqlLegacySupport::getInstance()->query($query);\n if (MySqlLegacySupport::getInstance()->num_rows($tRes) > 0) {\n $sUserName = $sUserNameBase.'-'.$iCount;\n } else {\n $bNameAvailable = true;\n }\n ++$iCount;\n } while (!$bNameAvailable);\n $this->oTable->sqlData['login'] = $sUserName;\n }", "public function testUserUpdateWithUninstalledDomainAccessFields() {\n $user = $this->drupalCreateUser();\n $user->save();\n self::assertNotEmpty($user->id());\n\n $this->deleteDomainAccessFields('user', 'user');\n $reloaded_user = $this->entityTypeManager->getStorage('user')->load($user->id());\n\n $new_name = $this->randomMachineName();\n $reloaded_user->setUsername($new_name);\n $reloaded_user->save();\n self::assertSame($new_name, $reloaded_user->getAccountName());\n }", "public function setUsername($newUsername) {\n\t\t$this->netxUsername = $newUsername;\n\t}", "protected function _oldUser() {\n\t\t$user_id = trim($this->in('User ID:'));\n\n\t\tif (!$user_id || !is_numeric($user_id)) {\n\t\t\t$user_id = $this->_oldUser();\n\n\t\t} else {\n\t\t\t$result = $this->db->fetchRow(sprintf(\"SELECT * FROM `%s` AS `User` WHERE `id` = %d LIMIT 1\",\n\t\t\t\t$this->install['table'],\n\t\t\t\t$user_id\n\t\t\t));\n\n\t\t\tif (!$result) {\n\t\t\t\t$this->out('User ID does not exist, please try again.');\n\t\t\t\t$user_id = $this->_oldUser();\n\n\t\t\t} else {\n\t\t\t\t$this->install['username'] = $result['User'][$this->config['userMap']['username']];\n\t\t\t\t$this->install['password'] = $result['User'][$this->config['userMap']['password']];\n\t\t\t\t$this->install['email'] = $result['User'][$this->config['userMap']['email']];\n\t\t\t}\n\t\t}\n\n\t\treturn $user_id;\n\t}", "public function update($username)\n\t{\n\n\t\t$user = User::where('username', '=', $username)->first();\n\n\t\tif (Auth::user()->getId() == $user->id) {\n\n\t\t\t$rules = array(\n\t\t\t\t'name' => 'required|min:3|regex:/^[a-zA-Z][a-zA-Z ]*$/'\n\t\t\t);\n\n\t\t\t$validator = Validator::make(Request::all(), $rules);\n\n\t\t\tif ($validator->fails()) {\n\n\t\t\t\treturn Redirect::back()\n\t\t\t\t\t->withErrors($validator)\n\t\t\t\t\t->withInput();\n\n\t\t\t} else {\n\n\t\t\t\t$user->name = Request::get('name');\n\n\t\t\t\t$user->save();\n\n\t\t\t\t// Redirect\n\t\t\t\tSession::flash('message', 'Successfully updated!');\n\t\t\t\treturn redirect(route('users.show', [$user->username]));\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\tSession::flash('info_message', 'You do not have that permission!');\n\t\t\treturn redirect(route('users.show', [$user->username]));\n\t\t}\n\t}", "function editUserName($data){\n\t\t\t$conn = $this->connect();\n\t\t\t$fname = $this->modify(mysqli_real_escape_string($conn, $data['fname']));\n\t\t\t$lname = $this->modify(mysqli_real_escape_string($conn, $data['lname']));\n\t\t\tif(empty($fname) || empty($lname)) {\n\t\t\t\t$this->re_direct(\"profile\", \"input=empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-z]+(\\.)?( )?[a-z]*$/i\", $fname) && preg_match(\"/^[a-z]+$/i\", $lname)) {\n\t\t\t\t\tif($this->length($fname, 25, 4) && $this->length($lname, 25, 4)) {\n\t\t\t\t\t\t$result = $this->change(\"user_login\", \"user_fname\", $fname , $_SESSION['userid']);\n\t\t\t\t\t\t$result1 = $this->change(\"user_login\", \"user_lname\", $lname , $_SESSION['userid']);\n\t\t\t\t\t\tif($result == false || $result1 == false) {\n\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"Failed\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"Successfull\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"profile\", \"Error=toobigOrtooSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=name\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private function saveUser(?User $oldUser, ?User $newUser)\n {\n if ($oldUser !== $newUser) {\n if ($oldUser && !$oldUser->isLocked()) {\n $this->userManager->save($oldUser);\n }\n if ($newUser && !$newUser->isLocked()) {\n $this->userManager->save($newUser);\n }\n }\n }", "function putData($username, $data) {\n\t\t$dbObject = getDatabase();\n\t\t\n\t\t// we need to check if the user exists, and if so put the data, if not create the data\n\t\t$sql = \"select * from users where users_username='$username'\";\n\t\t$res = $dbObject->query($sql);\n\t\tif($res->fetchColumn() > 0) {\n\t\t\t// do update\n\t\t\terror_log(\"doing userdata update\");\n\t\t\t$sql = \"update users set users_tokendata='$data' where users_username='$username'\";\n\t\t} else {\n\t\t\t// do insert\n\t\t\terror_log(\"doing user data create\");\n\t\t\t$sql = \"insert into users values (NULL, '$username', '', '', '$data', '')\";\n\t\t}\n\t\t\n\t\tif($dbObject->query($sql)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}", "function setUserName($newVal)\r\n\t{\r\n\t\t$this->UserName = $newVal;\r\n\t}", "private function handleKeyUsername(UserInterface $user, Request $request) {\n $data = $request->request->all();\n\n if (array_key_exists('username', $data)) {\n // Change username only if username is changed\n if ($data['username'] != $user->getUsername()) {\n // Check if username is already taken\n $user1 = $this->container->get('fos_user.user_manager')->findUserByUsernameOrEmail($data['username']);\n if (null != $user1) {\n $this->logAndThrowError(400, 'Already taken by Username: '.$user1->getUsername(), $this->get('translator')->trans('api.show_error_username_taken', array(), 'messages', $request->getLocale()), $request->getLocale());\n }\n $user->setUsername($data['username']);\n }\n }\n }", "function editInfo($user) {\n\n if (isset ($_POST ['submit'])) {\n $newUsername = trim(strip_tags($_POST['username']));\n $newFirstName = trim(strip_tags($_POST['firstname']));\n $newLastName = trim(strip_tags($_POST['lastname']));\n $newEmail = trim(strip_tags($_POST['email']));\n\n if(!empty($_POST['username']) AND !empty($_POST['email']) AND !empty($_POST['firstname'] AND !empty($_POST['lastname']))) {\n\n if(strlen($newUsername) <= 100 && strlen($newFirstName) <= 100 && strlen($newLastName) <= 100) {\n\n if (filter_var($newEmail, FILTER_VALIDATE_EMAIL)){\n\n $bdd = dbConnect();\n $reqmail = $bdd->prepare(\"SELECT * FROM user WHERE email = ?\");\n $reqmail->execute(array($newEmail));\n\n if ($reqmail->rowCount() > 0){\n $result = $reqmail->fetch(PDO::FETCH_ASSOC);\n if ($result['username'] == $user) // We can replace its old mail with the same one\n $mailexist = 0;\n else\n $mailexist = 1;\n }\n\n $requsername = $bdd->prepare(\"SELECT * FROM user WHERE username = ?\");\n $requsername->execute(array($newUsername));\n\n if ($requsername->rowCount() > 0){\n $result = $requsername->fetch(PDO::FETCH_ASSOC);\n if ($result['username'] == $user) // We can replace its old username with the same one\n $usernameexist = 0;\n else\n $usernameexist = 1;\n }\n\n if($mailexist == 0) {\n if($usernameexist == 0) {\n try {\n $stmt = $bdd->prepare(\"UPDATE user SET username=:newUsername, first_name=:newFirstName, last_name=:newLastName, email=:newEmail WHERE username=:username\");\n $stmt->execute(array(\n 'newUsername' => $newUsername,\n 'newFirstName' => $newFirstName,\n 'newLastName' => $newLastName,\n 'newEmail' => $newEmail,\n 'username' => $user\n ));\n $_SESSION['username'] = $newUsername;\n }\n catch(PDOException $e) {\n echo $sql . \"<br>\" . $e->getMessage();\n }\n return 0;\n\n } else\n return -3; // Username already used\n } else\n return -2; // Mail already used\n }\n }\n }\n }\n\n return -1;\n\n }", "public function __construct($newUsername){\n $this -> loadUser($newUsername);\n }", "public function updateProfileFor($username, $updatedData)\n {\n $profile = User::whereUsername($username)->firstOrFail()->profile;\n $profile->fill($updatedData)->save();\n }", "public function put($arguments = []) {\n try {\n //Attempt to update the row.\n $this->dbh->query($this->query_array['put'], $arguments);\n $this->result_array['new_username'] = $arguments['new_username'];\n } catch (PDOException $e) {\n $this->result_array['ok'] = false;\n if ($e->errorInfo[1] == 19) {\n //We've got a duplicate entry for the username.\n $this->result_array['error'] = 'Username already exists!';\n } else {\n //Other error.\n $this->result_array['error'] = $e->getMessage();\n }\n }\n }", "public function testUpdateInvalidUser() {\n\t\t// create a USer and try to update it without actually inserting it\n\t\t$user = new User(null, $this->VALID_SALT, $this->VALID_HASH, $this->VALID_EMAIL, $this->VALID_NAME);\n\t\t$user->update($this->getPDO());\n\t}", "function transferOwnership($oldUserId, $newUserId) {\n\t\t$submissionFiles =& $this->_getInternally(null, null, null, null, null, null, null, $oldUserId, null, null);\n\t\tforeach ($submissionFiles as $file) {\n\t\t\t$daoDelegate =& $this->_getDaoDelegateForObject($file);\n\t\t\t$file->setUploaderUserId($newUserId);\n\t\t\t$daoDelegate->updateObject($file, $file); // nothing else changes\n\t\t}\n\t}", "public function testUpdateUserGetsHandled()\n {\n $handler = new UpdateUserHandler(\n new EncoderFactory([User::class => new PlaintextPasswordEncoder()]),\n $this->userRepositoryCollection\n );\n\n $user = $this->userRepository->findByUsername('wouter');\n $originalUser = clone $user;\n\n $baseUserTransferObject = UserDataTransferObject::fromUser($user);\n $baseUserTransferObject->displayName = 'test';\n $baseUserTransferObject->plainPassword = 'randomPassword';\n $baseUserTransferObject->email = '[email protected]';\n\n $handler->handle($baseUserTransferObject);\n\n $this->assertNotEquals(\n 'test',\n $this->userRepository->findByUsername('wouter')->getUsername()\n );\n $this->assertEquals(\n 'test',\n $this->userRepository->findByUsername('wouter')->getDisplayName()\n );\n $this->assertEquals(\n 'randomPassword{' . $this->userRepository->findByUsername('wouter')->getSalt() . '}',\n $this->userRepository->findByUsername('wouter')->getPassword()\n );\n $this->assertNotEquals(\n $originalUser->getDisplayName(),\n $this->userRepository->findByUsername('wouter')->getDisplayName()\n );\n $this->assertNotEquals(\n $originalUser->getPassword(),\n $this->userRepository->findByUsername('wouter')->getPassword()\n );\n }" ]
[ "0.64323926", "0.63914484", "0.6341779", "0.62913924", "0.60810673", "0.60505277", "0.6014536", "0.59819937", "0.5809437", "0.5794171", "0.57554567", "0.57224655", "0.5705922", "0.56143767", "0.55717576", "0.5559833", "0.5557186", "0.55230534", "0.5513415", "0.55081934", "0.54914093", "0.5438901", "0.5395692", "0.5386302", "0.5377774", "0.5377488", "0.5363749", "0.53632975", "0.5356981", "0.535324" ]
0.70961016
0
Save the settings for the currently active user. Is called every time any setting changes. The triggerkey can be used for selectively saving only the modified setting. But most backends should simply JSONencode the whole $userSettings array and store that string.
public function saveUserSettings (array $userSettings, $triggerKey) { // Store the settings as a JSON blob. $encodedData = json_encode($userSettings); $this->_setUserKey($this->_username, self::SETTINGS, $encodedData); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SaveSettings()\n\t{\n\t\t$this->GetDb();\n\n\t\t$tempSettings = $this->Db->Quote(serialize($this->settings));\n\t\t$tempUserID = intval($this->userid);\n\n\t\t$query = \"\n\t\t\tUPDATE [|PREFIX|]users\n\t\t\tSET settings='{$tempSettings}'\n\t\t\tWHERE userid={$tempUserID}\n\t\t\";\n\n\t\t$result = $this->Db->Query($query);\n\t\tif (!$result) {\n\t\t\tlist($error, $level) = $this->Db->GetError();\n\t\t\ttrigger_error($error, $level);\n\t\t\treturn false;\n\t\t}\n\n\t\t$currentUser = IEM::userGetCurrent();\n\t\tif ($currentUser && $currentUser->userid == $this->userid) {\n\t\t\tIEM::userFlushCache();\n\t\t}\n\n\t\treturn true;\n\t}", "function saveSettings()\n {\n\t if ( wfReadOnly() ) {\n\t\treturn;\n\t }\n\t if ( 0 == $this->mCedarId ) {\n\t\treturn;\n\t }\n\t \n\t $dbw =& wfGetDB( DB_MASTER );\n\t $dbw->update( 'cedar_user_info',\n\t\t array( /* SET */\n\t\t\t 'user_id' => $this->mId,\n\t\t\t 'organization' => $this->mOrg,\n\t\t\t 'address1' => $this->mAddress1,\n\t\t\t 'address2' => $this->mAddress2,\n\t\t\t 'city' => $this->mCity,\n\t\t\t 'state' => $this->mState,\n\t\t\t 'country' => $this->mCountry,\n\t\t\t 'postal_code' => $this->mPostalCode,\n\t\t\t 'phone' => $this->mPhone,\n\t\t\t 'mobile_phone' => $this->mMobilePhone,\n\t\t\t 'fax' => $this->mFax,\n\t\t\t 'supervisor_name' => $this->mSupervisorName,\n\t\t\t 'supervisor_email' => $this->mSupervisorEmail\n\t\t ), array( /* WHERE */\n\t\t\t 'user_info_id' => $this->mCedarId\n\t\t ), __METHOD__\n\t );\n\t $this->clearSharedCache();\n }", "function save_settings(array $settings)\n {\n //if user is not active do not log changes\n if ($user = user()){\n $logs = [];\n foreach ($settings as $key => $value){\n //changed\n if (!settings($key) || settings($key) != $value){\n $old_val = settings($key);\n $logs[] = \"$user changed setting: '{$key}' from '{$old_val}' to '{$value}'\";\n }\n }\n }\n\n //sync settings and save\n \\Setting::set($settings);\n \\Setting::save();\n\n //log any changes\n if (!empty($logs))\n event(new \\App\\Events\\SettingsChanged($logs, $user));\n\n return $settings;\n }", "public function Save() {\n\t\t\n\t\tglobal $sql;\n\t\tforeach( $this->settings as $option => $value ) {\n\t\t\t\n\t\t\t$this->update_option( $option, $value, $this->username );\n\t\t}\n\t}", "public function saveSettings()\n {\n if (empty($this->settings)) {\n $this->loadSettings();\n }\n \n $this->saveJSON($this->settings);\n }", "public function save_settings()\n\t{\n\t\t// Create settings array.\n\t\t$settings = array();\n\n\t\t// Loop through default settings and check for saved values.\n\t\tforeach (ee()->simple_cloner_settings->_default_settings as $key => $value)\n\t\t{\n\t\t\tif(($settings[$key] = ee()->input->post($key)) == FALSE)\n\t\t\t{\n\t\t\t\t$settings[$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\t// Serialize settings array and update the extensions table.\n\t\tee()->db->where('class', $this->class_name.'_ext');\n\t\tee()->db->update('extensions', array('settings' => serialize($settings)));\n\n\t\t// Create alert when settings are saved and redirect back to settings page.\n\t\tee('CP/Alert')->makeInline('simple-cloner-save')\n\t\t\t->asSuccess()\n\t\t\t->withTitle(lang('message_success'))\n\t\t\t->addToBody(lang('preferences_updated'))\n\t\t\t->defer();\n\n\t\tee()->functions->redirect(ee('CP/URL')->make('addons/settings/simple_cloner'));\n\t}", "public function saveSettings()\n\t{\n\t\t$this->ensureAuthed();\n\t\t$input = Input::getInstance();\n\t\t$settings = $input->getInput('settings');\n\t\t$settingsManager = Settings::getInstance();\n\t\t$settingsManager->setSettings($this->username, $settings);\n\t\treturn true;\n\t}", "public function saveSettings($settings)\n {\n\n $db = $this->getDb();\n $user = $this->getUser();\n $cache = $this->getL1Cache();\n\n $settingsLoader = new LibUserSettings($db, $user, $cache);\n $settingsLoader->saveUserSetting(EUserSettingType::MESSAGES, $settings);\n\n }", "function saveSettings()\n\t\t{\n\t\t\t$this->Init();\n\n\t\t\t$this->saveExternalSettings();\n\t\t\t\n\t\t\t$settings = serialize(array(\"settings\"=>$this->settings));\n\t\n\t\n\t\t\t$stream = mapi_openpropertytostream($this->store, PR_EC_WEBACCESS_SETTINGS, MAPI_CREATE | MAPI_MODIFY);\n\t\t\tmapi_stream_setsize($stream, strlen($settings));\n\t\t\tmapi_stream_seek($stream, 0, STREAM_SEEK_SET);\n\t\t\tmapi_stream_write($stream, $settings);\n\t\t\tmapi_stream_commit($stream);\n\t\n\t\t\tmapi_savechanges($this->store);\n\t\n\t\t\t// reload settings from store...\n\t\t\t$this->retrieveSettings();\n\t\t}", "public function dokan_live_chat_save_seller_settings( $user_id ) {\n if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['_wpnonce'] ), 'dokan_store_settings_nonce' ) ) {\n return;\n }\n\n if ( ! isset( $_POST['live_chat'] ) ) {\n return;\n }\n\n $store_info = dokan_get_store_info( $user_id );\n $store_info['live_chat'] = isset( $_POST['live_chat'] ) ? wc_clean( wp_unslash( $_POST['live_chat'] ) ) : '';\n $store_info['fb_page_id'] = isset( $_POST['fb_page_id'] ) ? wc_clean( wp_unslash( $_POST['fb_page_id'] ) ) : '';\n $store_info['tawkto_property_id'] = isset( $_POST['tawkto_property_id'] ) ? wc_clean( wp_unslash( $_POST['tawkto_property_id'] ) ) : '';\n $store_info['tawkto_widget_id'] = isset( $_POST['tawkto_widget_id'] ) ? wc_clean( wp_unslash( $_POST['tawkto_widget_id'] ) ) : '';\n $store_info['whatsapp_number'] = isset( $_POST['whatsapp_number'] ) ? wc_clean( wp_unslash( $_POST['whatsapp_number'] ) ) : '';\n\n update_user_meta( $user_id, 'dokan_profile_settings', $store_info );\n }", "function save_settings() {\n\t\t$this->update_option( static::SETTINGS_KEY, $this->settings );\n\t}", "public function saveSettings() {\n\t\t\tif ( isset( $_POST['muut_settings_save'] )\n\t\t\t\t&& $_POST['muut_settings_save'] == 'true'\n\t\t\t\t&& check_admin_referer( 'muut_settings_save', 'muut_settings_nonce' )\n\t\t\t) {\n\t\t\t\t$this->submittedSettings = $_POST['setting'];\n\n\t\t\t\t$settings = $this->settingsValidate( $this->getSubmittedSettings() );\n\n\t\t\t\t// Save all the options by passing an array into setOption.\n\t\t\t\tif ( muut()->setOption( $settings ) ) {\n\t\t\t\t\tif ( !empty( $this->errorQueue ) ) {\n\t\t\t\t\t\t// Display partial success notice if they were updated or matched the previous settings.\n\t\t\t\t\t\tmuut()->queueAdminNotice( 'updated', __( 'Settings successfully saved, other than the errors listed.', 'muut' ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Display success notice if they were updated or matched the previous settings.\n\t\t\t\t\t\tmuut()->queueAdminNotice( 'updated', __( 'Settings successfully saved.', 'muut' ) );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Display error if the settings failed to save.\n\t\t\t\t\tmuut()->queueAdminNotice( 'error', __( 'Failed to save settings.', 'muut' ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function save_settings()\n {\n if(isset($_POST) && isset($_POST['api_settings'])) {\n $data = $_POST['api_settings'];\n update_option('api_settings', json_encode($data));\n }\n }", "public function save_settings($settings)\n {\n }", "public function saveSettings()\n {\n $this->store->save($this->data);\n }", "function notification_user_settings_save() {\n\tglobal $CONFIG;\n\t//@todo Wha??\n\tinclude($CONFIG->path . \"actions/notifications/settings/usersettings/save.php\");\n}", "function saveSettings() {\n\tglobal $settings;\n\n\tfile_put_contents(\"settings.json\",json_encode($settings));\n}", "public function settings_save()\n {\n $method = rcube_utils::get_input_value('_method', rcube_utils::INPUT_POST);\n $data = @json_decode(rcube_utils::get_input_value('_data', rcube_utils::INPUT_POST), true);\n\n $rcmail = rcmail::get_instance();\n $storage = $this->get_storage($rcmail->get_user_name());\n $success = false;\n $errors = 0;\n $save_data = array();\n\n if ($driver = $this->get_driver($method)) {\n if ($data === false) {\n if ($this->check_secure_mode()) {\n // remove method from active factors and clear stored settings\n $success = $driver->clear();\n }\n else {\n $errors++;\n }\n }\n else {\n // verify the submitted code before saving\n $verify_code = rcube_utils::get_input_value('_verify_code', rcube_utils::INPUT_POST);\n $timestamp = intval(rcube_utils::get_input_value('_timestamp', rcube_utils::INPUT_POST));\n if (!empty($verify_code)) {\n if (!$driver->verify($verify_code, $timestamp)) {\n $this->api->output->command('plugin.verify_response', array(\n 'id' => $driver->id,\n 'method' => $driver->method,\n 'success' => false,\n 'message' => str_replace('$method', $this->gettext($driver->method), $this->gettext('codeverificationfailed'))\n ));\n $this->api->output->send();\n }\n }\n\n foreach ($data as $prop => $value) {\n if (!$driver->set($prop, $value)) {\n $errors++;\n }\n }\n\n $driver->set('active', true);\n }\n\n // commit changes to the user properties\n if (!$errors) {\n if ($success = $driver->commit()) {\n $save_data = $data !== false ? $this->format_props($driver->props()) : array();\n }\n else {\n $errors++;\n }\n }\n }\n\n if ($success) {\n $this->api->output->show_message($data === false ? $this->gettext('factorremovesuccess') : $this->gettext('factorsavesuccess'), 'confirmation');\n $this->api->output->command('plugin.save_success', array(\n 'method' => $method,\n 'active' => $data !== false,\n 'id' => $driver->id) + $save_data);\n }\n else if ($errors) {\n $this->api->output->show_message($this->gettext('factorsaveerror'), 'error');\n $this->api->output->command('plugin.reset_form', $method);\n }\n\n $this->api->output->send();\n }", "function saveSettings() {\n\t\t//# convert class variables into an array and save using\n\t\t//# Wordpress functions, \"update_option\" or \"add_option\"\n\t\t//#convert class into array...\n\t\t$settings_array = array();\n\t\t$obj = $this;\n\t\tforeach (array_keys(get_class_vars(get_class($obj))) as $k){\n\t\t\tif (is_array($obj->$k)) {\n\t\t\t\t//serialize any arrays within $obj\n\t\t\t\tif (count($obj->$k)>0) {\n\t\t\t\t\t$settings_array[$k] = esc_attr(serialize($obj->$k));\n\t\t\t\t} else {\n\t\t\t\t\t$settings_array[$k] = \"\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$settings_array[$k] = \"{$obj->$k}\";\n\t\t\t}\n\t\t}\n\t\t//#save array to options table...\n\t\t$options_check = get_option('wassup_settings');\n\t\tif (!empty($options_check)) {\n\t\t\tupdate_option('wassup_settings', $settings_array);\n\t\t} else {\n\t\t\tadd_option('wassup_settings', $settings_array, 'Options for WassUp');\n\t\t}\n\t\treturn true;\n\t}", "public function save_settings()\n\t{\n\t\tif ( $_POST && wp_verify_nonce( $_POST['save-confirm-user-registration-settings-nonce'], 'save-confirm-user-registration-settings' ) ) :\n\t\t\t$options = array(\n\t\t\t\t'error' => $_POST['error'],\n\t\t\t\t'from' => $_POST['from'],\n\t\t\t\t'subject' => $_POST['subject'],\n\t\t\t\t'message' => $_POST['message']\n\t\t\t);\n\n\t\t\t$options = apply_filters( 'confirm-user-registration-save-options', $options );\n\t\t\tupdate_site_option( 'confirm-user-registration', $options);\n\n\t\t\t?>\n\t\t\t<div class=\"updated message\">\n\t\t\t\t<p><?php _e( 'Saved' ); ?></p>\n\t\t\t</div>\n\t\t\t<?php\n\t\tendif;\n\t}", "public function setUserSettings($userSettings) {\n\t\t$this->_userSettings = (array)$userSettings;\n\t}", "public function user_settings($public_key) {\n\t\tif($this->Auth->user('public_key') != $public_key) {\n\t\t\t$this->Session->setFlash('Those are not your settings to change.');\n\t\t\t$this->redirect('/');\t\n\t\t}\n\t\t$this->recursive = -1;\n\t\t\n\t\t$user = $this->User->find(\n\t\t\t'first', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'public_key' => $public_key\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t\n\t\tif(!empty($this->request->data)) {\n\t\t\t\n\t\t\t\n\t\t\t$data['User']['location'] = $this->request->data['User']['location'];\n\t\t\t$data['User']['website'] = $this->request->data['User']['website'];\n\t\t\t$data['User']['info'] = $this->request->data['User']['info'];\n\t\t\t$data['User']['id'] = $this->Auth->user('id');\n\t\t\tif($this->Auth->password($this->request->data['User']['current_password']) == $user['User']['password']) {\n\t\t\t\t\t\n\t\t\t\t$data['User']['password'] = $this->request->data['User']['password'];\n\t\t\t\t$data['User']['password_confirmation'] = $this->request->data['User']['password_confirmation'];\t\t\t\n\t\t\t\t$this->User->id = $this->Auth->user('id');\n\t\t\t\t\n\t\t\t\tif($this->User->save($data))\n\t\t\t\t\t$this->Session->setFlash('Settings updated!');\n\t\t\t\telse \n\t\t\t\t\t$this->Session->setFlash('Something is wrong. Settings are not updated');\n\t\t\t\t\t\n\t\t\t}elseif(empty($this->request->data['User']['old_password'])) {\n\t\t\t\tif($this->User->save($data))\n\t\t\t\t\t$this->Session->setFlash('Settings updated, except password.');\n\t\t\t\telse \n\t\t\t\t\t$this->Session->setFlash('Something is wrong. Settings are not updated');\t\n\t\t\t}else {\n\t\t\t\t$this->Session->setFlash('Old Password incorrect. Settings remain unchanged.');\n\t\t\t\t$this->redirect(Controller::referer('/'));\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t$user = $this->User->find(\n\t\t\t'first', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'public_key' => $public_key\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t\n\t\t$this -> set('title_for_layout', $user['User']['username']);\n\t\t$this->set('user_info', $user);\n\t\t\n\t}", "public function save_settings() {\n\n\t\twoocommerce_update_options( $this->get_settings() );\n\t}", "public function save_settings( $settings = array() ) {\n\t\tglobal $socialflow;\n\t\t$socialflow_params = filter_input_array( INPUT_POST );\n\t\t$settings = empty( $settings ) ? array() : $settings;\n\n\t\t// Merge current settings (we need to store account information which is not stored in the fields).\n\t\t$settings = $socialflow->array_merge_recursive( $socialflow->options->options, $settings );\n\n\t\t// Allow plugins/modules to add/modify settings when having post request.\n\t\t$settings = isset( $socialflow_params['socialflow'] ) ? apply_filters( 'sf_save_settings', $settings ) : $settings;\n\n\t\treturn $settings;\n\t}", "public function updateSettings(User $user, array $data);", "public function save_settings( $settings ) {\n\t\t$settings['_multiwidget'] = 1;\n\t\tupdate_option( $this->option_name, $settings );\n\t}", "public function updraft_ajax_savesettings() {\n\t\ttry {\n\t\t\tif (empty($_POST) || empty($_POST['subaction']) || 'savesettings' != $_POST['subaction'] || !isset($_POST['nonce']) || !is_user_logged_in() || !UpdraftPlus_Options::user_can_manage() || !wp_verify_nonce($_POST['nonce'], 'updraftplus-settings-nonce')) die('Security check');\n\t\n\t\t\tif (empty($_POST['settings']) || !is_string($_POST['settings'])) die('Invalid data');\n\t\n\t\t\tparse_str(stripslashes($_POST['settings']), $posted_settings);\n\t\t\t// We now have $posted_settings as an array\n\t\t\tif (!empty($_POST['updraftplus_version'])) $posted_settings['updraftplus_version'] = $_POST['updraftplus_version'];\n\t\t\t\n\t\t\techo json_encode($this->save_settings($posted_settings));\n\t\t} catch (Exception $e) {\n\t\t\t$log_message = 'PHP Fatal Exception error ('.get_class($e).') has occurred during save settings. Error Message: '.$e->getMessage().' (Code: '.$e->getCode().', line '.$e->getLine().' in '.$e->getFile().')';\n\t\t\terror_log($log_message);\n\t\t\techo json_encode(array(\n\t\t\t\t'fatal_error' => true,\n\t\t\t\t'fatal_error_message' => $log_message\n\t\t\t));\n\t\t// @codingStandardsIgnoreLine\n\t\t} catch (Error $e) {\n\t\t\t$log_message = 'PHP Fatal error ('.get_class($e).') has occurred during save settings. Error Message: '.$e->getMessage().' (Code: '.$e->getCode().', line '.$e->getLine().' in '.$e->getFile().')';\n\t\t\terror_log($log_message);\n\t\t\techo json_encode(array(\n\t\t\t\t'fatal_error' => true,\n\t\t\t\t'fatal_error_message' => $log_message\n\t\t\t));\n\t\t}\n\t\tdie;\n\t}", "public function settings()\r\n {\r\n if ($this->request->is('post')) {\r\n\r\n $settingsChanged = false;\r\n\r\n $userId = $this->Session->read('Auth.User.id');\r\n\r\n $this->User->id = $userId;\r\n\r\n if ($this->request->data['User']['Clear All']) {\r\n $this->User->Reminder->deleteAll(\r\n array('Reminder.user_id' => $this->Session->read('Auth.User.id'), false)\r\n );\r\n }\r\n\r\n if (!empty($this->request->data['User']['email'])) {\r\n\r\n $this->User->set($this->request->data);\r\n $this->OpauthUser->set($this->request->data);\r\n\r\n $validUser = $this->User->validates(array('fieldList' => array('email')));\r\n $validOpauth = $this->OpauthUser->validates(array('fieldList' => array('email')));\r\n\r\n if ($this->Session->read('User.authType') == 'opauth') {\r\n\r\n $this->OpauthUser->id = $userId;\r\n\r\n if ($validOpauth && $validUser) {\r\n $this->OpauthUser->saveField('email', $this->request->data['User']['email'], false);\r\n $settingsChanged = true;\r\n }\r\n\r\n } else {\r\n\r\n if ($validUser && $validOpauth) {\r\n $this->User->saveField('email', $this->request->data['User']['email'], false);\r\n $settingsChanged = true;\r\n }\r\n }\r\n }\r\n\r\n if (!empty($this->request->data['User']['password'])) {\r\n\r\n if ($this->User->saveField('password', $this->request->data['User']['password'], true)) {\r\n $settingsChanged = true;\r\n }\r\n }\r\n\r\n if ($this->request->data['User']['timezone'] !== \"empty\") {\r\n\r\n if ($this->Session->read('User.authType') == 'opauth') {\r\n\r\n $this->OpauthUser->id = $userId;\r\n\r\n if ($this->OpauthUser->saveField('timezone', $this->request->data['User']['timezone'], false)) {\r\n $this->Session->write('Auth.User.timezone', $this->request->data['User']['timezone']);\r\n $settingsChanged = true;\r\n }\r\n\r\n } else {\r\n if ($this->User->saveField('timezone', $this->request->data['User']['timezone'], true)) {\r\n $this->Session->write('Auth.User.timezone', $this->request->data['User']['timezone']);\r\n $settingsChanged = true;\r\n }\r\n }\r\n }\r\n\r\n if ($this->request->data['User']['Clear All']) {\r\n $settingsChanged = true;\r\n $this->Session->setFlash('Cleared all reminders', 'successFlash');\r\n }\r\n\r\n if ($settingsChanged) {\r\n $this->Session->setFlash('Settings Changed', 'successFlash');\r\n\r\n } else {\r\n $this->Session->setFlash('Nothing to update', 'failureFlash');\r\n }\r\n }\r\n }", "public function update(UserSettingsRequest $request)\n {\n $input = $request->except(['_method', '_token']);\n\n foreach ($input as $key => $value) {\n\n setting()->set(\n $key,\n $value\n );\n setting()->setExtraColumns(['user_id' => auth()->user()->id]);\n }\n setting()->save();\n\n return redirect(route('settings.index'))->with('message', 'Settings have been saved!');\n }", "public function save_settings($settings) {\n\t\n\t\tglobal $updraftplus;\n\t\t\n\t\t// Make sure that settings filters are registered\n\t\tUpdraftPlus_Options::admin_init();\n\t\t\n\t\t$more_files_path_updated = false;\n\n\t\tif (isset($settings['updraftplus_version']) && $updraftplus->version == $settings['updraftplus_version']) {\n\n\t\t\t$return_array = array('saved' => true);\n\t\t\t\n\t\t\t$add_to_post_keys = array('updraft_interval', 'updraft_interval_database', 'updraft_interval_increments', 'updraft_starttime_files', 'updraft_starttime_db', 'updraft_startday_files', 'updraft_startday_db');\n\t\t\t\n\t\t\t// If database and files are on same schedule, override the db day/time settings\n\t\t\tif (isset($settings['updraft_interval_database']) && isset($settings['updraft_interval_database']) && $settings['updraft_interval_database'] == $settings['updraft_interval'] && isset($settings['updraft_starttime_files'])) {\n\t\t\t\t$settings['updraft_starttime_db'] = $settings['updraft_starttime_files'];\n\t\t\t\t$settings['updraft_startday_db'] = $settings['updraft_startday_files'];\n\t\t\t}\n\t\t\tforeach ($add_to_post_keys as $key) {\n\t\t\t\t// For add-ons that look at $_POST to find saved settings, add the relevant keys to $_POST so that they find them there\n\t\t\t\tif (isset($settings[$key])) {\n\t\t\t\t\t$_POST[$key] = $settings[$key];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check if updraft_include_more_path is set, if it is then we need to update the page, if it's not set but there's content already in the database that is cleared down below so again we should update the page.\n\t\t\t$more_files_path_updated = false;\n\n\t\t\t// i.e. If an option has been set, or if it was currently active in the settings\n\t\t\tif (isset($settings['updraft_include_more_path']) || UpdraftPlus_Options::get_updraft_option('updraft_include_more_path')) {\n\t\t\t\t$more_files_path_updated = true;\n\t\t\t}\n\t\t\t\n\t\t\t// Wipe the extra retention rules, as they are not saved correctly if the last one is deleted\n\t\t\tUpdraftPlus_Options::update_updraft_option('updraft_retain_extrarules', array());\n\t\t\tUpdraftPlus_Options::update_updraft_option('updraft_email', array());\n\t\t\tUpdraftPlus_Options::update_updraft_option('updraft_report_warningsonly', array());\n\t\t\tUpdraftPlus_Options::update_updraft_option('updraft_report_wholebackup', array());\n\t\t\tUpdraftPlus_Options::update_updraft_option('updraft_extradbs', array());\n\t\t\tUpdraftPlus_Options::update_updraft_option('updraft_include_more_path', array());\n\t\t\t\n\t\t\t$relevant_keys = $updraftplus->get_settings_keys();\n\n\t\t\tif (isset($settings['updraft_auto_updates']) && in_array('updraft_auto_updates', $relevant_keys)) {\n\t\t\t\t$updraftplus->set_automatic_updates($settings['updraft_auto_updates']);\n\t\t\t\tunset($settings['updraft_auto_updates']); // unset the key and its value to prevent being processed the second time\n\t\t\t}\n\n\t\t\tif (method_exists('UpdraftPlus_Options', 'mass_options_update')) {\n\t\t\t\t$original_settings = $settings;\n\t\t\t\t$settings = UpdraftPlus_Options::mass_options_update($settings);\n\t\t\t\t$mass_updated = true;\n\t\t\t}\n\n\t\t\tforeach ($settings as $key => $value) {\n\n\t\t\t\tif (in_array($key, $relevant_keys)) {\n\t\t\t\t\tif ('updraft_service' == $key && is_array($value)) {\n\t\t\t\t\t\tforeach ($value as $subkey => $subvalue) {\n\t\t\t\t\t\t\tif ('0' == $subvalue) unset($value[$subkey]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// This flag indicates that either the stored database option was changed, or that the supplied option was changed before being stored. It isn't comprehensive - it's only used to update some UI elements with invalid input.\n\t\t\t\t\t$updated = empty($mass_updated) ? (is_string($value) && UpdraftPlus_Options::get_updraft_option($key) != $value) : (is_string($value) && (!isset($original_settings[$key]) || $original_settings[$key] != $value));\n\n\t\t\t\t\tif (empty($mass_updated)) UpdraftPlus_Options::update_updraft_option($key, $value);\n\t\t\t\t\t\n\t\t\t\t\t// Add information on what has changed to array to loop through to update links etc.\n\t\t\t\t\t// Restricting to strings for now, to prevent any unintended leakage (since this is just used for UI updating)\n\t\t\t\t\tif ($updated) {\n\t\t\t\t\t\t$value = UpdraftPlus_Options::get_updraft_option($key);\n\t\t\t\t\t\tif (is_string($value)) $return_array['changed'][$key] = $value;\n\t\t\t\t\t}\n\t\t\t\t// @codingStandardsIgnoreLine\n\t\t\t\t} else {\n\t\t\t\t\t// This section is ignored by CI otherwise it will complain the ELSE is empty.\n\t\t\t\t\t\n\t\t\t\t\t// When last active, it was catching: option_page, action, _wpnonce, _wp_http_referer, updraft_s3_endpoint, updraft_dreamobjects_endpoint. The latter two are empty; probably don't need to be in the page at all.\n\t\t\t\t\t// error_log(\"Non-UD key when saving from POSTed data: \".$key);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$return_array = array('saved' => false, 'error_message' => sprintf(__('UpdraftPlus seems to have been updated to version (%s), which is different to the version running when this settings page was loaded. Please reload the settings page before trying to save settings.', 'updraftplus'), $updraftplus->version));\n\t\t}\n\t\t\n\t\t// Checking for various possible messages\n\t\t$updraft_dir = $updraftplus->backups_dir_location(false);\n\t\t$really_is_writable = UpdraftPlus_Filesystem_Functions::really_is_writable($updraft_dir);\n\t\t$dir_info = $this->really_writable_message($really_is_writable, $updraft_dir);\n\t\t$button_title = esc_attr(__('This button is disabled because your backup directory is not writable (see the settings).', 'updraftplus'));\n\t\t\n\t\t$return_array['backup_now_message'] = $this->backup_now_remote_message();\n\t\t\n\t\t$return_array['backup_dir'] = array('writable' => $really_is_writable, 'message' => $dir_info, 'button_title' => $button_title);\n\n\t\t// Check if $more_files_path_updated is true, is so then there's a change and we should update the backup modal\n\t\tif ($more_files_path_updated) {\n\t\t\t$return_array['updraft_include_more_path'] = $this->files_selector_widgetry('backupnow_files_', false, 'sometimes');\n\t\t}\n\t\t\n\t\t// Because of the single AJAX call, we need to remove the existing UD messages from the 'all_admin_notices' action\n\t\tremove_all_actions('all_admin_notices');\n\t\t\n\t\t// Moving from 2 to 1 ajax call\n\t\tob_start();\n\n\t\t$service = UpdraftPlus_Options::get_updraft_option('updraft_service');\n\t\t\n\t\t$this->setup_all_admin_notices_global($service);\n\t\t$this->setup_all_admin_notices_udonly($service);\n\t\t\n\t\tdo_action('all_admin_notices');\n\t\t\n\t\tif (!$really_is_writable) { // Check if writable\n\t\t\t$this->show_admin_warning_unwritable();\n\t\t}\n\t\t\n\t\tif ($return_array['saved']) { //\n\t\t\t$this->show_admin_warning(__('Your settings have been saved.', 'updraftplus'), 'updated fade');\n\t\t} else {\n\t\t\tif (isset($return_array['error_message'])) {\n\t\t\t\t$this->show_admin_warning($return_array['error_message'], 'error');\n\t\t\t} else {\n\t\t\t\t$this->show_admin_warning(__('Your settings failed to save. Please refresh the settings page and try again', 'updraftplus'), 'error');\n\t\t\t}\n\t\t}\n\t\t\n\t\t$messages_output = ob_get_contents();\n\t\t\n\t\tob_clean();\n\t\t\n\t\t// Backup schedule output\n\t\t$this->next_scheduled_backups_output('line');\n\t\t\n\t\t$scheduled_output = ob_get_clean();\n\t\t\n\t\t$return_array['messages'] = $messages_output;\n\t\t$return_array['scheduled'] = $scheduled_output;\n\t\t$return_array['files_scheduled'] = $this->next_scheduled_files_backups_output(true);\n\t\t$return_array['database_scheduled'] = $this->next_scheduled_database_backups_output(true);\n\t\t\n\t\t\n\t\t// Add the updated options to the return message, so we can update on screen\n\t\treturn $return_array;\n\t\t\n\t}" ]
[ "0.7115756", "0.68787223", "0.6819958", "0.6615483", "0.64693767", "0.6369531", "0.6365924", "0.63436824", "0.63341576", "0.63057685", "0.6304582", "0.6268117", "0.62590814", "0.6219204", "0.6161533", "0.6159846", "0.6023926", "0.6004178", "0.5995158", "0.5974717", "0.5957768", "0.59275496", "0.59069943", "0.58692706", "0.5864377", "0.58563244", "0.58299583", "0.57943124", "0.5791594", "0.5773017" ]
0.83645856
0
Whether the storage backend has cookies for the currently active user. Even cookiefile (filebased jars) MUST answer this question, for example by checking if their desired cookiefile exists and is nonempty. And all other storage backends (such as databases) MUST also verify that their existing cookie data is nonempty. Don't validate the actual cookie contents, just look for nonzero size!
public function hasUserCookies () { // Simply check if the storage key for cookies exists and is non-empty. return ! empty($this->loadUserCookies()) ? true : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cookieExists(): bool\n {\n $result = true;\n if (empty($_COOKIE)) {\n $result = false;\n }\n return $result;\n }", "public function hasCookies() {\n\t\treturn $this->hasFirstPartyCookies() || $this->hasThirdPartyCookies();\n\t}", "public function cookieExists() {\n if (isset($_COOKIE[$this->cookie['name']])){\n return true;\n }\n\n return false;\n }", "public static function checkAuthCookie()\n {\n foreach (self::get() as $value) {\n if ($value === null) {\n return false;\n }\n }\n\n return true;\n }", "public function cookieIsset() {\n\t\tif(isset($_COOKIE[$this->cookieName])) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isSetSessionCookie() {}", "public function isSetSessionCookie() {}", "public static function isExist() {\n return ((self::$_isSessionRunning) && !empty($_COOKIE[session_name()]));\n }", "public function kapee_cookie_setted() {\n\t\treturn isset( $_COOKIE[self::$cookie['name']] );\n\t}", "public function isCookieSet() {}", "function _checkCookies() {\n if(isset($_COOKIE)) {\n if(isset($_COOKIE['user'])) {\n $_SESSION['is_login'] = true;\n $_SESSION['userid'] = $_COOKIE['user'];\n }\n }\n }", "public function is_cookie_set()\n {\n }", "private function checkCookie()\n\t\t{\n\t\t\tif(!empty($_COOKIE['auth_username']) && !empty($_COOKIE['auth_password']))\n\t\t\t\treturn $this->check($_COOKIE['auth_username'], $_COOKIE['auth_password']);\n\t\t}", "function checkCookie(){\n global $cookie;\n\n // Check database to see if a user exists with this cookie\n if (getSingleValue(\"SELECT COUNT(`id`) FROM `private_users` WHERE `cookie` ='\" . $cookie . \"' LIMIT 0 , 1\") != 1){\n // Some user has this cookie, it is valid\n return false;\n }else{\n // Nobody has this cookie, therefore it's invalid\n return true;\n }\n}", "public function valid() \n {\n return isset($_COOKIE[$this->key()]);\n }", "public function hasRememberMe()\n\t{\n return $this->cookies->has('RMU');\n }", "public static function exists($name){\n return (isset($_COOKIE[$name])) ? true : false;\n }", "public function has_cookie($name) {\n if (isset($this->_cookies[$name])) {\n return true;\n } else {\n return false;\n }\n }", "public function isLoggedIn() {\n $auth_cookie = Cookie::get(\"auth_cookie\"); //get hash from browser\n //check if cookie is valid\n if ($auth_cookie != '' && $this->cookieIsValid($auth_cookie)) {\n return true;\n } else {\n return false;\n }\n }", "function exists() {\n $this->log .= \"exists() called<br />\";\n if (!isset($_COOKIE['sid'])) {\n $this->log .= \"sid cookie does not exist.<br />\";\n return false;\n }\n $this->id = $_COOKIE['sid'];\n $this->filename = $this->dir.\"sid_\".$this->id;\n return true;\n }", "private function _loginPermitted ()\r\n {\r\n if(empty($_COOKIE[self::$_cookieCount])) {\r\n return true;\r\n }\r\n\r\n return $_COOKIE[self::$_cookieCount] < self::$_incercari;\r\n }", "public function hasRememberMe()\n {\n return $this->cookies->has('RMU');\n }", "public static function exists($name){\n\t\treturn (isset($_COOKIE[$name])) ? true : false;\t\t\t\t// Returns similar to the session method for the name we have defined and see if the cookie has been set.\n\t}", "public static function exists($name) {\n return (isset($_COOKIE[$name])) ? true : false;\n }", "function exists() {\r\n\t\t$this->log .= \"exists() called<br />\";\r\n\t\tif (!isset($_COOKIE['sid'])) {\r\n\t\t $this->log .= \"sid cookie does not exist.<br />\";\r\n\t\t return false;\r\n\t\t}\r\n\t\t$this->id = $_COOKIE['sid'];\r\n\t\t$this->filename = $this->dir.\"sid_\".$this->id;\r\n\t\treturn true;\r\n\t}", "protected function _hasCookie($cookie_name)\n {\n\n if (!$this->request->hasCookie($cookie_name))\n {\n Cookie::queue(Cookie::forever($cookie_name, 1)); //Cookie::forever($cookie_name, '1');\n return false;\n }\n else\n {\n return true;\n }\n\n }", "public function hasQueueingCookie(): bool;", "private static function is_logged_in () {\n\t\t# Check for the existence of the cookie\n\t\tif (isset($_COOKIE[\"user_id\"])) {\n\t\t\treturn (true);\n\t\t} else {\n\t\t\treturn (false);\n\t\t}\n\t}", "public static function exists($name) {\n\t\t\treturn (isset($_COOKIE[$name])) ? true : false;\n\t\t}", "public static function exists($name) {\n\t\t\treturn (isset($_COOKIE[$name])) ? true : false;\n\t\t}" ]
[ "0.73646384", "0.72484255", "0.7026608", "0.69638735", "0.6844069", "0.6802924", "0.6802924", "0.67953223", "0.6784761", "0.67574275", "0.67271584", "0.66777676", "0.66728944", "0.664498", "0.65714896", "0.65262324", "0.649147", "0.64878434", "0.6419699", "0.6406596", "0.63996667", "0.6388033", "0.63722646", "0.63658935", "0.63493544", "0.6343249", "0.6336697", "0.63338387", "0.6332436", "0.6332436" ]
0.8070163
0
Get the cookiefile disk path (only if a filebased cookie jar is wanted). The file does not have to exist yet. It will be created by the caller ondemand when necessary.
public function getUserCookiesFilePath () { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function configCookiePath()\n\t{\n\t\treturn dirname(__FILE__) . '\\cookiefile';\n\t}", "function get_cookie_path()\n{\n global $SITE_INFO;\n $ret = array_key_exists('cookie_path', $SITE_INFO) ? $SITE_INFO['cookie_path'] : '/';\n return ($ret == '') ? null : $ret;\n}", "function getCookiePath()\n{\n\t$URL_Array = array();\n\t$URL_Array = parse_url(curPageURL());\n\t$cookie_path = $URL_Array['path'];\n\n\t$pos = strrpos($cookie_path, \"/\");\n\tif ($pos === false) \n\t{ \n\t // can't find a proper URL, return \"/\" as the cookie position.\n\t $cookie_path = \"/\";\n\t}\n\telse\n\t $cookie_path = substr($cookie_path, 0, $pos) . \"/\";\n\n\treturn $cookie_path;\n}", "private function getCacheFile() {\n return new File($this->rootPath, self::CACHE_FILE);\n }", "protected function filepath() {\n if (is_null($this->path)) {\n try {\n $path = $this->config->get('path');\n $jar = $this->config->get('jar');\n\n $this->path = rtrim($path, '/') . DIRECTORY_SEPARATOR . $jar;\n } catch (Exception $exception) {\n $this->setErrorFromException($exception);\n }\n }\n\n return $this->path;\n }", "protected function getSwarmCookie()\n {\n return $this->getSession()->getCookie('SwarmDataPath');\n }", "protected function getCacheFile(){\n\t\treturn $this->getPath() . $this->getCacheName();\n\t}", "public function get_path()\n\t\t{\n\t\t\tif ($this->path) {\n\t\t\t\treturn $this->path.'/'.$this->get_full_name();\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t$hash = $this->hash();\n\t\t\t\t} catch(\\System\\Error\\File $e) {\n\t\t\t\t\t$hash = null;\n\t\t\t\t}\n\n\t\t\t\tif ($hash) {\n\t\t\t\t\treturn $this->get_path_hashed();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}", "private function get_filename() {\n \n $md5 = md5($_SERVER[\"HTTP_HOST\"] . $_SERVER[\"REQUEST_URI\"]);\n return CACHE_DIR . \"/\" . $md5;\n }", "public function cookieJar($loc) {\n\t\tif(is_null($loc))\n\t\t\tthrow new Exception(\"cURL::cookieJar() expects a file path of where to save the requested file.\");\n\n\t\tif(!is_dir(dirname($loc)))\n\t\t\tthrow new Exception(\"cURL::cookieJar() Directory `\" . dirname($loc) . \"` does not exist.\");\n\n\t\tif(!is_writable(dirname($loc)))\n\t\t\tthrow new Exception(\"cURL::cookieJar() Directory `\" . dirname($loc) . \"` is not writable by PHP.\");\n\n\t\t$this->cookieJar = $loc;\n\t}", "private function getFilePath() {\n return FileService::getInstance()->getTempDirPath() . DIRECTORY_SEPARATOR . $this->fileBaseName;\n }", "public function getCacheFile()\n\t{\n\t\treturn $this->tempDir . '/' . $this->filename;\n\t}", "private function getLoggerFile()\n {\n return $this->getLoggerFolder() . DIRECTORY_SEPARATOR . self::FILE_NAME;\n }", "public static function getFilePath(): string\n {\n return static::getInstance()->getFilePath();\n }", "public function getDiskCachingDirectory()\n {\n return $this->diskCachingDirectory;\n }", "public function getDiskCachingDirectory()\n {\n return $this->diskCachingDirectory;\n }", "public static function getFilePath()\n\t{\n\t\treturn __FILE__;\n\t}", "public static function getFilePath()\n\t{\n\t\treturn __FILE__;\n\t}", "private function getThumbFilepath() {\n\t\t$filename = $this->getThumbFilename();\n\t\t$filepath = $this->pathCache . $filename;\n\t\treturn($filepath);\n\t}", "private function getFilePath() {\n\t\treturn $this->options['path'].'/'.md5($this->options['revision']).'/'.$this->path;\n\t}", "public function get_cached_path() {\n // Set either the source or cache file as our datasource\n if ($this->serve_default)\n {\n $file_data = $this->source_file;\n }\n else\n {\n $file_data = $this->cached_file;\n }\n\n // Output the file\n return $file_data;\n }", "public function getSavePath(): string\n {\n return session_save_path();\n }", "public function sessionDirectoryPath();", "public static function getCacheFile()\r\n {\r\n return self::$_cacheFile;\r\n }", "protected function get_file() {\r\n\t\t$file = '';\r\n\r\n\t\tif ( @file_exists( $this->file ) ) {\r\n\t\t\tif ( ! is_writeable( $this->file ) ) {\r\n\t\t\t\t$this->is_writable = false;\r\n\t\t\t}\r\n\r\n\t\t\t$file = @file_get_contents( $this->file );\r\n\t\t} else {\r\n\t\t\t@file_put_contents( $this->file, '' );\r\n\t\t\t@chmod( $this->file, 0664 );\r\n\t\t}\r\n\r\n\t\treturn $file;\r\n\t}", "public function getFilePath()\n {\n\n if (is_writable($_SERVER['DOCUMENT_ROOT'])) {\n return $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $this->getFileName();\n }\n\n }", "public function getPathToFile(): string;", "private function tempFilePath()\n {\n $path = 'exports/'.Str::random();\n\n // Make sure the file exists\n Storage::put($path, null);\n\n return Storage::path($path);\n }", "protected function tempPath() {\n if ($nonce = $this->getNonce()) {\n return sys_get_temp_dir() . DIRECTORY_SEPARATOR . $nonce;\n }\n }", "protected function get_file() {\n\n\t\t$file = '';\n\n\t\tif ( @file_exists( $this->file ) ) {\n\n\t\t\tif ( ! is_writeable( $this->file ) ) {\n\t\t\t\t$this->is_writable = false;\n\t\t\t}\n\n\t\t\t$file = @file_get_contents( $this->file );\n\n\t\t} else {\n\n\t\t\t@file_put_contents( $this->file, '' );\n\t\t\t@chmod( $this->file, 0664 );\n\n\t\t}\n\n\t\treturn $file;\n\t}" ]
[ "0.7095272", "0.6541507", "0.65231365", "0.60637665", "0.57342523", "0.569794", "0.56609076", "0.5528602", "0.55081236", "0.5483616", "0.5446217", "0.5440193", "0.5433883", "0.5433056", "0.5375775", "0.5375775", "0.53735507", "0.53735507", "0.5372021", "0.5351479", "0.5328312", "0.5318508", "0.53002673", "0.52961004", "0.52957493", "0.5261202", "0.5258311", "0.5228425", "0.5204298", "0.51936823" ]
0.73801416
0
(Noncookiefile) Load all cookies for the currently active user. Note that this function is ONLY called if a nonstring answer was returned by the getUserCookiesFilePath() call. If your Storage backend class uses a cookiefile, make this a noop.
public function loadUserCookies () { return $this->_getUserKey($this->_username, self::COOKIES); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadCookies($username = '');", "public function getUserCookiesFilePath ()\n\t{\n\t\treturn null;\n\t}", "function load_cookie($file) {\n if (!is_file($file)) {\n return [];\n }\n return json_decode(file_get_contents($file), true);\n}", "public function getCookiesUser(): ?array\n {\n $email = $_COOKIE[APP_USERS_COOKIES_EMAIL] ?? '';\n return (new UserController())->getUser($email);\n }", "public function enableCookies() {}", "public function getCookie(): array;", "public static function all(){\n return $_COOKIE;\n }", "public function getCookies()\n {\n\n }", "function load()\n {\n $this->cookieJar = $this->getSession()->get($this->getCookieJarName(), []);\n }", "public function restoreLoginFromCookie() {\n\t$this->Cookie->name = 'Users';\n\t$cookie = $this->Cookie->read('rememberMe');\n\tif (!empty($cookie) && !$this->Auth->user()) {\n\t $data['User'][$this->Auth->fields['username']] = $cookie[$this->Auth->fields['username']];\n\t $data['User'][$this->Auth->fields['password']] = $cookie[$this->Auth->fields['password']];\n\t $this->Auth->login($data);\n\n\t if ($this->Auth->isLoggedin()) {\n\t\t$this->log('Cookie login succesful');\n\t }\n\t}\n }", "public function get_cookies()\n {\n }", "function _checkCookies() {\n if(isset($_COOKIE)) {\n if(isset($_COOKIE['user'])) {\n $_SESSION['is_login'] = true;\n $_SESSION['userid'] = $_COOKIE['user'];\n }\n }\n }", "public static function remember_from_cookies() {\n\t\tif (isset($_COOKIE['remember']) && !(self::logged_in())) {\n\t\t\t$user_id = explode(\"==\", $_COOKIE['remember'])[0];\n\t\t\t$user = User::find_where(\"users\", array(\"id\" => $user_id));\n\t\t\t$expected = $user_id.\"==\".$user[0][\"remember_token\"];\n\t\t\tif ($user_id && $user && $expected == $_COOKIE['remember']) {\n\t\t\t\tSession::write(\"user\", $user);\n\t\t\t\t$remember_token = $user[0][\"remember_token\"];\n\t\t\t\tsetcookie(\"remember\", $user[0][\"id\"]. \"==\". $remember_token, time()+60*60*24*7);\n\t\t\t} else {\n\t\t\t\tsetcookie(\"remember\", null, -1);\n\t\t\t}\n\t\t}\n\t}", "public function hasUserCookies ()\n\t{\n\t\t// Simply check if the storage key for cookies exists and is non-empty.\n\t\treturn ! empty($this->loadUserCookies()) ? true : false;\n\t}", "private function refreshCookiesLifetime() {\n\t\t// @see https://www.ccm19.de/\n\t\treturn;\n\n\t\tif (is_array($_COOKIE) == false) {\n\t\t\treturn;\n\t\t}\n\n\t\t$expire = time() + (int)$this->settings[\"cookie_lifetime\"] * 60 * 60 * 24;\n\t\t$path = rtrim(PAPOO_WEB_PFAD, \"/\").\"/\";\n\t\t// Cookie-Domain setzen, Cookie mit und ohne www. gültig machen. Dabei ebenfalls lokale Installationen beachten. (aus session_class uebernommen)\n\t\t$domain = str_replace('.www.', '.', (strpos($_SERVER['SERVER_NAME'], '.') === false ? '' : '.'.$_SERVER['SERVER_NAME']));\n\n\t\t// RegEx-Patterns zum Filtern der Cookies nach deren Namen\n\t\t$blacklist = array(\n\t\t\t\"~^_{1,2}g~\",\n\t\t);\n\n\t\tforeach ($_COOKIE as $key => $value) {\n\t\t\t$cookieIsBlacklisted = array_reduce($blacklist, function ($blacklisted, $pattern) use ($key) {\n\t\t\t\treturn $blacklisted || preg_match($pattern, $key);\n\t\t\t}, false);\n\n\t\t\tif ($cookieIsBlacklisted) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t@setcookie($key, $value, $expire, $path, $domain, false, true);\n\t\t}\n\t}", "public function getHttpCookies(): array\n {\n return $_COOKIE;\n }", "public function cookies() {\n $cookies = $this->command('cookies');\n $objCookies = array();\n foreach ($cookies as $cookie) {\n $objCookies[$cookie[\"name\"]] = new Cookie($cookie);\n }\n return $objCookies;\n }", "public function cookies() {\n\t\t$cookie = $this->getHeader('Cookie');\n\t\treturn $cookie === null ? array() : (array) self::parseCookies($cookie);\n\t}", "protected function _getSessionFromCookie(){\n\t\n\t\tif (isset($_COOKIE) && isset($_COOKIE[$this->_cookie_var_name])){\n\t\t\treturn json_decode($_COOKIE[$this->_cookie_var_name], true);\n\t\t} else\n\t\t\treturn array();\n\t\n\t}", "public function disableCookies() {\n\t\t$this->cookiesEnabled = FALSE;\n\t}", "private function _prepareCookieJar() {\n if(!empty($_SESSION['AppceleratorCloudServices']['cookie_jar'])) {\n // update modified time so it doesn't get cleaned up\n $this->_cookieJar = $_SESSION['AppceleratorCloudServices']['cookie_jar'];\n return touch($this->_cookieJar);\n }\n\n $cookieFile = tempnam($this->tempDir, 'ACS');\n if(!$cookieFile)\n throw new UnexpectedValueException('There was a problem storing your authentication cookie.');\n\n $this->_cookieJar = $cookieFile;\n $loginResponse = $this->usersLogin();\n\n $_SESSION['AppceleratorCloudServices']['cookie_jar'] = $this->_cookieJar;\n $_SESSION['AppceleratorCloudServices']['current_user'] = $loginResponse->response->users[0];\n return true;\n }", "public static function initCookies() {\n // Get valid cookies\n $cookies = array_map('self::mapCookies', $_COOKIE, array_keys($_COOKIE));\n $cookies = array_filter($cookies);\n $cookies = array_values($cookies);\n\n // Get valid sessions\n $sessions = array_map('self::mapCookies', $_SESSION, array_keys($_SESSION));\n $sessions = array_filter($sessions);\n $sessions = array_values($sessions);\n\n // Sort valid cookies and create objects to save\n for ($i = 0; $i < count($cookies); $i++) {\n $cookie = new NativeCookie;\n $cookie->setName($cookies[$i][0])->setContent($cookies[$i][1]);\n\n $expirationDate = explode(NativeCookie::$lifetimeSeperator, $cookies[$i][1]);\n\n if (array_key_exists(1, $expirationDate)) {\n $cookie->setLifetime((int)($expirationDate[1]));\n }\n else {\n $cookie->setLifetime(false);\n }\n\n self::$sessions[] = $cookie;\n }\n\n // Sort valid sessions and create objects to save\n for ($i = 0; $i < count($sessions); $i++) {\n $session = new NativeSession;\n $session->setName($sessions[$i][0])->setContent($sessions[$i][1]);\n\n self::$sessions[] = $session;\n }\n }", "public function getQueuedCookies(): array;", "#[Pure]\n public function getCookies() {}", "public function getCookies()\n {\n return $this->__getCookies();\n }", "function getPartnerInfoFromCookies()\n{\n return cache()->remember('i.partnerInfoFromCookies.' . $_SERVER['REMOTE_ADDR'], getCacheILifetime('partnerInfoFromCookies'), function () {\n $partnerId = isset($_COOKIE['partner_id']) ? $_COOKIE['partner_id'] : null;\n\n if (null === $partnerId) {\n return [];\n }\n\n return \\App\\Models\\User::where('my_id', $partnerId)->first()->toArray();\n });\n}", "public function getCookies()\n\t{\n\t\treturn $this->cookies->all();\n\t}", "public static function tryLoginByCookies() {\n if (Session::isUserLoggedIn() || !self::isCookiesSet()) {\n return;\n }\n\n $username = self::get(self::$usernameCookieName);\n $token = self::get(self::$passwordCookieName);\n $user = UserDALMySql::select($username);\n\n if ($user && $user->getToken() === $token) {\n Session::setFeedback('Welcome back with cookie');\n Session::setUserLoggedInStatus(true);\n Session::setUser($user);\n } else {\n self::deleteRememberMeCookies();\n Session::setFeedback('Wrong information in cookies');\n }\n }", "function loginThrowCookie()\n {\n\n // define all the global variables\n global $database, $message, $user, $settings, $functions, $browser;\n\n if (empty($_SESSION[\"user_data\"])) { // check if the current session is empty\n if (!empty($_COOKIE[\"user_data\"])) { // check if the current cookie is not empty or null\n\n // decrypt the user data\n $data = $functions->decryptIt($_COOKIE['user_data']);\n $data = explode(\",\", $data);\n\n // check if empty cookie\n if ($data[0] == \"\" || $data[1] == \"\") {\n return false;\n }\n\n $userID = $database->secureInput($data[0]);\n $cookieValue = $database->secureInput($data[1]);\n\n // ** Get the needed information from the database ** //\n $sql = \"SELECT * FROM \" . TBL_USERS . \" WHERE \" . TBL_USERS_ID . \" = '\" . $userID . \"'\";\n\n // get the sql results\n $result = $database->getQueryResults($sql);\n if ($database->anyError()) {\n return false;\n }\n\n // ** Check if such a user exists ** //\n if ($database->getQueryNumRows($result, true) > 0) {\n $row = $database->getQueryEffectedRow($result, true);\n\n // un-serialize the token array\n $tokenArray = unserialize($row[TBL_USERS_TOKEN]);\n\n // check if token and user data cookie match to continue\n if ($tokenArray['token'] != $cookieValue) {\n return false;\n }\n\n // check if the cookie was first created on the same device\n if ($tokenArray['browser_platform'] != $browser->getPlatform()) {\n return false;\n }\n\n // check if same ip login is disabled\n // then check if the stored ip matches the current device ip address\n if (!$settings->sameIpLogin()) {\n if ($tokenArray['ip'] != $functions->getUserIP()) {\n return false;\n }\n }\n\n // check if user has to sign in again with his credentials\n if ($row[TBL_USERS_SIGNIN_AGAIN]) {\n unset($_COOKIE[\"user_data\"]);\n unset($_COOKIE[\"user_id\"]);\n setcookie(\"user_data\", null, -1, '/');\n setcookie(\"user_id\", null, -1, '/');\n\n // update the database so that the user can log in again\n $sql = \"UPDATE \" . TBL_USERS . \" SET \" . TBL_USERS_SIGNIN_AGAIN . \" = '0' WHERE \" . TBL_USERS_ID . \" = '\" . $user->getID() . \"' AND \" . TBL_USERS_USERNAME . \" = '\" . $user->getUsername() . \"'\";\n\n // get the sql results\n $database->getQueryResults($sql);\n if ($database->anyError()) {\n return false;\n }\n\n $message->setError(\"You've been logged out for security reasons\", Message::Error);\n return false;\n }\n\n // ** Update the current session data ** //\n foreach ($row As $rowName => $rowValue) {\n $_SESSION[\"user_data\"][$rowName] = $rowValue;\n }\n\n // initiate the user data\n $user->initUserData();\n\n } else {\n return false;\n }\n } else {\n return false;\n }\n } else {\n return false;\n }\n\n return true;\n }", "protected function load(): void\n {\n if (!isset($_SESSION[$this->sessionKey])) {\n return;\n }\n $data = \\json_decode($_SESSION[$this->sessionKey], true);\n if (\\is_array($data)) {\n foreach ($data as $cookie) {\n $this->setCookie(new SetCookie($cookie));\n }\n } elseif (\\strlen($data)) {\n throw new \\RuntimeException('Invalid cookie data');\n }\n }" ]
[ "0.6486365", "0.61643726", "0.59896064", "0.5717968", "0.57139874", "0.5662884", "0.56552374", "0.56539065", "0.5605654", "0.55328864", "0.5508583", "0.5483877", "0.54750156", "0.5471019", "0.54589176", "0.53041375", "0.52894527", "0.52894413", "0.526278", "0.52358335", "0.52197725", "0.52075905", "0.5186487", "0.51684475", "0.51400936", "0.51157254", "0.5114709", "0.50945735", "0.5076982", "0.5075058" ]
0.66864043
0
Close the settings storage for the currently active user. Is called every time we're switching away from a user, BEFORE the new user's loadUserSettings() call. Should be used for doing things like closing previous peruser file handles in the backend, and unsetting the cached user information that was set in the openUser() call. After this call, there will not be any other userrelated calls until the next openUser() call.
public function closeUser () { $this->_username = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function closeUser()\n {\n $this->isUser = false;\n }", "protected function closed ($user) {\n }", "protected function closed($user)\n\t{\n\t}", "public static function loadSettingsAfterLogin() {\r\n\t\t//try to load from DB\r\n\t\t$settings=UserSettings::model()->findByAttributes(array('userId'=>Yii::app()->user->getId()));\r\n\t\t\r\n\t\tif(is_null($settings)) {\r\n\t\t\t//if there is nothing in DB, keep what is in session data, if anything is there\r\n\t\t\t$settings=Yii::app()->user->getState('settings');\r\n\t\t\t\r\n\t\t\t//else just use new\r\n\t\t\tif(is_null($settings)) {\r\n\t\t\t\t$settings=new UserSettings();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\tYii::app()->user->setState('settings', $settings);\r\n\t}", "abstract protected function closed($user);", "abstract protected function closed($user);", "function delete_all_user_settings()\n {\n }", "private function _logoutUser() { \n unlink(realpath('config/user_'.$this->username.'.conf'));\n session_destroy();\n return true;\n }", "public function clearUserNativePreferences()\n\t{\n\t\t$this->isInitialized();\n\t\t$this->getUserNativePreferencesTable()->delete($this->user_local_identifier);\n\t}", "protected function clearUserDataFromStorage()\n {\n $this->session->remove($this->getName());\n\n $recaller = $this->recaller();\n\n if (! is_null($recaller)) {\n $this->getCookieJar()->queue($this->getCookieJar()\n ->forget($this->getRecallerName()));\n\n $this->provider->deleteRememberToken($recaller->id(), $recaller->token());\n }\n }", "protected function closed ($user)\n\t\t{\n\t\t\techo \"User closed connectionn\";\n\t\t}", "public function user_settings()\n {\n\n //if existing user, go to settings\n if (Session::has('user'))\n {\n //remember url user is coming from\n Session::put('redirect', URL::previous());\n\n $user = Session::get('user');\n $failure = Session::get('failure');\n\n //specify whether user is new or not\n $user->new = 0;\n\n //get the grille's phone number, and put it in readable format\n $grille_num = Grille::where('id', $this->grille_id)->pluck('phone_number');\n $user->grille_number = '(' . substr($grille_num, 0, 3) . ') ' . substr($grille_num, 3, 3) \n . '-' . substr($grille_num, 6, 4);\n\n //format phone number to prefill\n $user->phone_formatted = '(' . substr($user->phone_number, 0, 3) . ') ' . substr($user->phone_number, 3, 3) \n . '-' . substr($user->phone_number, 6, 4);\n\n $this->layout->content = View::make('users.edit', ['user' => $user, 'failure' => $failure]);\n }\n //else redirect back to where came from\n else\n {\n try {\n return Redirect::back();\n }\n catch (Exception $e) {\n return Redirect::to('/');\n }\n\n }\n }", "function SaveSettings()\n\t{\n\t\t$this->GetDb();\n\n\t\t$tempSettings = $this->Db->Quote(serialize($this->settings));\n\t\t$tempUserID = intval($this->userid);\n\n\t\t$query = \"\n\t\t\tUPDATE [|PREFIX|]users\n\t\t\tSET settings='{$tempSettings}'\n\t\t\tWHERE userid={$tempUserID}\n\t\t\";\n\n\t\t$result = $this->Db->Query($query);\n\t\tif (!$result) {\n\t\t\tlist($error, $level) = $this->Db->GetError();\n\t\t\ttrigger_error($error, $level);\n\t\t\treturn false;\n\t\t}\n\n\t\t$currentUser = IEM::userGetCurrent();\n\t\tif ($currentUser && $currentUser->userid == $this->userid) {\n\t\t\tIEM::userFlushCache();\n\t\t}\n\n\t\treturn true;\n\t}", "public function shutdown()\n {\n $this->setAttribute('lastrequest', time(), 'user');\n\n // rimozione variabili flash da eliminare\n foreach ($names = $this->getNames('core/user/flash/remove') as $name)\n {\n $this->removeAttribute($name, 'core/user/flash');\n $this->removeAttribute($name, 'core/user/flash/remove');\n }\n\n // termina immediatamente\n session_write_close();\n }", "function deleteSettings($userId) {\n\t\treturn $this->update(\n\t\t\t'DELETE FROM user_settings WHERE user_id = ?', $userId\n\t\t);\n\t}", "public function destroy(UserSetting $userSetting)\n {\n //\n }", "public function disconnect($user_id){\n delete_user_meta($user_id, $this->umeta_id);\n }", "function saveSettings()\n {\n\t if ( wfReadOnly() ) {\n\t\treturn;\n\t }\n\t if ( 0 == $this->mCedarId ) {\n\t\treturn;\n\t }\n\t \n\t $dbw =& wfGetDB( DB_MASTER );\n\t $dbw->update( 'cedar_user_info',\n\t\t array( /* SET */\n\t\t\t 'user_id' => $this->mId,\n\t\t\t 'organization' => $this->mOrg,\n\t\t\t 'address1' => $this->mAddress1,\n\t\t\t 'address2' => $this->mAddress2,\n\t\t\t 'city' => $this->mCity,\n\t\t\t 'state' => $this->mState,\n\t\t\t 'country' => $this->mCountry,\n\t\t\t 'postal_code' => $this->mPostalCode,\n\t\t\t 'phone' => $this->mPhone,\n\t\t\t 'mobile_phone' => $this->mMobilePhone,\n\t\t\t 'fax' => $this->mFax,\n\t\t\t 'supervisor_name' => $this->mSupervisorName,\n\t\t\t 'supervisor_email' => $this->mSupervisorEmail\n\t\t ), array( /* WHERE */\n\t\t\t 'user_info_id' => $this->mCedarId\n\t\t ), __METHOD__\n\t );\n\t $this->clearSharedCache();\n }", "public function killUserSession(){\t\n\t\t@session_unset();\n\t\t@session_destroy();\n\t}", "function close() {\n if($this->locked) {\n foreach($this->users as $user => $pass) {\n if($this->cvs[$user]) {\n fputs($this->fplock, \"$user:$pass:\" . $this->cvs[$user] . \"\\n\");\n } else {\n fputs($this->fplock, \"$user:$pass\\n\");\n }\n }\n rename($this->lockfile, $this->filename);\n flock($this->fplock, LOCK_UN);\n $this->locked = false;\n fclose($this->fplock);\n }\n }", "public static function logoutUser( ) {\r\n self::$database->update(\"UPDATE users set sid=? where sid=?\", \r\n \"\", session_id());\r\n session_destroy();\r\n }", "protected function teardown() {\n User::delete($this->state[\"user\"]->id);\n }", "protected function teardown() {\n User::delete($this->state[\"user\"]->id);\n }", "protected function unlock_session() {\n \\core\\session\\manager::write_close();\n ignore_user_abort(true);\n }", "public function close() {\n if ($this->opened) {\n if ($this->shouldRegenerateId()) {\n $this->regenerateId();\n }\n\n $this->updateLastTrace();\n $this->save();\n\n $this->values = array();\n $this->opened = false;\n }\n }", "private function delete_all_user_metas() {\n\t\tglobal $wpdb;\n\n\t\t// User option keys are prefixed in single site and multisite when not in network mode.\n\t\t$key_prefix = $this->context->is_network_mode() ? '' : $wpdb->get_blog_prefix();\n\t\t$user_query = new \\WP_User_Query(\n\t\t\tarray(\n\t\t\t\t'fields' => 'id',\n\t\t\t\t'meta_key' => $key_prefix . OAuth_Client::OPTION_ACCESS_TOKEN,\n\t\t\t\t'compare' => 'EXISTS',\n\t\t\t)\n\t\t);\n\n\t\t$users = $user_query->get_results();\n\n\t\tforeach ( $users as $user_id ) {\n\t\t\t// Deletes all user stored options.\n\t\t\t$user_options = new User_Options( $this->context, $user_id );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_ACCESS_TOKEN );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_ACCESS_TOKEN_EXPIRES_IN );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_ACCESS_TOKEN_CREATED );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_REFRESH_TOKEN );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_REDIRECT_URL );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_AUTH_SCOPES );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_ERROR_CODE );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_PROXY_ACCESS_CODE );\n\t\t\t$user_options->delete( Verification::OPTION );\n\t\t\t$user_options->delete( Verification_Tag::OPTION );\n\t\t\t$user_options->delete( Profile::OPTION );\n\n\t\t\t// Clean up old user api key data, moved to options.\n\t\t\t// @todo remove after RC.\n\t\t\t$user_options->delete( 'googlesitekit_api_key' );\n\t\t\t$user_options->delete( 'sitekit_authentication' );\n\t\t\t$user_options->delete( 'googlesitekit_stored_nonce_user_id' );\n\t\t}\n\t}", "public function logoutUser()\n {\n // Unset session-key user\n $this->di->get(\"session\")->delete(\"my_user_id\");\n $this->di->get(\"session\")->delete(\"my_user_name\");\n //$this->di->get(\"session\")->delete(\"my_user_password\");\n $this->di->get(\"session\")->delete(\"my_user_email\");\n //$this->di->get(\"session\")->delete(\"my_user_created\");\n //$this->di->get(\"session\")->delete(\"my_user_updated\");\n //$this->di->get(\"session\")->delete(\"my_user_deleted\");\n //$this->di->get(\"session\")->delete(\"my_user_active\");\n $this->di->get(\"session\")->delete(\"my_user_admin\");\n }", "public function destroy(){\n\t\t//Update last visit of the user\n\t\t$sql = \"UPDATE __users\n\t\t\t\tSET user_lastvisit='\" . $this->db->escape(intval($this->data['session_current'])) . \"'\n\t\t\t\tWHERE user_id='\" . $this->db->escape($this->data['user_id']) . \"'\";\n\t\t$this->db->query($sql);\n\n\t\t// Delete existing session\n\t\t$this->destroy_session($this->sid);\n\n\t\tset_cookie('data', '0', -1);\n\t\tset_cookie('sid', '0', -1);\n\t\tregistry::add_const('SID', '?s=');\n\t\t$this->sid = '';\n\t\treturn true;\n\t}", "public function restored(User $user)\n {\n $this->clearCache($this->key);\n }", "public function profileLogout()\n {\n unset($this->getApp()->getSession()->BRACP_PROFILE_ID);\n self::$loggedUser = null;\n }" ]
[ "0.64519835", "0.5937539", "0.5919718", "0.57041454", "0.55767655", "0.55767655", "0.5532869", "0.5532494", "0.5427404", "0.54094124", "0.5364938", "0.5349593", "0.5319141", "0.5299789", "0.5289071", "0.5276134", "0.5228051", "0.5217518", "0.51942533", "0.5174687", "0.51173866", "0.50992674", "0.50992674", "0.50908905", "0.5080505", "0.50466436", "0.50446635", "0.5023006", "0.5009741", "0.49851376" ]
0.6198137
1
Set a redis key for a particular user.
private function _setUserKey (string $username, string $key, $value) { $realKey = $username . '_' . $key; $this->cache->put($realKey, (string) $value, self::CACHE_TIME); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function SetKey($key = ''){\n \tself::$userKey = $key;\n }", "function set_user_setting( $user, $key, $value )\n {\n //Unimplemented\n }", "private function setRedis_set($gid, $object){\n $client = new Predis\\Client([\n 'scheme' => 'tcp',\n 'host' => '127.0.0.1',\n 'port' => 6379,\n ]);\n\t\t$object = json_encode($object);\n $client->set($gid, $object);\n }", "public function setAccessTokenAndUserId($token, $user_id)\n {\n $ret = \\Yii::$app->redis->set('token_' . $token, $user_id); //设置redis缓存\n return $ret;\n }", "private function setInRedis($id, $key, $value)\r\n {\r\n if (is_array($value) === true) {\r\n $this->getRedis()->hmset($this->redis_options['prefix'].$id, $key, $value);\r\n } else {\r\n $this->getRedis()->hset($this->redis_options['prefix'].$id, $key, $value);\r\n }\r\n }", "public function setResetKeyForUser($user_id)\n {\n\n /*\n $this->reset_key = sha1(\n $user_id .\n \\Helpers\\Consts::appSecretKey .\n (new \\DateTime())->format(\\Helpers\\Consts::mysqlDateTimeColumnFormat)\n );\n\n */\n\n $this->reset_key = \\Helpers\\String::generateRandomString(\n $this->config->getResetKeyLength()\n );\n return $this;\n }", "function setKey($value) {\r\n $this->key = $value;\r\n }", "public function send_restore_key($user, $key)\n {\n $this->db->set('restore_key', $key)->where('email', $user)->update('ec_client');\n }", "public function user_key(string $user_key = null)\n {\n if (null === $user_key) {\n return $this->user_key;\n }\n\n $this->user_key = $user_key;\n return $this;\n }", "function update_auth_key($user_id)\n\t{\n\t\t$string = $this->random_string(20);\n\n\t\t$sql = \"\n\t\t\t\tUPDATE users\n\t\t\t\tSET auth_key = '$string'\n\t\t\t\tWHERE id_user = $user_id\n\t\t\t\";\n\n\t\t$dbdata = $this->conn->prepare($sql);\n\t\t$dbdata->execute();\n\n\t\treturn $string;\n\t}", "public function setKey(string $key);", "public function setKey($key);", "public function set(string $key, $data);", "public function set($key, $data);", "public function set( $key, $value );", "public function set( $key, $value );", "public function set_auth_key($data) {\n\t\t$this->UserAuth = ClassRegistry::init('UserAuth');\n\t\t$input = array(\n\t\t\t'key'\t=> $data['key'],\n\t\t\t'params'\t=> serialize($data),\n\t\t\t'created_at' => date('Y-m-d H:i:s'),\n\t\t\t);\n\t\t$this->UserAuth->create();\n\t\t$this->UserAuth->save($input);\n\t\treturn;\n\t}", "public function setKey( $key )\r\n {\r\n $this->key = $key;\r\n }", "function SetKey( $i ) { $this->_key = $i; $this->SetValue('_key', $i ); }", "public function set(string $key, $value);", "public function set(string $key, $value);", "public function set ($key, $value);", "public function set_user_id( $user_id ) {\r\n\t\t$this->user_id = $user_id;\r\n\t\t$this->store->set_id( $user_id );\r\n\t}", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);", "public function set($key, $value);" ]
[ "0.7010619", "0.63163507", "0.6311698", "0.629011", "0.62325096", "0.6226584", "0.61845386", "0.6122072", "0.6028243", "0.6006594", "0.5960473", "0.59544694", "0.58589417", "0.5847366", "0.5818005", "0.5818005", "0.581017", "0.579398", "0.5788379", "0.57704365", "0.57704365", "0.57688546", "0.57565415", "0.57482684", "0.57482684", "0.57482684", "0.57482684", "0.57482684", "0.57482684", "0.57482684" ]
0.6628035
1
Delete a memcached key for a particular user.
private function _delUserKey ($username, $key) { $realKey = $username . '_' . $key; $result = $this->cache->forget($realKey); if ( ! $result) throw new SettingsException('Redis Error: can not delete key - ' . $realKey); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function del($key);", "public function delete($key);", "public function delete($key);", "public function delete($key);", "public function delInCache($key);", "public function delete( $key );", "abstract public function delete_cached( $key );", "public function delete($userKey)\n {\n $userEntry = $this->getDbUser($userKey);\n\n if ($userEntry === null) {\n return null;\n }\n\n $sqliteUtils = new SqliteUtils($this->dbFile);\n $sqliteUtils->deleteRecordById($userEntry['id']);\n return true;\n }", "public function deleteByKey($key)\n {\n // Direct delete from memcached and local cache\n unset($this->cache[$key]);\n foreach ($this->mc as $mc) {\n $mc->delete($key);\n }\n }", "public function deleteKey( $key )\n {\n /** @var $client \\Memcached */\n $client = $this->getClient();\n $client->delete( $key );\n }", "function delete ($key) {\n return $this->memcached->delete($key);\n }", "public static function cacheDelete($userid)\n\t{\n\t\t$myCacher = new Cacher(self::cacheBuildKeystring($userid));\n\t\treturn $myCacher->clear();\n\t}", "public function delete($key): void;", "abstract public function deleteSyncCache($devid, $user);", "abstract public function delete($key);", "public function revokeUserKey($appUserID, $label)\n {\n // Check to see if the key exists for the user first\n $result = $this->sdb->query(\"select id from api_keys where uid=$1 and label=$2;\", [$appUserID, $label]);\n\n // Return only the data returned (one row);\n $all = array();\n while($row = $this->sdb->fetchrow($result))\n {\n $all = $row;\n }\n\n // If key exists for the user, then delete it\n if (!empty($all) && isset($all[\"id\"])) {\n $result = $this->sdb->query(\"delete from api_keys where id=$1 returning *;\", [$all[\"id\"]]);\n // Return only the data returned (one row);\n $check = array();\n while($row = $this->sdb->fetchrow($result))\n {\n $check = $row;\n }\n\n // Sanity check: did we actually delete something?\n if (empty($all))\n return false;\n return true;\n }\n\n return false;\n }", "public function delete(string $key): void;", "public function deleted(User $user)\n {\n clearCacheByArray($this->getCacheKeys($user));\n clearCacheByTags($this->getCacheTags($user));\n }", "abstract public function delete ($key);", "abstract public function delete( $key );", "public function deleteItem($key);", "public function delete_key($key){\n if($this->driver==\"file\"){\n $this->file->delete_file($this->path.md5($key).\".txt\");\n }\n if($this->driver==\"redis\"){\n $this->redis->hDel($this->path,md5($key));\n }\n }", "public function erase($key);", "public static function delete(string $key)\n {\n return \\apcu_delete(self::PREFIX.$key);\n }", "public function delete($key) {\n\t\t// and return the result\n\t\treturn eaccelerator_rm($key);\n\t}", "public function delete($key) {\n\t\treturn $this->_Memcached->delete($key);\n\t}", "function delete_usermeta($user_id, $meta_key, $meta_value = '')\n {\n }", "function delete($key) {\n\t\tunset($this->_cache[$key]);\n\t}", "public function unsetKey(string $key);", "public function unlink($key);" ]
[ "0.6957491", "0.6752543", "0.6752543", "0.6752543", "0.67215824", "0.67214817", "0.6693249", "0.65895", "0.6560337", "0.65207994", "0.6466811", "0.6465134", "0.6460812", "0.6386242", "0.6374395", "0.63148254", "0.6284899", "0.6283343", "0.6278164", "0.6278081", "0.62776124", "0.62775433", "0.6252678", "0.6226981", "0.6225866", "0.6224772", "0.6219426", "0.62130135", "0.62092745", "0.61907303" ]
0.6926232
1
adds `ignoreerrors` option to ansiblegalaxy
public function ignoreErrors() { $this->option('--ignore-errors'); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ignoreSSLErrors()\r\n {\r\n $this->commandLineOptions[] = '--ignore-ssl-errors=true';\r\n $this->commandLineOptions[] = '--ssl-protocol=tlsv1';\r\n }", "function ignore($excl){\n $excl[] = 'themes/myown/node_modules';\n return $excl;\n}", "protected function deactivate_and_die( $error = false ) {\n\t\t\t#load_plugin_textdomain(\n\t\t\t#\t'better-related',\n\t\t\t#\tfalse,\n\t\t\t#\tbasename( $this->plugin_dir ) . '/translations'\n\t\t\t#);\n\t\t\t$message = sprintf( __( \"Better Related has been automatically deactivated because of the following error: <strong>%s</strong>.\" ), $error );\n\t\t\tif ( !function_exists( 'deactivate_plugins' ) )\n\t\t\t\tinclude ( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t\t\tdeactivate_plugins( __FILE__ );\n\t\t\twp_die( $message );\n\t\t}", "public function testRollbarConfigInternalCheckIgnoredShouldSuppress(): void\n {\n $errorReporting = \\error_reporting();\n \\error_reporting(0);\n\n Rollbar::init([\n 'access_token' => $this->getTestAccessToken(),\n 'environment' => 'testing-php',\n 'verbose_logger' => $this->verboseLogger,\n ]);\n Rollbar::logger()->getConfig()->internalCheckIgnored(LogLevel::WARNING, \"Some message\");\n $this->assertVerboseLogContains(\n 'Ignoring \\(error reporting has been disabled in PHP config\\)',\n LogLevel::DEBUG,\n );\n\n \\error_reporting($errorReporting);\n }", "public function testOptionsNotFound()\n {\n $this->_task->execute();\n }", "function add_settings_error($setting, $code, $message, $type = 'error')\n {\n }", "private function _isQuietErrorsEnabled()\n {\n $plugin = craft()->plugins->getPlugin('amnav');\n $settings = $plugin->getSettings();\n if($settings->quietErrors) {\n return true;\n }\n\n return false;\n }", "protected function configure() {\n $this\n ->setName('mesd:jasper:delete-broken-records')\n ->setDescription('Removes any history record that points to a report that is no longer in the report store')\n ->addOption('dry-run', 'd', InputOption::VALUE_NONE, 'Dont make any database changes, just display the records that will be deleted')\n ;\n }", "static function error($error)\n {\n global $template_vars;\n $template_vars['errors'][] = $error;\n }", "private function getImportErrorsVerbosity() {\n\n return $this->input->getOption('skip-errors')\n ? OutputInterface::VERBOSITY_NORMAL\n : OutputInterface::VERBOSITY_QUIET;\n }", "function installError($errorMsg) {\n\t\t$templateMgr =& TemplateManager::getManager();\n\t\t$templateMgr->assign(array('isInstallError' => true, 'errorMsg' => $errorMsg));\n\t\t$this->display();\n\t}", "public function settings_errors() {\n\t\techo settings_errors( $this->token . '-errors' );\n\t}", "public function settingsWithMissingOptions()\n {\n return array(\n array(\n array('-f', '--option1'),\n array('flag1' => true, 'option1' => 'Error should be triggered')\n ),\n array(\n array('--option1', '-f'),\n array('option1' => 'Error should be triggered', 'flag1' => true)\n )\n );\n }", "private function suppressLibraryErrors()\n {\n $this->originalErrorReporting = ini_get('error_reporting');\n error_reporting(E_ERROR | E_PARSE);\n }", "protected function enableDisplayErrors() {}", "protected function enableDisplayErrors() {}", "function die_fatal_error($error)\n{\n\t\t\n\tdefine(\"e_IMAGE\",\"e107_images/\");\n\tdefine(\"e_JS\",\"e107_web/js/\");\n\tdefine(\"e_THEME\", \"e107_themes/\");\n\tdefine(\"e_LANGUAGEDIR\", \"e107_languages/\");\n\t\n\tinclude(e_LANGUAGEDIR.\"English/English.php\");\n\tinclude(e_LANGUAGEDIR.\"English/lan_installer.php\");\n\t\n\t$var = array();\n\t$var[\"installation_heading\"] \t= LANINS_001;\n\t$var[\"stage_pre\"] \t\t\t\t= LANINS_002;\n\t$var[\"stage_num\"] \t\t\t\t= LANINS_003;\n\t$var[\"stage_title\"] \t\t\t= LAN_ERROR;\n\t$var[\"percent\"] \t\t\t\t= 10;\n\t$var[\"bartype\"] \t\t\t\t= 'danger';\n\t$var['stage_content']\t\t\t= \"<div class='alert alert-error alert-block'>\".$error.\"</div>\";\n\t$var['debug_info'] \t\t\t\t= '';\n\t\n\t$template = template_data();\n\t\n\tforeach($var as $k=>$val)\n\t{\n\t\t$template = str_replace(\"{\".$k.\"}\", $val, $template);\t\n\t\t\n\t}\n\techo $template;\n\texit;\t\t\n}", "public function test_missing_options() {\n $recipe = self::$baserecipe;\n unset($recipe['name']);\n\n $this->setExpectedException('moodle_exception');\n $generator = new tool_pluginkenobi_lang_generator($recipe, 'unused');\n }", "public function setIgnoreFailedSubtask($value)\n {\n return $this->set(self::IGNORE_FAILED_SUBTASK, $value);\n }", "public static function PrintReadOnlyError(){\r\n echo \"Error: phar archive creation/modification is disabled.\\n\";\r\n }", "function pg_set_error_verbosity($connection = NULL, $verbosity)\n{\n}", "protected function configure()\n {\n $this->setDescription('Scan for legacy error middleware or error middleware invocation.');\n $this->setHelp(self::HELP);\n $this->addOption('dir', 'd', InputOption::VALUE_REQUIRED, self::HELP_OPT_DIR);\n }", "public function testRollbarConfigCheckIgnoredException(): void\n {\n Rollbar::init([\n 'access_token' => $this->getTestAccessToken(),\n 'environment' => 'testing-php',\n 'verbose_logger' => $this->verboseLogger,\n 'check_ignore' => function () {\n throw new \\Exception();\n },\n ]);\n\n Rollbar::log(LogLevel::WARNING, \"Testing PHP Notifier\");\n $this->assertVerboseLogContains('Exception occurred in the custom checkIgnore logic:', LogLevel::ERROR);\n }", "public static function output_error($x){\n _deprecated_function( __FUNCTION__, '4.9.0', 'output_message()' );\n extract( shortcode_atts( array(\n 'error'=>true,\n 'msg'=>'Missing required parameter $msg!', \n 'redirect'=>null,\n 'fields'=>array(),\n 'display'=>true,\n 'loading'=>false,\n 'json'=>true,\n 'response_data'=>array(),\n 'form_id'=>false\n ), $x));\n self::output_message($x);\n }", "function show_error ()\n {\n global $errormessage;\n global $lang;\n global $ts_template;\n if (!empty ($errormessage))\n {\n eval ($ts_template['show_error']);\n }\n\n }", "public function set_group_exceptions($cmarray) {\n $this->groupexceptions = $cmarray;\n }", "public function errorIfOldCustomDrivers(): void\n {\n $driversPath = VALET_HOME_PATH.'/Drivers';\n\n if (! $this->files->isDir($driversPath)) {\n return;\n }\n\n foreach ($this->files->scanDir($driversPath) as $driver) {\n if (! ends_with($driver, 'ValetDriver.php')) {\n continue;\n }\n\n if (! str_contains($this->files->get($driversPath.'/'.$driver), 'namespace')) {\n warning('Please make sure all custom drivers have been upgraded for Valet 4.');\n warning('See the upgrade guide for more info:');\n warning('https://github.com/laravel/valet/blob/master/UPGRADE.md');\n exit;\n }\n }\n }", "public function missingRequiredOption($message)\n {\n Command::error($message);\n die();\n }", "function setOnOptionsError($error) {\n\t\t$this->on_options_error = $error;\n\t}", "public static function suppressed(): bool\n {\n return @trigger_error('hello');\n }" ]
[ "0.5165538", "0.46428004", "0.46071783", "0.458099", "0.45791018", "0.4528251", "0.45200476", "0.45089853", "0.4496293", "0.44938752", "0.44867972", "0.44719437", "0.4444553", "0.4444389", "0.44227597", "0.44220954", "0.44164512", "0.44037446", "0.43869385", "0.4357889", "0.4339364", "0.43391386", "0.43045554", "0.43031994", "0.42978898", "0.4290334", "0.42870727", "0.42809364", "0.42730775", "0.4269189" ]
0.46455365
1
adds `rolefile` option to ansible
public function roleFile($role_file = '') { $this->option('--role-file=' . $role_file); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_role($role, $display_name, $capabilities = array())\n {\n }", "public function add_role($role)\n {\n }", "public function attachRole($role);", "public function attachRole($role);", "public function setRole($var)\n {\n GPBUtil::checkString($var, True);\n $this->role = $var;\n\n return $this;\n }", "public function setRole($role);", "public function addRole($role)\n {\n $role = strtoupper($role);\n if ($role === static::ROLE_DEFAULT) {\n return;\n }\n if (!in_array($role, $this->roles, true)) {\n $this->roles[] = $role;\n }\n }", "public function set_role($role)\n {\n }", "public function add_role($role, $display_name, $capabilities = array())\n {\n }", "public function set_role($role) {\n $this->role = $role;\n }", "function mkdf_re_include_roles_files() {\n\t\tif(mkdf_re_theme_installed()) {\n\t\t\tforeach (glob(MIKADO_RE_MODULE_PATH . '/roles/*/load.php') as $role_load) {\n\t\t\t\tinclude_once $role_load;\n\t\t\t}\n\t\t}\n\t}", "public function setAuthenticatedRole($role);", "public function addRole(string $role): void\n {\n if (!in_array($role, $this->roles)) {\n $this->roles[] = $role;\n }\n }", "protected function addRole($display, $role = null, $cap = [])\n\t{\n\t\t$role = ($role) ? (string)$role : Stringify::slugify($display);\n\t\t$role = Stringify::replace('-','_',$role);\n\t\treturn add_role($role,$display,$cap);\n\t}", "public function addRoleFormTemplate(Event $event){\n $entityManager = $this->getServiceLocator()->get('Omeka\\EntityManager');\n $roles = $entityManager->getRepository('Teams\\Entity\\TeamRole')->findAll();\n\n if (count($roles)>0){\n\n //this seems to encode the ids as characters\n\n foreach ($roles as $role):\n $role_array[$role->getId()] = $role->getName();\n endforeach;\n echo '<script> let role_array = '. json_encode($role_array) . ' </script>';\n $view = $event->getTarget();\n\n $view->headScript()->prependFile($view->assetUrl('js/chosen-trigger.js', 'Teams'));\n }\n }", "public function setRole($role)\n {\n $this->role = $role;\n }", "static function add_eb_w_role(): void {\r\n\t\tself::add_acf_inner_field(self::eb_ws, self::eb_w_role, [\r\n\t\t\t'label' => 'role',\r\n\t\t\t'type' => 'select',\r\n\t\t\t'instructions' => '',\r\n\t\t\t'required' => 1,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t\t'choices' => [\r\n\t\t\t\t'Editor-in-Chief' => 'Editor-in-Chief',\r\n\t\t\t\t'News Editor' => 'News Editor',\r\n\t\t\t\t'Arts Editor' => 'Arts Editor',\r\n\t\t\t\t'Features Editor' => 'Features Editor',\r\n\t\t\t\t'Sports Editor' => 'Sports Editor',\r\n\t\t\t\t'Photo Editor' => 'Photo Editor',\r\n\t\t\t],\r\n\t\t\t'default_value' => [],\r\n\t\t\t'allow_null' => 0,\r\n\t\t\t'multiple' => 0,\r\n\t\t\t'ui' => 1,\r\n\t\t\t'ajax' => 0,\r\n\t\t\t'placeholder' => '',\r\n\t\t\t'disabled' => 0,\r\n\t\t\t'readonly' => 0,\r\n\t\t\t'return_format' => 'value',\r\n\t\t]);\r\n\t}", "public function setRole($role)\n {\n $this->_role = $role;\n }", "public function addRole($username, $role);", "protected function setRole($role) {\n $this->role = (string) $role;\n return $this;\n }", "public function addRole($role) {\n if (!$this->hasRole($role)) {\n $this->roles[] = $role;\n }\n }", "function setRole($value)\n\t{\n\t\t$this->setState('__role', $value);\n\t}", "public function setDesiredRole($val)\n {\n $this->_propDict[\"desiredRole\"] = $val;\n return $this;\n }", "public function addRole($role)\n {\n $this->roles[] = $role;\n }", "public static function createRole()\n {\n add_action('init', __NAMESPACE__ . '\\DigitalWebmaster::renameAdministratorRole');\n }", "function mkdf_re_include_roles_register_files() {\n\t\tif(mkdf_re_theme_installed()) {\n\t\t\tforeach (glob(MIKADO_RE_MODULE_PATH . '/roles/*/role-register.php') as $role_load) {\n\t\t\t\tinclude_once $role_load;\n\t\t\t}\n\t\t}\n\t}", "public function setRole($role) {\n\n $this->role = $role;\n }", "protected function registerRoles()\n {\n if (! is_dir($path = resource_path('roles'))) {\n return;\n }\n\n $files = Finder::create()\n ->in($path)\n ->name('*.php')\n ->notName('defaults.php');\n\n $bouncer = app(Bouncer::class);\n $bouncer->seeder(function () use ($bouncer, $files) {\n collect($files)->each(function ($file) use ($bouncer) {\n $role = require $file->getRealPath();\n $name = $role['name'];\n $permissions = $role['permissions'];\n\n $bouncer->allow(\"$name\")->to($permissions);\n });\n });\n }", "public function assignRole ($name);", "function add_user_role_leadership(){\r\n\tif(isset($_GET['addrole']) && ($_GET['addrole'] == 'do')){\r\n\t\tadd_role( 'quote_manager', 'Quote Manager', array( 'read' => true, 'level_2' => true ) );\r\n\r\n//\t\tremove_role( 'tow_company' );\r\n\t}\r\n}" ]
[ "0.53365266", "0.5078995", "0.49909854", "0.49909854", "0.48811686", "0.48124954", "0.4807254", "0.47733837", "0.471409", "0.47004554", "0.46609274", "0.46253684", "0.45722702", "0.4559672", "0.45521155", "0.45278615", "0.4527051", "0.45222965", "0.45082125", "0.4493077", "0.4488675", "0.44837844", "0.4480368", "0.44666895", "0.44423005", "0.44306007", "0.44200227", "0.44194278", "0.43781036", "0.43678916" ]
0.6522479
0
Get all images from gallery folder
private function images() { return File::allFiles(public_path('img/gallery')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_all_gallery_images() {\n\n\t\tcheck_ajax_referer( 'daylife-gallery-add-nonce', 'nonce' );\n\t\trequire_once( dirname( __FILE__ ) . '/class-wp-daylife-api.php' );\n\t\t$daylife = new WP_Daylife_API( get_option( 'daylife' ) );\n\n\t\t// Should be int but santize value as id can be bigger than maximum int value\n\t\t$gallery_id = sanitize_text_field( $_POST['gallery_id'] );\n\t\tif ( $gallery_id > 0 ) {\n\t\t\t$args['gallery_id'] = $gallery_id;\n\n\t\t\t$images = $daylife->get_gallery_by_id( $args );\n\n\t\t\tforeach ( $images as $image ) {\n\t\t\t\t$image_data[] = $image->url . '|' . $image->caption;\n\t\t\t}\n\t\t\techo json_encode( $image_data );\n\t\t}\n\t\tdie;\n\n\t}", "public function actionGalleryImages() {\n\n // # Cache result forever\n $cached = Cache::rememberForever( 'actionGalleryImages', function () {\n\n // # Conatiner init\n $container = [];\n\n // # Directory iterator\n $iterator = new \\DirectoryIterator( \"./images/gallery/images\" );\n\n // # Loop through files and dir\n foreach( $iterator as $item ) {\n\n // # Avoid dirs\n if( is_dir( $item ) ) {\n continue;\n }\n\n // # Get pathname\n $path = ltrim( $item->getPathname(), \".\" );\n $tmp[ 'src' ] = $path;\n $tmp[ 'thumb' ] = $path;\n $container[] = $tmp;\n }\n\n // # toJson\n return json_encode($container);\n });\n\n return response()->make( $cached );\n\n }", "public function getAllImages() {\n\t\t$returnArr = array();\n\n\t\tforeach (File::allFiles($this->imageFolder) as $file) {\n\t\t\t$fileName = $file->getRelativePathName();\n\n\t\t\t$returnArr[] = url() . '/uploads/images/'.$fileName;\n\t\t}\n\n\t\treturn $returnArr;\n\t}", "public static function getGalleryImages($key) {\n $gallery = array();\n\n $path = ImageHelper::IMAGE_DIR . $key . '/gallery/';\n\n if (file_exists($path)) {\n foreach (scandir($path) as $file) {\n if (ImageHelper::endsWith($file, \".jpg\") || ImageHelper::endsWith($file, \".jpeg\") || ImageHelper::endsWith($file, \".png\")) {\n $tempPath = $path . $file;\n \n $filename = pathinfo($tempPath, PATHINFO_FILENAME);\n $small = ImageHelper::CACHE_DIR . $key . '_' . $filename . \"_small.jpg\";\n\n if (!file_exists($small)) {\n ImageHelper::convertToJPG($tempPath, 256, 256, $small);\n }\n\n array_push($gallery, $small);\n }\n }\n }\n\n return $gallery;\n }", "function rusticmodern_get_gallery_images() {\n\t$images = array();\n\n\tif ( function_exists( 'get_post_galleries' ) ) {\n\t\t$galleries = get_post_galleries( get_the_ID(), false );\n\t\tif ( isset( $galleries[0]['ids'] ) )\n\t\t \t$images = explode( ',', $galleries[0]['ids'] );\n\t} else {\n\t\t$pattern = get_shortcode_regex();\n\t\tpreg_match( \"/$pattern/s\", get_the_content(), $match );\n\t\t$atts = shortcode_parse_atts( $match[3] );\n\t\tif ( isset( $atts['ids'] ) )\n\t\t\t$images = explode( ',', $atts['ids'] );\n\t}\n\n\tif ( ! $images ) {\n\t\t$images = get_posts( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'numberposts' => 999,\n\t\t\t'order' => 'ASC',\n\t\t\t'orderby' => 'menu_order',\n\t\t\t'post_mime_type' => 'image',\n\t\t\t'post_parent' => get_the_ID(),\n\t\t\t'post_type' => 'attachment',\n\t\t) );\n\t}\n\n\treturn $images;\n}", "function twentyten_get_gallery_images() {\n\t$images = array();\n\n\tif ( function_exists( 'get_post_galleries' ) ) {\n\t\t$galleries = get_post_galleries( get_the_ID(), false );\n\t\tif ( isset( $galleries[0]['ids'] ) ) {\n\t\t\t$images = explode( ',', $galleries[0]['ids'] );\n\t\t}\n\t} else {\n\t\t$pattern = get_shortcode_regex();\n\t\tpreg_match( \"/$pattern/s\", get_the_content(), $match );\n\t\t$atts = shortcode_parse_atts( $match[3] );\n\t\tif ( isset( $atts['ids'] ) ) {\n\t\t\t$images = explode( ',', $atts['ids'] );\n\t\t}\n\t}\n\n\tif ( ! $images ) {\n\t\t$images = get_posts(\n\t\t\tarray(\n\t\t\t\t'fields' => 'ids',\n\t\t\t\t'numberposts' => 999,\n\t\t\t\t'order' => 'ASC',\n\t\t\t\t'orderby' => 'menu_order',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'post_parent' => get_the_ID(),\n\t\t\t\t'post_type' => 'attachment',\n\t\t\t)\n\t\t);\n\t}\n\n\treturn $images;\n}", "public function getGalleryImages()\n {\n $user_id = Auth::user()->user_id;\n\n $images = Azure::getImageThumbnailFiles($user_id);\n $imageOrder = DB::table(\"users\")\n ->select(\"gallery_order\")\n ->where(\"user_id\", $user_id)\n ->first();\n\n return array(\"success\" => true, \"data\" => array(\n \"images\" => $images,\n \"order\" => $imageOrder->gallery_order\n ));\n }", "public function getMediaGalleryImages()\n {\n if(!$this->hasData('media_gallery_images') && is_array($this->getMediaGallery('images'))) {\n $images = new Varien_Data_Collection();\n foreach ($this->getMediaGallery('images') as $image) {\n if ($image['disabled']) {\n continue;\n }\n $image['url'] = $this->getMediaConfig()->getMediaUrl($image['file']);\n $image['id'] = isset($image['value_id']) ? $image['value_id'] : null;\n $image['path'] = $this->getMediaConfig()->getMediaPath($image['file']);\n $images->addItem(new Varien_Object($image));\n }\n $this->setData('media_gallery_images', $images);\n }\n\n return $this->getData('media_gallery_images');\n }", "public function getAllPhotos();", "public function getImages()\n {\n return GalleryImage::get()->filter('ParentID', $this->AllChildren()->column('ID') ?: null);\n }", "public function all_gallery_images($id)\n\t{\n\t\t$gal=$this->db->query(\"SELECT *FROM `product_gallery` where `product_id`='\".$id.\"'\");\n\t\tif($gal->num_rows()>0)\n\t\t{\n\t\t\treturn $gal;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getImgs(){\n \n if ( is_null($this->getId()) ){\n return null;\n }\n\n $d = APPLICATION_PATH . '/../storage/category_pictures/' . $this->getId().'/';\n\n $pics = array();\n\n $dir = opendir($d);\n\n while($file = readdir($dir)){\n if ( $file != \".\" && $file != \"..\" && $file != \".svn\" && $file != \".DS_Store\" ) {\n $pics[] = '/../storage/category_pictures/' . $this->getId() . '/' . $file;\n }\n }\n\n return $pics;\n }", "public function getImages(){\n $images =[];\n $files=[];\n $imageDir=opendir(IMAGES_DIR);\n while(false !==($file=readdir($imageDir))){\n // $imageDirから一行ずつ読み込んで,$fileに入れて行く そんでそれがfalseにならない限り回し続ける\n if($file === '.'||$file =='..'){\n // カレントディレクトリやルートディレクトリを飛ばして回す\n continue;\n }\n $files[]=$file;\n //thumnailは imagesdirに存在するのかな\n if(file_exists(THUMBNAIL_DIR.'/'.$file)){\n $images[]=basename(THUMBNAIL_DIR).'/'.$file;\n } else{\n $images[]=basename(IMAGES_DIR).'/'.$file;\n }\n }\n array_multisort($files,SORT_DESC,$images);\n // 逆向き順に$filesに入っているimagesをそr・せよ\n return $images;\n}", "public function getPhotos();", "function get_images() \t{\n \t\treturn $this->getImages();\n \t}", "public function imagesManager()\n\t{\n\t\t$images = array();\n\n\t\t// Grab all images in the directory\n\t\t$files = File::allFiles(public_path() . '/uploads');\n\n\t\tforeach ($files as $file) {\n\t\t\t// Ignore thumbnail image\n\t\t\tif (!strpos($file, 'thumb_')) {\n\t\t\t\t// Get the image extension\n\t\t\t\t$ext = '.' . pathinfo($file, PATHINFO_EXTENSION);\n\t\t\t\t// Get the directory path for the image\n\t\t\t\t$path = explode( \"/\", substr($file,strpos($file,\"/uploads\")));\n\t\t\t\t// Remove file name to get only directory name\n\t\t\t\tarray_pop($path);\n\n\t\t\t\t$image_path = implode(\"/\", $path);\n\n\t\t\t\t$images[] = array(\"thumb\" => $image_path .'/thumb_' . basename($file), \"image\" => $image_path .'/' . basename($file), \"title\" => basename($file, $ext), \"link\" => $image_path .'/' . basename($file));\n\t\t\t}\n\t\t}\n\n\t\treturn Response::json($images);\n\t}", "public function getImages( $id_album = 0 )\n\t{\n\t\treturn Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'azgallery` WHERE `id_album`='.$id_album);\n\t}", "public function getGallery()\n {\n return $this->getItems()->getItems()->andWhere(['type' => 'gallery']);\n\n }", "public function getImages()\n\t\t{\n\t\t\t$this->createDir();\n\t\t\t//sacamos la lista de ficheros de la carpeta photos\n\t\t\t$files = $this->getFileList();\n\t\t\t//array de salida\n\t\t\t$image_List = array();\n\t\t\t\n\t\t\t//recorremos el contenido de esa carpeta\n\t\t\tforeach($files as $file)\n\t\t\t{\n\t\t\t\t//tiene que ser jpg, gif o png para que muestre las imagenes y que no sea . o ..\n\t\t\t\tif($file!=\".\" && $file!=\"..\" && $this->validatePhoto($file))\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t//guardo en el array la lista de imagenes\n\t\t\t\t\tarray_push($image_List, $file);\n\t\t\t\t\t\n\t\t\t\t\t//miro si existe la imagen en el thumbs si no lo creo\n\t\t\t\t\tif(!$this->checkIfFileExistes($file))\n\t\t\t\t\t{\n\t\t\t\t\t\t//como NO existe la minituara la creamos\n\t\t\t\t\t\t$this->createThumb(\"$file\");\n\t\t\t\t\t}\n\t\t\t\t\t//mostramos la miniatura y al hacer clic mostramos original \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\techo \"<a href='\".$this->ruta.\"/$file' target='_blank' ><img src='\".$this->rutaMini.\"/$file'/></a>\";\t\n\t\t\t\t}\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}", "function getImages($dir)\n {\n global $imagetypes;\n\n // array to hold return value\n $retval = array();\n\n // add trailing slash if missing\n if(substr($dir, -1) != \"/\") $dir .= \"/\";\n\n \n \n \n // full server path to directory\n $fulldir = \"{$_SERVER['DOCUMENT_ROOT']}/$dir\";\n \n\n $d = @dir($fulldir) or die(\"getImages: Failed opening directory $dir for reading\");\n while(false !== ($entry = $d->read())) {\n // skip hidden files\n if($entry[0] == \".\") continue;\n\n // check for image files\n if(in_array(mime_content_type(\"$fulldir$entry\"), $imagetypes)) {\n $retval[] = array(\n \"file\" => \"/$dir$entry\",\n \"size\" => getimagesize(\"$fulldir$entry\")\n );\n }\n }\n $d->close();\n\n return $retval;\n }", "public function galleries(){\n\n $parameters = [\n 'sort' => 'position',\n 'sort_direction' => 'asc',\n 'page' => 1,\n 'cover_size' => 4,\n 'rpp' => 40\n ];\n\n $data = $this->api->get_galleries($parameters);\n\n return $data['galleries'];\n }", "public static function getGalleryImages($subfolder = null) {\r\n $images = \\Nette\\Utils\\Finder::findFiles('*.jpg')->from(__DIR__ . self::GALLERY_PATH .(($subfolder!==null) ? ($subfolder.'/') : ''). 'thumbs/');\r\n $result = [];\r\n if (!empty($images)) {\r\n foreach ($images as $spl) {\r\n $filename = $spl->getBasename();\r\n if (file_exists(__DIR__ . self::GALLERY_PATH.(($subfolder!==null) ? ($subfolder.'/') : '') . $filename)) {\r\n $result[self::GALLERY_URI .(($subfolder!==null) ? ($subfolder.'/') : ''). 'thumbs/' . $filename] = self::GALLERY_URI.(($subfolder!==null) ? ($subfolder.'/') : '') . $filename;\r\n }\r\n }\r\n }\r\n return $result;\r\n }", "final public function get_images() : array {\n Helper::load('files');\n\n return Files::get_files_in_dir($this->route);\n }", "function getImages($hello) {\n\n\t$imagetypes = array(\"image/jpg\",\"image/jpeg\",\"image/png\");\n\t$dir = \"/assets/galleries/\".$hello.\"/images/\";\n\t$dir2 = \"/assets/galleries/\".$hello.\"/thumbs/\";\n\t$dir3 = \"/assets/galleries/\".$hello.\"/downloads/\";\n\n\t#array to hold return value\n\t$retval = array();\n\n\t#full server path to directory\n\t$fulldir = \"{$_SERVER['DOCUMENT_ROOT']}$dir2\"; \n\t$idir = \"{$_SERVER['DOCUMENT_ROOT']}$dir\"; \n\n\t$d = @dir($fulldir) or die(\"getImages: Failed opening directory $dir for reading\"); \n\twhile(false !== ($entry = $d->read())) { \n\t\t# skip hidden files \n\t\tif($entry[0] == \".\") continue; \n\n\t\t# check for image files \n\t\tif(in_array(mime_content_type(\"$fulldir$entry\"), $imagetypes)) { \n\t\t\t$retval[] = array( \"file\" => \"$dir$entry\", \n\t\t\t\"size\" => getimagesize(\"$fulldir$entry\"),\n\t\t\t\"name\" => \"$entry\",\n\t\t\t\"thumb\"=>\"$dir2$entry\",\n\t\t\t\"download\"=>\"$dir3$entry\",\n\t\t\t\"isize\" => getimagesize(\"$idir$entry\")\n\t\t\t); \n\t\t}\n\t}\n\t$d->close(); \n\treturn $retval;\n}", "public function get_images()\r\n\t\t{\r\n\t\t\t$images = $this->obj->result;\r\n\t\t\treturn $images;\r\n\t\t}", "public function getImages() {\n\t\tif($this->images === null) {\n\t\t\t$this->images = $this->getObjectManager()->get('Qinx\\Qxgallery\\Domain\\Repository\\ImageRepository')->findAll(array(\n\t\t\t\t'category' => $this\n\t\t\t));\n\t\t}\n\n\t\treturn $this->images;\n\t}", "function get_pages_images_list() {\n\t$files = scandir(BASEPATH . \"/../public/images/pages\");\n\tarray_shift($files); // remove \".\"\n\tarray_shift($files); // remove \"..\"\n\treturn $files;\n}", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "private function getAllImgsJpg($directory = 'images/')\n {\n $resizedFilePath = array();\n foreach ($directory AS $dir) {\n foreach (glob($dir . '*.jpg') as $filename) {\n array_push($resizedFilePath, $filename);\n }\n }\n return $resizedFilePath;\n }", "public function get_images_by_gallery($id, $options = array())\n\t{\n\t\t// Find new images on files\n\t\t$this->set_new_image_files($id);\t\n\n\t\t// Clear old files on images\n\t\t$this->unset_old_image_files($id);\n\n\t\tif (isset($options['offset']))\n\t\t{\n\t\t\t$this->db->offset($options['offset']);\n\t\t}\n\n\t\tif (isset($options['limit']))\n\t\t{\n\t\t\t$this->db->limit($options['limit']);\n\t\t}\n\n\t\t// Grand finale, do what you gotta do!!\n\t\t$images = $this->db\n\t\t\t\t// Select fields on gallery images table\n\t\t\t\t->select('gallery_images.*, files.name, files.filename, files.extension, files.description, files.name as title, galleries.folder_id, galleries.slug as gallery_slug, galleries.title as gallery_title')\n\t\t\t\t// Set my gallery by id\n\t\t\t\t->where('galleries.id', $id)\n\t\t\t\t// Filter images from my gallery\n\t\t\t\t->join('galleries', 'galleries.id = gallery_images.gallery_id', 'left')\n\t\t\t\t// Filter from my images\n\t\t\t\t->join('files', 'files.id = gallery_images.file_id', 'left')\n\t\t\t\t// Filter files type image\n\t\t\t\t->where('files.type', 'i')\n\t\t\t\t// Order by user order\n\t\t\t\t->order_by('`order`', 'asc')\n\t\t\t\t// Get all!\n\t\t\t\t->get('gallery_images')\n\t\t\t\t->result();\n\n\t\treturn $images;\n\t}" ]
[ "0.7814598", "0.7772644", "0.7670666", "0.7548918", "0.73371917", "0.7319401", "0.72812206", "0.71849316", "0.71804935", "0.71597433", "0.71211255", "0.7070795", "0.7044805", "0.7040692", "0.6957863", "0.69230336", "0.6921784", "0.6920976", "0.6919768", "0.6905779", "0.6898715", "0.6870964", "0.68537474", "0.6852665", "0.68221724", "0.68105614", "0.6806407", "0.68017334", "0.67571676", "0.67482734" ]
0.8162983
0
Find a string matching the given entity in the cache, or create one and add it.
protected function findOrCreateString($entity, $string) { $cache = static::get_cache(); $key = md5($entity); // It's not in the cache, which means it might have expired or might be a new entity if (!$result = $cache->load($key)) { $translation = DynamicTranslation::get()->filter(array('Entity' => $entity))->first(); // If no translation exists for this entity, create it if (!$translation) { $translation = DynamicTranslation::create(array('Entity' => $entity, 'String' => $string)); $translation->write(); } $cache->save($translation->String, $key); $result = $translation->String; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function addCache($key, $data)\n {\n \t$class = get_called_class();\n \tBaseEntityAbstract::$_entityCache[$class][$key] = $data;\n \treturn BaseEntityAbstract::$_entityCache[$class][$key];\n }", "public function lookup($key)\r\n {\r\n\t\t// create the unique cache key of the entity\r\n \t$cacheKey = $this->getCacheKey($key);\r\n \t// check if a entity with the passed primary key is available\r\n if (array_key_exists($cacheKey, $this->_entities)) {\r\n \treturn $this->_entities[$cacheKey];\r\n }\r\n // check if the requested entity exists in cache\r\n elseif($this->getCache()->test($cacheKey)) {\r\n \treturn $this->getCache()->load($cacheKey);\r\n }\r\n // if not return null\r\n else {\r\n \treturn null;\r\n }\r\n }", "public function add($entity)\r\n {\r\n \t$cacheKey = $this->getCacheKey($entity->getPrimaryKey());\r\n \t$this->_entities[$cacheKey] = $entity;\r\n }", "function get_entity_by_id_cache($entity_type, $entity_id)\n{\n global $cache;\n\n $translate = entity_type_translate_array($entity_type);\n\n if (is_array($cache[$entity_type][$entity_id]))\n {\n\n return $cache[$entity_type][$entity_id];\n\n } else {\n\n switch($entity_type)\n {\n case \"bill\":\n if (function_exists('get_bill_by_id'))\n {\n $entity = get_bill_by_id($entity_id);\n }\n break;\n\n case \"port\":\n $entity = get_port_by_id($entity_id);\n break;\n\n default:\n $sql = 'SELECT * FROM `'.$translate['table'].'`';\n\n if (isset($translate['state_table']))\n {\n $sql .= ' LEFT JOIN `'.$translate['state_table'].'` USING (`'.$translate['id_field'].'`)';\n }\n\n if (isset($translate['parent_table']))\n {\n $sql .= ' LEFT JOIN `'.$translate['parent_table'].'` USING (`'.$translate['parent_id_field'].'`)';\n }\n\n $sql .= ' WHERE `'.$translate['table'].'`.`'.$translate['id_field'].'` = ?';\n\n $entity = dbFetchRow($sql, array($entity_id));\n if (function_exists('humanize_'.$entity_type)) { $do = 'humanize_'.$entity_type; $do($entity); }\n else if (isset($translate['humanize_function']) && function_exists($translate['humanize_function'])) { $do = $translate['humanize_function']; $do($entity); }\n break;\n }\n\n if (is_array($entity))\n {\n entity_rewrite($entity_type, $entity);\n $cache[$entity_type][$entity_id] = $entity;\n return $entity;\n }\n }\n\n return FALSE;\n}", "private function cacheThis()\n\t{\n\t\t$q = 'UPDATE twitterSearch SET searchResults = \"' .addslashes($this->_results) .'\" WHERE searchTerm = \"' .$this->_searchString .'\"';\n\t\t$r = mysql_query($q, CONN) or die('could not update the results in the database for caching');\n\t}", "function create_search_cache($item_id)\n{\n global $db_prefix, $ce_cache;\n $row = sql_qquery(\"SELECT *, t1.idx AS item_id FROM \".$db_prefix.\"products AS t1 LEFT JOIN \".$db_prefix.\"product_cf_value AS t2 ON (t1.idx=t2.item_id) WHERE item_id='$item_id' LIMIT 1\");\n\n // cf type to store as smart cache\n $cfsc = array('varchar', 'textarea', 'country', 'select', 'multi');\n $cfsc_str = '';\n foreach ($ce_cache['cf_define'] as $k => $v) {\n if (in_array($v['cf_type'], $cfsc) && ($v['is_searchable'])) {\n $cfsc_str .= $row[$k].' ';\n }\n }\n\n // search_cache\n $string = strip_tags($row['sku'].' '.$row['title'].' '.$row['details'].' '.$cfsc_str);\n $string = str_replace('&#039;', '\\'', $string);\n $string = preg_replace('/[^\\p{L}\\p{N}\\s]/u', '', strtolower($string));\t// remove non alphanumeric, but keep UTF-8 chars\n $string = preg_replace('!\\s+!', ' ', $string);\t\t\t\t\t\t\t\t// replace tab & spaces as single space\n $string = addslashes(implode(' ', array_unique(explode(' ', $string))));// unique\n sql_query(\"UPDATE \".$db_prefix.\"products SET smart_search='$string' WHERE idx='$row[item_id]' LIMIT 1\");\n}", "function apc_cache_pre_get_keyword($args) {\n\tglobal $ydb;\n\t$keyword = $args[0];\n\t$use_cache = isset($args[1]) ? $args[1] : true;\n\t\n\t// Lookup in cache\n\tif($use_cache && apc_exists(apc_cache_get_keyword_key($keyword))) {\n\t\t$ydb->infos[$keyword] = apc_fetch(apc_cache_get_keyword_key($keyword)); \t\n\t}\n}", "public static function findById($id) \n {\n if(Cache::store('alunos')->has($id)) \n {\n //Caso exista, registra o hit\n event(new AlunosCacheHit);\n\n //E retorna o registro do cache\n return Cache::store('alunos')->get($id);\n } \n else \n {\n //Caso não exista, registra o miss\n event(new AlunosCacheMissed);\n\n //Procura na base\n $aluno = parent::find($id);\n\n //Sleep para simular uma consulta mais demorada\n sleep(1);\n\n //Insere no cache, com a chave primária\n Cache::store('alunos')->forever($id, $aluno);\n\n //Retorna o registro\n return $aluno;\n }\n\n }", "protected function cache(\n\t\tPersistentEntity $entity,\n\t\t$memcache = false,\n\t\t$overwrite = false\n\t) {\n\t\t$key = $this->cacheKey($entity->getValues(true));\n\t\tif (!$overwrite AND $this->isCached($key, $memcache)) {\n\t\t\t$entity = $this->getCached($key, $memcache);\n\t\t} else {\n\t\t\t$this->setCache($key, $entity, $memcache);\n\t\t}\n\t\treturn $entity;\n\t}", "protected function cache(PersistentEntity $entity, $memcache = false, $overwrite = false) {\r\n\t\t$key = $this->cacheKey($entity->getValues(true));\r\n\t\tif (!$overwrite AND $this->isCached($key, $memcache)) {\r\n\t\t\t$entity = $this->getCached($key, $memcache);\r\n\t\t} else {\r\n\t\t\t$this->setCache($key, $entity, $memcache);\r\n\t\t}\r\n\t\treturn $entity;\r\n\t}", "function entityID($entity){\n\t\t$entity = strtolower($entity);\n\t\t// Check local copy\n\t\tif(in_array($entity,$this->entities)) return $this->entities[$entity];\n\t\t\n\t\t// Check DB\n\t\tglobal $sess;\n\t\t$db = $sess->db();\n\t\t$entityID = $db->queryUniqueValue('SELECT id FROM `entities` WHERE `name` LIKE \\''.addslashes($entity).'\\'');\n\t\tif(!$entityID){\n\t\t\t// Create new entity\n\t\t\t$db->preparedInsert('entities',array('name'=>$entity));\n\t\t\t$entityID = $db->lastInsertedId();\n\t\t}\n\t\t// Store in local cache\n\t\t$this->entities[$entity] = $entityID;\t\n\t\treturn $entityID;\n\t}", "public function findByName(String $name);", "public function getItem($key): CacheItem;", "function checkRelatedInCache($productName)\n{\n return S::of(function (Cacher $cache) use ($productName) {\n return [$cache->get($productName), $cache];\n });\n}", "public function createItem(string $key): CacheItemInterface;", "private function cacheKey(Cache $cache, $name, $src, $paramStr, $filterStr)\n {\n return $cache->createKey(\n $src,\n $name,\n $paramStr.'/'.$filterStr,\n pathinfo($src, PATHINFO_EXTENSION)\n );\n }", "public function set($key, $value): CacheInterface;", "function shAddSefUrlToDBAndCache($nonSefUrl, $sefString, $rank, $urlType)\n{\n\n\t$db = ShlDbHelper::getDb();\n\t$sefString = JString::ltrim($sefString, '/'); // V 1.2.4.t just in case you forgot to remove leading slash\n\tswitch ($urlType)\n\t{\n\t\tcase sh404SEF_URLTYPE_AUTO:\n\t\t\t$dateAdd = '0000-00-00';\n\t\t\tbreak;\n\t\tcase sh404SEF_URLTYPE_CUSTOM:\n\t\t\t$dateAdd = date(\"Y-m-d\");\n\t\t\tbreak;\n\t\tcase sh404SEF_URLTYPE_NONE:\n\t\t\treturn null;\n\t\t\tbreak;\n\t}\n\n\ttry\n\t{\n\n\t\t$query = '';\n\t\tif ($urlType == sh404SEF_URLTYPE_AUTO)\n\t\t{\n\t\t\t$result = ShlDbHelper::quoteQuery('select ??, ?? from ?? where ?? = ? and (?? = ? or ?? = ?)',\n\t\t\t\tarray('id', 'newurl', '#__sh404sef_urls', 'oldurl', 'newurl', 'newurl'), array($sefString, '', addslashes(urldecode($nonSefUrl))))\n\t\t\t\t->loadObject();\n\n\t\t\tif (!empty($result))\n\t\t\t{\n\t\t\t\t// sef urls was found either as a 404 or as already existing, with also the same non-sef\n\t\t\t\tif ($result->newurl == $nonSefUrl)\n\t\t\t\t{\n\t\t\t\t\t// url already in db, nothing to do\n\t\t\t\t\tShlSystem_Log::debug('sh404sef', 'url already in db, nothing to do');\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tShlDbHelper::update('#__sh404sef_urls', array('newurl' => addslashes(urldecode($nonSefUrl)), 'rank' => $rank, 'dateadd' => $dateAdd),\n\t\t\t\t\tarray('oldurl' => $sefString));\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// another option: sef exists, but with another non-sef: that's a duplicate\n\t\t\t\t// need to check that\n\t\t\t\t$result = ShlDbHelper::selectObject('#__sh404sef_urls', array('id', 'newurl', 'rank'),\n\t\t\t\t\t$db->quoteName('oldurl') . ' = ? and ' . $db->quoteName('newurl') . ' <> ?',\n\t\t\t\t\tarray($sefString, addslashes(urldecode($nonSefUrl))), array('rank' => 'desc'));\n\n\t\t\t\tif (!empty($result))\n\t\t\t\t{\n\t\t\t\t\t// we found at least one identical SEF url, with another non-sef. Mark the new one as duplicate of the old one\n\t\t\t\t\t$rank = $result->rank + 1;\n\t\t\t\t}\n\n\t\t\t\tShlDbHelper::insert('#__sh404sef_urls', array('oldurl' => $sefString, 'newurl' => $nonSefUrl, 'rank' => $rank, 'dateadd' => $dateAdd));\n\n\t\t\t\t// store optional data\n\t\t\t\tSh404sefHelperUrl::storeUrlSourceData($nonSefUrl, $sefString);\n\t\t\t}\n\t\t}\n\n\t\t// store new sef/non-sef pair in memory cache\n\t\tSh404sefHelperCache::addSefUrlToCache($nonSefUrl, $sefString, $urlType);\n\n\t\t// create shURL : get a shURL model, and ask url creation\n\t\t$model = ShlMvcModel_Base::getInstance('pageids', 'Sh404sefModel');\n\t\t$model->createPageId($sefString, $nonSefUrl);\n\n\t}\n\tcatch (Exception $e)\n\t{\n\t\tShlSystem_Log::error('sh404sef', '%s::%s::%d: %s', __CLASS__, __METHOD__, __LINE__, $e->getMessage());\n\t}\n}", "function getItem($name){\n\t\t$i = cacheItem::getInstance($name);\n\t\tif(empty($i->cacheTime) && empty($i->content) ){\n\t\t\t$datas = $this->db->select_row(self::$tableName,'*',array('WHERE name=?',$name));\n\t\t\tif( false !== $datas)\n\t\t\t\t$i->setDatas($datas);\n\t\t}\n\t\treturn $i;\n\t}", "public function getObjFromCache($key);", "function wp_cache_get($key, $group = '', $force = false, &$found = null)\n{\n global $wp_object_cache;\n\n return $wp_object_cache->get($key, $group, $force, $found);\n}", "function wp_cache_get($key, $group = '', $force = false, &$found = null)\n{\n global $wp_object_cache;\n\n return $wp_object_cache->get($key, $group, $force, $found);\n}", "public function getItem(string $key): CacheItemInterface;", "public function isExistInCache($key);", "public function find ($key);", "public function findByName($name);", "public function findByName($name);", "public function findByName($name);", "function wp_cache_get($key, $group = '', $force = \\false, &$found = \\null)\n {\n }", "private function _getCache($term) {\n\t\t// find our search term\n\t\t$result = $this->db->get_where('Cache', array('Term' => $term, 'Expires >' => date(\"Y-m-d H:i:s\")))->row_array();\n\t\t// did we get one that isn't expired?\n\t\tif ($result) { \n\t\t\t// cache hit\n\t\t\treturn $result['Data'];\n\t\t}\n\t\t// cache miss\n\t\treturn false;\n\t}" ]
[ "0.5409238", "0.5355655", "0.5323046", "0.5268693", "0.5076938", "0.50654864", "0.5052053", "0.49734613", "0.4970405", "0.49582818", "0.49579415", "0.49021587", "0.48987982", "0.48794687", "0.48473954", "0.48415858", "0.483729", "0.483095", "0.4814251", "0.47787786", "0.47620735", "0.47620735", "0.47573006", "0.47505242", "0.47377914", "0.47298485", "0.47298485", "0.47298485", "0.47141603", "0.47091395" ]
0.6792213
0
Generated from protobuf field float score = 1;
public function setScore($var) { GPBUtil::checkFloat($var); $this->score = $var; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getScore()\n {\n return $this->score;\n }", "public function getScore()\n {\n return $this->score;\n }", "public function getScore()\n {\n return $this->score;\n }", "public function getScore()\n {\n return $this->score;\n }", "public function getScore() : int{\n return $this->score;\n }", "public function setScore( float $score ) {\n if ($score < 0.0 || $score > 1.0) {\n $score = 1.0;\n }\n\n $this->score = $score;\n return $this;\n }", "public function score(): int;", "public function getScore();", "function score()\r\n {\r\n return $this->Score;\r\n }", "abstract public function score();", "public function getScore(): int\n {\n return $this->score;\n }", "public function getScore()\n {\n }", "public function score()\n {\n $this->score++;\n }", "public function uvScore();", "public function getSpamScore(){\r\n\t\treturn $this->spamScore;\r\n\t}", "public function soundScore();", "public function getScore()\r\n\t{\r\n\t\treturn $this->root->getAttribute('score');\r\n\t}", "public function score()\n {\n return $this->hasOne(Score::class);\n }", "public function getFeedbackScore()\n {\n return $this->feedbackScore;\n }", "public function _getCalculatedScore() {\n\t\treturn $this->_calculatedScore;\n\t}", "public function getMatchedScore(){\n if($this->greScore) return $this->greScore;\n if($this->toeflScore) return $this->toeflScore;\n return false;\n }", "public function getScoreSum()\n\t{\n\t\treturn (float) $this->score_mc + $this->score_case;\n\t}", "function get_weight($score){\n\tswitch($score){\n\t\tcase 1:\n\t\t\treturn 1;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\treturn 1.3;\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\treturn 1.5;\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\treturn 1.9;\n\t\t\tbreak;\n\t}\n}", "function setScore( &$value )\r\n {\r\n $this->Score = $value;\r\n }", "public function score(float $defaultScore = 1.0): self\n {\n $this->arguments[] = 'SCORE';\n $this->arguments[] = $defaultScore;\n\n return $this;\n }", "public function put_score()\r\n\t\t{\r\n\t\t\t// Scaffolding Code For Single:\r\n\t\t\treturn $this->obj;\r\n\t\t}", "public function addScore($score)\n {\n $this->score += $score;\n }", "function score($array){\n return $array['score'];\n }", "public function saveScore()\n {\n $this->savedScore += $this->score;\n $this->score = 0;\n }", "public function co2Score();" ]
[ "0.6787265", "0.6787265", "0.6787265", "0.6787265", "0.67662615", "0.67303276", "0.6714648", "0.6710551", "0.67060196", "0.65232396", "0.6488983", "0.6413199", "0.64010215", "0.6375659", "0.6287169", "0.6229824", "0.6150764", "0.61242944", "0.609062", "0.6087809", "0.6084411", "0.60800546", "0.60193485", "0.5977077", "0.5972438", "0.5953636", "0.5937487", "0.59327483", "0.5859202", "0.58375436" ]
0.7095722
1
Generated from protobuf field .Rect location = 2;
public function setLocation($var) { GPBUtil::checkMessage($var, \Rect::class); $this->location = $var; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRect() {}", "public function rect($x, $y, $width, $height) {}", "public function getRectangle() {}", "public function setRect(\\SetaPDF_Core_DataStructure_Rectangle $rect) {}", "public abstract function getBoundingBox(): Rectangle;", "public function rect($x1, $y1, $width, $height, $style = self::STYLE_DRAW) {}", "public static function invalidMarkerShapeRectCoordinates()\n {\n return new static(sprintf(\n '%s'.PHP_EOL.'%s',\n 'The coordinates setter arguments is invalid if the marker shape type is rect.',\n 'The available prototype is : function setCoordinates('.\n 'array(double $x1, double $y1, double $x2, double $y2)'.\n ')'\n ));\n }", "public function getRect()\n {\n $x1 = min([$this->p1->x, $this->p2->x, $this->p3->x]);\n $y1 = min([$this->p1->y, $this->p2->y, $this->p3->y]);\n $x2 = max([$this->p1->x, $this->p2->x, $this->p3->x]);\n $y2 = max([$this->p1->y, $this->p2->y, $this->p3->y]);\n\n return [new Point($x1, $y1), new Point($x2, $y2)];\n }", "public static function invalidRectangleBoundCoordinates()\n {\n return new static('A rectangle bound must have a south west & a north east coordinate.');\n }", "public function getBoundingBox() {}", "function makeRectangle(array $point, $width, $height)\n{\n return [\n 'point' => $point,\n 'width' => $width,\n 'height' => $height\n ];\n}", "function bbox(string $id): Rect {\n if (!isset($this->features[$id]))\n return new Rect([41, -4, 51, 10]);\n else\n return $this->features[$id]['bbox'];\n }", "public static function invalidRectangleBound()\n {\n return new static(sprintf(\n '%s'.PHP_EOL.'%s'.PHP_EOL.'%s'.PHP_EOL.'%s'.PHP_EOL.'%s',\n 'The bound setter arguments is invalid.',\n 'The available prototypes are :',\n ' - function setBound(Fungio\\GoogleMap\\Base\\Bound $bound)',\n ' - function setBount('.\n 'Fungio\\GoogleMap\\Base\\Coordinate $southWest, '.\n 'Fungio\\GoogleMap\\Base\\Coordinate $northEast'.\n ')',\n ' - function setBound('.\n 'double $southWestLatitude, '.\n 'double $southWestLongitude, '.\n 'double $northEastLatitude, '.\n 'double $northEastLongitude, '.\n 'boolean southWestNoWrap = true, '.\n 'boolean $northEastNoWrap = true'.\n ')'\n ));\n }", "public function getDifferencesRect() {}", "public function contains($otherRect) {}", "function SetPos($aRect) {\n\tassert( $this->prect != null ) ;\n\t$this->prect->SetPos($aRect);\n }", "public function getPosY();", "public function getPos() {}", "public function getPos() {}", "public function getPos() {}", "public function getPos() {}", "public function getPos() {}", "public function getBounds();", "public function getRectangles()\n {\n return $this->rectangles;\n }", "public function getPos();", "public function getPos();", "public function getBBox($asRect = true) {}", "public function setDifferencesRect(\\SetaPDF_Core_DataStructure_Rectangle $differencesRect) {}", "public function getShape(): object {\n return (object) ['m' => $this->row, 'n' => $this->col];\n }", "public function position();" ]
[ "0.688255", "0.61259276", "0.6108282", "0.59763074", "0.5968003", "0.5953375", "0.59226847", "0.56285876", "0.5618909", "0.55072004", "0.53764987", "0.5330377", "0.5321184", "0.5273294", "0.51717216", "0.5141965", "0.50781566", "0.5065568", "0.5065568", "0.5065568", "0.5065568", "0.5065568", "0.50424564", "0.50341624", "0.5000985", "0.5000985", "0.49756965", "0.49603793", "0.49536723", "0.49330842" ]
0.69350255
0
Generated from protobuf field int32 detection_id = 3;
public function getDetectionId() { return $this->detection_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDetectionId($var)\n {\n GPBUtil::checkInt32($var);\n $this->detection_id = $var;\n\n return $this;\n }", "public function getDetectionClass()\n {\n return $this->detection_class;\n }", "public function getId() {\n\t\treturn (string) $this->photo['id'];\n\t}", "public function getGamerId()\n {\n $value = $this->get(self::GAMER_ID);\n return $value === null ? (integer)$value : $value;\n }", "public function getGameId(): int\n {\n return $this->gameId;\n }", "public function getId()\n\t{\n\t\treturn $this->googleDriveFile->getId();\n\t}", "public function determineId() {}", "public function getId()\n {\n return $this->_imageId;\n }", "public function getId(): int\n {\n $idSplit = explode('.', $this->data['externalidField']);\n return $idSplit[1] ?? $this->data['externalidField'];\n }", "public function getId() {\r\n\r\n return $this->getGameManager()->getGameId($this);\r\n\r\n }", "public function getPictureId()\n {\n return $this->pictureId;\n }", "public function getId(): int\n {\n return (int)substr($this->token, 0, strpos($this->token, ':'));\n }", "public function getVideoId();", "public function getPhotoId()\n {\n return $this->photoId;\n }", "public function setDetectionClass($var)\n {\n GPBUtil::checkString($var, True);\n $this->detection_class = $var;\n\n return $this;\n }", "public function getTrackingId()\n {\n if (isset($this->data['TrackingId'])) {\n return $this->data['TrackingId'];\n } else {\n return false;\n }\n }", "public function getId()\n {\n return $this->file->get('id');\n }", "public function getTrackingId()\n {\n return $this->trackingId;\n }", "public function getGameId(){\n\t\treturn $this->gameId;\n\t}", "function getImageId();", "public function getId()\n {\n switch ($this->type) {\n case VideoInfo::TYPE_YOUTUBE:\n return app(InferYoutubeId::class)($this->info->url);\n case VideoInfo::TYPE_VIMEO:\n return $this->info->video_id;\n }\n return null;\n }", "public function getId() : int\n {\n return $this->getValue('nb_icontact_prospect_id');\n }", "public function getMediaId();", "public function getIdVideoInfo()\n {\n return $this->idVideoInfo;\n }", "public function getMagicNumber()\n {\n return $this->readOneof(1);\n }", "public function getId()\n {\n $tmp = (array) $this->getHeaderFieldModel($this->getIdField());\n\n return $this->headers->has($this->getIdField()) ? current($tmp) : $this->id;\n }", "private function computeId(): void\n {\n /** @noinspection JsonEncodingApiUsageInspection */\n $this->id = md5(\n json_encode(\n [\n $this->simulation->id,\n $this->fn,\n $this->useEndpoints,\n $this->usePerturbation,\n collect($this->findByTags)->map(fn($t) => strtolower($t))->sort()->toArray(),\n $this->searchMode\n ]\n )\n );\n }", "public function id()\n {\n if (!$this->object->getValue()) {\n return null;\n }\n\n /* @var \\Anomaly\\VideoFieldType\\Matcher\\Contract\\MatcherInterface $matcher */\n $matcher = dispatch_now(new GetMatcher($this->object->getValue()));\n\n return $matcher->id($this->object->getValue());\n }", "public static function getHolderID();", "public function getTrackingID()\n {\n return $this->trackingID;\n }" ]
[ "0.7037807", "0.5350284", "0.5243273", "0.5230687", "0.5138672", "0.5099635", "0.50109506", "0.49675262", "0.494784", "0.49134162", "0.48817244", "0.48485684", "0.48055425", "0.4771033", "0.47501564", "0.47292325", "0.47213992", "0.47014728", "0.4695155", "0.4649501", "0.46366188", "0.45979932", "0.45795012", "0.45765346", "0.4536567", "0.45358166", "0.45346543", "0.4530903", "0.45189694", "0.45155185" ]
0.7689458
0