Skip to content

Commit

Permalink
phalcon#15186 - Remove deprecated C code from optimizers
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson authored and niden committed Mar 23, 2021
1 parent 80588df commit f4d2bd3
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 37 deletions.
2 changes: 1 addition & 1 deletion optimizers/PhalconCssminOptimizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function optimize(array $expression, Call $call, CompilationContext $cont
);

$context->codePrinter->output(
'phalcon_cssmin(' . $symbolVariable->getName() . ', ' . $resolvedParams[0] . ' TSRMLS_CC);'
'phalcon_cssmin(' . $symbolVariable->getName() . ', ' . $resolvedParams[0] . ');'
);

return new CompiledExpression(
Expand Down
9 changes: 0 additions & 9 deletions optimizers/PhalconFixPathOptimizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,8 @@ public function optimize(array $expression, Call $call, CompilationContext $cont
}

$context->headersManager->add('kernel/array');

$symbolVariable->setDynamicTypes('array');

$resolvedParams = $call->getReadOnlyResolvedParams(
$expression['parameters'],
$context,
$expression
);

//$context->codePrinter->output('zephir_fast_array_merge(' . $symbolVariable->getName() . ', &(' . $resolvedParams[0] . '), &(' . $resolvedParams[1] . ') TSRMLS_CC);');

return new CompiledExpression(
'variable',
$symbolVariable->getRealName(),
Expand Down
2 changes: 1 addition & 1 deletion optimizers/PhalconJsminOptimizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function optimize(array $expression, Call $call, CompilationContext $cont
);

$context->codePrinter->output(
'phalcon_jsmin(' . $symbolVariable->getName() . ', ' . $resolvedParams[0] . ' TSRMLS_CC);'
'phalcon_jsmin(' . $symbolVariable->getName() . ', ' . $resolvedParams[0] . ');'
);

return new CompiledExpression(
Expand Down
2 changes: 1 addition & 1 deletion optimizers/PhalconOrmDestroyCacheOptimizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function optimize(array $expression, Call $call, CompilationContext $cont
{
$context->headersManager->add('phalcon/mvc/model/orm');

$context->codePrinter->output('phalcon_orm_destroy_cache(TSRMLS_C);');
$context->codePrinter->output('phalcon_orm_destroy_cache();');

return new CompiledExpression(
'null',
Expand Down
3 changes: 1 addition & 2 deletions optimizers/PhalconOrmSinglequotesOptimizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ public function optimize(array $expression, Call $call, CompilationContext $cont
);

$symbol = $context->backend->getVariableCode($symbolVariable);

$context->codePrinter->output(
'phalcon_orm_singlequotes(' . $symbol . ', ' . $resolvedParams[0] . ' TSRMLS_CC);'
'phalcon_orm_singlequotes(' . $symbol . ', ' . $resolvedParams[0] . ');'
);

return new CompiledExpression(
Expand Down
9 changes: 0 additions & 9 deletions optimizers/PhalconPossibleAutoloadFilepathOptimizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,8 @@ public function optimize(array $expression, Call $call, CompilationContext $cont
}

$context->headersManager->add('kernel/array');

$symbolVariable->setDynamicTypes('array');

$resolvedParams = $call->getReadOnlyResolvedParams(
$expression['parameters'],
$context,
$expression
);

//$context->codePrinter->output('zephir_fast_array_merge(' . $symbolVariable->getName() . ', &(' . $resolvedParams[0] . '), &(' . $resolvedParams[1] . ') TSRMLS_CC);');

return new CompiledExpression(
'variable',
$symbolVariable->getRealName(),
Expand Down
9 changes: 0 additions & 9 deletions optimizers/PhalconPrepareVirtualPathOptimizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,8 @@ public function optimize(array $expression, Call $call, CompilationContext $cont
}

$context->headersManager->add('kernel/array');

$symbolVariable->setDynamicTypes('array');

$resolvedParams = $call->getReadOnlyResolvedParams(
$expression['parameters'],
$context,
$expression
);

//$context->codePrinter->output('zephir_fast_array_merge(' . $symbolVariable->getName() . ', &(' . $resolvedParams[0] . '), &(' . $resolvedParams[1] . ') TSRMLS_CC);');

return new CompiledExpression(
'variable',
$symbolVariable->getRealName(),
Expand Down
3 changes: 1 addition & 2 deletions optimizers/PhalconReplacePathsOptimizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ public function optimize(array $expression, Call $call, CompilationContext $cont
);

$symbol = $context->backend->getVariableCode($symbolVariable);

$context->codePrinter->output(
'phalcon_replace_paths(' . $symbol . ', ' . $resolvedParams[0] . ', ' . $resolvedParams[1] . ', ' . $resolvedParams[2] . ' TSRMLS_CC);'
'phalcon_replace_paths(' . $symbol . ', ' . $resolvedParams[0] . ', ' . $resolvedParams[1] . ', ' . $resolvedParams[2] . ');'
);

return new CompiledExpression(
Expand Down
2 changes: 1 addition & 1 deletion optimizers/PhannotParseAnnotationsOptimizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function optimize(array $expression, Call $call, CompilationContext $cont
$symbol = $context->backend->getVariableCode($symbolVariable);

$context->codePrinter->output(
'ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(' . $symbol . ', ' . $resolvedParams[0] . ', ' . $resolvedParams[1] . ', ' . $resolvedParams[2] . ' TSRMLS_CC);'
'ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(' . $symbol . ', ' . $resolvedParams[0] . ', ' . $resolvedParams[1] . ', ' . $resolvedParams[2] . ');'
);

$call->checkTempParameters($context);
Expand Down
2 changes: 1 addition & 1 deletion optimizers/PhqlParsePhqlOptimizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function optimize(array $expression, Call $call, CompilationContext $cont
$symbol = $context->backend->getVariableCode($symbolVariable);

$context->codePrinter->output(
'ZEPHIR_LAST_CALL_STATUS = phql_parse_phql(' . $symbol . ', ' . $resolvedParams[0] . ' TSRMLS_CC);'
'ZEPHIR_LAST_CALL_STATUS = phql_parse_phql(' . $symbol . ', ' . $resolvedParams[0] . ');'
);

$call->checkTempParameters($context);
Expand Down
2 changes: 1 addition & 1 deletion optimizers/PhvoltParseViewOptimizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function optimize(array $expression, Call $call, CompilationContext $cont
$symbol = $context->backend->getVariableCode($symbolVariable);

$context->codePrinter->output(
'ZEPHIR_LAST_CALL_STATUS = phvolt_parse_view(' . $symbol . ', ' . $resolvedParams[0] . ', ' . $resolvedParams[1] . ' TSRMLS_CC);'
'ZEPHIR_LAST_CALL_STATUS = phvolt_parse_view(' . $symbol . ', ' . $resolvedParams[0] . ', ' . $resolvedParams[1] . ');'
);

$call->checkTempParameters($context);
Expand Down

0 comments on commit f4d2bd3

Please sign in to comment.